diff options
-rw-r--r-- | vcl/win/window/salframe.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 0f2d18547bc4..a3941450f6aa 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -756,27 +756,21 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, try { + tools::Rectangle aRect; sal_Int32 nMonitors = Application::GetScreenCount(); if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) ) { - tools::Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay ); - nScreenX = aRect.Left(); - nScreenY = aRect.Top(); - nScreenDX = aRect.GetWidth(); - nScreenDY = aRect.GetHeight(); + aRect = Application::GetScreenPosSizePixel(pFrame->mnDisplay); } else { - tools::Rectangle aCombined = Application::GetScreenPosSizePixel( 0 ); - for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) - { - aCombined.Union( Application::GetScreenPosSizePixel( i ) ); - } - nScreenX = aCombined.Left(); - nScreenY = aCombined.Top(); - nScreenDX = aCombined.GetWidth(); - nScreenDY = aCombined.GetHeight(); + for (sal_Int32 i = 0; i < nMonitors; i++) + aRect.Union(Application::GetScreenPosSizePixel(i)); } + nScreenX = aRect.Left(); + nScreenY = aRect.Top(); + nScreenDX = aRect.GetWidth(); + nScreenDY = aRect.GetHeight(); } catch( Exception& ) { |