summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-28 06:57:18 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-28 08:10:33 +0200
commitbd568b360450b348ff0e6813862a49892df81140 (patch)
treeb7e66a4fe8e7ff0b7353e3e94de1789621b2f84b /vcl
parent7b7d2f4a3e96e771e125c95a7d262b20f6dc9ecc (diff)
check kashida only if the flag is set
Change-Id: Ie508863c670e4b691bd30ac4d20ce479a569f793 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133531 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/impglyphitem.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 8ea80293ee08..d6cd36ab1b5c 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -192,18 +192,25 @@ static SalLayoutGlyphs makeGlyphsSubset(const SalLayoutGlyphs& source,
| outputDevice->GetBiDiLayoutFlags(text, index, index + len));
// SalLayoutFlags::KashidaJustification is set only if any glyph
// in the range has GlyphItemFlags::ALLOW_KASHIDA (otherwise unset it).
- bool hasKashida = false;
- for (const GlyphItem& item : *cloned)
+ if (cloned->GetFlags() & SalLayoutFlags::KashidaJustification)
{
- if (item.AllowKashida())
+ bool hasKashida = false;
+ for (const GlyphItem& item : *cloned)
{
- assert(cloned->GetFlags() & SalLayoutFlags::KashidaJustification);
- hasKashida = true;
- break;
+ if (item.AllowKashida())
+ {
+ hasKashida = true;
+ break;
+ }
}
+ if (!hasKashida)
+ cloned->SetFlags(cloned->GetFlags() & ~SalLayoutFlags::KashidaJustification);
}
- if (!hasKashida)
- cloned->SetFlags(cloned->GetFlags() & ~SalLayoutFlags::KashidaJustification);
+#ifdef DBG_UTIL
+ else
+ for (const GlyphItem& item : *cloned)
+ assert(!item.AllowKashida());
+#endif
ret.AppendImpl(cloned);
}
return ret;