[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/vcl sw/source vcl/source

Khaled Hosny khaledhosny at eglug.org
Wed Feb 22 08:58:29 UTC 2017


 include/vcl/outdev.hxx              |    2 ++
 sw/source/core/txtnode/fntcache.cxx |   34 +++++++++++++++++++++++++---------
 vcl/source/outdev/text.cxx          |    5 +++++
 3 files changed, 32 insertions(+), 9 deletions(-)

New commits:
commit 4f8edca85216b46b266fc5dba3103da57e5975be
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Feb 19 22:21:40 2017 +0200

    Fix visible space on Mac with the new layout engine
    
    This is not an issue on master since the alternative Mac code path is
    gone, but we need to skip it in 5.3 when the old layout engine is not
    used as well.
    
    Change-Id: Ib0c8fcf072229c59e15877815c9d88aed94672f0
    Reviewed-on: https://gerrit.libreoffice.org/34433
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 0088136..1bf5229 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1172,6 +1172,8 @@ public:
                                               vcl::TextLayoutCache const* = nullptr) const;
     std::shared_ptr<vcl::TextLayoutCache> CreateTextLayoutCache(OUString const&) const;
 
+    static bool                 UseCommonLayout();
+
 private:
     SAL_DLLPRIVATE void         ImplInitTextColor();
 
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a92fb87..70be938 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1384,10 +1384,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
     {
         const OUString* pStr = &rInf.GetText();
 
-#if !defined(MACOSX) && !defined(IOS)
         OUString aStr;
         OUString aBulletOverlay;
-#endif
+
         bool bBullet = rInf.GetBullet();
         if( m_bSymbol )
             bBullet = false;
@@ -1492,8 +1491,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
 
         nScrPos = pScrArray[ 0 ];
 
-#if !defined(MACOSX) && !defined(IOS)
-        if( bBullet )
+        if( bBullet
+#if defined(MACOSX) || defined(IOS)
+            && OutputDevice::UseCommonLayout()
+#endif
+          )
         {
             // !!! HACK !!!
             // The Arabic layout engine requires some context of the string
@@ -1532,7 +1534,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK));
                 }
         }
-#endif
+
         sal_Int32 nCnt = rInf.GetText().getLength();
         if ( nCnt < rInf.GetIdx() )
             nCnt = 0;
@@ -1557,14 +1559,21 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                 rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos );
 
 #if defined(MACOSX) || defined(IOS)
-            rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
+            if (!OutputDevice::UseCommonLayout())
+            {
+                rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
                                          pKernArray, rInf.GetIdx(), 1, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE );
-#else
+            }
+            else
+            {
+#endif
             rInf.GetOut().DrawTextArray( aTextOriginPos, rInf.GetText(),
                                          pKernArray, rInf.GetIdx(), 1 );
             if( bBullet )
                 rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray,
                                              rInf.GetIdx() ? 1 : 0, 1 );
+#if defined(MACOSX) || defined(IOS)
+            }
 #endif
         }
         else
@@ -1747,9 +1756,14 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     rInf.GetFrame()->SwitchHorizontalToVertical( aTextOriginPos );
 
 #if defined(MACOSX) || defined(IOS)
-                rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs,
+                if (!OutputDevice::UseCommonLayout())
+                {
+                        rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray + nOffs,
                                              rInf.GetIdx() + nOffs , nLen - nOffs, bBullet ? SalLayoutFlags::DrawBullet : SalLayoutFlags::NONE );
-#else
+                }
+                else
+                {
+#endif
                 // If we paint bullets instead of spaces, we use a copy of
                 // the paragraph string. For the layout engine, the copy
                 // of the string has to be an environment of the range which
@@ -1804,6 +1818,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     pTmpFont->SetStrikeout(aPreviousStrikeout);
                     rInf.GetOut().Pop();
                 }
+#if defined(MACOSX) || defined(IOS)
+                }
 #endif
             }
         }
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 0506280..60917ce 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2903,4 +2903,9 @@ bool OutputDevice::GetTextOutline( tools::PolyPolygon& rPolyPoly, const OUString
     return true;
 }
 
+bool OutputDevice::UseCommonLayout()
+{
+    return SalLayout::UseCommonLayout();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list