summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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