summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-01-25 13:01:24 +0100
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-01-26 07:08:19 +0100
commitba8911931c18e6a4cc737ffc9f0f415f1ba794d7 (patch)
tree47a072209e0700605ff07b2884858884aba6c289 /xmloff
parent3460799175e6c5795aa07c784e16d10ba9081d49 (diff)
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 <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/SettingsExportHelper.cxx10
1 files changed, 10 insertions, 0 deletions
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 <comphelper/diagnose_ex.hxx>
#include <comphelper/base64.hxx>
#include <comphelper/extract.hxx>
+#include <unotools/securityoptions.hxx>
#include <com/sun/star/linguistic2/XSupportedLocales.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
@@ -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 );
}
}