[Libreoffice-commits] core.git: include/svx svx/qa

Aditya (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 4 19:59:39 UTC 2020


 include/svx/gallery1.hxx                      |    5 ---
 include/svx/gallerybinarystoragelocations.hxx |    2 -
 include/svx/gallerystoragelocations.hxx       |    3 +-
 svx/qa/unit/gallery/test_gallery.cxx          |   36 ++++++++++++++------------
 4 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit 44e81831dfc194b60b6d0c89ba275669e23c443e
Author:     Aditya <adityasahu1511 at gmail.com>
AuthorDate: Fri Aug 28 18:55:03 2020 +0530
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Sep 4 21:58:57 2020 +0200

    svx refactoring: Remove GalleryThemeEntry::GetThmURL() and others
    
    Remove GalleryThemeEntry::GetThmURL(), GetSdvURL(), GetSdgURL(), GetStrURL
     because they don't belong here because they deal with URL.
    
    Change-Id: I5a36742c49793726505ebbf394d9410194c39e6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101547
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx
index 41b71c1c6130..81d22ac1e5ae 100644
--- a/include/svx/gallery1.hxx
+++ b/include/svx/gallery1.hxx
@@ -61,11 +61,6 @@ public:
 
     const OUString&         GetThemeName() const { return aName; }
 
-    const INetURLObject& GetThmURL() const { return mpGalleryStorageEngineEntry->GetThmURL(); }
-    const INetURLObject& GetSdgURL() const { return mpGalleryStorageEngineEntry->GetSdgURL(); }
-    const INetURLObject& GetSdvURL() const { return mpGalleryStorageEngineEntry->GetSdvURL(); }
-    const INetURLObject& GetStrURL() const { return mpGalleryStorageEngineEntry->GetStrURL(); }
-
     bool                    IsReadOnly() const { return bReadOnly; }
     bool                    IsDefault() const;
 
diff --git a/include/svx/gallerybinarystoragelocations.hxx b/include/svx/gallerybinarystoragelocations.hxx
index c744ea610577..aefe1fcad3eb 100644
--- a/include/svx/gallerybinarystoragelocations.hxx
+++ b/include/svx/gallerybinarystoragelocations.hxx
@@ -23,7 +23,7 @@
 #include <svx/svxdllapi.h>
 #include <svx/gallerystoragelocations.hxx>
 
-class GalleryBinaryStorageLocations : public GalleryStorageLocations
+class SVXCORE_DLLPUBLIC GalleryBinaryStorageLocations : public GalleryStorageLocations
 {
 private:
     INetURLObject maThmURL;
diff --git a/include/svx/gallerystoragelocations.hxx b/include/svx/gallerystoragelocations.hxx
index 0e15c35bab70..343ed0b7e77b 100644
--- a/include/svx/gallerystoragelocations.hxx
+++ b/include/svx/gallerystoragelocations.hxx
@@ -19,9 +19,10 @@
 
 #pragma once
 
+#include <svx/svxdllapi.h>
 #include <tools/urlobj.hxx>
 
-class GalleryStorageLocations
+class SVXCORE_DLLPUBLIC GalleryStorageLocations
 {
 public:
     virtual ~GalleryStorageLocations() = 0;
diff --git a/svx/qa/unit/gallery/test_gallery.cxx b/svx/qa/unit/gallery/test_gallery.cxx
index c423f900cd64..83ccf600ed36 100644
--- a/svx/qa/unit/gallery/test_gallery.cxx
+++ b/svx/qa/unit/gallery/test_gallery.cxx
@@ -15,6 +15,8 @@
 
 #include <svx/gallery1.hxx>
 #include <svx/galtheme.hxx>
+#include <svx/gallerybinarystoragelocations.hxx>
+#include <svx/gallerystoragelocations.hxx>
 #include <galobj.hxx>
 
 #include <cppunit/TestAssert.h>
@@ -255,6 +257,8 @@ void GalleryObjTest::TestGalleryThemeEntry()
                                  myThemeName);
 
     // Check URLs
+    GalleryBinaryStorageLocations& aGalleryBinaryStorageLocations
+        = dynamic_cast<GalleryBinaryStorageLocations&>(*mpThemeEntry->getGalleryStorageLocations());
     INetURLObject aURL(aGalleryURL);
     aURL.Append(myThemeName);
     INetURLObject aThemeURL(aURL), aSdvURL(aURL), aSdgURL(aURL), aStrURL(aURL);
@@ -262,22 +266,22 @@ void GalleryObjTest::TestGalleryThemeEntry()
     aSdvURL.setExtension("sdv");
     aSdgURL.setExtension("sdg");
     aStrURL.setExtension("str");
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        "Theme URL doesn't match",
-        mpThemeEntry->GetThmURL().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous),
-        aThemeURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        "Sdv URL doesn't match",
-        mpThemeEntry->GetSdvURL().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous),
-        aSdvURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        "Sdg URL doesn't match",
-        mpThemeEntry->GetSdgURL().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous),
-        aSdgURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(
-        "Str URL doesn't match",
-        mpThemeEntry->GetStrURL().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous),
-        aStrURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Theme URL doesn't match",
+                                 aGalleryBinaryStorageLocations.GetThmURL().GetMainURL(
+                                     INetURLObject::DecodeMechanism::Unambiguous),
+                                 aThemeURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Sdv URL doesn't match",
+                                 aGalleryBinaryStorageLocations.GetSdvURL().GetMainURL(
+                                     INetURLObject::DecodeMechanism::Unambiguous),
+                                 aSdvURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Sdg URL doesn't match",
+                                 aGalleryBinaryStorageLocations.GetSdgURL().GetMainURL(
+                                     INetURLObject::DecodeMechanism::Unambiguous),
+                                 aSdgURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Str URL doesn't match",
+                                 aGalleryBinaryStorageLocations.GetStrURL().GetMainURL(
+                                     INetURLObject::DecodeMechanism::Unambiguous),
+                                 aStrURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous));
 }
 
 void GalleryObjTest::TestInsertGalleryObject()


More information about the Libreoffice-commits mailing list