hello,
in vcl/win/source/gdi/winlayout.cxx, around line 695 there is:

 long SimpleWinLayout::FillDXArray( long* pDXArray ) const
 {
+    if( !mnWidth )
+    {
+        long mnWidth = mnBaseAdv;
+        for( int i = 0; i < mnGlyphCount; ++i )
+            mnWidth += mpGlyphAdvances[ i ];
+    }

+    if( pDXArray != NULL )
     {
+        for( int i = 0; i < mnCharCount; ++i )
+             pDXArray[ i ] = mpCharWidths[ i ];
     }

+    return mnWidth;
 }

the statement within th IF does not make any sense for my poor understanding. As I read the code, the first IF could also be totally removed, since as soon as exiting the first IF, all value are lost.

It seems to me that this is more or less what happened with the early code before the change of commit 2f382d6c2579a2 in 2003. But I do not sucess to match both logic.
Has someone more / better hints?
Thanks
Pierre-André

long SimpleWinLayout::FillDXArray( long* pDXArray ) const
 {
-    if( mnWidth && !pDXArray )
-        return mnWidth;
-
-    long nWidth = 0;

-    for( int i = 0; i < mnGlyphCount; ++i )
     {
-        int j = !mpChars2Glyphs ? i : mpChars2Glyphs[i];
-        nWidth += mpGlyphAdvances[j];
-        if( pDXArray )
-            pDXArray[i] = nWidth;
     }

-    return nWidth;
 }

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to