diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-08 13:00:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-09 18:12:02 +0200 |
commit | 4f520dc7e3badc0165ee3b13ddd514bb94b00265 (patch) | |
tree | 82e615a02f72c093768bf7408f84a901e83da5a1 | |
parent | 9af57871fc153ca0145dd40e48f577564395ab73 (diff) |
inline GalleryStorageLocations allocation into GalleryFileStorageEntry
no need to allocate this separately
Change-Id: I01795ac459c5b65b5c143dc081e5b7cf74c2e6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151554
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/inc/galleryfilestorageentry.hxx | 15 | ||||
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galleryfilestorageentry.cxx | 9 |
3 files changed, 12 insertions, 14 deletions
diff --git a/svx/inc/galleryfilestorageentry.hxx b/svx/inc/galleryfilestorageentry.hxx index 66762fa82241..10a020297e72 100644 --- a/svx/inc/galleryfilestorageentry.hxx +++ b/svx/inc/galleryfilestorageentry.hxx @@ -30,7 +30,7 @@ class GalleryObjectCollection; class GalleryFileStorageEntry final { private: - std::unique_ptr<GalleryStorageLocations> mpGalleryStorageLocations; + GalleryStorageLocations maGalleryStorageLocations; public: GalleryFileStorageEntry(); @@ -38,15 +38,16 @@ public: OUString ReadStrFromIni(std::u16string_view aKeyName) const; - const INetURLObject& GetThmURL() const { return mpGalleryStorageLocations->GetThmURL(); } - const INetURLObject& GetSdgURL() const { return mpGalleryStorageLocations->GetSdgURL(); } - const INetURLObject& GetSdvURL() const { return mpGalleryStorageLocations->GetSdvURL(); } - const INetURLObject& GetStrURL() const { return mpGalleryStorageLocations->GetStrURL(); } + const INetURLObject& GetThmURL() const { return maGalleryStorageLocations.GetThmURL(); } + const INetURLObject& GetSdgURL() const { return maGalleryStorageLocations.GetSdgURL(); } + const INetURLObject& GetSdvURL() const { return maGalleryStorageLocations.GetSdvURL(); } + const INetURLObject& GetStrURL() const { return maGalleryStorageLocations.GetStrURL(); } - const std::unique_ptr<GalleryStorageLocations>& getGalleryStorageLocations() const + const GalleryStorageLocations& getGalleryStorageLocations() const { - return mpGalleryStorageLocations; + return maGalleryStorageLocations; } + GalleryStorageLocations& getGalleryStorageLocations() { return maGalleryStorageLocations; } static GalleryThemeEntry* CreateThemeEntry(const INetURLObject& rURL, bool bReadOnly); diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 8dad889b6a8c..17bc19a8990a 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -726,7 +726,7 @@ bool GalleryThemeEntry::IsDefault() const GalleryStorageLocations& GalleryThemeEntry::getGalleryStorageLocations() const { - return *mpGalleryStorageEngineEntry->getGalleryStorageLocations(); + return mpGalleryStorageEngineEntry->getGalleryStorageLocations(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galleryfilestorageentry.cxx b/svx/source/gallery2/galleryfilestorageentry.cxx index b7de500f66e3..593396aaed37 100644 --- a/svx/source/gallery2/galleryfilestorageentry.cxx +++ b/svx/source/gallery2/galleryfilestorageentry.cxx @@ -35,20 +35,17 @@ static bool FileExists(const INetURLObject& rURL, std::u16string_view rExt) return FileExists(aURL); } -GalleryFileStorageEntry::GalleryFileStorageEntry() -{ - mpGalleryStorageLocations = std::make_unique<GalleryStorageLocations>(); -} +GalleryFileStorageEntry::GalleryFileStorageEntry() {} void GalleryFileStorageEntry::setStorageLocations(INetURLObject& rURL) { - mpGalleryStorageLocations->SetStorageLocations(rURL); + maGalleryStorageLocations.SetStorageLocations(rURL); } std::unique_ptr<GalleryFileStorage> GalleryFileStorageEntry::createGalleryStorageEngine( GalleryObjectCollection& mrGalleryObjectCollection, bool& bReadOnly) { - return std::make_unique<GalleryFileStorage>(*mpGalleryStorageLocations, + return std::make_unique<GalleryFileStorage>(maGalleryStorageLocations, mrGalleryObjectCollection, bReadOnly); } |