Kaydet (Commit) bb56e2de authored tarafından Khaled Hosny's avatar Khaled Hosny

Don’t abuse glyph id for flagging dropped glyphs

Use a bitflag instead.

Change-Id: I7833a37578112b5326f4a30578596e53085ff3c0
Reviewed-on: https://gerrit.libreoffice.org/53269Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 63a71678
......@@ -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
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment