sc/source/core/data/global.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
New commits: commit 60011cefbccd91065dadf66896a688b807e76964 Author: Miklos Vajna <vmik...@collabora.co.uk> AuthorDate: Mon Oct 1 21:27:49 2018 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Tue Oct 9 14:02:55 2018 +0200 tdf#115262 sc: fix cumulative placement error of images Commit 708d1c5ab242b545ced598879233fc662d7e6cc0 (sc lok: emit RowColumnHeader info in twips, 2015-11-02) improved precision of the twip -> pixel conversion ratio, but ignored the detail that limited precision used to silence cumulative errors that appear with larger precision. The original use-case was better precision of row/column headers for the LOK API, so keep that as-is, but go back to the original behavior on the desktop. (cherry picked from commit 616fd241838069e18c59064e33c4b24f5ae112c6) Change-Id: Ide169ab1745a9a9299caf3334559884ff7223cbe Reviewed-on: https://gerrit.libreoffice.org/61312 Tested-by: Jenkins Tested-by: Xisco FaulĂ <xiscofa...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 7c05743572a2..f3819735f6dc 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -487,8 +487,19 @@ void ScGlobal::InitPPT() { OutputDevice* pDev = Application::GetDefaultDevice(); - nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH); - nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH); + if (comphelper::LibreOfficeKit::isActive()) + { + nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH); + nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH); + } + else + { + // Avoid cumulative placement errors by intentionally limiting + // precision. + Point aPix1000 = pDev->LogicToPixel(Point(1000, 1000), MapMode(MapUnit::MapTwip)); + nScreenPPTX = aPix1000.X() / 1000.0; + nScreenPPTY = aPix1000.Y() / 1000.0; + } } const OUString& ScGlobal::GetClipDocName() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits