From 8cea43730177a89c7686cda64f87a2e9e63fd7fd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Mar 2020 15:51:37 +0200 Subject: 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 Reviewed-by: Noel Grandin --- toolkit/source/awt/vclxwindow.cxx | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) 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 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 pWindow = GetWindow() ) + pWindow->SetOutputSizePixel( VCLSize( aSize ) ); } css::awt::Size SAL_CALL VCLXWindow::getOutputSize( ) { SolarMutexGuard aGuard; - VclPtr 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 pWindow = GetWindow() ) + return AWTSize( pWindow->GetOutputSizePixel() ); else return css::awt::Size(); } -- cgit