Author: hdu
Date: Tue Aug 13 14:32:41 2013
New Revision: 1513506

URL: http://svn.apache.org/r1513506
Log:
#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.

Modified:
    openoffice/branches/AOO401/   (props changed)
    openoffice/branches/AOO401/main/cui/   (props changed)
    openoffice/branches/AOO401/main/drawinglayer/   (props changed)
    openoffice/branches/AOO401/main/vcl/source/gdi/sallayout.cxx
    openoffice/branches/AOO401/main/vcl/unx/gtk/window/gtkframe.cxx   (props 
changed)
    openoffice/branches/AOO401/main/vcl/win/source/gdi/winlayout.cxx
    openoffice/branches/AOO401/test/   (props changed)
    openoffice/branches/AOO401/test/testcommon/source/org/openoffice/test/vcl/  
 (props changed)

Propchange: openoffice/branches/AOO401/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1509224,1510954,1512298

Propchange: openoffice/branches/AOO401/main/cui/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main/cui:r1509224,1510954,1512298

Propchange: openoffice/branches/AOO401/main/drawinglayer/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main/drawinglayer:r1509224,1510954,1512298

Modified: openoffice/branches/AOO401/main/vcl/source/gdi/sallayout.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/vcl/source/gdi/sallayout.cxx?rev=1513506&r1=1513505&r2=1513506&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/vcl/source/gdi/sallayout.cxx (original)
+++ openoffice/branches/AOO401/main/vcl/source/gdi/sallayout.cxx Tue Aug 13 
14:32:41 2013
@@ -1869,12 +1869,7 @@ void MultiSalLayout::AdjustLayout( ImplL
     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;
@@ -2083,8 +2078,6 @@ void MultiSalLayout::AdjustLayout( ImplL
                 }
             }
         }
-//            if( !maFallbackRuns[i].PosIsInRun( nActiveCharPos ) )
-//                maFallbackRuns[i].NextRun();
     }
 
     mpLayouts[0]->Simplify( true );

Propchange: openoffice/branches/AOO401/main/vcl/unx/gtk/window/gtkframe.cxx
------------------------------------------------------------------------------
  Merged 
/openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx:r1509224,1510954,1512298

Modified: openoffice/branches/AOO401/main/vcl/win/source/gdi/winlayout.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/vcl/win/source/gdi/winlayout.cxx?rev=1513506&r1=1513505&r2=1513506&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/vcl/win/source/gdi/winlayout.cxx (original)
+++ openoffice/branches/AOO401/main/vcl/win/source/gdi/winlayout.cxx Tue Aug 13 
14:32:41 2013
@@ -1845,30 +1845,39 @@ int UniscribeLayout::GetNextGlyphs( int 
            nXOffset += mpJustifications[ nStart ] - mpGlyphAdvances[ nStart ];
     }
 
-    // create mpGlyphs2Chars[] if it is needed later
-    if( pCharPosAry && !mpGlyphs2Chars )
-    {
-        // create and reset the new array
-        mpGlyphs2Chars = new int[ mnGlyphCapacity ];
-        for( int i = 0; i < mnGlyphCount; ++i )
-            mpGlyphs2Chars[i] = -1;
-        // calculate the char->glyph mapping
-        for( nItem = 0; nItem < mnItemCount; ++nItem )
-        {
-            // ignore invisible visual items
-            const VisualItem& rVI = mpVisualItems[ nItem ];
-            if( rVI.IsEmpty() )
-                continue;
-            // calculate the mapping by using mpLogClusters[]
-            // mpGlyphs2Chars[] should obey the logical order
-            // => reversing the loop does this by overwriting higher logicals
-            for( c = rVI.mnEndCharPos; --c >= rVI.mnMinCharPos; )
-            {
-                int i = mpLogClusters[c] + rVI.mnMinGlyphPos;
-                mpGlyphs2Chars[i] = c;
-            }
-        }
-    }
+       // create mpGlyphs2Chars[] if it is needed later
+       if( pCharPosAry && !mpGlyphs2Chars )
+       {
+               // 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] = CHARPOS_NONE;
+               // calculate the char->glyph mapping
+               for( nItem = 0; nItem < mnItemCount; ++nItem )
+               {
+                       // ignore invisible visual items
+                       const VisualItem& rVI = mpVisualItems[ nItem ];
+                       if( rVI.IsEmpty() )
+                               continue;
+                       // calculate the mapping by using mpLogClusters[]
+                       // mpGlyphs2Chars[] should obey the logical order
+                       // => reversing the loop does this by overwriting 
higher logicals
+                       for( c = rVI.mnEndCharPos; --c >= rVI.mnMinCharPos; )
+                       {
+                               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];
+                       }
+               }
+       }
 
     // calculate the absolute position of the first result glyph in pixel units
     const GOFFSET aGOffset = mpGlyphOffsets[ nStart ];

Propchange: openoffice/branches/AOO401/test/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/test:r1509224,1510954,1512298

Propchange: 
openoffice/branches/AOO401/test/testcommon/source/org/openoffice/test/vcl/
------------------------------------------------------------------------------
  Merged 
/openoffice/trunk/test/testcommon/source/org/openoffice/test/vcl:r1509224,1510954,1512298


Reply via email to