From ba8911931c18e6a4cc737ffc9f0f415f1ba794d7 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 25 Jan 2024 13:01:24 +0100 Subject: Don't export printer name & config in privacy mode Don't export printer name & printer config when RemovePersonalInfoOnSaving is enabled, as it might contain sensitive data such as printer location. Add an option to export printer settings even when RemovePersonalInfoOnSaving is enabled. Change-Id: I3d2ca91ad2032050c919d382c11c9ceabf331770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162577 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- xmloff/source/core/SettingsExportHelper.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xmloff') diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 8cd0519918a5..ea562f101959 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -276,8 +277,17 @@ void XMLSettingsExportHelper::exportSequencePropertyValue( { m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.StartElement( XML_CONFIG_ITEM_SET ); + bool bSkipPrinterSettings = SvtSecurityOptions::IsOptionSet( + SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo) + && !SvtSecurityOptions::IsOptionSet( + SvtSecurityOptions::EOption::DocKeepPrinterSettings); for (const auto& rProp : aProps) + { + if (bSkipPrinterSettings + && (rProp.Name == "PrinterSetup" || rProp.Name == "PrinterName")) + continue; CallTypeFunction(rProp.Value, rProp.Name); + } m_rContext.EndElement( true ); } } -- cgit