diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-05-28 04:56:25 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2020-07-06 08:40:13 +0200 |
commit | 4c84a73d741022e6ee0015a4a6bd3e4e8dc884e7 (patch) | |
tree | e0eafb5aa5184640945f25372a46a8e5b16b1a8d | |
parent | 8eaf52648b429dc79e8e58316af87f65d8873bed (diff) |
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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
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 { |