From 0acac1a2741d47b98ae600800e2db0e7a5fb3efe Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 27 Jun 2024 09:23:08 +0200 Subject: xlsx: Don't export notes author when in privacy mode Change-Id: Id0b3f0aca7bd4e21f41c2a8307964423debcf5bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169616 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sc/qa/unit/data/xlsx/cell-note.xlsx | Bin 0 -> 7083 bytes sc/qa/unit/subsequent_export_test4.cxx | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 sc/qa/unit/data/xlsx/cell-note.xlsx (limited to 'sc/qa/unit') diff --git a/sc/qa/unit/data/xlsx/cell-note.xlsx b/sc/qa/unit/data/xlsx/cell-note.xlsx new file mode 100644 index 000000000000..9df212a2970f Binary files /dev/null and b/sc/qa/unit/data/xlsx/cell-note.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index a6e5802cf98f..fbf31673ada3 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -1917,6 +1917,26 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testChangesAuthorDateXLSX) pBatch->commit(); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testNotesAuthor) +{ + createScDoc("xlsx/cell-note.xlsx"); + + auto pBatch(comphelper::ConfigurationChanges::create()); + // Remove all personal info + officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch); + pBatch->commit(); + + save(u"Calc Office Open XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"xl/comments1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPathContent(pXmlDoc, "/x:comments/x:authors/x:author"_ostr, u"Author1"_ustr); + + // Reset config change + officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(false, pBatch); + pBatch->commit(); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit