summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-23 08:26:36 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-23 10:34:12 +0000
commit8110d0c3cd79339d1d01b8ab2b11bee72551f083 (patch)
treeb10904e4094242636baab4179dca02956577f73d /sc
parenta99a8aa1f6ec95a578a34f92aeab3523f090176b (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx10
-rw-r--r--sc/source/ui/docshell/docsh4.cxx18
2 files changed, 24 insertions, 4 deletions
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<beans::PropertyVa
OUString sCTName("TrackedChangesProtectionKey");
OUString sVBName("VBACompatibilityMode");
OUString sSCName("ScriptConfiguration");
+ css::uno::Sequence<css::beans::PropertyValue> 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::Sequence<beans::PropertyVa
xImportInfo->setPropertyValue( aConfigProps[i].Name, aConfigProps[i].Value );
}
}
+ if (aConfigProps[i].Name != "LinkUpdateMode")
+ {
+ aFilteredProps[nFilteredPropsLen++] = aConfigProps[i];
+ }
}
+ aFilteredProps.realloc(nFilteredPropsLen);
uno::Reference <uno::XInterface> xInterface = xMultiServiceFactory->createInstance("com.sun.star.comp.SpreadsheetSettings");
uno::Reference <beans::XPropertySet> 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 <svl/PasswordHelper.hxx>
#include <svl/documentlockfile.hxx>
#include <svl/sharecontrolfile.hxx>
+#include <unotools/securityoptions.hxx>
#include <comphelper/processfactory.hxx>
#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),