desktop/source/lib/init.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9bd7ff6b918de25fc3662898009228db6510ebf8
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Nov 14 17:34:55 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Nov 15 10:11:37 2022 +0100

    gtktiledviewer: Fix getting tiles on Windows
    
    The "CanvasSize + 1" hack was implemented by myself in commit
    ebb3a72ba0c4f070c9c254c439147beea8b2d93d (Paint tiles on Windows;
    Oct 24 09:01:32 2022 +0200) to workaround a rounding error, where
    converting pixels to logic and back resulted in 1 pixel smaller
    size (when I worked in Writer). This hack breaks in Calc, because
    the size then is 1 pixel larger than expected, failing the assert
    below.
    
    This fixes the problem by disabling the map mode, as everywhere
    else in such cases.
    
    Change-Id: I37f0f03ae4cb19f2de0e7995064843d17b0c7189
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142714
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit dbc307ef7c2351cd72e60ef46e647c908379db86)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142680
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 13fef313aec4..627c352c4b24 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3712,8 +3712,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 
 #ifdef _WIN32
     // pBuffer was not used there
-    tools::Rectangle r(pDevice->PixelToLogic({ Point(0, 0), Size(nCanvasWidth 
+ 1, nCanvasHeight + 1) }));
-    BitmapEx aBmpEx = pDevice->GetBitmapEx(r.TopLeft(), r.GetSize());
+    pDevice->EnableMapMode(false);
+    BitmapEx aBmpEx = pDevice->GetBitmapEx({ 0, 0 }, { nCanvasWidth, 
nCanvasHeight });
     Bitmap aBmp = aBmpEx.GetBitmap();
     Bitmap aAlpha = aBmpEx.GetAlpha();
     Bitmap::ScopedReadAccess sraBmp(aBmp);

Reply via email to