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:41:41 +0200 |
commit | 508a596df1a75e27b199bfebb08ee66583e35d99 (patch) | |
tree | 70f0a69155c554b76a971fef39ba72483866f78e | |
parent | 53f151e6bb48de603595e519eb9e968c7f678224 (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/+/98116
Tested-by: Jenkins
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 774509870c02..4f02c69ae818 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -626,20 +626,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 { |