summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2020-08-28 20:39:41 +0530
committerTomaž Vajngerl <quikee@gmail.com>2020-09-06 12:44:41 +0200
commit0e3b72ac75d9f9c70fe6e74e83a43ffa2635c777 (patch)
tree1cbe0822c688fcf6d8fd60384c970f987c727da3 /include
parentd17b80d8a0c540a5add6e675a3b42f97c4737f98 (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 'include')
-rw-r--r--include/svx/gallery1.hxx8
-rw-r--r--include/svx/gallerybinaryengineentry.hxx20
2 files changed, 18 insertions, 10 deletions
diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx
index 81d22ac1e5ae..36f25a292877 100644
--- a/include/svx/gallery1.hxx
+++ b/include/svx/gallery1.hxx
@@ -39,7 +39,6 @@ class GalleryThemeEntry
private:
std::unique_ptr<GalleryBinaryEngineEntry> mpGalleryStorageEngineEntry;
- std::unique_ptr<GalleryStorageLocations> mpGalleryStorageLocations;
OUString aName;
sal_uInt32 nId;
bool bReadOnly;
@@ -53,11 +52,10 @@ public:
bool bReadOnly, bool bNewFile,
sal_uInt32 nId, bool bThemeNameFromResource );
- std::unique_ptr<GalleryBinaryEngineEntry> createGalleryStorageEngineEntry();
+ static std::unique_ptr<GalleryBinaryEngineEntry> createGalleryStorageEngineEntry();
const std::unique_ptr<GalleryBinaryEngineEntry>& getGalleryStorageEngineEntry() const { return mpGalleryStorageEngineEntry; }
- static std::unique_ptr<GalleryStorageLocations> createGalleryStorageLocations();
- const std::unique_ptr<GalleryStorageLocations>& getGalleryStorageLocations() const { return mpGalleryStorageLocations; }
+ GalleryStorageLocations& getGalleryStorageLocations() const { return *mpGalleryStorageEngineEntry->getGalleryStorageLocations(); }
const OUString& GetThemeName() const { return aName; }
@@ -79,6 +77,8 @@ public:
void removeTheme();
std::unique_ptr<GalleryTheme> getCachedTheme(Gallery* pGallery) const;
+
+ void setStorageLocations(INetURLObject& rURL);
};
class SfxListener;
diff --git a/include/svx/gallerybinaryengineentry.hxx b/include/svx/gallerybinaryengineentry.hxx
index 8039661e4dec..b0f8d7a447b3 100644
--- a/include/svx/gallerybinaryengineentry.hxx
+++ b/include/svx/gallerybinaryengineentry.hxx
@@ -32,24 +32,32 @@ class GalleryBinaryStorageLocations;
class GalleryBinaryEngineEntry : public GalleryFileStorageEntry
{
private:
- GalleryBinaryStorageLocations& m_rGalleryStorageLocations;
+ std::unique_ptr<GalleryBinaryStorageLocations> mpGalleryStorageLocations;
public:
- GalleryBinaryEngineEntry(GalleryBinaryStorageLocations& rGalleryStorageLocations);
+ GalleryBinaryEngineEntry();
static void CreateUniqueURL(const INetURLObject& rBaseURL, INetURLObject& aURL);
OUString ReadStrFromIni(const OUString& aKeyName);
- const INetURLObject& GetThmURL() const { return m_rGalleryStorageLocations.GetThmURL(); }
- const INetURLObject& GetSdgURL() const { return m_rGalleryStorageLocations.GetSdgURL(); }
- const INetURLObject& GetSdvURL() const { return m_rGalleryStorageLocations.GetSdvURL(); }
- const INetURLObject& GetStrURL() const { return m_rGalleryStorageLocations.GetStrURL(); }
+ 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(); }
+
+ static std::unique_ptr<GalleryBinaryStorageLocations> createGalleryStorageLocations();
+ const std::unique_ptr<GalleryBinaryStorageLocations>& getGalleryStorageLocations() const
+ {
+ return mpGalleryStorageLocations;
+ }
static GalleryThemeEntry* CreateThemeEntry(const INetURLObject& rURL, bool bReadOnly);
void removeTheme();
std::unique_ptr<GalleryTheme>& getCachedTheme(std::unique_ptr<GalleryTheme>& pNewTheme);
+
+ void setStorageLocations(INetURLObject& rURL);
};
SvStream& ReadGalleryTheme(SvStream& rIn, GalleryTheme& rTheme);