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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 21 07:08:08 UTC 2020


 toolkit/source/awt/vclxwindow.cxx |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

New commits:
commit 8cea43730177a89c7686cda64f87a2e9e63fd7fd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Mar 20 15:51:37 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Mar 21 08:07:34 2020 +0100

    simplify code
    
    These methods are virtual, so the check does nothing useful.
    Possibly back when this code was introduced, the methods were not.
    
    This was introduced in
        commit 411f66186e228
        Date:   Mon Jan 31 07:58:15 2005 +0000
        INTEGRATION: CWS vcl34 (1.49.26); FILE MERGED
    2005/01/06 14:13:03 ssa 1.49.26.1: #i37461# get/setOutputsize has to
    check for DockingWindow to call proper method
    
    to solve
        https://bz.apache.org/ooo/show_bug.cgi?id=37461
    
    I have checked, and the bug does not come back.
    
    Change-Id: I540b85eccbf7107ee640f09b41340dc906995557
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90795
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 0a789dc376e3..01ec82878f79 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -2441,29 +2441,15 @@ sal_Bool SAL_CALL VCLXWindow::isInPopupMode(  )
 void SAL_CALL VCLXWindow::setOutputSize( const css::awt::Size& aSize )
 {
     SolarMutexGuard aGuard;
-    VclPtr<vcl::Window> pWindow;
-    if( (pWindow = GetWindow()) != nullptr )
-    {
-        DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow.get());
-        if( pDockingWindow )
-            pDockingWindow->SetOutputSizePixel( VCLSize( aSize ) );
-        else
-            pWindow->SetOutputSizePixel( VCLSize( aSize ) );
-    }
+    if( VclPtr<vcl::Window> pWindow = GetWindow() )
+        pWindow->SetOutputSizePixel( VCLSize( aSize ) );
 }
 
 css::awt::Size SAL_CALL VCLXWindow::getOutputSize(  )
 {
     SolarMutexGuard aGuard;
-    VclPtr<vcl::Window> pWindow;
-    if( (pWindow = GetWindow()) != nullptr )
-    {
-        DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow.get());
-        if( pDockingWindow )
-            return AWTSize( pDockingWindow->GetOutputSizePixel() );
-        else
-            return AWTSize( pWindow->GetOutputSizePixel() );
-    }
+    if( VclPtr<vcl::Window> pWindow = GetWindow() )
+        return AWTSize( pWindow->GetOutputSizePixel() );
     else
         return css::awt::Size();
 }


More information about the Libreoffice-commits mailing list