diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-18 13:52:16 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-19 14:16:09 +0200 |
commit | 87e1a77a9aadb883386816dc4ebc3dad64c81892 (patch) | |
tree | 500b9143995a1f5699dca9467401801c3890610d /sc | |
parent | 9f9e195dbabe07244622924bf609ab4676f16993 (diff) |
tdf#156336 - sc ods: fix can't remove Calc comment metadata
Remove Calc comment metadata (author, date) during ods export
if the Remove personal information option is enable.
Change-Id: I814aabb734cff4160dccf1913a33aa270c2edbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158116
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 2ac992a20930..9acae7b1ec0d 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3714,16 +3714,22 @@ void ScXMLExport::exportAnnotationMeta( const uno::Reference < drawing::XShape > if (xCurrentShape.get()!=xShape.get()) return; + bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet( + SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo) && !SvtSecurityOptions::IsOptionSet( + SvtSecurityOptions::EOption::DocWarnKeepNoteAuthorDateInfo); + const OUString& sAuthor(pNote->GetAuthor()); if (!sAuthor.isEmpty()) { SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, true, false ); - Characters(sAuthor); + Characters( bRemovePersonalInfo + ? "Author" + OUString::number(SvXMLExport::GetInfoID(sAuthor)) + : sAuthor ); } - const OUString& aDate(pNote->GetDate()); + const OUString& aDate(bRemovePersonalInfo ? OUString("1970-01-01") : pNote->GetDate()); // Epoch time if (pDoc) { SvNumberFormatter* pNumForm = pDoc->GetFormatTable(); |