[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 21 12:56:44 UTC 2018
svx/source/form/fmexpl.cxx | 3 ++-
svx/source/form/navigatortree.cxx | 4 ++--
svx/source/form/navigatortreemodel.cxx | 4 ++--
svx/source/inc/fmexpl.hxx | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
New commits:
commit c4b76e9cb2cddfcc758a6459255bf3c1704ad990
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Nov 21 10:22:39 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Nov 21 13:56:22 2018 +0100
tdf#121540 crash deleting a form from form navigator
regression from
commit eec9f6c8b928de38dd9e683f46bfab00f3243048
Date: Mon Jun 4 15:01:43 2018 +0200
loplugin:useuniqueptr in FmEntryDataList
and rename the method to make the it's operation clearer
Reviewed-on: https://gerrit.libreoffice.org/63694
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 2edc8c53433be4423d7b009c9f60ed732d554816)
Change-Id: Ife366f02c3d8907c397345d825ef7d1721d8930c
Reviewed-on: https://gerrit.libreoffice.org/63704
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 8fec9e0f5798..8f636b92d962 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -132,13 +132,14 @@ FmEntryDataList::~FmEntryDataList()
}
-void FmEntryDataList::remove( FmEntryData* pItem )
+void FmEntryDataList::removeNoDelete( FmEntryData* pItem )
{
auto aEnd = maEntryDataList.end();
for ( auto it = maEntryDataList.begin(); it != aEnd; ++it )
{
if ( it->get() == pItem )
{
+ it->release();
maEntryDataList.erase( it );
return;
}
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 29392f811489..2a44e7d9953a 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1053,9 +1053,9 @@ namespace svxform
// remove from parent
if (pCurrentParentUserData)
- pCurrentParentUserData->GetChildList()->remove( pCurrentUserData );
+ pCurrentParentUserData->GetChildList()->removeNoDelete( pCurrentUserData );
else
- GetNavModel()->GetRootList()->remove( pCurrentUserData );
+ GetNavModel()->GetRootList()->removeNoDelete( pCurrentUserData );
// remove from container
sal_Int32 nIndex = getElementPos(xContainer, xCurrentChild);
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index 62ce8a327dc0..c178c68b6439 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -415,10 +415,10 @@ namespace svxform
// remove from parent
if (pFolder)
- pFolder->GetChildList()->remove( pEntry );
+ pFolder->GetChildList()->removeNoDelete( pEntry );
else
{
- GetRootList()->remove( pEntry );
+ GetRootList()->removeNoDelete( pEntry );
// If root has no more form, reset CurForm at shell
if ( !GetRootList()->size() )
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index 4f26008fa054..6e751c2921f8 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -197,7 +197,7 @@ public:
{ return maEntryDataList.at(Index).get(); }
size_t size() const { return maEntryDataList.size(); }
- void remove( FmEntryData* pItem );
+ void removeNoDelete( FmEntryData* pItem );
void insert( std::unique_ptr<FmEntryData> pItem, size_t Index );
void clear();
};
More information about the Libreoffice-commits
mailing list