summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-28 12:32:18 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-28 15:28:26 +0200
commit34b3c66da2e5a300930f4ea47661b0e38a459565 (patch)
treeccbfa2da031fcbe913577ab9636db3509f5a8b5e
parentf4d51b6fc1f4e0457efc0d513bd74c64d5697938 (diff)
add a hack to SalLayoutGlyphsImpl::cloneCharRange() for a strange glyph
Change-Id: Id4859982079f5f156b5e2d85598940ec8c936475 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133547 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--vcl/source/gdi/impglyphitem.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 6f0c3f3db5fd..d6c59e5decfa 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -147,6 +147,11 @@ SalLayoutGlyphsImpl* SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_In
{
if (pos->IsRTLGlyph() != rtl)
return nullptr; // Don't mix RTL and non-RTL runs.
+ // HACK: When running CppunitTest_sw_uiwriter3's testTdf104649 on Mac there's glyph
+ // with id 1232 that has 0 charCount, 0 origWidth and inconsistent xOffset (sometimes 0,
+ // but sometimes not). Possibly font or Harfbuzz bug? It's extremely rare, so simply bail out.
+ if (pos->charCount() == 0 && pos->origWidth() == 0)
+ return nullptr;
copy->push_back(*pos);
copy->back().setLinearPos(copy->back().linearPos() - zeroPoint);
++pos;