summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-17 01:00:00 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-16 16:16:19 +0000
commit26371f105bc44e04469ec03fc5bb12505e651c6b (patch)
treef60eb9388f3a736d966137ef40fca336fb4277e9 /vcl/source
parent2dd0b4317372b8022efe3911b38b4fa02956d8b9 (diff)
vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic()
This brings FontAttributes into line with ImplFont and Font, which is important to the refactoring work I am doing. Change-Id: I2a2ca2f18fc7b5be45d6f350c0328fad62bf2bc9 Reviewed-on: https://gerrit.libreoffice.org/21517 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/font/PhysicalFontCollection.cxx6
-rw-r--r--vcl/source/font/PhysicalFontFace.cxx12
-rw-r--r--vcl/source/font/PhysicalFontFamily.cxx6
-rw-r--r--vcl/source/font/fontcache.cxx2
-rw-r--r--vcl/source/font/fontselect.cxx2
-rw-r--r--vcl/source/gdi/embeddedfontshelper.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx18
-rw-r--r--vcl/source/outdev/font.cxx4
8 files changed, 27 insertions, 27 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 07723101235a..61a8a9fd3ccd 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -1273,7 +1273,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r
PhysicalFontFamily::CalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.GetFamilyType(), pFontAttr );
PhysicalFontFamily* pFoundData = FindFontFamilyByAttributes( nSearchType,
- eSearchWeight, eSearchWidth, rFSD.GetSlantType(), aSearchFamilyName );
+ eSearchWeight, eSearchWidth, rFSD.GetItalic(), aSearchFamilyName );
if( pFoundData )
{
@@ -1293,8 +1293,8 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r
}
if( (nSearchType & ImplFontAttrs::Italic) &&
- ((rFSD.GetSlantType() == ITALIC_DONTKNOW) ||
- (rFSD.GetSlantType() == ITALIC_NONE)) &&
+ ((rFSD.GetItalic() == ITALIC_DONTKNOW) ||
+ (rFSD.GetItalic() == ITALIC_NONE)) &&
(pFoundData->GetTypeFaces() & FONT_FAMILY_ITALIC) )
{
rFSD.SetItalic( ITALIC_NORMAL );
diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx
index 9540604f137f..1e50b0cafece 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -50,9 +50,9 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther )
else if( GetWeight() > rOther.GetWeight() )
return 1;
- if( GetSlantType() < rOther.GetSlantType() )
+ if( GetItalic() < rOther.GetItalic() )
return -1;
- else if( GetSlantType() > rOther.GetSlantType() )
+ else if( GetItalic() > rOther.GetItalic() )
return 1;
sal_Int32 nRet = GetFamilyName().compareTo( rOther.GetFamilyName() );
@@ -143,18 +143,18 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
}
// if requiring custom matrix to fake italic, prefer upright font
- FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetSlantType();
+ FontItalic ePatternItalic = rFSD.maItalicMatrix != ItalicMatrix() ? ITALIC_NONE : rFSD.GetItalic();
if ( ePatternItalic == ITALIC_NONE )
{
- if( GetSlantType() == ITALIC_NONE )
+ if( GetItalic() == ITALIC_NONE )
nMatch += 900;
}
else
{
- if( ePatternItalic == GetSlantType() )
+ if( ePatternItalic == GetItalic() )
nMatch += 900;
- else if( GetSlantType() != ITALIC_NONE )
+ else if( GetItalic() != ITALIC_NONE )
nMatch += 600;
}
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx
index 20a72e068625..47879976e28d 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -150,10 +150,10 @@ bool PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace )
mnTypeFaces |= FONT_FAMILY_NORMAL;
}
- if( pNewFontFace->GetSlantType() == ITALIC_NONE )
+ if( pNewFontFace->GetItalic() == ITALIC_NONE )
mnTypeFaces |= FONT_FAMILY_NONEITALIC;
- else if( (pNewFontFace->GetSlantType() == ITALIC_NORMAL)
- || (pNewFontFace->GetSlantType() == ITALIC_OBLIQUE) )
+ else if( (pNewFontFace->GetItalic() == ITALIC_NORMAL)
+ || (pNewFontFace->GetItalic() == ITALIC_OBLIQUE) )
mnTypeFaces |= FONT_FAMILY_ITALIC;
// reassign name (sharing saves memory)
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index 7f2e82b7420d..39d436635d84 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -87,7 +87,7 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo
// check font face attributes
if( (rA.GetWeight() != rB.GetWeight())
- || (rA.GetSlantType() != rB.GetSlantType())
+ || (rA.GetItalic() != rB.GetItalic())
// || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member
|| (rA.GetPitch() != rB.GetPitch()) )
return false;
diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx
index 641e3c6ea0b3..6f5f42ba05fc 100644
--- a/vcl/source/font/fontselect.cxx
+++ b/vcl/source/font/fontselect.cxx
@@ -155,7 +155,7 @@ size_t FontSelectPatternAttributes::hashCode() const
}
nHash += 11 * mnHeight;
nHash += 19 * GetWeight();
- nHash += 29 * GetSlantType();
+ nHash += 29 * GetItalic();
nHash += 37 * mnOrientation;
nHash += 41 * meLanguage;
if( mbVertical )
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx
index 7b08e92bcd75..d5c3087cf651 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -245,7 +245,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil
// It is possible that it still may be needed to do at least some checks here
// for some encodings (can one font have more font files for more encodings?).
if(( family == FAMILY_DONTKNOW || f->GetFamilyType() == family )
- && ( italic == ITALIC_DONTKNOW || f->GetSlantType() == italic )
+ && ( italic == ITALIC_DONTKNOW || f->GetItalic() == italic )
&& ( weight == WEIGHT_DONTKNOW || f->GetWeight() == weight )
&& ( pitch == PITCH_DONTKNOW || f->GetPitch() == pitch ))
{ // Exact match, return it immediately.
@@ -253,7 +253,7 @@ OUString EmbeddedFontsHelper::fontFileUrl( const OUString& familyName, FontFamil
break;
}
if(( f->GetFamilyType() == FAMILY_DONTKNOW || family == FAMILY_DONTKNOW || f->GetFamilyType() == family )
- && ( f->GetSlantType() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetSlantType() == italic )
+ && ( f->GetItalic() == ITALIC_DONTKNOW || italic == ITALIC_DONTKNOW || f->GetItalic() == italic )
&& ( f->GetWeight() == WEIGHT_DONTKNOW || weight == WEIGHT_DONTKNOW || f->GetWeight() == weight )
&& ( f->GetPitch() == PITCH_DONTKNOW || pitch == PITCH_DONTKNOW || f->GetPitch() == pitch ))
{ // Some fonts specify 'DONTKNOW' for some things, still a good match, if we don't find a better one.
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 3197ed3ded0c..8f9f37151431 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -3532,9 +3532,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
aErrorComment.append( "GetEmbedFontData failed for font \"" );
aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) );
aErrorComment.append( '\"' );
- if( pFont->GetSlantType() == ITALIC_NORMAL )
+ if( pFont->GetItalic() == ITALIC_NORMAL )
aErrorComment.append( " italic" );
- else if( pFont->GetSlantType() == ITALIC_OBLIQUE )
+ else if( pFont->GetItalic() == ITALIC_OBLIQUE )
aErrorComment.append( " oblique" );
aErrorComment.append( " weight=" );
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
@@ -3602,7 +3602,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
pRef->SetMapMode( MapMode( MAP_PIXEL ) );
Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) );
aFont.SetWeight( pFont->GetWeight() );
- aFont.SetItalic( pFont->GetSlantType() );
+ aFont.SetItalic( pFont->GetItalic() );
aFont.SetPitch( pFont->GetPitch() );
pRef->SetFont( aFont );
pRef->ImplNewFont();
@@ -3817,7 +3817,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font
// possibly characters outside Adobe standard encoding
// so set Symbolic flag
sal_Int32 nFontFlags = (1<<2);
- if( pFont->GetSlantType() == ITALIC_NORMAL || pFont->GetSlantType() == ITALIC_OBLIQUE )
+ if( pFont->GetItalic() == ITALIC_NORMAL || pFont->GetItalic() == ITALIC_OBLIQUE )
nFontFlags |= (1 << 6);
if( pFont->GetPitch() == PITCH_FIXED )
nFontFlags |= 1;
@@ -3847,7 +3847,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font
aLine.append( ' ' );
aLine.append( (sal_Int32)(rInfo.m_aFontBBox.BottomRight().Y()+1) );
aLine.append( "]/ItalicAngle " );
- if( pFont->GetSlantType() == ITALIC_OBLIQUE || pFont->GetSlantType() == ITALIC_NORMAL )
+ if( pFont->GetItalic() == ITALIC_OBLIQUE || pFont->GetItalic() == ITALIC_NORMAL )
aLine.append( "-30" );
else
aLine.append( "0" );
@@ -4122,9 +4122,9 @@ bool PDFWriterImpl::emitFonts()
aErrorComment.append( "CreateFontSubset failed for font \"" );
aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) );
aErrorComment.append( '\"' );
- if( pFont->GetSlantType() == ITALIC_NORMAL )
+ if( pFont->GetItalic() == ITALIC_NORMAL )
aErrorComment.append( " italic" );
- else if( pFont->GetSlantType() == ITALIC_OBLIQUE )
+ else if( pFont->GetItalic() == ITALIC_OBLIQUE )
aErrorComment.append( " oblique" );
aErrorComment.append( " weight=" );
aErrorComment.append( sal_Int32(pFont->GetWeight()) );
@@ -8870,8 +8870,8 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
// perform artificial italics if necessary
if( ( m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_NORMAL ||
m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_OBLIQUE ) &&
- !( m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetSlantType() == ITALIC_NORMAL ||
- m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetSlantType() == ITALIC_OBLIQUE )
+ !( m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetItalic() == ITALIC_NORMAL ||
+ m_pReferenceDevice->mpFontInstance->maFontSelData.mpFontData->GetItalic() == ITALIC_OBLIQUE )
)
{
fSkew = M_PI/12.0;
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 8fa55cae7852..0f7c783dfe4b 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -80,7 +80,7 @@ FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const
aFontMetric.SetFamily( rData.GetFamilyType() );
aFontMetric.SetPitch( rData.GetPitch() );
aFontMetric.SetWeight( rData.GetWeight() );
- aFontMetric.SetItalic( rData.GetSlantType() );
+ aFontMetric.SetItalic( rData.GetItalic() );
aFontMetric.SetWidthType( rData.GetWidthType() );
aFontMetric.SetScalableFlag( rData.IsScalable() );
aFontMetric.SetBuiltInFontFlag( rData.IsBuiltInFont() );
@@ -202,7 +202,7 @@ FontMetric OutputDevice::GetFontMetric() const
aMetric.SetFamily( xFontMetric->GetFamilyType() );
aMetric.SetPitch( xFontMetric->GetPitch() );
aMetric.SetWeight( xFontMetric->GetWeight() );
- aMetric.SetItalic( xFontMetric->GetSlantType() );
+ aMetric.SetItalic( xFontMetric->GetItalic() );
aMetric.SetWidthType( xFontMetric->GetWidthType() );
if ( pFontInstance->mnOwnOrientation )
aMetric.SetOrientation( pFontInstance->mnOwnOrientation );