summaryrefslogtreecommitdiffstats
path: root/dbaccess/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-18 10:52:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-18 10:55:04 +0100
commit1660bdd08bde5efa7cbfc9e8b2aed5d90504fceb (patch)
treeedbab6c016aaae7f41264690259ea88ffc0bccdc /dbaccess/source
parentwe surely don't want to fall through after showing a menu (diff)
downloadcore-1660bdd08bde5efa7cbfc9e8b2aed5d90504fceb.tar.gz
core-1660bdd08bde5efa7cbfc9e8b2aed5d90504fceb.zip
convert primary key menu to .ui
Change-Id: I78b4f6edc33ddc908402d8ab952bfebc11e4f929
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/inc/dbu_resource.hrc1
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx33
-rw-r--r--dbaccess/source/ui/misc/WizardPages.src14
3 files changed, 15 insertions, 33 deletions
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 85da27797fff..70d00dbd234f 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -124,7 +124,6 @@
// menus
#define RID_QUERYFUNCTION_POPUPMENU RID_MENU_START + 6
-#define RID_SBA_RTF_PKEYPOPUP RID_MENU_START + 9
#define RID_MENU_JOINVIEW_CONNECTION RID_MENU_START + 16
#define RID_MENU_JOINVIEW_TABLE RID_MENU_START + 17
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index e7a6e3f1e233..4d3a0961a435 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -434,7 +434,8 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
if (pComEvt->IsMouseEvent())
ptWhere = pComEvt->GetMousePosPixel();
- ScopedVclPtrInstance<PopupMenu> aContextMenu(ModuleRes(RID_SBA_RTF_PKEYPOPUP));
+ VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "dbaccess/ui/keymenu.ui", "");
+ VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu"));
// Should primary key checkbox be checked?
const sal_Int32 nCount = GetEntryCount();
bool bCheckOk = false;
@@ -454,31 +455,27 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
}
if (bCheckOk)
- aContextMenu->CheckItem( SID_TABLEDESIGN_TABED_PRIMARYKEY );
+ aContextMenu->CheckItem(aContextMenu->GetItemId("primarykey"));
- switch( aContextMenu->Execute( this, ptWhere ) )
+ if (aContextMenu->Execute(this, ptWhere))
{
- case SID_TABLEDESIGN_TABED_PRIMARYKEY:
+ for (sal_Int32 j = 0 ; j < nCount ; ++j)
{
- for(sal_Int32 j = 0 ; j < nCount ; ++j)
+ OFieldDescription* pFieldDescr = static_cast<OFieldDescription*>(GetEntryData(j));
+ if( pFieldDescr )
{
- OFieldDescription* pFieldDescr = static_cast<OFieldDescription*>(GetEntryData(j));
- if( pFieldDescr )
+ if(!bCheckOk && IsEntryPosSelected(j))
{
- if(!bCheckOk && IsEntryPosSelected(j))
- {
- setPrimaryKey(pFieldDescr,j,true);
- SelectEntryPos(j);
- }
- else
- {
- setPrimaryKey(pFieldDescr,j);
- }
+ setPrimaryKey(pFieldDescr,j,true);
+ SelectEntryPos(j);
+ }
+ else
+ {
+ setPrimaryKey(pFieldDescr,j);
}
}
- GetSelectHdl().Call(*this);
}
- break;
+ GetSelectHdl().Call(*this);
}
bDone = true;
}
diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src
index affd3c6f9933..7c4f403cd5c0 100644
--- a/dbaccess/source/ui/misc/WizardPages.src
+++ b/dbaccess/source/ui/misc/WizardPages.src
@@ -56,20 +56,6 @@ String STR_WIZ_PB_OK
Text [ en-US ] = "C~reate";
};
-Menu RID_SBA_RTF_PKEYPOPUP
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ;
- HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ;
- Checkable = TRUE ;
- Text [ en-US ] = "Primary Key" ;
- };
- };
-};
-
Bitmap BMP_UP
{
File = "sortup.png" ;