diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-10 13:34:46 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-11 06:54:05 +0000 |
commit | 9e0335d1db22bd3ad3f4bb249b30a00fd55558f4 (patch) | |
tree | f5a48783b8b0558b267c018b8856167bdcf7b09f /vcl/source | |
parent | eff219140f5dc81424b3281438dc5ed0a9dd6a9a (diff) |
Convert FONT_FAMILY to scoped enum
Change-Id: Id7cc5c76ba45cdd6a06a981ad14e83713cfe5c1a
Reviewed-on: https://gerrit.libreoffice.org/24840
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 22 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFamily.cxx | 18 |
2 files changed, 20 insertions, 20 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 10c992ebd680..9bef807eea5e 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -549,7 +549,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByAttributes( ImplFont { nTestMatch += 10000000*5; } - else if ( pData->GetTypeFaces() & FONT_FAMILY_SYMBOL ) + else if ( pData->GetTypeFaces() & FontTypeFaces::Symbol ) { nTestMatch += 10000000*4; } @@ -561,7 +561,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByAttributes( ImplFont nTestMatch += 10000000; } } - else if ( (pData->GetTypeFaces() & (FONT_FAMILY_SYMBOL | FONT_FAMILY_NONESYMBOL)) == FONT_FAMILY_SYMBOL ) + else if ( (pData->GetTypeFaces() & (FontTypeFaces::Symbol | FontTypeFaces::NoneSymbol)) == FontTypeFaces::Symbol ) { nTestMatch -= 10000000; } @@ -728,14 +728,14 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByAttributes( ImplFont // test ITALIC attribute if( nSearchType & ImplFontAttrs::Italic ) { - if( pData->GetTypeFaces() & FONT_FAMILY_ITALIC ) + if( pData->GetTypeFaces() & FontTypeFaces::Italic ) nTestMatch += 1000000*3; if( nMatchType & ImplFontAttrs::Italic ) nTestMatch += 1000000; } else if( !(nSearchType & ImplFontAttrs::AllScript) && ((nMatchType & ImplFontAttrs::Italic) || - !(pData->GetTypeFaces() & FONT_FAMILY_NONEITALIC)) ) + !(pData->GetTypeFaces() & FontTypeFaces::NoneItalic)) ) { nTestMatch -= 1000000*2; } @@ -770,14 +770,14 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByAttributes( ImplFont { if( eSearchWeight < WEIGHT_NORMAL ) { - if( pData->GetTypeFaces() & FONT_FAMILY_LIGHT ) + if( pData->GetTypeFaces() & FontTypeFaces::Light ) nTestMatch += 1000000; if( (eMatchWeight < WEIGHT_NORMAL) && (eMatchWeight != WEIGHT_DONTKNOW) ) nTestMatch += 1000000; } else { - if( pData->GetTypeFaces() & FONT_FAMILY_BOLD ) + if( pData->GetTypeFaces() & FontTypeFaces::Bold ) nTestMatch += 1000000; if( eMatchWeight > WEIGHT_BOLD ) nTestMatch += 1000000; @@ -786,13 +786,13 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamilyByAttributes( ImplFont else if( ((eMatchWeight != WEIGHT_DONTKNOW) && (eMatchWeight != WEIGHT_NORMAL) && (eMatchWeight != WEIGHT_MEDIUM)) || - !(pData->GetTypeFaces() & FONT_FAMILY_NORMAL) ) + !(pData->GetTypeFaces() & FontTypeFaces::Normal) ) { nTestMatch -= 1000000; } // prefer scalable fonts - if( pData->GetTypeFaces() & FONT_FAMILY_SCALABLE ) + if( pData->GetTypeFaces() & FontTypeFaces::Scalable ) nTestMatch += 10000*4; else nTestMatch -= 10000*4; @@ -1269,14 +1269,14 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r // overwrite font selection attributes using info from the typeface flags if( (eSearchWeight >= WEIGHT_BOLD) && (eSearchWeight > rFSD.GetWeight()) && - (pFoundData->GetTypeFaces() & FONT_FAMILY_BOLD) ) + (pFoundData->GetTypeFaces() & FontTypeFaces::Bold) ) { rFSD.SetWeight( eSearchWeight ); } else if( (eSearchWeight < WEIGHT_NORMAL) && (eSearchWeight < rFSD.GetWeight()) && (eSearchWeight != WEIGHT_DONTKNOW) && - (pFoundData->GetTypeFaces() & FONT_FAMILY_LIGHT) ) + (pFoundData->GetTypeFaces() & FontTypeFaces::Light) ) { rFSD.SetWeight( eSearchWeight ); } @@ -1284,7 +1284,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r if( (nSearchType & ImplFontAttrs::Italic) && ((rFSD.GetItalic() == ITALIC_DONTKNOW) || (rFSD.GetItalic() == ITALIC_NONE)) && - (pFoundData->GetTypeFaces() & FONT_FAMILY_ITALIC) ) + (pFoundData->GetTypeFaces() & FontTypeFaces::Italic) ) { rFSD.SetItalic( ITALIC_NORMAL ); } diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index a1382a999d02..e56935c99707 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -87,7 +87,7 @@ static ImplFontAttrs lcl_IsCJKFont( const OUString& rFontName ) PhysicalFontFamily::PhysicalFontFamily( const OUString& rSearchName ) : maSearchName( rSearchName ), - mnTypeFaces( 0 ), + mnTypeFaces( FontTypeFaces::NONE ), meFamily( FAMILY_DONTKNOW ), mePitch( PITCH_DONTKNOW ), mnMinQuality( -1 ), @@ -129,28 +129,28 @@ bool PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace ) // set attributes for attribute based font matching if( pNewFontFace->IsScalable() ) - mnTypeFaces |= FONT_FAMILY_SCALABLE; + mnTypeFaces |= FontTypeFaces::Scalable; if( pNewFontFace->IsSymbolFont() ) - mnTypeFaces |= FONT_FAMILY_SYMBOL; + mnTypeFaces |= FontTypeFaces::Symbol; else - mnTypeFaces |= FONT_FAMILY_NONESYMBOL; + mnTypeFaces |= FontTypeFaces::NoneSymbol; if( pNewFontFace->GetWeight() != WEIGHT_DONTKNOW ) { if( pNewFontFace->GetWeight() >= WEIGHT_SEMIBOLD ) - mnTypeFaces |= FONT_FAMILY_BOLD; + mnTypeFaces |= FontTypeFaces::Bold; else if( pNewFontFace->GetWeight() <= WEIGHT_SEMILIGHT ) - mnTypeFaces |= FONT_FAMILY_LIGHT; + mnTypeFaces |= FontTypeFaces::Light; else - mnTypeFaces |= FONT_FAMILY_NORMAL; + mnTypeFaces |= FontTypeFaces::Normal; } if( pNewFontFace->GetItalic() == ITALIC_NONE ) - mnTypeFaces |= FONT_FAMILY_NONEITALIC; + mnTypeFaces |= FontTypeFaces::NoneItalic; else if( (pNewFontFace->GetItalic() == ITALIC_NORMAL) || (pNewFontFace->GetItalic() == ITALIC_OBLIQUE) ) - mnTypeFaces |= FONT_FAMILY_ITALIC; + mnTypeFaces |= FontTypeFaces::Italic; // reassign name (sharing saves memory) if( pNewFontFace->GetFamilyName() == GetFamilyName() ) |