[Libreoffice-commits] core.git: vcl/source vcl/win

Herbert Dürr hdu at apache.org
Tue Aug 6 07:30:12 PDT 2013


 vcl/source/gdi/sallayout.cxx     |    7 -------
 vcl/win/source/gdi/winlayout.cxx |   11 ++++++++++-
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 022da4ea298d5d5c134c374546d963926dae2b37
Author: Herbert Dürr <hdu at apache.org>
Date:   Tue Aug 6 13:14:19 2013 +0000

    Resolves: #i122948# fill gaps in glyphs->chars mapping for usp10-layouts
    
    using a heuristic that assumes a glyph with unknown char mapping
    is the continuation of the preceding glyph. If there is no known
    preceding mapping use the run bounds.
    
    (cherry picked from commit 576e4ea626e1c1ffcf9d025e692db62fed8c3cab)
    
    Change-Id: I70e58a02d814e14e9592ff8efc0ae630346ae5df

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 4b1d536..c6b8a30 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1730,12 +1730,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
     for( n = 0; n < nLevel; ++n )
         maFallbackRuns[n].ResetPos();
     // get the next codepoint index that needs fallback
-    // and limit it to the minindex..endindex bounds
     int nActiveCharPos = nCharPos[0];
-    if( nActiveCharPos < mnMinCharPos)
-        nActiveCharPos = mnMinCharPos;
-    else if( nActiveCharPos >= rArgs.mnEndCharPos )
-        nActiveCharPos = rArgs.mnEndCharPos - 1;
     // get the end index of the active run
     int nLastRunEndChar = (vRtl[nActiveCharPos - mnMinCharPos])?
         rArgs.mnEndCharPos : rArgs.mnMinCharPos - 1;
@@ -1944,8 +1939,6 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
                 }
             }
         }
-//            if( !maFallbackRuns[i].PosIsInRun( nActiveCharPos ) )
-//                maFallbackRuns[i].NextRun();
     }
 
     mpLayouts[0]->Simplify( true );
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 2210ca4..80f94ae 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -1739,8 +1739,9 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
     {
         // create and reset the new array
         mpGlyphs2Chars = new int[ mnGlyphCapacity ];
+        static const int CHARPOS_NONE = -1;
         for( int i = 0; i < mnGlyphCount; ++i )
-            mpGlyphs2Chars[i] = -1;
+            mpGlyphs2Chars[i] = CHARPOS_NONE;
         // calculate the char->glyph mapping
         for( nItem = 0; nItem < mnItemCount; ++nItem )
         {
@@ -1780,6 +1781,14 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
                 int i = mpLogClusters[c] + rVI.mnMinGlyphPos;
                 mpGlyphs2Chars[i] = c;
             }
+            // use a heuristic to fill the gaps in the glyphs2chars array
+            c = !rVI.IsRTL() ? rVI.mnMinCharPos : rVI.mnEndCharPos - 1;
+            for( int i = rVI.mnMinGlyphPos; i < rVI.mnEndGlyphPos; ++i ) {
+                if( mpGlyphs2Chars[i] == CHARPOS_NONE )
+                    mpGlyphs2Chars[i] = c;
+                else
+                    c = mpGlyphs2Chars[i];
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list