summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNiklas Johansson <sleeping.pillow@gmail.com>2013-02-28 02:31:55 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-03-08 15:06:38 +0100
commit27f93b3b851e59d254bf5cd3825c8691d0ff3b51 (patch)
tree490714980947b4d4be863d76aaccd94056f96fb6 /sfx2
parentb2983b4653339d83d3e98df4d44608f031dabe9f (diff)
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
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/templatedlg.cxx17
1 files changed, 14 insertions, 3 deletions
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 <vcl/toolbox.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/frame/Desktop.hpp>
@@ -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<TemplateViewItem*>(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 ThumbnailViewItem*>::const_iterator pIter;