diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/gallery/test_gallery.cxx | 2 | ||||
-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 |
5 files changed, 26 insertions, 16 deletions
diff --git a/svx/qa/unit/gallery/test_gallery.cxx b/svx/qa/unit/gallery/test_gallery.cxx index 83ccf600ed36..d9ae9150ceb1 100644 --- a/svx/qa/unit/gallery/test_gallery.cxx +++ b/svx/qa/unit/gallery/test_gallery.cxx @@ -258,7 +258,7 @@ void GalleryObjTest::TestGalleryThemeEntry() // Check URLs GalleryBinaryStorageLocations& aGalleryBinaryStorageLocations - = dynamic_cast<GalleryBinaryStorageLocations&>(*mpThemeEntry->getGalleryStorageLocations()); + = dynamic_cast<GalleryBinaryStorageLocations&>(mpThemeEntry->getGalleryStorageLocations()); INetURLObject aURL(aGalleryURL); aURL.Append(myThemeName); INetURLObject aThemeURL(aURL), aSdvURL(aURL), aSdgURL(aURL), aStrURL(aURL); 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; } |