diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-12-31 17:45:39 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-01-07 15:30:44 +0100 |
commit | b8d9334b9d4cc03a9b7d1e570a35e0ac6ca42338 (patch) | |
tree | c6d3cdd67490d977f953ec44a7f849e4ff00a507 | |
parent | aa1ce583f0ad64b4ea5096c3ce9c6bd0a84794fe (diff) |
tdf#138544 sw LoadUserSettings: default PrinterIndependentLayout
I hope I understand this correctly.
In Options - Load/Save - General, there is option
"Load user-specific settings with the document" (default = true).
Turning this off seems to simply mean, don't read the settings in
Options - LibreOffice Writer - Compatibility from the document.
The assumption I guess is that this would instead use system defaults.
(Well, actually the user can "modify" these and "set as default".)
Well, that wasn't quite true in a few cases, like this one.
The general logic says "if the setting is not specified in the doc,
set to some old behaviour". And that makes sense. Of course there
is no setting in old documents - the concept didn't exist yet.
But when we explicitly exclude these user-enforceable
compat items, do we really want to force old behaviour
instead of current behaviour? And if the user has actually modified
these defaults, do we want to ignore the user's settings? I doubt it.
So here is the first patch.
When you start a new document, Writer compat setting
"Use printer metrics for document formatting" is off.
Now, when saving and reloading it with LoadUserSettings disabled,
it is still the program default of "off", instead of "on".
And if the user modifies it to always be on, it will still
turn on - so no regression there.
Change-Id: I13b236852da843ce72be16d79e2fdace1550523c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108545
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 956582987373..d0266ef31c28 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1296,7 +1296,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC }; SvtSaveOptions aSaveOpt; - bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(); + bool bAreUserSettingsFromDocument = 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 @@ -1336,7 +1336,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC for( const PropertyValue& rValue : aConfigProps ) { bool bSet = aExcludeAlways.find(rValue.Name) == aExcludeAlways.end(); - if( bSet && !bIsUserSetting + if( bSet && !bAreUserSettingsFromDocument && (aExcludeWhenNotLoadingUserSettings.find(rValue.Name) != aExcludeWhenNotLoadingUserSettings.end()) ) { @@ -1452,7 +1452,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC // introduce boolean, that indicates a document, written by version prior SO8. const bool bDocumentPriorSO8 = !bConsiderWrapOnObjPos; - if( ! bPrinterIndependentLayout ) + // Use old behaviour if this setting didn't exist, but only if this setting is being read from the document. + // (Obviously the setting doesn't exist if we are explicitly ignoring it, so then stick with program/user defaults) + if(!bPrinterIndependentLayout && bAreUserSettingsFromDocument) { xProps->setPropertyValue( "PrinterIndependentLayout", Any(sal_Int16(document::PrinterIndependentLayout::DISABLED)) ); } |