Kaydet (Commit) 27f93b3b authored tarafından Niklas Johansson's avatar Niklas Johansson Kaydeden (comit) Cédric Bosdonnat

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
üst b2983b46
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <com/sun/star/beans/PropertyValue.hpp> #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/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/Desktop.hpp>
...@@ -63,6 +65,7 @@ using namespace ::com::sun::star::frame; ...@@ -63,6 +65,7 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::document;
static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName ); static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName );
...@@ -674,9 +677,13 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem) ...@@ -674,9 +677,13 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem)
{ {
if (!mbIsSaveMode) if (!mbIsSaveMode)
{ {
uno::Sequence< PropertyValue > aArgs(1); uno::Sequence< PropertyValue > aArgs(3);
aArgs[0].Name = "AsTemplate"; 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); TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
...@@ -974,9 +981,13 @@ void SfxTemplateManagerDlg::OnTemplateSearch () ...@@ -974,9 +981,13 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
void SfxTemplateManagerDlg::OnTemplateEdit () void SfxTemplateManagerDlg::OnTemplateEdit ()
{ {
uno::Sequence< PropertyValue > aArgs(1); uno::Sequence< PropertyValue > aArgs(3);
aArgs[0].Name = "AsTemplate"; aArgs[0].Name = "AsTemplate";
aArgs[0].Value <<= sal_False; 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; uno::Reference< XStorable > xStorable;
std::set<const ThumbnailViewItem*>::const_iterator pIter; std::set<const ThumbnailViewItem*>::const_iterator 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