diff options
author | Aditya <adityasahu1511@gmail.com> | 2020-08-01 18:58:06 +0530 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-08-31 20:10:01 +0200 |
commit | 9a7ab3527adef056291ec56c031ebbe3f471af66 (patch) | |
tree | 4ba36fc80abde36ec7c42799100f0b38bd0c0d47 /include | |
parent | 828914a94fe93d5b300bda1d23a049ae92c159e1 (diff) |
svx:Refactor WriteData() and move m_aDestDir member out of GalleryTheme
Move m_aDestDir out of GalleryTheme because only GalleryBinaryEngine seems to be using it.
Use SetDestDir() to delegate the member value to GalleryBinaryEngine.
Refactor WriteData() so that it's called writeGalleryTheme()
Change-Id: I5f6b6f0857695adeb102342e617ad341553abd14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99940
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/gallerybinaryengine.hxx | 18 | ||||
-rw-r--r-- | include/svx/galtheme.hxx | 7 |
2 files changed, 12 insertions, 13 deletions
diff --git a/include/svx/gallerybinaryengine.hxx b/include/svx/gallerybinaryengine.hxx index cf56b98c8c47..eb9e0b291de1 100644 --- a/include/svx/gallerybinaryengine.hxx +++ b/include/svx/gallerybinaryengine.hxx @@ -38,6 +38,7 @@ class SotStorage; struct GalleryObject; class FmFormModel; class GalleryTheme; +class GalleryThemeEntry; class SVXCORE_DLLPUBLIC GalleryBinaryEngine { @@ -46,6 +47,8 @@ private: const GalleryStorageLocations& maGalleryStorageLocations; GalleryObjectCollection& mrGalleryObjectCollection; bool mbReadOnly; + OUString m_aDestDir; + bool m_bDestDirRelative; public: GalleryBinaryEngine(const GalleryStorageLocations& rGalleryStorageLocations, @@ -54,6 +57,8 @@ public: void clearSotStorage(); + void setDestDir(const OUString& rDestDir, bool bRelative); + SAL_DLLPRIVATE void ImplCreateSvDrawStorage(); SAL_DLLPRIVATE const tools::SvRef<SotStorage>& GetSvDrawStorage() const; @@ -62,14 +67,12 @@ public: const INetURLObject& GetSdvURL() const { return maGalleryStorageLocations.GetSdvURL(); } const INetURLObject& GetStrURL() const { return maGalleryStorageLocations.GetStrURL(); } - SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme); + SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme, const GalleryThemeEntry* pThm); - void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, OUString& rDestDir, - sal_uInt32& rInsertPos); + void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, sal_uInt32& rInsertPos); std::unique_ptr<SgaObject> implReadSgaObject(GalleryObject const* pEntry); - bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry, - OUString& aDestDir); + bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry); bool readModel(const GalleryObject* pObject, SdrModel& rModel); SgaObjectSvDraw insertModel(const FmFormModel& rModel, const INetURLObject& rUserURL); @@ -90,8 +93,9 @@ public: void updateTheme(); static void insertFileOrDirURL(const INetURLObject& rFileOrDirURL, std::vector<INetURLObject>& rURLVector); -}; -SvStream& WriteGalleryTheme(SvStream& rOut, const GalleryTheme& rTheme); + SvStream& writeGalleryTheme(SvStream& rOStm, const GalleryTheme& rTheme, + const GalleryThemeEntry* pThm); +}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx index 4c3748c7b145..97da3322044f 100644 --- a/include/svx/galtheme.hxx +++ b/include/svx/galtheme.hxx @@ -22,7 +22,6 @@ #include <svx/svxdllapi.h> #include <svx/galleryobjectcollection.hxx> -#include <svx/gallerybinaryengine.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> @@ -76,8 +75,6 @@ private: std::unique_ptr<GalleryBinaryEngine> mpGalleryBinaryEngine; GalleryObjectCollection maGalleryObjectCollection; - OUString m_aDestDir; - bool m_bDestDirRelative; Gallery* pParent; GalleryThemeEntry* pThm; sal_uInt32 mnThemeLockCount; @@ -112,8 +109,7 @@ public: const OUString& GetName() const; // used for building gallery themes during compilation: - SAL_DLLPRIVATE void SetDestDir(const OUString& rDestDir, bool bRelative) - { m_aDestDir = rDestDir; m_bDestDirRelative = bRelative; } + void SetDestDir(const OUString& rDestDir, bool bRelative); SAL_DLLPRIVATE const INetURLObject& GetThmURL() const; const INetURLObject& GetSdgURL() const; @@ -180,7 +176,6 @@ public: public: - SAL_DLLPRIVATE SvStream& WriteData( SvStream& rOut ) const; SAL_DLLPRIVATE SvStream& ReadData( SvStream& rIn ); static void InsertAllThemes(weld::ComboBox& rListBox); |