summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-06 17:56:54 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-06 17:58:54 +0100
commitc8e206fdaab7490fb6e62bc7ab475888236179c2 (patch)
tree9b286bd4b7a1fef5bd5a0543177af6525bf8ed83
parent2afb6528c1bc70231b00555cdaa4dd3d25faed11 (diff)
fdo#74148: sfx2: fix crash when editing template
SfxTemplateManagerDlg::OnTemplateEdit() accesses invalid iterator because during loadComponentFromURL() it happens that ThumnailView::LoseFocus() is called and maSelTemplates is cleared. Change-Id: I074a70e5ce8bc89a38b720ddd0325c69c1d2b9ff
-rw-r--r--sfx2/source/doc/templatedlg.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5c88f99dad9a..b2b61703d12b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1235,8 +1235,10 @@ void SfxTemplateManagerDlg::OnTemplateEdit ()
aArgs[2].Value <<= UpdateDocMode::ACCORDING_TO_CONFIG;
uno::Reference< XStorable > xStorable;
+ std::set<const ThumbnailViewItem*,selection_cmp_fn> aSelTemplates(
+ maSelTemplates); // Avoids invalid iterators from LoseFocus
std::set<const ThumbnailViewItem*,selection_cmp_fn>::const_iterator pIter;
- for (pIter = maSelTemplates.begin(); pIter != maSelTemplates.end(); ++pIter)
+ for (pIter = aSelTemplates.begin(); pIter != aSelTemplates.end(); ++pIter)
{
const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*pIter);