summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-20 14:23:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-20 16:41:51 +0200
commitd2c9c60fefb9687adbde4be61ed66a5123a2587f (patch)
tree1ac529ad155069551456d751e4e156521447eaa8
parentc1a06ec8779ffb6fe442379735bcdeab5fb3532e (diff)
make PhysicalFontCollection::Close return std::shared_ptr
Change-Id: Iefa9df1d40c11cc56831467a03e0274475c50ed1 Reviewed-on: https://gerrit.libreoffice.org/59327 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/PhysicalFontCollection.hxx2
-rw-r--r--vcl/source/font/PhysicalFontCollection.cxx14
-rw-r--r--vcl/source/gdi/virdev.cxx2
-rw-r--r--vcl/source/outdev/font.cxx2
4 files changed, 10 insertions, 10 deletions
diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx
index 46caab87c7c7..08ce6dcf98c1 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -63,7 +63,7 @@ public:
void SetFallbackHook( ImplGlyphFallbackFontSubstitution* );
// misc utilities
- PhysicalFontCollection* Clone() const;
+ std::shared_ptr<PhysicalFontCollection> Clone() const;
std::unique_ptr<ImplDeviceFontList> GetDeviceFontList() const;
std::unique_ptr<ImplDeviceFontSizeList> GetDeviceFontSizeList( const OUString& rFontName ) const;
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 8df6104c97f9..38dedaf09645 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -866,22 +866,22 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindFontFamilyOfDefaultFont() co
return pFoundData;
}
-PhysicalFontCollection* PhysicalFontCollection::Clone() const
+std::shared_ptr<PhysicalFontCollection> PhysicalFontCollection::Clone() const
{
- PhysicalFontCollection* pClonedCollection = new PhysicalFontCollection;
- pClonedCollection->mpPreMatchHook = mpPreMatchHook;
- pClonedCollection->mpFallbackHook = mpFallbackHook;
+ std::shared_ptr<PhysicalFontCollection> xClonedCollection(new PhysicalFontCollection);
+ xClonedCollection->mpPreMatchHook = mpPreMatchHook;
+ xClonedCollection->mpFallbackHook = mpFallbackHook;
// TODO: clone the config-font attributes too?
- pClonedCollection->mbMatchData = false;
+ xClonedCollection->mbMatchData = false;
for (auto const& family : maPhysicalFontFamilies)
{
const PhysicalFontFamily* pFontFace = family.second.get();
- pFontFace->UpdateCloneFontList(*pClonedCollection);
+ pFontFace->UpdateCloneFontList(*xClonedCollection);
}
- return pClonedCollection;
+ return xClonedCollection;
}
std::unique_ptr<ImplDeviceFontList> PhysicalFontCollection::GetDeviceFontList() const
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index f48d9b3b1473..7a7c3b7d855c 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -499,7 +499,7 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
// get font list with scalable fonts only
AcquireGraphics();
- mxFontCollection.reset(pSVData->maGDIData.mxScreenFontList->Clone());
+ mxFontCollection = pSVData->maGDIData.mxScreenFontList->Clone();
// prepare to use new font lists
mxFontCache.reset(new ImplFontCache);
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 81a825fe17f8..72338d32bac1 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -581,7 +581,7 @@ void OutputDevice::ImplRefreshFontData( const bool bNewFontLists )
{
if( mpPDFWriter )
{
- mxFontCollection.reset(pSVData->maGDIData.mxScreenFontList->Clone());
+ mxFontCollection = pSVData->maGDIData.mxScreenFontList->Clone();
mxFontCache.reset(new ImplFontCache);
}
else