vcl/source/gdi/impglyphitem.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 34b3c66da2e5a300930f4ea47661b0e38a459565
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Thu Apr 28 12:32:18 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Thu Apr 28 15:28:26 2022 +0200

    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.lu...@collabora.com>

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;

Reply via email to