summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/global.cxx15
1 files changed, 13 insertions, 2 deletions
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()