summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAditya <adityasahu1511@gmail.com>2020-08-27 15:55:46 +0530
committerTomaž Vajngerl <quikee@gmail.com>2020-09-04 14:59:58 +0200
commitfa3f514f33d4beadabf8526278939ed51417918b (patch)
tree8903076cd276f848e859f4b3d86bb15c01e22e2f /svx
parent7dbd1cd44918c50f2540955f908cd0a96fce024c (diff)
svx: Refactor Gallery::RemoveTheme()
Introduce GalleryTheme::removeTheme() and GalleryBinaryEngine::removeTheme() Change-Id: Ic9c1b4fdb3e173d922635e5fd78d463e1f2c220a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101496 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/gallery1.cxx17
-rw-r--r--svx/source/gallery2/gallerybinaryengineentry.cxx12
-rw-r--r--svx/source/gallery2/galtheme.cxx4
3 files changed, 18 insertions, 15 deletions
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 188abd2d995d..5e1182c46a4d 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -193,6 +193,10 @@ void GalleryThemeEntry::SetId( sal_uInt32 nNewId, bool bResetThemeName )
bThemeNameFromResource = ( nId && bResetThemeName );
}
+void GalleryThemeEntry::removeTheme()
+{
+ mpGalleryStorageEngineEntry->removeTheme();
+}
class GalleryThemeCacheEntry
{
@@ -615,17 +619,8 @@ bool Gallery::RemoveTheme( const OUString& rThemeName )
if( pThm )
{
- INetURLObject aThmURL( pThm->GetThmURL() );
- INetURLObject aSdgURL( pThm->GetSdgURL() );
- INetURLObject aSdvURL( pThm->GetSdvURL() );
- INetURLObject aStrURL( pThm->GetStrURL() );
-
- ReleaseTheme( pThm, aListener );
-
- KillFile( aThmURL );
- KillFile( aSdgURL );
- KillFile( aSdvURL );
- KillFile( aStrURL );
+ ReleaseTheme(pThm, aListener);
+ pThemeEntry->removeTheme();
}
auto it = std::find_if(aThemeList.begin(), aThemeList.end(),
diff --git a/svx/source/gallery2/gallerybinaryengineentry.cxx b/svx/source/gallery2/gallerybinaryengineentry.cxx
index ee67b2a255b7..56c836677c3a 100644
--- a/svx/source/gallery2/gallerybinaryengineentry.cxx
+++ b/svx/source/gallery2/gallerybinaryengineentry.cxx
@@ -128,4 +128,16 @@ GalleryThemeEntry* GalleryBinaryEngineEntry::CreateThemeEntry(const INetURLObjec
return pRet;
}
+void GalleryBinaryEngineEntry::removeTheme()
+{
+ INetURLObject aThmURL(GetThmURL());
+ INetURLObject aSdgURL(GetSdgURL());
+ INetURLObject aSdvURL(GetSdvURL());
+ INetURLObject aStrURL(GetStrURL());
+
+ KillFile(aThmURL);
+ KillFile(aSdgURL);
+ KillFile(aSdvURL);
+ KillFile(aStrURL);
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 69f8f4f7557c..8486d6d4ad14 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -801,10 +801,6 @@ void GalleryTheme::ImplSetModified( bool bModified )
pThm->SetModified(bModified);
}
-const INetURLObject& GalleryTheme::GetThmURL() const { return pThm->GetThmURL(); }
-const INetURLObject& GalleryTheme::GetSdgURL() const { return pThm->GetSdgURL(); }
-const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL(); }
-const INetURLObject& GalleryTheme::GetStrURL() const { return pThm->GetStrURL(); }
sal_uInt32 GalleryTheme::GetId() const { return pThm->GetId(); }
void GalleryTheme::SetId( sal_uInt32 nNewId, bool bResetThemeName ) { pThm->SetId( nNewId, bResetThemeName ); }
bool GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); }