[PATCH] resolves:fdo#54629 vcl:gdi add recursive check

navin patidar (via Code Review) gerrit at gerrit.libreoffice.org
Sat Jan 12 01:31:12 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1662

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/1662/1

resolves:fdo#54629 vcl:gdi add recursive check

check all font fallback levels if rRect.IsEmpty() is true for
specific level.

Change-Id: I8eebde2196d6551ddcf9d020afa3a157c809710c
---
M vcl/unx/generic/gdi/salgdi3.cxx
1 file changed, 16 insertions(+), 4 deletions(-)



diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index fb7027e..e0924f8 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -687,14 +687,15 @@
 
 sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
 {
+    static int i = -1;
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
-    if( nLevel >= MAX_FALLBACK )
-        return sal_False;
 
     ServerFont* pSF = mpServerFont[ nLevel ];
     if( !pSF )
+    {
+        i = -1;
         return sal_False;
-
+    }
     nGlyphIndex &= GF_IDXMASK;
     const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
     Rectangle aRect( rGM.GetOffset(), rGM.GetSize() );
@@ -712,7 +713,18 @@
     else
         rRect = aRect;
 
-    return sal_True;
+    if ( rRect.IsEmpty() )
+    {
+        i++;
+        sal_GlyphId nFontTag = i << GF_FONTSHIFT;
+// Check all fallback font levels, start from level zero
+        GetGlyphBoundRect( nGlyphIndex | nFontTag, rRect );
+    }
+    else
+    {
+        i = -1;
+        return sal_True;
+    }
 }
 
 // ---------------------------------------------------------------------------

-- 
To view, visit https://gerrit.libreoffice.org/1662
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8eebde2196d6551ddcf9d020afa3a157c809710c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: navin patidar <patidar at kacst.edu.sa>



More information about the LibreOffice mailing list