summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2020-06-10 14:52:20 +0530
committerTomaž Vajngerl <quikee@gmail.com>2020-06-13 10:50:28 +0200
commite0c9ed26b982813a3f26e350b25caec395d44653 (patch)
tree6298ad53247c04eada14d98a528f866669079152 /include/svx
parentc98affa44e3f61279ae9fe052dbcfbda0c58838e (diff)
svx: Gallery code refactoring
Older classes like Gallery, GalleryTheme, GalleryThemeEntry have reading and writing data members and member functions included in the classes which makes the code unclear and less organized. Introduce new class Gallery Binary Engine that would deal with these member functions in such a way that older classes will have no knowledge about reading and writing. Only change the internal structure of the project and no change in behaviour of output must be there. Change-Id: Ia05eb3c692976b775a3d00e7d09fecc861bced2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95922 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/svx')
-rw-r--r--include/svx/gallery1.hxx19
-rwxr-xr-xinclude/svx/gallerybinaryengine.hxx45
2 files changed, 54 insertions, 10 deletions
diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx
index aa3e986f9e78..f25128955b5b 100644
--- a/include/svx/gallery1.hxx
+++ b/include/svx/gallery1.hxx
@@ -24,28 +24,25 @@
#include <svl/SfxBroadcaster.hxx>
#include <svx/svxdllapi.h>
#include <tools/urlobj.hxx>
+#include <svx/gallerybinaryengine.hxx>
#include <cstdio>
#include <memory>
#include <vector>
+class GalleryBinaryEngine;
class GalleryThemeEntry
{
private:
+ GalleryBinaryEngine maGalleryBinaryEngine;
OUString aName;
- INetURLObject aThmURL;
- INetURLObject aSdgURL;
- INetURLObject aSdvURL;
- INetURLObject aStrURL;
sal_uInt32 nId;
bool bReadOnly;
bool bModified;
bool bThemeNameFromResource;
- static INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL );
-
public:
GalleryThemeEntry( bool bCreateUniqueURL,
const INetURLObject& rBaseURL,
@@ -53,12 +50,14 @@ public:
bool bReadOnly, bool bNewFile,
sal_uInt32 nId, bool bThemeNameFromResource );
+ static INetURLObject ImplGetURLIgnoreCase(const INetURLObject& rURL);
+
const OUString& GetThemeName() const { return aName; }
- const INetURLObject& GetThmURL() const { return aThmURL; }
- const INetURLObject& GetSdgURL() const { return aSdgURL; }
- const INetURLObject& GetSdvURL() const { return aSdvURL; }
- const INetURLObject& GetStrURL() const { return aStrURL; }
+ const INetURLObject& GetThmURL() const { return maGalleryBinaryEngine.GetThmURL(); }
+ const INetURLObject& GetSdgURL() const { return maGalleryBinaryEngine.GetSdgURL(); }
+ const INetURLObject& GetSdvURL() const { return maGalleryBinaryEngine.GetSdvURL(); }
+ const INetURLObject& GetStrURL() const { return maGalleryBinaryEngine.GetStrURL(); }
OUString ReadStrFromIni(const OUString &aKeyName );
diff --git a/include/svx/gallerybinaryengine.hxx b/include/svx/gallerybinaryengine.hxx
new file mode 100755
index 000000000000..7ce4ff471ecd
--- /dev/null
+++ b/include/svx/gallerybinaryengine.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <tools/urlobj.hxx>
+#include <svx/svxdllapi.h>
+
+class SVXCORE_DLLPUBLIC GalleryBinaryEngine
+{
+private:
+ INetURLObject aThmURL;
+ INetURLObject aSdgURL;
+ INetURLObject aSdvURL;
+ INetURLObject aStrURL;
+
+public:
+ void SetThmExtension(INetURLObject aURL);
+ void SetSdgExtension(INetURLObject aURL);
+ void SetSdvExtension(INetURLObject aURL);
+ void SetStrExtension(INetURLObject aURL);
+
+ const INetURLObject& GetThmURL() const { return aThmURL; }
+ const INetURLObject& GetSdgURL() const { return aSdgURL; }
+ const INetURLObject& GetSdvURL() const { return aSdvURL; }
+ const INetURLObject& GetStrURL() const { return aStrURL; }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */