summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2020-07-10 16:10:05 +0530
committerTomaž Vajngerl <quikee@gmail.com>2020-07-17 10:16:12 +0200
commit457ffe960dfdbd0200292ad9c9835d947dd35c73 (patch)
treed29b6cda869334a3f57203a03b9f3b9cc6d6668f /include
parente154d9044fca4fea71d5623be094492df1d45229 (diff)
svx: refactoring of GalleryTheme GetModel(), InsertModel()
Introduce readModel(), readModelStream(), insertModel(), insertModelStream() in Gallery Binary Engine because these deal with file reading stuff. Move ImplGetURL() to galmisc for now because GalleryTheme and GalleryBinaryEngine both use it. Separate InsertModel() into two parts - one dealing with Sot Storage stream, the other adding object to gallery list. Move first part to Gallery Binary Engine, the second stays. Separate InsertObject() into two parts. Move CreateThemeEntry() to Binary Engine. Change-Id: Id3b4091db27b5b88bcf025f9fd94ad86169505d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98492 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/gallery1.hxx11
-rw-r--r--include/svx/gallerybinaryengine.hxx22
-rw-r--r--include/svx/galmisc.hxx5
-rw-r--r--include/svx/galtheme.hxx6
4 files changed, 36 insertions, 8 deletions
diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx
index 15fa6e1d6629..013245d91da0 100644
--- a/include/svx/gallery1.hxx
+++ b/include/svx/gallery1.hxx
@@ -30,6 +30,8 @@
#include <memory>
#include <vector>
+class SgaObjectSvDraw;
+struct GalleryObject;
class GalleryBinaryEngine;
class GalleryThemeEntry
@@ -55,6 +57,15 @@ public:
void callGalleryThemeInit();
+ bool readModel(const GalleryObject* pObject, SdrModel& rModel);
+ bool insertModel(const FmFormModel& rModel, INetURLObject& aURL);
+
+ bool readModelStream(const GalleryObject* pObject, tools::SvRef<SotStorageStream> const& rxModelStream);
+ SgaObjectSvDraw insertModelStream(const tools::SvRef<SotStorageStream>& rxModelStream, INetURLObject& rURL);
+
+ void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, OUString& rDestDir,
+ ::std::vector<std::unique_ptr<GalleryObject>>& rObjectList, sal_uInt32& rInsertPos);
+
const OUString& GetThemeName() const { return aName; }
const INetURLObject& GetThmURL() const { return mpGalleryBinaryEngine->GetThmURL(); }
diff --git a/include/svx/gallerybinaryengine.hxx b/include/svx/gallerybinaryengine.hxx
index 20be0b6cdfe0..4582bd1d4b8d 100644
--- a/include/svx/gallerybinaryengine.hxx
+++ b/include/svx/gallerybinaryengine.hxx
@@ -24,6 +24,7 @@
#include <svx/galtheme.hxx>
#include <sot/storage.hxx>
+class SgaObjectSvDraw;
class SotStorage;
struct GalleryObject;
@@ -64,10 +65,23 @@ public:
OUString& aDestDir,
::std::vector<std::unique_ptr<GalleryObject>>& aObjectList);
SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme);
- SAL_DLLPRIVATE static INetURLObject
- implCreateUniqueURL(SgaObjKind eObjKind, const INetURLObject& rUserURL,
- ::std::vector<std::unique_ptr<GalleryObject>>& rObjectList,
- ConvertDataFormat nFormat = ConvertDataFormat::Unknown);
+
+ bool readModel(const GalleryObject* pObject, SdrModel& rModel);
+ bool insertModel(const FmFormModel& rModel, INetURLObject& rURL);
+
+ bool readModelStream(const GalleryObject* pObject,
+ tools::SvRef<SotStorageStream> const& rxModelStream);
+ SgaObjectSvDraw insertModelStream(const tools::SvRef<SotStorageStream>& rxModelStream,
+ INetURLObject& rURL);
+
+ void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, OUString& rDestDir,
+ ::std::vector<std::unique_ptr<GalleryObject>>& rObjectList,
+ sal_uInt32& rInsertPos);
+
+ SAL_DLLPRIVATE static GalleryThemeEntry* CreateThemeEntry(const INetURLObject& rURL,
+ bool bReadOnly);
};
+SvStream& WriteGalleryTheme(SvStream& rOut, const GalleryTheme& rTheme);
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index 4d7c03757375..dd5a361105de 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -23,6 +23,7 @@
#include <vcl/imap.hxx>
#include <svl/hint.hxx>
#include <vcl/transfer.hxx>
+#include <vcl/salctype.hxx>
#include <svx/svdobj.hxx>
#include <com/sun/star/uno/Reference.h>
#include <svx/svxdllapi.h>
@@ -193,5 +194,9 @@ public:
void* GetData1() const { return mnData1; }
};
+struct GalleryObject;
+
+INetURLObject ImplGetURL(const GalleryObject* pObject);
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx
index b262805a0744..7d67fe6f3488 100644
--- a/include/svx/galtheme.hxx
+++ b/include/svx/galtheme.hxx
@@ -98,7 +98,6 @@ private:
return i;
return SAL_MAX_UINT32;
}
- SAL_DLLPRIVATE static INetURLObject ImplGetURL( const GalleryObject* pObject );
SAL_DLLPRIVATE void ImplSetModified( bool bModified );
SAL_DLLPRIVATE void ImplBroadcast(sal_uInt32 nUpdatePos);
@@ -111,8 +110,6 @@ public:
SAL_DLLPRIVATE virtual ~GalleryTheme() override;
- SAL_DLLPRIVATE static GalleryThemeEntry* CreateThemeEntry( const INetURLObject& rURL, bool bReadOnly );
-
SAL_DLLPRIVATE sal_uInt32 GetObjectCount() const { return aObjectList.size(); }
std::unique_ptr<SgaObject> AcquireObject(sal_uInt32 nPos);
@@ -182,6 +179,8 @@ public:
SAL_DLLPRIVATE bool GetModelStream(sal_uInt32 nPos, tools::SvRef<SotStorageStream> const & rModelStreamRef);
SAL_DLLPRIVATE bool InsertModelStream(const tools::SvRef<SotStorageStream>& rModelStream, sal_uInt32 nInsertPos);
+ INetURLObject implCreateUniqueURL(SgaObjKind eObjKind, ConvertDataFormat nFormat = ConvertDataFormat::Unknown);
+
SAL_DLLPRIVATE bool GetURL(sal_uInt32 nPos, INetURLObject& rURL);
bool InsertURL(const INetURLObject& rURL, sal_uInt32 nInsertPos = SAL_MAX_UINT32);
SAL_DLLPRIVATE bool InsertFileOrDirURL(const INetURLObject& rFileOrDirURL, sal_uInt32 nInsertPos);
@@ -201,7 +200,6 @@ public:
SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const BitmapEx& rBitmapEx, const Size& rSize, const OUString& rTitle, const OUString& rPath);
};
-SvStream& WriteGalleryTheme( SvStream& rOut, const GalleryTheme& rTheme );
SvStream& ReadGalleryTheme( SvStream& rIn, GalleryTheme& rTheme );
#endif // INCLUDED_SVX_GALTHEME_HXX