summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-23 08:26:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-23 08:26:36 +0200
commit77cc71476bae2b3655102e2c29d36af40a393201 (patch)
tree8e4e17f0498a4ad08dd1eb2811ab2f5afb0fdcfd /sc
parent17815049103b920df054b4f1bb8b1e99486972f2 (diff)
LinkUpdateMode is a global setting
Change-Id: Ida1257337c6e0916f2228fe053d9c9f085183af6
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 9ec2733e6fda..2ddf1a692987 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 a379f6f18b37..969c678e4ce1 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)
{
ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),