From 34b3c66da2e5a300930f4ea47661b0e38a459565 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Thu, 28 Apr 2022 12:32:18 +0200 Subject: add a hack to SalLayoutGlyphsImpl::cloneCharRange() for a strange glyph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id4859982079f5f156b5e2d85598940ec8c936475 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133547 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/source/gdi/impglyphitem.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit