[Libreoffice-commits] core.git: sfx2/source
Rafael Dominguez
venccsralph at gmail.com
Wed Mar 27 07:58:10 PDT 2013
sfx2/source/doc/templatedlg.cxx | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
New commits:
commit 439db93bee83f49196547c3028df5310341eacd9
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Tue Mar 26 20:44:44 2013 -0430
Fix deleting templates through Template Manager.
Change-Id: Ic59d3d666ae5f3808ef7dd7324589a731a841186
Reviewed-on: https://gerrit.libreoffice.org/3076
Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c537321..1cea676d 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1088,30 +1088,19 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
else
{
sal_uInt16 nRegionItemId = maView->getCurRegionItemId();
+ std::set<const ThumbnailViewItem*,selection_cmp_fn> aSelTemplates = maSelTemplates; //Avoid invalid iterators
std::set<const ThumbnailViewItem*,selection_cmp_fn>::const_iterator pIter;
- for (pIter = maSelTemplates.begin(); pIter != maSelTemplates.end();)
+ for (pIter = aSelTemplates.begin(); pIter != aSelTemplates.end(); ++pIter)
{
- if (maView->removeTemplate((*pIter)->mnId,nRegionItemId))
- maSelTemplates.erase(pIter++);
- else
+ if (!maView->removeTemplate((*pIter)->mnId,nRegionItemId))
{
if (aTemplateList.isEmpty())
aTemplateList = (*pIter)->maTitle;
else
aTemplateList = aTemplateList + "\n" + (*pIter)->maTitle;
-
- ++pIter;
}
}
-
- if (maSelTemplates.empty())
- {
- mpTemplateBar->SetItemDown(TBI_TEMPLATE_DELETE,false);
- mpTemplateBar->Show(false);
- mpViewBar->Show();
- mpActionBar->Show();
- }
}
if (!aTemplateList.isEmpty())
More information about the Libreoffice-commits
mailing list