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

Chris Sherlock chris.sherlock79 at gmail.com
Thu Jan 14 10:26:37 PST 2016


 vcl/unx/generic/gdi/cairotextrender.cxx        |    4 -
 vcl/unx/generic/gdi/salgdi3.cxx                |    4 -
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |   84 ++++++++++++-------------
 vcl/win/gdi/salfont.cxx                        |   58 ++++++++---------
 4 files changed, 75 insertions(+), 75 deletions(-)

New commits:
commit abbf57dd41c29fa6a16328247776c1d3cc7024fa
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Jan 15 05:25:28 2016 +1100

    vcl: fixup prefixes for ImplFontMetricDataPtr variables
    
    Change-Id: Ie93a2e47bbe92c8268ea2b463c6134685445fc2b

diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 979202f..8c76759 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -455,7 +455,7 @@ FontConfigFontOptions* GetFCFontOptions( const FontAttributes& rFontAttributes,
 }
 
 void
-CairoTextRender::GetFontMetric( ImplFontMetricDataPtr& xFontMetric, int nFallbackLevel )
+CairoTextRender::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int nFallbackLevel )
 {
     if( nFallbackLevel >= MAX_FALLBACK )
         return;
@@ -463,7 +463,7 @@ CairoTextRender::GetFontMetric( ImplFontMetricDataPtr& xFontMetric, int nFallbac
     if( mpServerFont[nFallbackLevel] != nullptr )
     {
         long rDummyFactor;
-        mpServerFont[nFallbackLevel]->GetFontMetric( xFontMetric, rDummyFactor );
+        mpServerFont[nFallbackLevel]->GetFontMetric( rxFontMetric, rDummyFactor );
     }
 }
 
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 4796478..11a5030 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -136,9 +136,9 @@ void X11SalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection )
 }
 
 void
-X11SalGraphics::GetFontMetric( ImplFontMetricDataPtr &xFontMetric, int nFallbackLevel )
+X11SalGraphics::GetFontMetric( ImplFontMetricDataPtr &rxFontMetric, int nFallbackLevel )
 {
-    mxTextRenderImpl->GetFontMetric(xFontMetric, nFallbackLevel);
+    mxTextRenderImpl->GetFontMetric(rxFontMetric, nFallbackLevel);
 }
 
 bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 16100a8..957450f 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -614,19 +614,19 @@ ServerFont::~ServerFont()
 }
 
 
-void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rTo, long& rFactor ) const
+void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rxTo, long& rFactor ) const
 {
-    rTo->FontAttributes::operator =(mpFontInfo->GetFontAttributes());
+    rxTo->FontAttributes::operator =(mpFontInfo->GetFontAttributes());
 
-    rTo->SetScalableFlag( true ); // FIXME: Shouldn't this check FT_IS_SCALABLE( maFaceFT )?
-    rTo->SetTrueTypeFlag( FT_IS_SFNT( maFaceFT ) != 0 );
-    rTo->SetBuiltInFontFlag( true );
-    rTo->SetKernableFlag( FT_HAS_KERNING( maFaceFT ) != 0 );
-    rTo->SetOrientation( GetFontSelData().mnOrientation );
+    rxTo->SetScalableFlag( true ); // FIXME: Shouldn't this check FT_IS_SCALABLE( maFaceFT )?
+    rxTo->SetTrueTypeFlag( FT_IS_SFNT( maFaceFT ) != 0 );
+    rxTo->SetBuiltInFontFlag( true );
+    rxTo->SetKernableFlag( FT_HAS_KERNING( maFaceFT ) != 0 );
+    rxTo->SetOrientation( GetFontSelData().mnOrientation );
 
     //Always consider [star]symbol as symbol fonts
-    if ( IsStarSymbol( rTo->GetFamilyName() ) )
-        rTo->SetSymbolFlag( true );
+    if ( IsStarSymbol( rxTo->GetFamilyName() ) )
+        rxTo->SetSymbolFlag( true );
 
     FT_Activate_Size( maSizeFT );
 
@@ -635,11 +635,11 @@ void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rTo, long& rFactor ) cons
     const TT_OS2* pOS2 = static_cast<const TT_OS2*>(FT_Get_Sfnt_Table( maFaceFT, ft_sfnt_os2 ));
     const double fScale = (double)GetFontSelData().mnHeight / maFaceFT->units_per_EM;
 
-    rTo->SetAscent( 0 );
-    rTo->SetDescent( 0 );
-    rTo->SetExternalLeading( 0 );
-    rTo->SetSlant( 0 );
-    rTo->SetWidth( mnWidth );
+    rxTo->SetAscent( 0 );
+    rxTo->SetDescent( 0 );
+    rxTo->SetExternalLeading( 0 );
+    rxTo->SetSlant( 0 );
+    rxTo->SetWidth( mnWidth );
 
     // Calculating ascender and descender:
     // FreeType >= 2.4.6 does the right thing, so we just use what it gives us,
@@ -650,63 +650,63 @@ void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rTo, long& rFactor ) cons
     if (nFTVERSION >= 2406)
     {
         const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
-        rTo->SetAscent( (rMetrics.ascender + 32) >> 6 );
-        rTo->SetDescent( (-rMetrics.descender + 32) >> 6 );
-        rTo->SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rTo->GetAscent() + rTo->GetDescent()) );
+        rxTo->SetAscent( (rMetrics.ascender + 32) >> 6 );
+        rxTo->SetDescent( (-rMetrics.descender + 32) >> 6 );
+        rxTo->SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rxTo->GetAscent() + rxTo->GetDescent()) );
     }
     else
     {
         const TT_HoriHeader* pHHea = static_cast<const TT_HoriHeader*>(FT_Get_Sfnt_Table(maFaceFT, ft_sfnt_hhea));
         if (pHHea)
         {
-            rTo->SetAscent( pHHea->Ascender * fScale + 0.5 );
-            rTo->SetDescent( -pHHea->Descender * fScale + 0.5 );
-            rTo->SetExternalLeading( pHHea->Line_Gap * fScale + 0.5 );
+            rxTo->SetAscent( pHHea->Ascender * fScale + 0.5 );
+            rxTo->SetDescent( -pHHea->Descender * fScale + 0.5 );
+            rxTo->SetExternalLeading( pHHea->Line_Gap * fScale + 0.5 );
         }
 
-        if (!(rTo->GetAscent() || rTo->GetDescent()))
+        if (!(rxTo->GetAscent() || rxTo->GetDescent()))
         {
             if (pOS2 && (pOS2->version != 0xFFFF))
             {
                 if (pOS2->sTypoAscender || pOS2->sTypoDescender)
                 {
-                    rTo->SetAscent( pOS2->sTypoAscender * fScale + 0.5 );
-                    rTo->SetDescent( -pOS2->sTypoDescender * fScale + 0.5 );
-                    rTo->SetExternalLeading( pOS2->sTypoLineGap * fScale + 0.5 );
+                    rxTo->SetAscent( pOS2->sTypoAscender * fScale + 0.5 );
+                    rxTo->SetDescent( -pOS2->sTypoDescender * fScale + 0.5 );
+                    rxTo->SetExternalLeading( pOS2->sTypoLineGap * fScale + 0.5 );
                 }
                 else
                 {
-                    rTo->SetAscent( pOS2->usWinAscent * fScale + 0.5 );
-                    rTo->SetDescent( pOS2->usWinDescent * fScale + 0.5 );
-                    rTo->SetExternalLeading( 0 );
+                    rxTo->SetAscent( pOS2->usWinAscent * fScale + 0.5 );
+                    rxTo->SetDescent( pOS2->usWinDescent * fScale + 0.5 );
+                    rxTo->SetExternalLeading( 0 );
                 }
             }
         }
 
-        if (!(rTo->GetAscent() || rTo->GetDescent()))
+        if (!(rxTo->GetAscent() || rxTo->GetDescent()))
         {
             const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
-            rTo->SetAscent( (rMetrics.ascender + 32) >> 6 );
-            rTo->SetDescent( (-rMetrics.descender + 32) >> 6 );
-            rTo->SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rTo->GetAscent() + rTo->GetDescent() ) );
+            rxTo->SetAscent( (rMetrics.ascender + 32) >> 6 );
+            rxTo->SetDescent( (-rMetrics.descender + 32) >> 6 );
+            rxTo->SetExternalLeading( ((rMetrics.height + 32) >> 6) - (rxTo->GetAscent() + rxTo->GetDescent() ) );
         }
     }
 
-    rTo->SetInternalLeading( rTo->GetAscent() + rTo->GetDescent() - (maFaceFT->units_per_EM * fScale + 0.5) );
+    rxTo->SetInternalLeading( rxTo->GetAscent() + rxTo->GetDescent() - (maFaceFT->units_per_EM * fScale + 0.5) );
 
     if( pOS2 && (pOS2->version != 0xFFFF) )
     {
         // map the panose info from the OS2 table to their VCL counterparts
         switch( pOS2->panose[0] )
         {
-            case 1: rTo->SetFamilyType( FAMILY_ROMAN ); break;
-            case 2: rTo->SetFamilyType( FAMILY_SWISS ); break;
-            case 3: rTo->SetFamilyType( FAMILY_MODERN ); break;
-            case 4: rTo->SetFamilyType( FAMILY_SCRIPT ); break;
-            case 5: rTo->SetFamilyType( FAMILY_DECORATIVE ); break;
+            case 1: rxTo->SetFamilyType( FAMILY_ROMAN ); break;
+            case 2: rxTo->SetFamilyType( FAMILY_SWISS ); break;
+            case 3: rxTo->SetFamilyType( FAMILY_MODERN ); break;
+            case 4: rxTo->SetFamilyType( FAMILY_SCRIPT ); break;
+            case 5: rxTo->SetFamilyType( FAMILY_DECORATIVE ); break;
             // TODO: is it reasonable to override the attribute with DONTKNOW?
             case 0: // fall through
-            default: rTo->SetFamilyType( FAMILY_DONTKNOW ); break;
+            default: rxTo->SetFamilyType( FAMILY_DONTKNOW ); break;
         }
 
         switch( pOS2->panose[3] )
@@ -717,12 +717,12 @@ void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rTo, long& rFactor ) cons
             case 5: // fall through
             case 6: // fall through
             case 7: // fall through
-            case 8: rTo->SetPitch( PITCH_VARIABLE ); break;
-            case 9: rTo->SetPitch( PITCH_FIXED ); break;
+            case 8: rxTo->SetPitch( PITCH_VARIABLE ); break;
+            case 9: rxTo->SetPitch( PITCH_FIXED ); break;
             // TODO: is it reasonable to override the attribute with DONTKNOW?
             case 0: // fall through
             case 1: // fall through
-            default: rTo->SetPitch( PITCH_DONTKNOW ); break;
+            default: rxTo->SetPitch( PITCH_DONTKNOW ); break;
         }
     }
 
@@ -733,7 +733,7 @@ void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rTo, long& rFactor ) cons
     {
         GlyphData aGlyphData;
         InitGlyphData( nKashidaGlyphId, aGlyphData );
-        rTo->SetMinKashida( aGlyphData.GetMetric().GetCharWidth() );
+        rxTo->SetMinKashida( aGlyphData.GetMetric().GetCharWidth() );
     }
 
 }
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index ef00538..b95e9f5 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1479,14 +1479,14 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
         return 0;
 }
 
-void WinSalGraphics::GetFontMetric( ImplFontMetricDataPtr& pFontMetric, int nFallbackLevel )
+void WinSalGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int nFallbackLevel )
 {
     // temporarily change the HDC to the font in the fallback level
     HFONT hOldFont = SelectFont( getHDC(), mhFonts[nFallbackLevel] );
 
     wchar_t aFaceName[LF_FACESIZE+60];
     if( ::GetTextFaceW( getHDC(), sizeof(aFaceName)/sizeof(wchar_t), aFaceName ) )
-        pFontMetric->SetFamilyName(OUString(reinterpret_cast<const sal_Unicode*>(aFaceName)));
+        rxFontMetric->SetFamilyName(OUString(reinterpret_cast<const sal_Unicode*>(aFaceName)));
 
     // get the font metric
     TEXTMETRICA aWinMetric;
@@ -1497,63 +1497,63 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricDataPtr& pFontMetric, int nFal
         return;
 
     // device independent font attributes
-    pFontMetric->SetFamilyType(ImplFamilyToSal( aWinMetric.tmPitchAndFamily ));
-    pFontMetric->SetSymbolFlag(aWinMetric.tmCharSet == SYMBOL_CHARSET);
-    pFontMetric->SetWeight(ImplWeightToSal( aWinMetric.tmWeight ));
-    pFontMetric->SetPitch(ImplMetricPitchToSal( aWinMetric.tmPitchAndFamily ));
-    pFontMetric->SetItalic(aWinMetric.tmItalic ? ITALIC_NORMAL : ITALIC_NONE);
-    pFontMetric->SetSlant( 0 );
+    rxFontMetric->SetFamilyType(ImplFamilyToSal( aWinMetric.tmPitchAndFamily ));
+    rxFontMetric->SetSymbolFlag(aWinMetric.tmCharSet == SYMBOL_CHARSET);
+    rxFontMetric->SetWeight(ImplWeightToSal( aWinMetric.tmWeight ));
+    rxFontMetric->SetPitch(ImplMetricPitchToSal( aWinMetric.tmPitchAndFamily ));
+    rxFontMetric->SetItalic(aWinMetric.tmItalic ? ITALIC_NORMAL : ITALIC_NONE);
+    rxFontMetric->SetSlant( 0 );
 
     // device dependent font attributes
-    pFontMetric->SetBuiltInFontFlag( (aWinMetric.tmPitchAndFamily & TMPF_DEVICE) != 0 );
-    pFontMetric->SetScalableFlag( (aWinMetric.tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) != 0 );
-    pFontMetric->SetTrueTypeFlag( (aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE) != 0 );
-    if( pFontMetric->IsScalable() )
+    rxFontMetric->SetBuiltInFontFlag( (aWinMetric.tmPitchAndFamily & TMPF_DEVICE) != 0 );
+    rxFontMetric->SetScalableFlag( (aWinMetric.tmPitchAndFamily & (TMPF_VECTOR|TMPF_TRUETYPE)) != 0 );
+    rxFontMetric->SetTrueTypeFlag( (aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE) != 0 );
+    if( rxFontMetric->IsScalable() )
     {
         // check if there are kern pairs
         // TODO: does this work with GPOS kerning?
         DWORD nKernPairs = ::GetKerningPairsA( getHDC(), 0, NULL );
-        pFontMetric->SetKernableFlag( (nKernPairs > 0) );
+        rxFontMetric->SetKernableFlag( (nKernPairs > 0) );
     }
     else
     {
         // bitmap fonts cannot be rotated directly
-        pFontMetric->SetOrientation( 0 );
+        rxFontMetric->SetOrientation( 0 );
         // bitmap fonts have no kerning
-        pFontMetric->SetKernableFlag( false );
+        rxFontMetric->SetKernableFlag( false );
     }
 
     // transformation dependent font metrics
-    pFontMetric->SetWidth( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth ) );
-    pFontMetric->SetInternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading ) );
-    pFontMetric->SetExternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading ) );
-    pFontMetric->SetAscent( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent ) );
-    pFontMetric->SetDescent( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent ) );
+    rxFontMetric->SetWidth( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAveCharWidth ) );
+    rxFontMetric->SetInternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmInternalLeading ) );
+    rxFontMetric->SetExternalLeading( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmExternalLeading ) );
+    rxFontMetric->SetAscent( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmAscent ) );
+    rxFontMetric->SetDescent( static_cast<int>( mfFontScale[nFallbackLevel] * aWinMetric.tmDescent ) );
 
     // #107888# improved metric compatibility for Asian fonts...
     // TODO: assess workaround below for CWS >= extleading
     // TODO: evaluate use of aWinMetric.sTypo* members for CJK
     if( mpWinFontData[nFallbackLevel] && mpWinFontData[nFallbackLevel]->SupportsCJK() )
     {
-        pFontMetric->SetInternalLeading( pFontMetric->GetInternalLeading() + pFontMetric->GetExternalLeading() );
+        rxFontMetric->SetInternalLeading( rxFontMetric->GetInternalLeading() + rxFontMetric->GetExternalLeading() );
 
         // #109280# The line height for Asian fonts is too small.
         // Therefore we add half of the external leading to the
         // ascent, the other half is added to the descent.
-        const long nHalfTmpExtLeading = pFontMetric->GetExternalLeading() / 2;
-        const long nOtherHalfTmpExtLeading = pFontMetric->GetExternalLeading() - nHalfTmpExtLeading;
+        const long nHalfTmpExtLeading = rxFontMetric->GetExternalLeading() / 2;
+        const long nOtherHalfTmpExtLeading = rxFontMetric->GetExternalLeading() - nHalfTmpExtLeading;
 
         // #110641# external leading for Asian fonts.
         // The factor 0.3 has been confirmed with experiments.
-        long nCJKExtLeading = static_cast<long>(0.30 * (pFontMetric->GetAscent() + pFontMetric->GetDescent()));
-        nCJKExtLeading -= pFontMetric->GetExternalLeading();
-        pFontMetric->SetExternalLeading( (nCJKExtLeading > 0) ? nCJKExtLeading : 0 );
+        long nCJKExtLeading = static_cast<long>(0.30 * (rxFontMetric->GetAscent() + rxFontMetric->GetDescent()));
+        nCJKExtLeading -= rxFontMetric->GetExternalLeading();
+        rxFontMetric->SetExternalLeading( (nCJKExtLeading > 0) ? nCJKExtLeading : 0 );
 
-        pFontMetric->SetAscent( pFontMetric->GetAscent() + nHalfTmpExtLeading );
-        pFontMetric->SetDescent(  pFontMetric->GetDescent() + nOtherHalfTmpExtLeading );
+        rxFontMetric->SetAscent( rxFontMetric->GetAscent() + nHalfTmpExtLeading );
+        rxFontMetric->SetDescent(  rxFontMetric->GetDescent() + nOtherHalfTmpExtLeading );
     }
 
-    pFontMetric->SetMinKashida( GetMinKashidaWidth() );
+    rxFontMetric->SetMinKashida( GetMinKashidaWidth() );
 }
 
 const FontCharMapPtr WinSalGraphics::GetFontCharMap() const


More information about the Libreoffice-commits mailing list