summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/core/doc/DocumentLinksAdministrationManager.cxx10
-rw-r--r--sw/source/filter/xml/xmlimp.cxx80
2 files changed, 51 insertions, 39 deletions
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 1d596a4ee67c..086dd42e5492 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -44,6 +44,7 @@
#include <ndtxt.hxx>
#include <tools/urlobj.hxx>
#include <unotools/charclass.hxx>
+#include <unotools/securityoptions.hxx>
//#include <rtl/string.h>
#include <boost/foreach.hpp>
@@ -224,6 +225,15 @@ void DocumentLinksAdministrationManager::UpdateLinks( bool bUI )
case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = false; break;
case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = true; break;
}
+ if (nLinkMode == AUTOMATIC && !bAskUpdate)
+ {
+ SfxMedium * medium = m_rDoc.GetDocShell()->GetMedium();
+ if (!SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks(
+ medium == nullptr ? OUString() : medium->GetName()))
+ {
+ bAskUpdate = true;
+ }
+ }
if( bUpdate && (bUI || !bAskUpdate) )
{
SfxMedium* pMedium = m_rDoc.GetDocShell()->GetMedium();
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index ee3081815fc1..f59c732b66a1 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1084,47 +1084,47 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if( !xInfo.is() )
return;
- boost::unordered_set< OUString, OUStringHash > aSet;
- aSet.insert("ForbiddenCharacters");
- aSet.insert("IsKernAsianPunctuation");
- aSet.insert("CharacterCompressionType");
- aSet.insert("LinkUpdateMode");
- aSet.insert("FieldAutoUpdate");
- aSet.insert("ChartAutoUpdate");
- aSet.insert("AddParaTableSpacing");
- aSet.insert("AddParaTableSpacingAtStart");
- aSet.insert("PrintAnnotationMode");
- aSet.insert("PrintBlackFonts");
- aSet.insert("PrintControls");
- aSet.insert("PrintDrawings");
- aSet.insert("PrintGraphics");
- aSet.insert("PrintLeftPages");
- aSet.insert("PrintPageBackground");
- aSet.insert("PrintProspect");
- aSet.insert("PrintReversed");
- aSet.insert("PrintRightPages");
- aSet.insert("PrintFaxName");
- aSet.insert("PrintPaperFromSetup");
- aSet.insert("PrintTables");
- aSet.insert("PrintSingleJobs");
- aSet.insert("UpdateFromTemplate");
- aSet.insert("PrinterIndependentLayout");
- aSet.insert("PrintEmptyPages");
- aSet.insert("SmallCapsPercentage66");
- aSet.insert("TabOverflow");
- aSet.insert("UnbreakableNumberings");
- aSet.insert("ClippedPictures");
- aSet.insert("BackgroundParaOverDrawings");
- aSet.insert("TabOverMargin");
- aSet.insert("PropLineSpacingShrinksFirstLine");
- aSet.insert("SubtractFlysAnchoredAtFlys");
+ boost::unordered_set< OUString, OUStringHash > aExcludeAlways;
+ aExcludeAlways.insert("LinkUpdateMode");
+ boost::unordered_set< OUString, OUStringHash > aExcludeWhenNotLoadingUserSettings;
+ aExcludeWhenNotLoadingUserSettings.insert("ForbiddenCharacters");
+ aExcludeWhenNotLoadingUserSettings.insert("IsKernAsianPunctuation");
+ aExcludeWhenNotLoadingUserSettings.insert("CharacterCompressionType");
+ aExcludeWhenNotLoadingUserSettings.insert("FieldAutoUpdate");
+ aExcludeWhenNotLoadingUserSettings.insert("ChartAutoUpdate");
+ aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacing");
+ aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacingAtStart");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintAnnotationMode");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintBlackFonts");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintControls");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintDrawings");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintGraphics");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintLeftPages");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintPageBackground");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintProspect");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintReversed");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintRightPages");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintFaxName");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintPaperFromSetup");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintTables");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintSingleJobs");
+ aExcludeWhenNotLoadingUserSettings.insert("UpdateFromTemplate");
+ aExcludeWhenNotLoadingUserSettings.insert("PrinterIndependentLayout");
+ aExcludeWhenNotLoadingUserSettings.insert("PrintEmptyPages");
+ aExcludeWhenNotLoadingUserSettings.insert("SmallCapsPercentage66");
+ aExcludeWhenNotLoadingUserSettings.insert("TabOverflow");
+ aExcludeWhenNotLoadingUserSettings.insert("UnbreakableNumberings");
+ aExcludeWhenNotLoadingUserSettings.insert("ClippedPictures");
+ aExcludeWhenNotLoadingUserSettings.insert("BackgroundParaOverDrawings");
+ aExcludeWhenNotLoadingUserSettings.insert("TabOverMargin");
+ aExcludeWhenNotLoadingUserSettings.insert("PropLineSpacingShrinksFirstLine");
+ aExcludeWhenNotLoadingUserSettings.insert("SubtractFlysAnchoredAtFlys");
sal_Int32 nCount = aConfigProps.getLength();
const PropertyValue* pValues = aConfigProps.getConstArray();
SvtSaveOptions aSaveOpt;
- bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(),
- bSet = bIsUserSetting;
+ bool bIsUserSetting = aSaveOpt.IsLoadUserSettings();
// for some properties we don't want to use the application
// default if they're missing. So we watch for them in the loop
@@ -1161,10 +1161,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
while( nCount-- )
{
- if( !bIsUserSetting )
+ bool bSet = aExcludeAlways.find(pValues->Name) == aExcludeAlways.end();
+ if( bSet && !bIsUserSetting
+ && (aExcludeWhenNotLoadingUserSettings.find(pValues->Name)
+ != aExcludeWhenNotLoadingUserSettings.end()) )
{
- // test over the hash value if the entry is in the table.
- bSet = aSet.find(pValues->Name) == aSet.end();
+ bSet = false;
}
if( bSet )