summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-04-04 12:25:44 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-04-04 13:54:25 +0200
commit22fd7ccb913c55db14adf736859fc9e0e7f00630 (patch)
tree68ca696bbddc4a7cd8122de2c5f59e4e0dbbcd9f /vcl
parent250b820a24640a33d73a6e690e04e36be01cda28 (diff)
vcl: PDF export: fix erroneous MCID produced for 1st page
PDFWriterImpl::beginStructureElementMCSeq() emits a spurious MCID definition outside of any stream, before the 1st page: /Document<</MCID 1>>BDC % PDFPage::emit 1 0 obj <</Type/Page/Parent... This is because SwPageFrame is translated to a Document StructElem in EnhancedPDFExportHelper, but PDFPage::emit is called at a later time than when the page content stream is produced, so this is just wrong; an MCID inside the page content stream is pointless because that's an object already anyway, so just suppress this. Looks like other applications don't produce Document currently. Change-Id: Ic2e30e4125c0e97c8e47330c7a247f74efc18f98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150017 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index f5837c48ba7b..242172313940 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10622,6 +10622,9 @@ void PDFWriterImpl::beginStructureElementMCSeq()
{
if( m_bEmitStructure &&
m_nCurrentStructElement > 0 && // StructTreeRoot
+ // Document = SwPageFrame => this is not *inside* the page content
+ // stream so do not emit MCID!
+ m_aStructure[m_nCurrentStructElement].m_eType != PDFWriter::Document &&
! m_aStructure[ m_nCurrentStructElement ].m_bOpenMCSeq // already opened sequence
)
{