summaryrefslogtreecommitdiff
path: root/vcl/win/gdi/salfont.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-05 14:48:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-07 13:27:53 +0200
commit77a01802d1a0452814718789bb0c76adeeb747c0 (patch)
tree00198f9cc2c3e4ea4f91597adebb1c52eb6cc395 /vcl/win/gdi/salfont.cxx
parentd9fc8b494be53bacffe45564e98da61ae5b28bd3 (diff)
manage PhysicalFontFace by rtl::Reference
Change-Id: I8f66b5afb066fe83abb83c56ebde6f21197f894b Reviewed-on: https://gerrit.libreoffice.org/55333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win/gdi/salfont.cxx')
-rw-r--r--vcl/win/gdi/salfont.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 1313778ccebb..fb4160f80190 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -559,7 +559,7 @@ static FontAttributes WinFont2DevFontAttributes( const ENUMLOGFONTEXW& rEnumFont
}
-static WinFontFace* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
+static rtl::Reference<WinFontFace> ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
const NEWTEXTMETRICW* pMetric,
DWORD nFontType )
{
@@ -567,7 +567,7 @@ static WinFontFace* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
if ( nFontType & RASTER_FONTTYPE )
nHeight = pMetric->tmHeight - pMetric->tmInternalLeading;
- WinFontFace* pData = new WinFontFace(
+ rtl::Reference<WinFontFace> pData = new WinFontFace(
WinFont2DevFontAttributes(*pLogFont, *pMetric),
nHeight,
pLogFont->elfLogFont.lfCharSet,
@@ -658,7 +658,7 @@ sal_IntPtr WinFontFace::GetFontId() const
return mnId;
}
-PhysicalFontFace* WinFontFace::Clone() const
+rtl::Reference<PhysicalFontFace> WinFontFace::Clone() const
{
return new WinFontFace(*this);
}
@@ -1088,10 +1088,10 @@ int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
return 1;
}
- WinFontFace* pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType );
+ rtl::Reference<WinFontFace> pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType );
pData->SetFontId( sal_IntPtr( pInfo->mnFontCount++ ) );
- pInfo->mpList->Add( pData );
+ pInfo->mpList->Add( pData.get() );
}
return 1;
@@ -1292,11 +1292,11 @@ bool WinSalGraphics::AddTempDevFont( PhysicalFontCollection* pFontCollection,
aDFS.maMapName = aFontName;
*/
- WinFontFace* pFontData = new WinFontFace( aDFA, 0,
+ rtl::Reference<WinFontFace> pFontData = new WinFontFace( aDFA, 0,
sal::static_int_cast<BYTE>(DEFAULT_CHARSET),
sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
- pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData) );
- pFontCollection->Add( pFontData );
+ pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData.get()) );
+ pFontCollection->Add( pFontData.get() );
return true;
}