diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-20 14:23:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-20 16:41:51 +0200 |
commit | d2c9c60fefb9687adbde4be61ed66a5123a2587f (patch) | |
tree | 1ac529ad155069551456d751e4e156521447eaa8 /vcl/source/font/PhysicalFontCollection.cxx | |
parent | c1a06ec8779ffb6fe442379735bcdeab5fb3532e (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>
Diffstat (limited to 'vcl/source/font/PhysicalFontCollection.cxx')
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
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 |