diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-06 17:56:54 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2014-02-07 11:56:01 +0000 |
commit | 69c487642143f5c77885ab674aa2aaae039b5bb7 (patch) | |
tree | dbe32bf6df299242c005c67fe114d60eb71f9231 /sfx2 | |
parent | a1c6bed17f373947ee41d395fb380b663fba5d64 (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
(cherry picked from commit c8e206fdaab7490fb6e62bc7ab475888236179c2)
Reviewed-on: https://gerrit.libreoffice.org/7904
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index d61d6b5c7155..ea350319e9f0 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); |