vcl/qa/cppunit/pdfexport/data/tdf167290.odt |binary vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 13 +++++++++++++ vcl/source/pdf/pdfwriterimpl_utils.cxx | 1 + 3 files changed, 14 insertions(+)
New commits: commit 0197d810c2e92e48d39b5484e014982ac864144e Author: Xisco Fauli <[email protected]> AuthorDate: Fri Feb 20 15:55:42 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Fri Feb 20 22:18:15 2026 +0100 tdf#167290: export CreationDate with DateTime format Otherwise, the validator fails with "The value of CreationDate entry from the document Info dictionary and its matching XMP property "xmp:CreateDate" are not equivalent (Info /CreationDate = D:20260220154049+01'00', XMP xmp:CreateDate = 2025-12-31T11:13:40.000+01) The call to osl_getDateTimeFromTimeValue was removed in commit 07ac61f2c67020ad2941462ea7081f06495bcb92 Author: Sarper Akdemir <[email protected]> Date: Mon Aug 28 11:16:34 2023 +0300 tdf#138792: PDF export: fix date of xmp:CreateDate for no apparent reason Change-Id: I4c6948769797a4e446239316de2857851b31565e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199886 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/vcl/qa/cppunit/pdfexport/data/tdf167290.odt b/vcl/qa/cppunit/pdfexport/data/tdf167290.odt new file mode 100644 index 000000000000..668123031c02 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf167290.odt differ diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index efef680693b4..334fee87abf5 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -1770,6 +1770,19 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152235) CPPUNIT_ASSERT_GREATEREQUAL(2, nArtifacts); // 1 watermark + 1 other thing } +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf167290) +{ + uno::Sequence<beans::PropertyValue> aFilterData(comphelper::InitPropertySequence({ + { "SelectPdfVersion", uno::Any(static_cast<sal_Int32>(1)) }, + })); + comphelper::SequenceAsHashMap aMediaDescriptor; + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; + vcl::filter::PDFDocument aDocument; + loadFromFile(u"tdf167290.odt"); + save(TestFilter::PDF_WRITER, aMediaDescriptor.getAsConstPropertyValueList()); + validate(TestFilter::PDF_WRITER); +} + CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf149140) { // Enable PDF/UA diff --git a/vcl/source/pdf/pdfwriterimpl_utils.cxx b/vcl/source/pdf/pdfwriterimpl_utils.cxx index f8a8bce60617..f76ad49afdb4 100644 --- a/vcl/source/pdf/pdfwriterimpl_utils.cxx +++ b/vcl/source/pdf/pdfwriterimpl_utils.cxx @@ -240,6 +240,7 @@ void computeDocumentIdentifier(std::vector<sal_uInt8>& o_rIdentifier, osl_getSystemTime(&aGMT); osl_getLocalTimeFromSystemTime(&aGMT, &aTVal); + osl_getDateTimeFromTimeValue( &aTVal, &aDT ); OStringBuffer aCreationMetaDateString(64); // i59651: we fill the Metadata date string as well, if PDF/A is requested
