From e3cb29854314f73e5e8ad20845a1f7127ec46d7d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 23 Jun 2015 08:26:36 +0200 Subject: LinkUpdateMode is a global setting (cherry picked from commit 77cc71476bae2b3655102e2c29d36af40a393201) Conflicts: sw/source/core/doc/DocumentLinksAdministrationManager.cxx sw/source/filter/xml/xmlimp.cxx Change-Id: Ida1257337c6e0916f2228fe053d9c9f085183af6 Reviewed-on: https://gerrit.libreoffice.org/16422 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- sc/source/filter/xml/xmlimprt.cxx | 10 +++++++++- sc/source/ui/docshell/docsh4.cxx | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 1620f44d3712..7b6bfb3ffd99 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2593,6 +2593,9 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence aFilteredProps( + aConfigProps.getLength()); + sal_Int32 nFilteredPropsLen = 0; for (sal_Int32 i = nCount - 1; i >= 0; --i) { if (aConfigProps[i].Name == sCTName) @@ -2627,11 +2630,16 @@ void ScXMLImport::SetConfigurationSettings(const uno::SequencesetPropertyValue( aConfigProps[i].Name, aConfigProps[i].Value ); } } + if (aConfigProps[i].Name != "LinkUpdateMode") + { + aFilteredProps[nFilteredPropsLen++] = aConfigProps[i]; + } } + aFilteredProps.realloc(nFilteredPropsLen); uno::Reference xInterface = xMultiServiceFactory->createInstance("com.sun.star.comp.SpreadsheetSettings"); uno::Reference xProperties(xInterface, uno::UNO_QUERY); if (xProperties.is()) - SvXMLUnitConverter::convertPropertySet(xProperties, aConfigProps); + SvXMLUnitConverter::convertPropertySet(xProperties, aFilteredProps); } } } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 957e7a43df73..9d1f94f98b4a 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -48,6 +48,7 @@ using namespace ::com::sun::star; #include #include #include +#include #include #include "docuno.hxx" @@ -419,12 +420,23 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (nCanUpdate == com::sun::star::document::UpdateDocMode::NO_UPDATE) nSet = LM_NEVER; - else if (nCanUpdate == com::sun::star::document::UpdateDocMode::QUIET_UPDATE && - nSet == LM_ON_DEMAND) - nSet = LM_NEVER; else if (nCanUpdate == com::sun::star::document::UpdateDocMode::FULL_UPDATE) nSet = LM_ALWAYS; + if (nSet == LM_ALWAYS + && !(SvtSecurityOptions() + .isTrustedLocationUriForUpdatingLinks( + GetMedium() == nullptr + ? OUString() : GetMedium()->GetName()))) + { + nSet = LM_ON_DEMAND; + } + if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE + && nSet == LM_ON_DEMAND) + { + nSet = LM_NEVER; + } + if(nSet==LM_ON_DEMAND) { QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), -- cgit