[Libreoffice-commits] core.git: vcl/inc vcl/source

Khaled Hosny khaledhosny at eglug.org
Sun Apr 22 04:41:02 UTC 2018


 vcl/inc/sallayout.hxx        |    4 +++-
 vcl/source/gdi/sallayout.cxx |    9 ++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit bb56e2ded30d190c57810812983e5010f6945915
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Apr 21 20:38:58 2018 +0200

    Don’t abuse glyph id for flagging dropped glyphs
    
    Use a bitflag instead.
    
    Change-Id: I7833a37578112b5326f4a30578596e53085ff3c0
    Reviewed-on: https://gerrit.libreoffice.org/53269
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index ba9cd3bd08e9..ffc38d4b8adf 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -286,7 +286,8 @@ public:
         IS_DIACRITIC  = 0x004,
         IS_VERTICAL   = 0x008,
         IS_SPACING    = 0x010,
-        ALLOW_KASHIDA = 0x020
+        ALLOW_KASHIDA = 0x020,
+        IS_DROPPED    = 0x040
     };
 
     bool    IsClusterStart() const  { return ((mnFlags & IS_IN_CLUSTER) == 0); }
@@ -295,6 +296,7 @@ public:
     bool    IsVertical() const      { return ((mnFlags & IS_VERTICAL) != 0); }
     bool    IsSpacing() const       { return ((mnFlags & IS_SPACING) != 0); }
     bool    AllowKashida() const    { return ((mnFlags & ALLOW_KASHIDA) != 0); }
+    bool    IsDropped() const       { return ((mnFlags & IS_DROPPED) != 0); }
 };
 
 class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 616fc63e27fc..2d73d55517ea 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -47,7 +47,6 @@
 // Glyph Flags
 #define GF_FONTMASK  0xF0000000
 #define GF_FONTSHIFT 28
-#define GF_DROPPED   0xFFFFFFFF
 
 
 std::ostream &operator <<(std::ostream& s, ImplLayoutArgs const &rArgs)
@@ -1003,19 +1002,19 @@ void GenericSalLayout::DropGlyph( int nStart )
 
     std::vector<GlyphItem>::iterator pGlyphIter = m_GlyphItems.begin();
     pGlyphIter += nStart;
-    pGlyphIter->maGlyphId = GF_DROPPED;
     pGlyphIter->mnCharPos = -1;
+    pGlyphIter->mnFlags |= GlyphItem::IS_DROPPED;
 }
 
 void GenericSalLayout::Simplify( bool bIsBase )
 {
-    const sal_GlyphId nDropMarker = bIsBase ? GF_DROPPED : 0;
-
     // remove dropped glyphs inplace
     size_t j = 0;
     for(size_t i = 0; i < m_GlyphItems.size(); i++ )
     {
-        if( m_GlyphItems[i].maGlyphId == nDropMarker )
+        if (bIsBase && m_GlyphItems[i].IsDropped())
+            continue;
+        if (!bIsBase && m_GlyphItems[i].maGlyphId == 0)
             continue;
 
         if( i != j )


More information about the Libreoffice-commits mailing list