diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-18 15:12:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-18 20:36:12 +0200 |
commit | 3af6ac85d13986aa619b4d33c39f1b964be9778b (patch) | |
tree | 08dc79bbcb77b79e52fdf5e3bb7a8d41b59d86c6 | |
parent | 0be41ce3002e1ee3c84ec3096c95e72645faa187 (diff) |
only the first comphelper::LibreOfficeKit::isActive() branch is used
since...
commit 63f320f6352bfca0dcd7ed0b55b95e8bc27d8d67
Date: Mon Aug 13 13:27:21 2018 +0200
lokit: Draw dialogs without using a MetaFile
if comphelper::LibreOfficeKit::isActive is true the top block will return so
the code inside the following comphelper::LibreOfficeKit::isActive block can't
be called, which was introduced by
commit d6a2dc03806c4e7c0be8e4f2aee272f036f4765e
Date: Sat Feb 10 17:31:44 2018 +0100
lokdialog: Render non-pixel based preview windows
Change-Id: I857f92a69bc9b592df7a810aa11cb0979aac3718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96613
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/window/paint.cxx | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 7bd98672b5cb..e1d281e71948 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1451,29 +1451,9 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP bool bOutput = IsOutputEnabled(); EnableOutput(); - double fScaleX = 1; - double fScaleY = 1; - bool bNeedsScaling = false; - if(comphelper::LibreOfficeKit::isActive()) - { - if(GetMapMode().GetMapUnit() != MapUnit::MapPixel && - // Some of the preview windows (SvxPreviewBase) uses different painting (drawinglayer primitives) - // For these preview we don't need to scale even though the unit is not pixel. - GetMapMode().GetMapUnit() != MapUnit::Map100thMM) - { - bNeedsScaling = true; - // 1000.0 is used to reduce rounding imprecision (Size uses integers) - Size aLogicSize = PixelToLogic(Size(1000.0, 1000.0)); - fScaleX = aLogicSize.Width() / 1000.0; - fScaleY = aLogicSize.Height() / 1000.0; - } - } - else - { // TODO: Above scaling was added for LOK only, would be good to check how it works in other use cases - SAL_WARN_IF( GetMapMode().GetMapUnit() != MapUnit::MapPixel, "vcl.window", "MapMode must be PIXEL based" ); - if ( GetMapMode().GetMapUnit() != MapUnit::MapPixel ) - return; - } + SAL_WARN_IF( GetMapMode().GetMapUnit() != MapUnit::MapPixel, "vcl.window", "MapMode must be PIXEL based" ); + if ( GetMapMode().GetMapUnit() != MapUnit::MapPixel ) + return; // preserve graphicsstate Push(); @@ -1522,18 +1502,9 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP else SetRefPoint(); SetLayoutMode( GetLayoutMode() ); - SetDigitLanguage( GetDigitLanguage() ); - tools::Rectangle aPaintRect; - if(bNeedsScaling) - { - aPaintRect = tools::Rectangle( Point( 0, 0 ), - Size(GetOutputSizePixel().Width() * fScaleX, GetOutputSizePixel().Height() * fScaleY) ); - } - else - { - aPaintRect = tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() ); - } + SetDigitLanguage( GetDigitLanguage() ); + tools::Rectangle aPaintRect(Point(0, 0), GetOutputSizePixel()); aClipRegion.Intersect( aPaintRect ); SetClipRegion( aClipRegion ); @@ -1543,8 +1514,6 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP if( ! IsPaintTransparent() && IsBackground() && ! (GetParentClipMode() & ParentClipMode::NoClip ) ) { Erase(*this); - if(bNeedsScaling) - aMtf.Scale(fScaleX, fScaleY); } // foreground Paint(*this, aPaintRect); @@ -1560,8 +1529,6 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); - if(bNeedsScaling) - pMaskedDevice->SetMapMode( GetMapMode() ); pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() ); pMaskedDevice->EnableRTL( IsRTLEnabled() ); aMtf.WindStart(); |