summaryrefslogtreecommitdiff
path: root/basctl/source
diff options
context:
space:
mode:
authorTsutomu Uchino <hanya@apache.org>2014-05-17 09:39:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-05-19 08:57:45 +0100
commitc9f3c508bb1a1d94fd6172b9cdac30278559f31c (patch)
tree7b44efeb1f223aa804b00d2a0b7906ee90dc285a /basctl/source
parentca0be6743496cbb747e320b5b13bd1270b113892 (diff)
Resolves: #i76558# jump by Enter key on the Object catalog
(cherry picked from commit 7bc75c1a7b05d81631ebccf05bf022636d1a3a14) Conflicts: basctl/source/basicide/objdlg.cxx basctl/source/basicide/objdlg.hxx Change-Id: Id3fa3686fd60df192c02cc8137c9bc59e68c1d49
Diffstat (limited to 'basctl/source')
-rw-r--r--basctl/source/basicide/bastype2.cxx59
-rw-r--r--basctl/source/basicide/bastype2.hxx2
2 files changed, 39 insertions, 22 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 8f848a8f390b..9ff70c06d753 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -922,32 +922,47 @@ void TreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
SvTreeListBox::MouseButtonDown( rMEvt );
if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) )
{
- EntryDescriptor aDesc = GetEntryDescriptor(GetCurEntry());
- switch (aDesc.GetType())
- {
- case OBJ_TYPE_METHOD:
- case OBJ_TYPE_MODULE:
- case OBJ_TYPE_DIALOG:
- if (SfxDispatcher* pDispatcher = GetDispatcher())
- {
- SbxItem aSbxItem(
- SID_BASICIDE_ARG_SBX, aDesc.GetDocument(),
- aDesc.GetLibName(), aDesc.GetName(), aDesc.GetMethodName(),
- ConvertType(aDesc.GetType())
- );
- pDispatcher->Execute(
- SID_BASICIDE_SHOWSBX,
- SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L
- );
- }
- break;
+ OpenCurrent();
+ }
+}
- default:
- break;
- }
+void TreeListBox::KeyInput( const KeyEvent& rEvt )
+{
+ if ( rEvt.GetKeyCode() == KEY_RETURN && OpenCurrent() )
+ {
+ return;
}
+ SvTreeListBox::KeyInput( rEvt );
}
+bool TreeListBox::OpenCurrent()
+{
+ EntryDescriptor aDesc = GetEntryDescriptor(GetCurEntry());
+ switch (aDesc.GetType())
+ {
+ case OBJ_TYPE_METHOD:
+ case OBJ_TYPE_MODULE:
+ case OBJ_TYPE_DIALOG:
+ if (SfxDispatcher* pDispatcher = GetDispatcher())
+ {
+ SbxItem aSbxItem(
+ SID_BASICIDE_ARG_SBX, aDesc.GetDocument(),
+ aDesc.GetLibName(), aDesc.GetName(), aDesc.GetMethodName(),
+ ConvertType(aDesc.GetType())
+ );
+ pDispatcher->Execute(
+ SID_BASICIDE_SHOWSBX,
+ SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L
+ );
+ return true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ return false;
+}
} // namespace basctl
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index 40c7eca66b9a..e703d2e4613b 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -185,7 +185,9 @@ protected:
virtual void ExpandedHdl() SAL_OVERRIDE;
virtual SvTreeListEntry* CloneEntry( SvTreeListEntry* pSource ) SAL_OVERRIDE;
virtual bool ExpandingHdl() SAL_OVERRIDE;
+ virtual void KeyInput( const KeyEvent& rEvt ) SAL_OVERRIDE;
+ bool OpenCurrent();
void ImpCreateLibEntries( SvTreeListEntry* pShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation );
void ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName );
void ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName );