diff options
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 80f180a4b923..6b9a2c462fb9 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1070,19 +1070,17 @@ void SfxTemplateManagerDlg::OnTemplateDelete () void SfxTemplateManagerDlg::OnTemplateAsDefault () { - assert(!maSelTemplates.empty()); - - const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*(maSelTemplates.begin())); - - OUString aServiceName; - if (lcl_getServiceName(pItem->getPath(),aServiceName)) + if (!maSelTemplates.empty()) { - SfxObjectFactory::SetStandardTemplate(aServiceName,pItem->getPath()); + const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*(maSelTemplates.begin())); - createDefaultTemplateMenu(); + OUString aServiceName; + if (lcl_getServiceName(pItem->getPath(),aServiceName)) + { + SfxObjectFactory::SetStandardTemplate(aServiceName,pItem->getPath()); - // clear selection and display view/action toolbars - maView->deselectOverlayItem(pItem->mnId); + createDefaultTemplateMenu(); + } } } |