sc/source/ui/unoobj/docuno.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 4c84a73d741022e6ee0015a4a6bd3e4e8dc884e7
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Thu May 28 04:56:25 2020 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Mon Jul 6 08:40:13 2020 +0200

    lokit: Do not assume 100% zoom for computing document-size
    
    This fix prevents rendering issues (bottom/right area the sheet clipped
    off/extra spaces) at the bottom/right of sheets with certain non default
    zooms in online.
    
    Change-Id: I2778d6259f8caf5a99d9eab57ae7b87751304ce3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98052
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 416357b35bea..63aaf55bc3e6 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -620,20 +620,22 @@ Size ScModelObj::getDocumentSize()
     rDoc.GetTiledRenderingArea(nTab, nEndCol, nEndRow);
 
     const ScDocument* pThisDoc = &rDoc;
+    const double fPPTX = pViewData->GetPPTX();
+    const double fPPTY = pViewData->GetPPTY();
 
-    auto GetColWidthPx = [pThisDoc, nTab](SCCOL nCol) {
+    auto GetColWidthPx = [pThisDoc, fPPTX, nTab](SCCOL nCol) {
         const sal_uInt16 nSize = pThisDoc->GetColWidth(nCol, nTab);
-        return ScViewData::ToPixel(nSize, 1.0 / TWIPS_PER_PIXEL);
+        return ScViewData::ToPixel(nSize, fPPTX);
     };
 
     long nDocWidthPixel = 
pViewData->GetLOKWidthHelper().computePosition(nEndCol, GetColWidthPx);
-    long nDocHeightPixel = pThisDoc->GetScaledRowHeight( 0, nEndRow, nTab, 1.0 
/ TWIPS_PER_PIXEL );
+    long nDocHeightPixel = pThisDoc->GetScaledRowHeight(0, nEndRow, nTab, 
fPPTY);
 
     if (nDocWidthPixel > 0 && nDocHeightPixel > 0)
     {
         // convert to twips
-        aSize.setWidth(nDocWidthPixel * TWIPS_PER_PIXEL);
-        aSize.setHeight(nDocHeightPixel * TWIPS_PER_PIXEL);
+        aSize.setWidth(nDocWidthPixel / fPPTX);
+        aSize.setHeight(nDocHeightPixel / fPPTY);
     }
     else
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to