vcl/source/gdi/pdfwriter_impl.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
New commits: commit 3545c0c0b991e5b9438d890f48dd10c4a60f2090 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Mar 21 12:53:04 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Wed Mar 22 14:00:59 2023 +0000 vcl: PDF export: simplify version checks The constructor converts PDF_A_1 etc versions to the underlying PDF versions and a boolean flag, so almost all of the PDFWriterImpl code needs to check only the base PDF versions. Change-Id: I0a74f532f7ed2473acc73eabc8a59eff25396672 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149260 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3fe6430fc000..52bd77e3ebc4 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -752,8 +752,7 @@ bool PDFPage::emit(sal_Int32 nParentObject ) aLine.append( ((i+1)%15) ? " " : "\n" ); } aLine.append( "]\n" ); - if (m_pWriter->m_aContext.Version != PDFWriter::PDFVersion::PDF_A_1 - && PDFWriter::PDFVersion::PDF_1_5 <= m_pWriter->m_aContext.Version) + if (PDFWriter::PDFVersion::PDF_1_5 <= m_pWriter->m_aContext.Version) { // ISO 14289-1:2014, Clause: 7.18.3 aLine.append( "/Tabs(S)\n" ); @@ -10612,8 +10611,7 @@ const char* PDFWriterImpl::getStructureTag( PDFWriter::StructElement eType ) } if (eType == PDFWriter::Annot - && (m_aContext.Version == PDFWriter::PDFVersion::PDF_A_1 - || m_aContext.Version < PDFWriter::PDFVersion::PDF_1_5)) + && m_aContext.Version < PDFWriter::PDFVersion::PDF_1_5) { return "Figure"; // fallback } @@ -11156,7 +11154,6 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr if (eVal == PDFWriter::Row || eVal == PDFWriter::Column || eVal == PDFWriter::Both) { if (eType == PDFWriter::TableHeader - && m_aContext.Version != PDFWriter::PDFVersion::PDF_A_1 && PDFWriter::PDFVersion::PDF_1_5 <= m_aContext.Version) { bInsert = true; @@ -11177,7 +11174,6 @@ bool PDFWriterImpl::setStructureAttribute( enum PDFWriter::StructAttribute eAttr if (eVal == PDFWriter::Header || eVal == PDFWriter::Footer || eVal == PDFWriter::Watermark) { if (eType == PDFWriter::NonStructElement - && m_aContext.Version != PDFWriter::PDFVersion::PDF_A_1 && PDFWriter::PDFVersion::PDF_1_7 <= m_aContext.Version) { bInsert = true;