From 44e81831dfc194b60b6d0c89ba275669e23c443e Mon Sep 17 00:00:00 2001 From: Aditya Date: Fri, 28 Aug 2020 18:55:03 +0530 Subject: svx refactoring: Remove GalleryThemeEntry::GetThmURL() and others MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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(-) 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 #include -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 #include -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 #include +#include +#include #include #include @@ -255,6 +257,8 @@ void GalleryObjTest::TestGalleryThemeEntry() myThemeName); // Check URLs + GalleryBinaryStorageLocations& aGalleryBinaryStorageLocations + = dynamic_cast(*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() -- cgit