Kaydet (Commit) c8e206fd authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 2afb6528
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment