From 27f93b3b851e59d254bf5cd3825c8691d0ff3b51 Mon Sep 17 00:00:00 2001 From: Niklas Johansson Date: Thu, 28 Feb 2013 02:31:55 +0100 Subject: Template manager should respect users macro/link settings. When opening a file with loadComponentFromURL, macro and link settings is not respected unless it's explicitly told to do so. Change-Id: Iaf2f2a797285e40147152ac8dfd53720dc26931b --- sfx2/source/doc/templatedlg.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index d78cbafc2295..06a0dfe93a86 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -40,6 +40,8 @@ #include #include +#include +#include #include #include #include @@ -63,6 +65,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; +using namespace ::com::sun::star::document; static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName ); @@ -674,9 +677,13 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem) { if (!mbIsSaveMode) { - uno::Sequence< PropertyValue > aArgs(1); + uno::Sequence< PropertyValue > aArgs(3); aArgs[0].Name = "AsTemplate"; - aArgs[0].Value <<= sal_True; + aArgs[0].Value <<= sal_False; + aArgs[1].Name = "MacroExecutionMode"; + aArgs[1].Value <<= MacroExecMode::USE_CONFIG; + aArgs[2].Name = "UpdateDocMode"; + aArgs[2].Value <<= UpdateDocMode::ACCORDING_TO_CONFIG; TemplateViewItem *pTemplateItem = static_cast(pItem); @@ -974,9 +981,13 @@ void SfxTemplateManagerDlg::OnTemplateSearch () void SfxTemplateManagerDlg::OnTemplateEdit () { - uno::Sequence< PropertyValue > aArgs(1); + uno::Sequence< PropertyValue > aArgs(3); aArgs[0].Name = "AsTemplate"; aArgs[0].Value <<= sal_False; + aArgs[1].Name = "MacroExecutionMode"; + aArgs[1].Value <<= MacroExecMode::USE_CONFIG; + aArgs[2].Name = "UpdateDocMode"; + aArgs[2].Value <<= UpdateDocMode::ACCORDING_TO_CONFIG; uno::Reference< XStorable > xStorable; std::set::const_iterator pIter; -- cgit v1.2.3