[Libreoffice-commits] .: Branch 'libreoffice-3-6' - basctl/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Mon Jul 23 23:57:19 PDT 2012


 basctl/source/basicide/baside2.cxx  |   28 +++++++++++++++++++++-------
 basctl/source/basicide/baside2.hxx  |    2 ++
 basctl/source/basicide/basides1.cxx |   23 ++++-------------------
 basctl/source/basicide/basidesh.cxx |    2 --
 basctl/source/inc/basidesh.hxx      |    2 --
 5 files changed, 27 insertions(+), 30 deletions(-)

New commits:
commit 80bab179b259de2d963384444b7eac4579dea06d
Author: Uray M. János <uray.janos at gmail.com>
Date:   Mon Jul 23 18:48:47 2012 +0200

    fdo#52223 fix Object Catalog in Basic IDE when resizing
    
    Change-Id: I96861bfcf7c0da6dd94c50acd673dedb14d15204
    (cherry picked from commit c55a4639d27957ee96c59269d894d169fa2b7b34)
    
    Signed-off-by: Ivan Timofeev <timofeev.i.s at gmail.com>

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index a397e49..40fc635 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1511,14 +1511,14 @@ void ModulWindowLayout::ArrangeWindows()
     if ( ( nVSplitPos < nMinPos ) || ( nVSplitPos > nMaxPos ) )
         nVSplitPos = ( nVSplitPos < nMinPos ) ? 0 : ( aSz.Height() - SPLIT_HEIGHT );
 
-    Size aXEWSz;
-    aXEWSz.Width() = aSz.Width() - OBJCAT_PANE_WIDTH;
-
-    aXEWSz.Height() = nVSplitPos + 1;
     if ( m_pModulWindow )
     {
         DBG_CHKOBJ( m_pModulWindow, ModulWindow, 0 );
-        m_pModulWindow->SetPosSizePixel( Point( OBJCAT_PANE_WIDTH, 0 ), aXEWSz );
+        bool const bObjCat = aObjectCatalog.IsVisible();
+        m_pModulWindow->SetPosSizePixel(
+            Point(bObjCat ? OBJCAT_PANE_WIDTH : 0, 0),
+            Size(bObjCat ? aSz.Width() - OBJCAT_PANE_WIDTH : aSz.Width(), nVSplitPos + 1)
+        );
     }
 
     aVSplitter.SetDragRectPixel( Rectangle( Point( 0, 0 ), Size( aSz.Width(), aSz.Height() ) ) );
@@ -1543,10 +1543,12 @@ void ModulWindowLayout::ArrangeWindows()
     if ( !aStackWindow.IsFloatingMode() )
         aStackWindow.SetPosSizePixel( aSWPos, aSWSz );
 
-    Size aOCSz( OBJCAT_PANE_WIDTH, aSz.Height() - aSWSz.Height() - 3 );
-    Point aOCPos( 0, 0 );
     if ( !aObjectCatalog.IsFloatingMode() )
+    {
+        Size aOCSz( OBJCAT_PANE_WIDTH, aSz.Height() - aSWSz.Height() - 3 );
+        Point aOCPos( 0, 0 );
         aObjectCatalog.SetPosSizePixel( aOCPos, aOCSz );
+    }
 
     if ( aStackWindow.IsFloatingMode() && aWatchWindow.IsFloatingMode() )
         aHSplitter.Hide();
@@ -1736,4 +1738,16 @@ Image ModulWindowLayout::getImage(sal_uInt16 nId) const
     return m_aImagesNormal.GetImage(nId);
 }
 
+// shows or hides the Object Catalog window (depending on its state)
+void ModulWindowLayout::ToggleObjectCatalog ()
+{
+    // show or hide?
+    bool const bShow = !aObjectCatalog.IsVisible();
+    bShow ? aObjectCatalog.Show() : aObjectCatalog.Hide();
+    if (m_pModulWindow)
+        m_pModulWindow->SetObjectCatalogDisplay(bShow);
+    // refreshing
+    ArrangeWindows();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index bae4730..a841057 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -486,6 +486,8 @@ public:
 
     inline Color const & getSyntaxColor(TokenTypes eType) const
     { return m_aSyntaxColors[eType]; }
+
+    void ToggleObjectCatalog ();
 };
 
 #endif  // _BASIDE2_HXX
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 24c7884..69d773c 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -443,26 +443,11 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
             pWin->EditMacro( rInfo.GetMethod() );
         }
         break;
+
         case SID_BASICIDE_OBJCAT:
-        {
-            if ( bObjectCatalogDisplay )
-            {
-                pModulLayout->GetObjectCatalog().Hide();
-                dynamic_cast<ModulWindow*>(pCurWin)->SetPosPixel( Point( 0, 0 ) );
-                dynamic_cast<ModulWindow*>(pCurWin)->SetSizePixel( Size( pCurWin->GetSizePixel().Width() + OBJCAT_PANE_WIDTH, pCurWin->GetSizePixel().Height() ) );
-                dynamic_cast<ModulWindow*>(pCurWin)->SetObjectCatalogDisplay( false );
-                bObjectCatalogDisplay = sal_False;
-            }
-            else
-            {
-                pModulLayout->GetObjectCatalog().Show();
-                dynamic_cast<ModulWindow*>(pCurWin)->SetPosPixel( Point( OBJCAT_PANE_WIDTH, 0 ) );
-                dynamic_cast<ModulWindow*>(pCurWin)->SetSizePixel( Size( pCurWin->GetSizePixel().Width() - OBJCAT_PANE_WIDTH, pCurWin->GetSizePixel().Height() ) );
-                dynamic_cast<ModulWindow*>(pCurWin)->SetObjectCatalogDisplay( true );
-                bObjectCatalogDisplay = sal_True;
-            }
-        }
-        break;
+            pModulLayout->ToggleObjectCatalog();
+            break;
+
         case SID_BASICIDE_NAMECHANGEDONTAB:
         {
             DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 3c00def..d2ced7e 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -202,8 +202,6 @@ void BasicIDEShell::Init()
     pObjectCatalog = 0;
     bCreatingWindow = sal_False;
 
-    bObjectCatalogDisplay = sal_True;
-
     pTabBar = new BasicIDETabBar( &GetViewFrame()->GetWindow() );
     pTabBar->SetSplitHdl( LINK( this, BasicIDEShell, TabBarSplitHdl ) );
     bTabBarSplitted = sal_False;
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 6b56b43..8ed9701 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -100,8 +100,6 @@ friend class LocalizationMgr;
 friend class ContainerListenerImpl;
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xLibListener;
 
-    sal_Bool            bObjectCatalogDisplay;
-
 #if _SOLAR__PRIVATE
     void                Init();
     void                InitTabBar();


More information about the Libreoffice-commits mailing list