diff options
author | Aditya <adityasahu1511@gmail.com> | 2020-08-28 20:39:41 +0530 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-09-06 12:44:41 +0200 |
commit | 0e3b72ac75d9f9c70fe6e74e83a43ffa2635c777 (patch) | |
tree | 1cbe0822c688fcf6d8fd60384c970f987c727da3 /svx/source/gallery2 | |
parent | d17b80d8a0c540a5add6e675a3b42f97c4737f98 (diff) |
svx refactoring: Remove GalleryStorageLocations from GalleryThemeEntry
Change-Id: I3955a66b7ec4f463264dbb5db6209bbb667bf2b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101557
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 10 | ||||
-rw-r--r-- | svx/source/gallery2/gallerybinaryengineentry.cxx | 18 | ||||
-rw-r--r-- | svx/source/gallery2/gallerybinarystoragelocations.cxx | 10 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 2 |
4 files changed, 25 insertions, 15 deletions
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index aaa6b47ed918..d0a2da1836d7 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -122,9 +122,8 @@ GalleryThemeEntry::GalleryThemeEntry( bool bCreateUniqueURL, { GalleryBinaryEngineEntry::CreateUniqueURL(rBaseURL,aURL); } - mpGalleryStorageLocations = createGalleryStorageLocations(); mpGalleryStorageEngineEntry = createGalleryStorageEngineEntry(); - mpGalleryStorageLocations->SetStorageLocations(aURL); + setStorageLocations(aURL); SetModified( _bNewFile ); @@ -164,14 +163,13 @@ GalleryThemeEntry::GalleryThemeEntry( bool bCreateUniqueURL, std::unique_ptr<GalleryBinaryEngineEntry> GalleryThemeEntry::createGalleryStorageEngineEntry() { - std::unique_ptr<GalleryBinaryEngineEntry> pGalleryBinaryEngineEntry = std::make_unique<GalleryBinaryEngineEntry>(dynamic_cast<GalleryBinaryStorageLocations&>(*mpGalleryStorageLocations)); + std::unique_ptr<GalleryBinaryEngineEntry> pGalleryBinaryEngineEntry = std::make_unique<GalleryBinaryEngineEntry>(); return pGalleryBinaryEngineEntry; } -std::unique_ptr<GalleryStorageLocations> GalleryThemeEntry::createGalleryStorageLocations() +void GalleryThemeEntry::setStorageLocations(INetURLObject& rURL) { - std::unique_ptr<GalleryStorageLocations> pGalleryStorageLocations = std::make_unique<GalleryBinaryStorageLocations>(); - return pGalleryStorageLocations; + mpGalleryStorageEngineEntry->setStorageLocations(rURL); } void GalleryTheme::InsertAllThemes(weld::ComboBox& rListBox) diff --git a/svx/source/gallery2/gallerybinaryengineentry.cxx b/svx/source/gallery2/gallerybinaryengineentry.cxx index 1d669576dc98..5c7c81fb5790 100644 --- a/svx/source/gallery2/gallerybinaryengineentry.cxx +++ b/svx/source/gallery2/gallerybinaryengineentry.cxx @@ -41,10 +41,22 @@ static bool FileExists(const INetURLObject& rURL, const OUString& rExt) return FileExists(aURL); } -GalleryBinaryEngineEntry::GalleryBinaryEngineEntry( - GalleryBinaryStorageLocations& rGalleryStorageLocations) - : m_rGalleryStorageLocations(rGalleryStorageLocations) +GalleryBinaryEngineEntry::GalleryBinaryEngineEntry() { + mpGalleryStorageLocations = createGalleryStorageLocations(); +} + +std::unique_ptr<GalleryBinaryStorageLocations> +GalleryBinaryEngineEntry::createGalleryStorageLocations() +{ + std::unique_ptr<GalleryBinaryStorageLocations> pGalleryStorageLocations + = std::make_unique<GalleryBinaryStorageLocations>(); + return pGalleryStorageLocations; +} + +void GalleryBinaryEngineEntry::setStorageLocations(INetURLObject& rURL) +{ + mpGalleryStorageLocations->SetStorageLocations(rURL); } void GalleryBinaryEngineEntry::CreateUniqueURL(const INetURLObject& rBaseURL, INetURLObject& aURL) diff --git a/svx/source/gallery2/gallerybinarystoragelocations.cxx b/svx/source/gallery2/gallerybinarystoragelocations.cxx index cefb79d543a9..e8aaf88b1fee 100644 --- a/svx/source/gallery2/gallerybinarystoragelocations.cxx +++ b/svx/source/gallery2/gallerybinarystoragelocations.cxx @@ -64,12 +64,12 @@ void GalleryBinaryStorageLocations::SetStrExtension(INetURLObject& aURL) maStrURL = ImplGetURLIgnoreCase(aURL); } -void GalleryBinaryStorageLocations::SetStorageLocations(INetURLObject& aURL) +void GalleryBinaryStorageLocations::SetStorageLocations(INetURLObject& rURL) { - SetThmExtension(aURL); - SetSdgExtension(aURL); - SetSdvExtension(aURL); - SetStrExtension(aURL); + SetThmExtension(rURL); + SetSdgExtension(rURL); + SetSdvExtension(rURL); + SetStrExtension(rURL); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index c0fb25b430ce..69a09b84c2ee 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -96,7 +96,7 @@ void GalleryTheme::SetDestDir(const OUString& rDestDir, bool bRelative) std::unique_ptr<GalleryBinaryEngine> GalleryTheme::createGalleryStorageEngine(bool bReadOnly) { - std::unique_ptr<GalleryBinaryEngine> pGalleryBinaryEngine = std::make_unique<GalleryBinaryEngine>(dynamic_cast<GalleryBinaryStorageLocations&>(*pThm->getGalleryStorageLocations()), maGalleryObjectCollection, bReadOnly); + std::unique_ptr<GalleryBinaryEngine> pGalleryBinaryEngine = std::make_unique<GalleryBinaryEngine>(dynamic_cast<GalleryBinaryStorageLocations&>(pThm->getGalleryStorageLocations()), maGalleryObjectCollection, bReadOnly); return pGalleryBinaryEngine; } |