Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


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;
 }


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.