[Libreoffice-commits] core.git: sfx2/source
Michael Stahl
mstahl at redhat.com
Thu Feb 6 09:03:42 PST 2014
sfx2/source/doc/templatedlg.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit c8e206fdaab7490fb6e62bc7ab475888236179c2
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Feb 6 17:56:54 2014 +0100
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
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5c88f99..b2b6170 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);
More information about the Libreoffice-commits
mailing list