[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara caolanm at redhat.com
Sat Jan 30 06:02:30 PST 2016


 sfx2/source/appl/childwin.cxx |   15 +++++----------
 sfx2/source/appl/workwin.cxx  |    8 ++++++--
 2 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 9af8fe36148caf42954495fe059500fd26217a7c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 29 21:27:22 2016 +0000

    these checks for DockingWindows are all wrong
    
    the type is WINDOW_DOCKINGWINDOW not RSC_DOCKINGWINDOW
    
    maybe better drop the wrong paths ? But try and do what
    the original intent might have been.
    
    Change-Id: Ibbcf885d82e498d38c1c82b9b647ef3cdd8f146a

diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index b8c7d0d..f744948 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -327,14 +327,11 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo)
     pImp->pFact->aInfo = rInfo;
 }
 
-
 void SfxChildWindow::SetAlignment(SfxChildAlignment eAlign)
 {
-
     eChildAlignment = eAlign;
 }
 
-
 SfxChildWinInfo SfxChildWindow::GetInfo() const
 {
 
@@ -348,14 +345,14 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const
             nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT );
         aInfo.aWinState = static_cast<SystemWindow*>(pWindow.get())->GetWindowState( nMask );
     }
-    else if ( pWindow->GetType() == RSC_DOCKINGWINDOW )
+    else if (DockingWindow* pDockingWindow = dynamic_cast<DockingWindow*>(pWindow.get()))
     {
-        if (static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow() )
-            aInfo.aWinState = static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow()->GetWindowState();
-        else
+        if (pDockingWindow->GetFloatingWindow())
+            aInfo.aWinState = pDockingWindow->GetFloatingWindow()->GetWindowState();
+        else if (SfxDockingWindow* pSfxDockingWindow = dynamic_cast<SfxDockingWindow*>(pDockingWindow))
         {
             SfxChildWinInfo aTmpInfo;
-            static_cast<SfxDockingWindow*>(pWindow.get())->FillInfo( aTmpInfo );
+            pSfxDockingWindow->FillInfo( aTmpInfo );
             aInfo.aExtraString = aTmpInfo.aExtraString;
         }
     }
@@ -365,13 +362,11 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const
     return aInfo;
 }
 
-
 sal_uInt16 SfxChildWindow::GetPosition()
 {
     return pImp->pFact->nPos;
 }
 
-
 void SfxChildWindow::InitializeChildWinFactory_Impl(sal_uInt16 nId, SfxChildWinInfo& rInfo)
 {
     // load configuration
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 17ecd21..7f4d5bb 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1593,12 +1593,16 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
         {
             if ( pChild->GetType() == nId )
             {
-                if ( pChild->GetWindow()->GetType() == RSC_DOCKINGWINDOW )
+                if (SfxDockingWindow* pSfxDockingWindow = dynamic_cast<SfxDockingWindow*>(pChild->GetWindow()))
+                {
                     // it's a DockingWindow
-                    pDockWin = static_cast<SfxDockingWindow*>( pChild->GetWindow() );
+                    pDockWin = pSfxDockingWindow;
+                }
                 else
+                {
                     // FloatingWindow or ModelessDialog
                     pWin = pChild->GetWindow();
+                }
                 break;
             }
         }


More information about the Libreoffice-commits mailing list