summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-15 03:06:18 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-14 18:09:47 +0000
commit659db7d705835b8676065fb4fe3babe39d938977 (patch)
treef426e3f089449a855f51ac589865212eaef241ba /vcl/quartz
parentc5c47412d16b5bbdc79886ae9bf93d0158405d14 (diff)
vcl: change ImplFontMetricData to be reference counted via intrusive_ptr
Change-Id: Ie9f5fbd21a6223520cbea3af6436beb407d7a88c Reviewed-on: https://gerrit.libreoffice.org/21477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/ctfonts.cxx18
-rw-r--r--vcl/quartz/salgdi.cxx4
2 files changed, 11 insertions, 11 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index ef8767fbc587..573f8ef26a1a 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -117,7 +117,7 @@ CoreTextStyle::~CoreTextStyle()
CFRelease( mpStyleDict );
}
-void CoreTextStyle::GetFontMetric( ImplFontMetricData& rFontMetric ) const
+void CoreTextStyle::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric ) const
{
// get the matching CoreText font handle
// TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here?
@@ -125,20 +125,20 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData& rFontMetric ) const
const CGFloat fAscent = CTFontGetAscent( aCTFontRef );
const CGFloat fCapHeight = CTFontGetCapHeight( aCTFontRef );
- rFontMetric.SetAscent( lrint( fAscent ) );
- rFontMetric.SetDescent( lrint( CTFontGetDescent( aCTFontRef )) );
- rFontMetric.SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) );
- rFontMetric.SetInternalLeading( lrint( fAscent - fCapHeight ) );
+ rxFontMetric->SetAscent( lrint( fAscent ) );
+ rxFontMetric->SetDescent( lrint( CTFontGetDescent( aCTFontRef )) );
+ rxFontMetric->SetExternalLeading( lrint( CTFontGetLeading( aCTFontRef )) );
+ rxFontMetric->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
- rFontMetric.SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) );
+ rxFontMetric->SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) );
// all CoreText fonts are scalable
- rFontMetric.SetScalableFlag( true );
- rFontMetric.SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far
- rFontMetric.SetKernableFlag( true );
+ rxFontMetric->SetScalableFlag( true );
+ rxFontMetric->SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far
+ rxFontMetric->SetKernableFlag( true );
}
bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index fb9e8dbbe758..d4dd9582028e 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -308,9 +308,9 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor )
// SAL_ DEBUG(std::hex << nSalColor << std::dec << "={" << maTextColor.GetRed() << ", " << maTextColor.GetGreen() << ", " << maTextColor.GetBlue() << ", " << maTextColor.GetAlpha() << "}");
}
-void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pFontMetric, int /*nFallbackLevel*/ )
+void AquaSalGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int /*nFallbackLevel*/ )
{
- mpTextStyle->GetFontMetric( *pFontMetric );
+ mpTextStyle->GetFontMetric( rxFontMetric );
}
static bool AddTempDevFont(const OUString& rFontFileURL)