[Libreoffice-commits] core.git: include/svx svx/source
Aditya (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 1 07:29:58 UTC 2020
include/svx/gallerybinaryengine.hxx | 1 +
svx/source/gallery2/gallerybinaryengine.cxx | 9 +++++++++
svx/source/gallery2/galtheme.cxx | 6 +-----
3 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 20369e9b4bc1b1b312113f04b0420d2ae1c7fc03
Author: Aditya <adityasahu1511 at gmail.com>
AuthorDate: Sat Aug 1 20:38:24 2020 +0530
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Sep 1 09:29:19 2020 +0200
svx:GalleryTheme Refactoring -implement removeObject() in GalleryBinaryEngine
Change-Id: I90d380efecbd5ed88e16b5f20603ff0183144302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99945
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/svx/gallerybinaryengine.hxx b/include/svx/gallerybinaryengine.hxx
index e8353d11af5a..bf13cecc9471 100644
--- a/include/svx/gallerybinaryengine.hxx
+++ b/include/svx/gallerybinaryengine.hxx
@@ -71,6 +71,7 @@ public:
SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme, const GalleryThemeEntry* pThm);
void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, sal_uInt32& rInsertPos);
+ void removeObject(std::unique_ptr<GalleryObject>& pEntry);
std::unique_ptr<SgaObject> implReadSgaObject(GalleryObject const* pEntry);
bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry);
diff --git a/svx/source/gallery2/gallerybinaryengine.cxx b/svx/source/gallery2/gallerybinaryengine.cxx
index 6831608d9506..64e23a480781 100644
--- a/svx/source/gallery2/gallerybinaryengine.cxx
+++ b/svx/source/gallery2/gallerybinaryengine.cxx
@@ -154,6 +154,15 @@ void GalleryBinaryEngine::insertObject(const SgaObject& rObj, GalleryObject* pFo
implWriteSgaObject(rObj, rInsertPos, nullptr);
}
+void GalleryBinaryEngine::removeObject(std::unique_ptr<GalleryObject>& pEntry)
+{
+ if (mrGalleryObjectCollection.getObjectList().empty())
+ KillFile(GetSdgURL());
+
+ if (SgaObjKind::SvDraw == pEntry->eObjKind)
+ GetSvDrawStorage()->Remove(pEntry->aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+}
+
std::unique_ptr<SgaObject> GalleryBinaryEngine::implReadSgaObject(GalleryObject const* pEntry)
{
std::unique_ptr<SgaObject> pSgaObj;
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 1de5ff849b8e..c10041ee8471 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -187,11 +187,7 @@ void GalleryTheme::RemoveObject(sal_uInt32 nPos)
std::unique_ptr<GalleryObject> pEntry = std::move(*it);
maGalleryObjectCollection.getObjectList().erase( it );
- if( maGalleryObjectCollection.getObjectList().empty() )
- KillFile( GetSdgURL() );
-
- if( SgaObjKind::SvDraw == pEntry->eObjKind )
- mpGalleryBinaryEngine->GetSvDrawStorage()->Remove( pEntry->aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
+ mpGalleryBinaryEngine->removeObject(pEntry);
Broadcast( GalleryHint( GalleryHintType::CLOSE_OBJECT, GetName(), pEntry.get() ) );
pEntry.reset();
More information about the Libreoffice-commits
mailing list