[Libreoffice-commits] core.git: Branch 'aoo/trunk' - basctl/source

Tsutomu Uchino hanya at apache.org
Sat May 17 03:07:17 PDT 2014


 basctl/source/basicide/objdlg.cxx |   41 +++++++++++++++++++++++++-------------
 basctl/source/basicide/objdlg.hxx |    2 +
 2 files changed, 30 insertions(+), 13 deletions(-)

New commits:
commit 7bc75c1a7b05d81631ebccf05bf022636d1a3a14
Author: Tsutomu Uchino <hanya at apache.org>
Date:   Sat May 17 09:39:39 2014 +0000

    #i76558# jump by Enter key on the Object catalog

diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index b9c85ee..a2431a6 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -66,26 +66,41 @@ void ObjectTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
 
     if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) )
     {
-        BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
+        OpenCurrent();
+    }
+}
+
+void ObjectTreeListBox::KeyInput( const KeyEvent& rEvt )
+{
+    if ( rEvt.GetKeyCode() == KEY_RETURN && OpenCurrent() )
+    {
+        return;
+    }
+    BasicTreeListBox::KeyInput( rEvt );
+}
+
+bool ObjectTreeListBox::OpenCurrent()
+{
+    BasicEntryDescriptor aDesc( GetEntryDescriptor( GetCurEntry() ) );
 
-        if ( aDesc.GetType() == OBJ_TYPE_METHOD )
+    if ( aDesc.GetType() == OBJ_TYPE_METHOD )
+    {
+        BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+        SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
+        SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
+        if( pDispatcher )
         {
-            BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
-            SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
-            SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
-            if( pDispatcher )
-            {
-                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 );
-            }
+            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;
         }
     }
+    return false;
 }
 
 
-
 ObjectCatalog::ObjectCatalog( Window * pParent )
     :FloatingWindow( pParent, IDEResId( RID_BASICIDE_OBJCAT ) )
     ,aMacroTreeList( this, IDEResId( RID_TLB_MACROS ) )
diff --git a/basctl/source/basicide/objdlg.hxx b/basctl/source/basicide/objdlg.hxx
index feda773..273b323 100644
--- a/basctl/source/basicide/objdlg.hxx
+++ b/basctl/source/basicide/objdlg.hxx
@@ -40,7 +40,9 @@ private:
 
     virtual void    Command( const CommandEvent& rCEvt );
     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
+    virtual void    KeyInput( const KeyEvent& rEvt );
 
+    bool            OpenCurrent();
 public:
             ObjectTreeListBox( Window* pParent, const ResId& rRes );
             ~ObjectTreeListBox();


More information about the Libreoffice-commits mailing list