[Libreoffice-commits] .: vcl/generic vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 7 02:20:08 PST 2013


 vcl/generic/fontmanager/fontconfig.cxx |   12 +-
 vcl/generic/fontmanager/fontsubst.cxx  |    8 -
 vcl/generic/glyphs/gcach_ftyp.cxx      |   22 ++--
 vcl/generic/glyphs/glyphcache.cxx      |    8 -
 vcl/generic/print/genpspgraphics.cxx   |   20 +--
 vcl/inc/outfont.hxx                    |   11 +-
 vcl/source/gdi/font.cxx                |   17 +--
 vcl/source/gdi/outdev3.cxx             |  174 ++++++++++++++++-----------------
 vcl/source/gdi/pdfwriter_impl.cxx      |   32 +++---
 9 files changed, 155 insertions(+), 149 deletions(-)

New commits:
commit 1e1ba8611fb134fb693354daae8931e93e46124c
Author: navin <patidar at kacst.edu.sa>
Date:   Sun Jan 6 16:18:00 2013 +0300

    Change public variables of class ImplFontAttributes to private.
    
    Change-Id: I56ff5d7d2420c334c6fc9e4c552f8b5c4715d93f
    Reviewed-on: https://gerrit.libreoffice.org/1551
    Reviewed-by: Tor Lillqvist <tml at iki.fi>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index b707b78..0efdbe4 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -946,8 +946,8 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
        FcCharSetDestroy(unicodes);
     }
 
-    addtopattern(pPattern, rPattern.meItalic, rPattern.meWeight,
-        rPattern.meWidthType, rPattern.mePitch);
+    addtopattern(pPattern, rPattern.GetSlant(), rPattern.GetWeight(),
+        rPattern.GetWidthType(), rPattern.GetPitch());
 
     // query fontconfig for a substitute
     FcConfigSubstitute(FcConfigGetCurrent(), pPattern, FcMatchPattern);
@@ -1017,13 +1017,13 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
             {
                 int val = 0;
                 if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WEIGHT, 0, &val))
-                    rPattern.meWeight = convertWeight(val);
+                    rPattern.SetWeight( convertWeight(val) );
                 if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SLANT, 0, &val))
-                    rPattern.meItalic = convertSlant(val);
+                    rPattern.SetItalic( convertSlant(val) );
                 if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SPACING, 0, &val))
-                    rPattern.mePitch = convertSpacing(val);
+                    rPattern.SetPitch ( convertSpacing(val) );
                 if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WIDTH, 0, &val))
-                    rPattern.meWidthType = convertWidth(val);
+                    rPattern.SetWidthType ( convertWidth(val) );
                 FcBool bEmbolden;
                 if (FcResultMatch == FcPatternGetBool(pSet->fonts[0], FC_EMBOLDEN, 0, &bEmbolden))
                     rPattern.mbEmbolden = bEmbolden;
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 23ac968..a026ee9 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -132,10 +132,10 @@ namespace
         return
           (
             rOrig.maTargetName == rNew.maSearchName &&
-            rOrig.meWeight == rNew.meWeight &&
-            rOrig.meItalic == rNew.meItalic &&
-            rOrig.mePitch == rNew.mePitch &&
-            rOrig.meWidthType == rNew.meWidthType
+            rOrig.GetWeight() == rNew.GetWeight() &&
+            rOrig.GetSlant() == rNew.GetSlant() &&
+            rOrig.GetPitch() == rNew.GetPitch() &&
+            rOrig.GetWidthType() == rNew.GetWidthType()
           );
     }
 
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index d7e693b..de44e31 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -788,8 +788,8 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
     mnLoadFlags |= FT_LOAD_IGNORE_TRANSFORM;
 #endif
 
-    mbArtItalic = (rFSD.meItalic != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE);
-    mbArtBold = (rFSD.meWeight > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM);
+    mbArtItalic = (rFSD.GetSlant() != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE);
+    mbArtBold = (rFSD.GetWeight() > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM);
     mbUseGamma = false;
     if( mbArtBold )
     {
@@ -934,7 +934,7 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
          (rTo.GetFamilyName().EqualsAscii("StarSymbol"))
        )
     {
-        rTo.mbSymbolFlag = true;
+        rTo.SetSymbolFlag( true );
     }
 
     if( maSizeFT )
@@ -964,11 +964,11 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
         // map the panose info from the OS2 table to their VCL counterparts
         switch( pOS2->panose[0] )
         {
-            case 1: rTo.meFamily = FAMILY_ROMAN; break;
-            case 2: rTo.meFamily = FAMILY_SWISS; break;
-            case 3: rTo.meFamily = FAMILY_MODERN; break;
-            case 4: rTo.meFamily = FAMILY_SCRIPT; break;
-            case 5: rTo.meFamily = FAMILY_DECORATIVE; break;
+            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;
             // TODO: is it reasonable to override the attribute with DONTKNOW?
             case 0: // fall through
             default: rTo.meFamilyType = FAMILY_DONTKNOW; break;
@@ -982,12 +982,12 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
             case 5: // fall through
             case 6: // fall through
             case 7: // fall through
-            case 8: rTo.mePitch = PITCH_VARIABLE; break;
-            case 9: rTo.mePitch = PITCH_FIXED; break;
+            case 8: rTo.SetPitch( PITCH_VARIABLE ); break;
+            case 9: rTo.SetPitch( PITCH_FIXED ); break;
             // TODO: is it reasonable to override the attribute with DONTKNOW?
             case 0: // fall through
             case 1: // fall through
-            default: rTo.mePitch = PITCH_DONTKNOW; break;
+            default: rTo.SetPitch( PITCH_DONTKNOW ); break;
         }
 
         const double fScale = (double)GetFontSelData().mnHeight / maFaceFT->units_per_EM;
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
index deef6be..79a2d7a 100644
--- a/vcl/generic/glyphs/glyphcache.cxx
+++ b/vcl/generic/glyphs/glyphcache.cxx
@@ -97,8 +97,8 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData
     nHash   += rFontSelData.mnHeight;
     nHash   += rFontSelData.mnOrientation;
     nHash   += rFontSelData.mbVertical;
-    nHash   += rFontSelData.meItalic;
-    nHash   += rFontSelData.meWeight;
+    nHash   += rFontSelData.GetSlant();
+    nHash   += rFontSelData.GetWeight();
 #ifdef ENABLE_GRAPHITE
     nHash   += rFontSelData.meLanguage;
 #endif
@@ -122,8 +122,8 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font
     ||  (rA.mbNonAntialiased != rB.mbNonAntialiased) )
         return false;
 
-    if( (rA.meItalic != rB.meItalic)
-    ||  (rA.meWeight != rB.meWeight) )
+    if( (rA.GetSlant() != rB.GetSlant())
+    ||  (rA.GetWeight() != rB.GetWeight()) )
         return false;
 
     // NOTE: ignoring meFamily deliberately
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 1a271a0..7b2ce32 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -840,13 +840,13 @@ sal_uInt16 GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLeve
     // determine which font attributes need to be emulated
     bool bArtItalic = false;
     bool bArtBold = false;
-    if( pEntry->meItalic == ITALIC_OBLIQUE || pEntry->meItalic == ITALIC_NORMAL )
+    if( pEntry->GetSlant() == ITALIC_OBLIQUE || pEntry->GetSlant() == ITALIC_NORMAL )
     {
         FontItalic eItalic = m_pPrinterGfx->GetFontMgr().getFontItalic( nID );
         if( eItalic != ITALIC_NORMAL && eItalic != ITALIC_OBLIQUE )
             bArtItalic = true;
     }
-    int nWeight = (int)pEntry->meWeight;
+    int nWeight = (int)pEntry->GetWeight();
     int nRealWeight = (int)m_pPrinterGfx->GetFontMgr().getFontWeight( nID );
     if( nRealWeight <= (int)WEIGHT_MEDIUM && nWeight > (int)WEIGHT_MEDIUM )
     {
@@ -1124,14 +1124,14 @@ void GenPspGraphics::DoGetGlyphWidths( psp::fontID aFont,
 ImplDevFontAttributes GenPspGraphics::Info2DevFontAttributes( const psp::FastPrintFontInfo& rInfo )
 {
     ImplDevFontAttributes aDFA;
-    aDFA.maName         = rInfo.m_aFamilyName;
-    aDFA.maStyleName    = rInfo.m_aStyleName;
-    aDFA.meFamily       = rInfo.m_eFamilyStyle;
-    aDFA.meWeight       = rInfo.m_eWeight;
-    aDFA.meItalic       = rInfo.m_eItalic;
-    aDFA.meWidthType    = rInfo.m_eWidth;
-    aDFA.mePitch        = rInfo.m_ePitch;
-    aDFA.mbSymbolFlag   = (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL);
+    aDFA.SetFamilyName( rInfo.m_aFamilyName );
+    aDFA.SetStyleName( rInfo.m_aStyleName );
+    aDFA.SetFamilyType( rInfo.m_eFamilyStyle );
+    aDFA.SetWeight( rInfo.m_eWeight );
+    aDFA.SetItalic( rInfo.m_eItalic );
+    aDFA.SetWidthType( rInfo.m_eWidth );
+    aDFA.SetPitch( rInfo.m_ePitch );
+    aDFA.SetSymbolFlag( (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL) );
     aDFA.mbSubsettable  = rInfo.m_bSubsettable;
     aDFA.mbEmbeddable   = rInfo.m_bEmbeddable;
 
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 0fe3cb6..741d6be 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -61,14 +61,21 @@ public: // TODO: create matching interface class
     FontPitch       GetPitch() const        { return mePitch; }
     FontWidth       GetWidthType() const    { return meWidthType; }
     bool            IsSymbolFont() const    { return mbSymbolFlag; }
-
+    void            SetFamilyName(const String sFamilyName)    { maName = sFamilyName; }
+    void            SetStyleName( const String sStyleName)           { maStyleName = sStyleName; }
+    void            SetFamilyType(const FontFamily eFontFamily)    { meFamily = eFontFamily; }
+    void            SetPitch(const FontPitch ePitch )          { mePitch = ePitch; }
+    void            SetItalic(const FontItalic eItalic )       { meItalic = eItalic; }
+    void            SetWeight(const FontWeight eWeight )       { meWeight = eWeight; }
+    void            SetWidthType(const FontWidth eWidthType)   { meWidthType = eWidthType; }
+    void            SetSymbolFlag(const bool bSymbolFlag )     { mbSymbolFlag = bSymbolFlag; }
     bool operator==(const ImplFontAttributes& rOther) const;
     bool operator!=(const ImplFontAttributes& rOther) const
     {
         return !(*this == rOther);
     }
 
-public: // TODO: hide members behind accessor methods
+private:
     String          maName;         // Font Family Name
     String          maStyleName;    // Font Style Name
     FontWeight      meWeight;       // Weight Type
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 11897d0..bbb74ed 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -750,15 +750,14 @@ void Font::Merge( const Font& rFont )
 
 void Font::GetFontAttributes( ImplFontAttributes& rAttrs ) const
 {
-    // #i56788# Use members directly, don't risc config access.
-    rAttrs.maName = mpImplFont->maFamilyName;
-    rAttrs.maStyleName = mpImplFont->maStyleName;
-    rAttrs.meFamily = mpImplFont->meFamily;
-    rAttrs.mePitch = mpImplFont->mePitch;
-    rAttrs.meItalic = mpImplFont->meItalic;
-    rAttrs.meWeight = mpImplFont->meWeight;
-    rAttrs.meWidthType = WIDTH_DONTKNOW;
-    rAttrs.mbSymbolFlag= (mpImplFont->meCharSet == RTL_TEXTENCODING_SYMBOL);
+    rAttrs.SetFamilyName( mpImplFont->maFamilyName );
+    rAttrs.SetStyleName( mpImplFont->maStyleName );
+    rAttrs.SetFamilyType( mpImplFont->meFamily );
+    rAttrs.SetPitch( mpImplFont->mePitch );
+    rAttrs.SetItalic( mpImplFont->meItalic );
+    rAttrs.SetWeight( mpImplFont->meWeight );
+    rAttrs.SetWidthType( WIDTH_DONTKNOW );
+    rAttrs.SetSymbolFlag( mpImplFont->meCharSet == RTL_TEXTENCODING_SYMBOL );
 }
 
 
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index db9cb8d..6d3b02e 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -614,7 +614,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
                     if (pEntry)
                     {
                         if( pEntry->maFontSelData.mpFontData )
-                            aFont.SetName( pEntry->maFontSelData.mpFontData->maName );
+                            aFont.SetName( pEntry->maFontSelData.mpFontData->GetFamilyName() );
                         else
                             aFont.SetName( pEntry->maFontSelData.maTargetName );
                     }
@@ -745,10 +745,10 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
     mpNext( NULL )
 {
     // StarSymbol is a unicode font, but it still deserves the symbol flag
-    if( !mbSymbolFlag )
+    if( !IsSymbolFont() )
         if( 0 == GetFamilyName().CompareIgnoreCaseToAscii( "starsymbol", 10)
         ||  0 == GetFamilyName().CompareIgnoreCaseToAscii( "opensymbol", 10) )
-            mbSymbolFlag = true;
+            SetSymbolFlag( true );
 }
 
 // -----------------------------------------------------------------------
@@ -756,22 +756,22 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
 StringCompare PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const
 {
     // compare their width, weight, italic and style name
-    if( meWidthType < rOther.meWidthType )
+    if( GetWidthType() < rOther.GetWidthType() )
         return COMPARE_LESS;
-    else if( meWidthType > rOther.meWidthType )
+    else if( GetWidthType() > rOther.GetWidthType() )
         return COMPARE_GREATER;
 
-    if( meWeight < rOther.meWeight )
+    if( GetWeight() < rOther.GetWeight() )
         return COMPARE_LESS;
-    else if( meWeight > rOther.meWeight )
+    else if( GetWeight() > rOther.GetWeight() )
         return COMPARE_GREATER;
 
-    if( meItalic < rOther.meItalic )
+    if( GetSlant() < rOther.GetSlant() )
         return COMPARE_LESS;
-    else if( meItalic > rOther.meItalic )
+    else if( GetSlant() > rOther.GetSlant() )
         return COMPARE_GREATER;
 
-    StringCompare eCompare = maName.CompareTo( rOther.maName );
+    StringCompare eCompare = GetFamilyName().CompareTo( rOther.GetFamilyName() );
     return eCompare;
 }
 
@@ -812,34 +812,34 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
     int nMatch = 0;
 
     const String& rFontName = rFSD.maTargetName;
-    if( (rFontName == maName) || rFontName.EqualsIgnoreCaseAscii( maName ) )
+    if( (rFontName == GetFamilyName()) || rFontName.EqualsIgnoreCaseAscii( GetFamilyName() ) )
         nMatch += 240000;
 
     if( rStatus.mpTargetStyleName
-    &&  maStyleName.EqualsIgnoreCaseAscii( rStatus.mpTargetStyleName ) )
+    &&  GetStyleName().EqualsIgnoreCaseAscii( rStatus.mpTargetStyleName ) )
         nMatch += 120000;
 
-    if( (rFSD.mePitch != PITCH_DONTKNOW) && (rFSD.mePitch == mePitch) )
+    if( (rFSD.GetPitch() != PITCH_DONTKNOW) && (rFSD.GetPitch() == GetPitch()) )
         nMatch += 20000;
 
     // prefer NORMAL font width
     // TODO: change when the upper layers can tell their width preference
-    if( meWidthType == WIDTH_NORMAL )
+    if( GetWidthType() == WIDTH_NORMAL )
         nMatch += 400;
-    else if( (meWidthType == WIDTH_SEMI_EXPANDED) || (meWidthType == WIDTH_SEMI_CONDENSED) )
+    else if( (GetWidthType() == WIDTH_SEMI_EXPANDED) || (GetWidthType() == WIDTH_SEMI_CONDENSED) )
         nMatch += 300;
 
-    if( rFSD.meWeight != WEIGHT_DONTKNOW )
+    if( rFSD.GetWeight() != WEIGHT_DONTKNOW )
     {
         // if not bold or requiring emboldening prefer light fonts to bold fonts
-        FontWeight ePatternWeight = rFSD.mbEmbolden ? WEIGHT_NORMAL : rFSD.meWeight;
+        FontWeight ePatternWeight = rFSD.mbEmbolden ? WEIGHT_NORMAL : rFSD.GetWeight();
 
         int nReqWeight = (int)ePatternWeight;
         if ( ePatternWeight > WEIGHT_MEDIUM )
             nReqWeight += 100;
 
-        int nGivenWeight = (int)meWeight;
-        if( meWeight > WEIGHT_MEDIUM )
+        int nGivenWeight = (int)GetWeight();
+        if( GetWeight() > WEIGHT_MEDIUM )
             nGivenWeight += 100;
 
         int nWeightDiff = nReqWeight - nGivenWeight;
@@ -855,29 +855,29 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
     {
         // prefer NORMAL font weight
         // TODO: change when the upper layers can tell their weight preference
-        if( meWeight == WEIGHT_NORMAL )
+        if( GetWeight() == WEIGHT_NORMAL )
             nMatch += 450;
-        else if( meWeight == WEIGHT_MEDIUM )
+        else if( GetWeight() == WEIGHT_MEDIUM )
             nMatch += 350;
-        else if( (meWeight == WEIGHT_SEMILIGHT) || (meWeight == WEIGHT_SEMIBOLD) )
+        else if( (GetWeight() == WEIGHT_SEMILIGHT) || (GetWeight() == WEIGHT_SEMIBOLD) )
             nMatch += 200;
-        else if( meWeight == WEIGHT_LIGHT )
+        else if( GetWeight() == WEIGHT_LIGHT )
             nMatch += 150;
     }
 
     // if requiring custom matrix to fake italic, prefer upright font
-    FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.meItalic;
+    FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetSlant();
 
     if ( ePatternItalic == ITALIC_NONE )
     {
-        if( meItalic == ITALIC_NONE )
+        if( GetSlant() == ITALIC_NONE )
             nMatch += 900;
     }
     else
     {
-        if( ePatternItalic == meItalic )
+        if( ePatternItalic == GetSlant() )
             nMatch += 900;
-        else if( meItalic != ITALIC_NONE )
+        else if( GetSlant() != ITALIC_NONE )
             nMatch += 600;
     }
 
@@ -1051,18 +1051,18 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
 
     if( !mpFirst )
     {
-        maName         = pNewData->maName;
+        maName         = pNewData->GetFamilyName();
         maMapNames     = pNewData->maMapNames;
-        meFamily       = pNewData->meFamily;
-        mePitch        = pNewData->mePitch;
+        meFamily       = pNewData->GetFamilyType();
+        mePitch        = pNewData->GetPitch();
         mnMinQuality   = pNewData->mnQuality;
     }
     else
     {
         if( meFamily == FAMILY_DONTKNOW )
-            meFamily = pNewData->meFamily;
+            meFamily = pNewData->GetFamilyType();
         if( mePitch == PITCH_DONTKNOW )
-            mePitch = pNewData->mePitch;
+            mePitch = pNewData->GetPitch();
         if( mnMinQuality > pNewData->mnQuality )
             mnMinQuality = pNewData->mnQuality;
     }
@@ -1076,20 +1076,20 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
     else
         mnTypeFaces |= IMPL_DEVFONT_NONESYMBOL;
 
-    if( pNewData->meWeight != WEIGHT_DONTKNOW )
+    if( pNewData->GetWeight() != WEIGHT_DONTKNOW )
     {
-        if( pNewData->meWeight >= WEIGHT_SEMIBOLD )
+        if( pNewData->GetWeight() >= WEIGHT_SEMIBOLD )
             mnTypeFaces |= IMPL_DEVFONT_BOLD;
-        else if( pNewData->meWeight <= WEIGHT_SEMILIGHT )
+        else if( pNewData->GetWeight() <= WEIGHT_SEMILIGHT )
             mnTypeFaces |= IMPL_DEVFONT_LIGHT;
         else
             mnTypeFaces |= IMPL_DEVFONT_NORMAL;
     }
 
-    if( pNewData->meItalic == ITALIC_NONE )
+    if( pNewData->GetSlant() == ITALIC_NONE )
         mnTypeFaces |= IMPL_DEVFONT_NONEITALIC;
-    else if( (pNewData->meItalic == ITALIC_NORMAL)
-         ||  (pNewData->meItalic == ITALIC_OBLIQUE) )
+    else if( (pNewData->GetSlant() == ITALIC_NORMAL)
+         ||  (pNewData->GetSlant() == ITALIC_OBLIQUE) )
         mnTypeFaces |= IMPL_DEVFONT_ITALIC;
 
     if( (meMatchWeight == WEIGHT_DONTKNOW)
@@ -1106,8 +1106,8 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
     }
 
     // reassign name (sharing saves memory)
-    if( pNewData->maName == maName )
-        pNewData->maName = maName;
+    if( pNewData->GetFamilyName() == GetFamilyName() )
+        pNewData->SetFamilyName( GetFamilyName() );
 
     // insert new physical font face into linked list
     // TODO: get rid of linear search?
@@ -1480,7 +1480,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
 
 void ImplDevFontList::Add( PhysicalFontFace* pNewData )
 {
-    String aSearchName = pNewData->maName;
+    String aSearchName = pNewData->GetFamilyName();
     GetEnglishSearchFontName( aSearchName );
 
     DevFontList::const_iterator it = maDevFontList.find( aSearchName );
@@ -2129,7 +2129,7 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const Font& rFont,
     , mbNonAntialiased( false )
     , mbEmbolden( false )
 {
-    maTargetName = maName;
+    maTargetName = GetFamilyName();
 
     rFont.GetFontAttributes( *this );
 
@@ -2170,7 +2170,7 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace
     , mbNonAntialiased( false )
     , mbEmbolden( false )
 {
-    maTargetName = maSearchName = maName;
+    maTargetName = maSearchName = GetFamilyName();
     // NOTE: no normalization for width/height/orientation
 }
 
@@ -2208,8 +2208,8 @@ size_t FontSelectPatternAttributes::hashCode() const
     }
 #endif
     nHash += 11 * mnHeight;
-    nHash += 19 * meWeight;
-    nHash += 29 * meItalic;
+    nHash += 19 * GetWeight();
+    nHash += 29 * GetSlant();
     nHash += 37 * mnOrientation;
     nHash += 41 * meLanguage;
     if( mbVertical )
@@ -2278,14 +2278,14 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo
         return false;
 
     // check font face attributes
-    if( (rA.meWeight       != rB.meWeight)
-    ||  (rA.meItalic       != rB.meItalic)
+    if( (rA.GetWeight()       != rB.GetWeight())
+    ||  (rA.GetSlant()       != rB.GetSlant())
 //    ||  (rA.meFamily       != rB.meFamily) // TODO: remove this mostly obsolete member
-    ||  (rA.mePitch        != rB.mePitch) )
+    ||  (rA.GetPitch()     != rB.GetPitch()) )
         return false;
 
     // check style name
-    if( rA.maStyleName != rB.maStyleName)
+    if( rA.GetStyleName() != rB.GetStyleName() )
         return false;
 
     // Symbol fonts may recode from one type to another So they are only
@@ -2504,7 +2504,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
     String& aSearchName = rFSD.maSearchName; // TODO: get rid of reference
     for(;;)
     {
-        rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
+        rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
         aSearchName = rFSD.maTargetName;
 
 #ifdef ENABLE_GRAPHITE
@@ -2526,7 +2526,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
         ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific );
         // #114999# special emboldening for Ricoh fonts
         // TODO: smarter check for special cases by using PreMatch infrastructure?
-        if( (rFSD.meWeight > WEIGHT_MEDIUM)
+        if( (rFSD.GetWeight() > WEIGHT_MEDIUM)
         &&  aSearchName.EqualsAscii( "hg", 0, 2) )
         {
             String aBoldName;
@@ -2548,7 +2548,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
                 // the other font is available => use it
                 aSearchName = aBoldName;
                 // prevent synthetic emboldening of bold version
-                rFSD.meWeight = WEIGHT_DONTKNOW;
+                rFSD.SetWeight(WEIGHT_DONTKNOW);
             }
         }
 
@@ -2613,7 +2613,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
     {
         if( bMultiToken )
         {
-            rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
+            rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
             aSearchName = rFSD.maTargetName;
             GetEnglishSearchFontName( aSearchName );
         }
@@ -2633,15 +2633,15 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
     if ( bMultiToken )
     {
         nTokenPos = 0;
-        rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
+        rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
         aSearchName = rFSD.maTargetName;
         GetEnglishSearchFontName( aSearchName );
     }
 
     String      aSearchShortName;
     String      aSearchFamilyName;
-    FontWeight  eSearchWeight   = rFSD.meWeight;
-    FontWidth   eSearchWidth    = rFSD.meWidthType;
+    FontWeight  eSearchWeight   = rFSD.GetWeight();
+    FontWidth   eSearchWidth    = rFSD.GetWidthType();
     sal_uLong       nSearchType     = 0;
     FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
                                         eSearchWeight, eSearchWidth, nSearchType );
@@ -2705,7 +2705,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
     // now try the other font name tokens
     while( nTokenPos != STRING_NOTFOUND )
     {
-        rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
+        rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
         if( !rFSD.maTargetName.Len() )
             continue;
 
@@ -2715,7 +2715,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
         String      aTempShortName;
         String      aTempFamilyName;
         sal_uLong       nTempType   = 0;
-        FontWeight  eTempWeight = rFSD.meWeight;
+        FontWeight  eTempWeight = rFSD.GetWeight();
         FontWidth   eTempWidth  = WIDTH_DONTKNOW;
         FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
                                             eTempWeight, eTempWidth, nTempType );
@@ -2769,32 +2769,32 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
         nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_JP;
     else
     {
-        nSearchType |= ImplIsCJKFont( rFSD.maName );
+        nSearchType |= ImplIsCJKFont( rFSD.GetFamilyName() );
         if( rFSD.IsSymbolFont() )
             nSearchType |= IMPL_FONT_ATTR_SYMBOL;
     }
 
-    ImplCalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.meFamily, pFontAttr );
+    ImplCalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.GetFamilyType(), pFontAttr );
     ImplDevFontListData* pFoundData = ImplFindByAttributes( nSearchType,
-        eSearchWeight, eSearchWidth, rFSD.meItalic, aSearchFamilyName );
+        eSearchWeight, eSearchWidth, rFSD.GetSlant(), aSearchFamilyName );
 
     if( pFoundData )
     {
         // overwrite font selection attributes using info from the typeface flags
         if( (eSearchWeight >= WEIGHT_BOLD)
-        &&  (eSearchWeight > rFSD.meWeight)
+        &&  (eSearchWeight > rFSD.GetWeight())
         &&  (pFoundData->mnTypeFaces & IMPL_DEVFONT_BOLD) )
-            rFSD.meWeight = eSearchWeight;
+            rFSD.SetWeight( eSearchWeight );
         else if( (eSearchWeight < WEIGHT_NORMAL)
-        &&  (eSearchWeight < rFSD.meWeight)
+        &&  (eSearchWeight < rFSD.GetWeight())
         &&  (eSearchWeight != WEIGHT_DONTKNOW)
         &&  (pFoundData->mnTypeFaces & IMPL_DEVFONT_LIGHT) )
-            rFSD.meWeight = eSearchWeight;
+            rFSD.SetWeight( eSearchWeight );
 
         if( (nSearchType & IMPL_FONT_ATTR_ITALIC)
-        &&  ((rFSD.meItalic == ITALIC_DONTKNOW) || (rFSD.meItalic == ITALIC_NONE))
+        &&  ((rFSD.GetSlant() == ITALIC_DONTKNOW) || (rFSD.GetSlant() == ITALIC_NONE))
         &&  (pFoundData->mnTypeFaces & IMPL_DEVFONT_ITALIC) )
-            rFSD.meItalic = ITALIC_NORMAL;
+            rFSD.SetItalic( ITALIC_NORMAL );
     }
     else
     {
@@ -2833,7 +2833,7 @@ ImplFontEntry* ImplFontCache::GetGlyphFallbackFont( ImplDevFontList* pFontList,
         if( !pFallbackData  )
             return NULL;
         // override the font name
-        rFontSelData.maName = pFallbackData->GetFamilyName();
+        rFontSelData.SetFamilyName( pFallbackData->GetFamilyName() );
         // clear the cached normalized name
         rFontSelData.maSearchName = String();
     }
@@ -3399,16 +3399,16 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
     // intialize the used font name
     if( rFontSelData.mpFontData )
     {
-        maName     = rFontSelData.mpFontData->maName;
-        maStyleName= rFontSelData.mpFontData->maStyleName;
+        SetFamilyName( rFontSelData.mpFontData->GetFamilyName() );
+        SetStyleName( rFontSelData.mpFontData->GetStyleName() );
         mbDevice   = rFontSelData.mpFontData->mbDevice;
         mbKernableFont = true;
     }
     else
     {
         xub_StrLen nTokenPos = 0;
-        maName     = GetNextFontToken( rFontSelData.maName, nTokenPos );
-        maStyleName= rFontSelData.maStyleName;
+        SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) );
+        SetStyleName( rFontSelData.GetStyleName() );
         mbDevice   = false;
         mbKernableFont = false;
     }
@@ -7304,14 +7304,14 @@ FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
     if( nDevFontIndex < nCount )
     {
         const PhysicalFontFace& rData = *mpGetDevFontList->Get( nDevFontIndex );
-        aFontInfo.SetName( rData.maName );
-        aFontInfo.SetStyleName( rData.maStyleName );
-        aFontInfo.SetCharSet( rData.mbSymbolFlag ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
-        aFontInfo.SetFamily( rData.meFamily );
-        aFontInfo.SetPitch( rData.mePitch );
-        aFontInfo.SetWeight( rData.meWeight );
-        aFontInfo.SetItalic( rData.meItalic );
-        aFontInfo.SetWidthType( rData.meWidthType );
+        aFontInfo.SetName( rData.GetFamilyName() );
+        aFontInfo.SetStyleName( rData.GetStyleName() );
+        aFontInfo.SetCharSet( rData.IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
+        aFontInfo.SetFamily( rData.GetFamilyType() );
+        aFontInfo.SetPitch( rData.GetPitch() );
+        aFontInfo.SetWeight( rData.GetWeight() );
+        aFontInfo.SetItalic( rData.GetSlant() );
+        aFontInfo.SetWidthType( rData.GetWidthType() );
         if( rData.IsScalable() )
             aFontInfo.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG;
         if( rData.mbDevice )
@@ -7423,14 +7423,14 @@ FontMetric OutputDevice::GetFontMetric() const
 
     // set aMetric with info from font
     aMetric.SetName( maFont.GetName() );
-    aMetric.SetStyleName( pMetric->maStyleName );
+    aMetric.SetStyleName( pMetric->GetStyleName() );
     aMetric.SetSize( PixelToLogic( Size( pMetric->mnWidth, pMetric->mnAscent+pMetric->mnDescent-pMetric->mnIntLeading ) ) );
-    aMetric.SetCharSet( pMetric->mbSymbolFlag ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
-    aMetric.SetFamily( pMetric->meFamily );
-    aMetric.SetPitch( pMetric->mePitch );
-    aMetric.SetWeight( pMetric->meWeight );
-    aMetric.SetItalic( pMetric->meItalic );
-    aMetric.SetWidthType( pMetric->meWidthType );
+    aMetric.SetCharSet( pMetric->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
+    aMetric.SetFamily( pMetric->GetFamilyType() );
+    aMetric.SetPitch( pMetric->GetPitch() );
+    aMetric.SetWeight( pMetric->GetWeight() );
+    aMetric.SetItalic( pMetric->GetSlant() );
+    aMetric.SetWidthType( pMetric->GetWidthType() );
     if ( pEntry->mnOwnOrientation )
         aMetric.SetOrientation( pEntry->mnOwnOrientation );
     else
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index b017daa7..83f5753 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2292,14 +2292,14 @@ inline const ImplPdfBuiltinFontData* GetPdfFontData( const PhysicalFontFace* pFo
 static ImplDevFontAttributes GetDevFontAttributes( const PDFWriterImpl::BuiltinFont& rBuiltin )
 {
     ImplDevFontAttributes aDFA;
-    aDFA.maName         = rtl::OUString::createFromAscii( rBuiltin.m_pName );
-    aDFA.maStyleName    = rtl::OUString::createFromAscii( rBuiltin.m_pStyleName );
-    aDFA.meFamily       = rBuiltin.m_eFamily;
-    aDFA.mbSymbolFlag   = (rBuiltin.m_eCharSet != RTL_TEXTENCODING_MS_1252 );
-    aDFA.mePitch        = rBuiltin.m_ePitch;
-    aDFA.meWeight       = rBuiltin.m_eWeight;
-    aDFA.meItalic       = rBuiltin.m_eItalic;
-    aDFA.meWidthType    = rBuiltin.m_eWidthType;
+    aDFA.SetFamilyName( rtl::OUString::createFromAscii( rBuiltin.m_pName ) );
+    aDFA.SetStyleName( rtl::OUString::createFromAscii( rBuiltin.m_pStyleName ) );
+    aDFA.SetFamilyType( rBuiltin.m_eFamily );
+    aDFA.SetSymbolFlag( rBuiltin.m_eCharSet != RTL_TEXTENCODING_MS_1252 );
+    aDFA.SetPitch( rBuiltin.m_ePitch );
+    aDFA.SetWeight( rBuiltin.m_eWeight );
+    aDFA.SetItalic( rBuiltin.m_eItalic );
+    aDFA.SetWidthType( rBuiltin.m_eWidthType );
 
     aDFA.mbOrientation  = true;
     aDFA.mbDevice       = true;
@@ -2349,11 +2349,11 @@ void PDFWriterImpl::getFontMetric( FontSelectPattern* pSelect, ImplFontMetricDat
     const BuiltinFont* pBuiltinFont = pFD->GetBuiltinFont();
 
     pMetric->mnOrientation  = sal::static_int_cast<short>(pSelect->mnOrientation);
-    pMetric->meFamily       = pBuiltinFont->m_eFamily;
-    pMetric->mePitch        = pBuiltinFont->m_ePitch;
-    pMetric->meWeight       = pBuiltinFont->m_eWeight;
-    pMetric->meItalic       = pBuiltinFont->m_eItalic;
-    pMetric->mbSymbolFlag   = pFD->IsSymbolFont();
+    pMetric->SetFamilyType( pBuiltinFont->m_eFamily );
+    pMetric->SetPitch( pBuiltinFont->m_ePitch );
+    pMetric->SetWeight( pBuiltinFont->m_eWeight );
+    pMetric->SetItalic( pBuiltinFont->m_eItalic );
+    pMetric->SetSymbolFlag( pFD->IsSymbolFont() );
     pMetric->mnWidth        = pSelect->mnHeight;
     pMetric->mnAscent       = ( pSelect->mnHeight * +pBuiltinFont->m_nAscent + 500 ) / 1000;
     pMetric->mnDescent      = ( pSelect->mnHeight * -pBuiltinFont->m_nDescent + 500 ) / 1000;
@@ -3158,7 +3158,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const PhysicalFo
     aInfo.m_nDescent = 200;
     aInfo.m_nCapHeight = 1000;
     aInfo.m_aFontBBox = Rectangle( Point( -200, -200 ), Size( 1700, 1700 ) );
-    aInfo.m_aPSName = pFont->maName;
+    aInfo.m_aPSName = pFont->GetFamilyName();
     sal_Int32 pWidths[256];
     memset( pWidths, 0, sizeof(pWidths) );
     if( pFont->IsEmbeddable() )
@@ -3231,7 +3231,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const PhysicalFo
             aLine.append( "/BaseFont/" );
             appendName( aInfo.m_aPSName, aLine );
             aLine.append( "\n" );
-            if( !pFont->mbSymbolFlag )
+            if( !pFont->IsSymbolFont() )
                 aLine.append( "/Encoding/WinAnsiEncoding\n" );
             aLine.append( "/FirstChar 32 /LastChar 255\n"
                           "/Widths[" );
@@ -3728,7 +3728,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
                 "<</Type/Font/Subtype/Type1/BaseFont/" );
             appendName( aInfo.m_aPSName, aLine );
             aLine.append( "\n" );
-            if( !pFont->mbSymbolFlag &&  pEncoding == 0 )
+            if( !pFont->IsSymbolFont() &&  pEncoding == 0 )
                 aLine.append( "/Encoding/WinAnsiEncoding\n" );
             if( nToUnicodeStream )
             {


More information about the Libreoffice-commits mailing list