From 694ec8930ab7d7a54805ec598be84845b502772c Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 3 Jan 2016 09:33:28 +1100 Subject: vcl: convert ImplFontMetricData to accessor functions Changed private variables to use accessor functions in ImplFontMetric. It turns out there are some variables that are redundant as they are already in ImplFontAttributes. These are: - meFamilyType - mbDevice I also needed to change ImplFontMetric::GetSlant() to GetSlantType() as the names conflicted. Change-Id: Ic06a374fb929e3b2ffb18a6c66577c526c3b31a7 Reviewed-on: https://gerrit.libreoffice.org/21050 Reviewed-by: Chris Sherlock Tested-by: Chris Sherlock --- vcl/quartz/ctfonts.cxx | 22 +++++++++++----------- vcl/quartz/salgdi.cxx | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'vcl/quartz') diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 980ffa24f581..a9a70e83f5d1 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -86,9 +86,9 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) } // fake italic - if (((pReqFont->GetSlant() == ITALIC_NORMAL) || - (pReqFont->GetSlant() == ITALIC_OBLIQUE)) && - (mpFontData->GetSlant() == ITALIC_NONE)) + if (((pReqFont->GetSlantType() == ITALIC_NORMAL) || + (pReqFont->GetSlantType() == ITALIC_OBLIQUE)) && + (mpFontData->GetSlantType() == ITALIC_NONE)) { aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMake(1, 0, toRadian(120), 1, 0, 0)); } @@ -124,20 +124,20 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData& rMetric ) const const CGFloat fAscent = CTFontGetAscent( aCTFontRef ); const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef ); - rMetric.mnAscent = lrint( fAscent ); - rMetric.mnDescent = lrint( CTFontGetDescent( aCTFontRef )); - rMetric.mnExtLeading = lrint( CTFontGetLeading( aCTFontRef )); - rMetric.mnIntLeading = lrint( fAscent - fCapHeight ); + rMetric.SetAscent( lrint( fAscent ) ); + rMetric.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) ); + rMetric.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) ); + rMetric.SetInternalLeading( lrint( fAscent - fCapHeight ) ); // since ImplFontMetricData::mnWidth is only used for stretching/squeezing fonts // setting this width to the pixel height of the fontsize is good enough // it also makes the calculation of the stretch factor simple - rMetric.mnWidth = lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch); + rMetric.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) ); // all CoreText fonts are scalable - rMetric.mbScalableFont = true; - rMetric.mbTrueTypeFont = true; // Not sure, but this field is used only for Windows so far - rMetric.mbKernableFont = true; + rMetric.SetScalableFlag( true ); + rMetric.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far + rMetric.SetKernableFlag( true ); } bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index bfff1fd79554..436890af72c0 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -440,7 +440,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac << " for " << pReqFont->GetFamilyName() << ", " << pReqFont->GetStyleName() << " weight=" << pReqFont->GetWeight() - << " slant=" << pReqFont->GetSlant() + << " slant=" << pReqFont->GetSlantType() << " size=" << pReqFont->mnHeight << "x" << pReqFont->mnWidth << " orientation=" << pReqFont->mnOrientation ); -- cgit