[Libreoffice-commits] core.git: sc/source
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 6 06:42:27 UTC 2020
sc/source/ui/unoobj/docuno.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 508a596df1a75e27b199bfebb08ee66583e35d99
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Thu May 28 04:56:25 2020 +0530
Commit: Dennis Francis <dennis.francis at collabora.com>
CommitDate: Mon Jul 6 08:41:41 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/+/98116
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
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
{
More information about the Libreoffice-commits
mailing list