sc/inc/global.hxx              |    2 ++
 sc/source/core/data/global.cxx |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 5bff92cfcb9cf97c742cc9fb4d85b79b082b941e
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Apr 8 10:50:00 2019 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Apr 8 16:18:29 2019 +0200

    tdf#124327 sc opengl: fix lack of AA text in charts
    
    Commit 708d1c5ab242b545ced598879233fc662d7e6cc0 (sc lok: emit
    RowColumnHeader info in twips, 2015-11-02) and later commits improved
    precision of the Pixel Per Twips (PPT) factor in Calc, but this caused
    offset problems in PDF export. So the LOK case uses double precision and
    otherwise we use limited precision since commit
    616fd241838069e18c59064e33c4b24f5ae112c6 (tdf#115262 sc: fix cumulative
    placement error of images, 2018-10-01).
    
    It turns out this double precision was also useful in the opengl case:
    if UI scaling is set to 125% on Windows, then this helps producing AA
    text for charts. Given that unlimited precision is the direction we want
    to go, enable double precision for the GL case as well, not just for
    LOK.
    
    Verified that tdf#115262 is not re-introduced in the GL case, also that
    manual PDF export (with GL enabled) does not produce the mentioned
    unexpected image position offsets.
    
    (cherry picked from commit 7069ec6de9807d12ff9ad52ecbb66ea7dc373723)
    
    Change-Id: I23a8d6dce1b48c178977bda9909feb59fe8f3ad8
    Reviewed-on: https://gerrit.libreoffice.org/70410
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 176cfe124518..eb737f954790 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -573,7 +573,9 @@ public:
     SC_DLLPUBLIC static sal_uInt32 GetStandardFormat( SvNumberFormatter&, 
sal_uInt32 nFormat, SvNumFormatType nType );
 
     SC_DLLPUBLIC static sal_uInt16 GetStandardRowHeight();
+    /// Horizontal pixel per twips factor.
     SC_DLLPUBLIC static double              nScreenPPTX;
+    /// Vertical pixel per twips factor.
     SC_DLLPUBLIC static double              nScreenPPTY;
 
     static tools::SvRef<ScDocShell>   xDrawClipDocShellRef;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 2138f3e776b8..0999082d9589 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -47,6 +47,7 @@
 #include <unotools/transliterationwrapper.hxx>
 
 #include <comphelper/lok.hxx>
+#include <vcl/opengl/OpenGLWrapper.hxx>
 
 #include <global.hxx>
 #include <scresid.hxx>
@@ -475,8 +476,10 @@ void ScGlobal::InitPPT()
 {
     OutputDevice* pDev = Application::GetDefaultDevice();
 
-    if (comphelper::LibreOfficeKit::isActive())
+    if (comphelper::LibreOfficeKit::isActive() || 
OpenGLWrapper::isVCLOpenGLEnabled())
     {
+        // LOK: the below limited precision is not enough for RowColumnHeader.
+        // OpenGL: limited precision breaks AA of text in charts.
         nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH);
         nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH);
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to