From 8466fae95acff67b25272170b49deb47146d2971 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Thu, 31 Dec 2020 20:56:54 +0300 Subject: tdf#138544 sw LoadUserSettings: default EmptyDbFieldHidesPara This is the fourth patch in the series. When you start a new document, Writer compat setting "Hide paragraphs of database fields with an empty value" is on. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "on", instead of "off". This one was a bit different because it didn't initialize in the standard way. // for some properties we don't want to use the application // default if they're missing. So we watch for them in the loop // below, and set them if not found So I'm changing it to match the standard way, and adding the now familiar clause to cover the case when the LoadUserSettings is disabled. Change-Id: I979b01340000056567a4baa9ace27f9f9d15e9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108548 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/source/filter/xml/xmlimp.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sw/source/filter/xml/xmlimp.cxx') diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 13198a2f9cfc..1e8691ca827b 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1326,6 +1326,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bool bTabOverMarginValue = false; bool bPropLineSpacingShrinksFirstLine = false; bool bSubtractFlysAnchoredAtFlys = false; + bool bEmptyDbFieldHidesPara = false; bool bCollapseEmptyCellPara = false; const PropertyValue* currentDatabaseDataSource = nullptr; @@ -1423,6 +1424,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bPropLineSpacingShrinksFirstLine = true; else if (rValue.Name == "SubtractFlysAnchoredAtFlys") bSubtractFlysAnchoredAtFlys = true; + else if (rValue.Name == "EmptyDbFieldHidesPara") + bEmptyDbFieldHidesPara = true; else if (rValue.Name == "CollapseEmptyCellPara") bCollapseEmptyCellPara = true; } @@ -1599,6 +1602,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC if (!bSubtractFlysAnchoredAtFlys && bAreUserSettingsFromDocument) xProps->setPropertyValue("SubtractFlysAnchoredAtFlys", makeAny(true)); + if (!bEmptyDbFieldHidesPara && bAreUserSettingsFromDocument) + xProps->setPropertyValue("EmptyDbFieldHidesPara", makeAny(false)); + if (!bCollapseEmptyCellPara) xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false)); -- cgit