summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-07-20 11:54:26 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-07-20 13:35:40 +0200
commit49dca4be647733507b2082a9c74187076a4a8d9b (patch)
treee075ecbaa069c16b410d7e78d6e75a424317437a /vcl
parentad6f23d2a3842c40f7c812003af4031150ea8183 (diff)
tdf#154990 vcl: PDF export: incorrect checks of annotation struct parents
The first form annotation is missing /StructParent. The invalid value is -1, not 0. Typically 0 is the index of the MCIDs entry (m_aMCIDParents) in the ParentTree /Nums, but if there is not a single MCID in the document, this is omitted and 0 may be a valid annotation then. Change-Id: I9885d176eae272d98000f9d9f0ffae82558c0ea0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154668 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 5765426375ba..42f85d42bb76 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -3641,7 +3641,7 @@ bool PDFWriterImpl::emitScreenAnnotations()
// End Action dictionary.
aLine.append("/OP 0 >>");
- if (0 < rScreen.m_nStructParent)
+ if (-1 != rScreen.m_nStructParent)
{
aLine.append("\n/StructParent "
+ OString::number(rScreen.m_nStructParent)
@@ -3879,7 +3879,7 @@ we check in the following sequence:
}
aLine.append( ">>\n" );
}
- if( rLink.m_nStructParent > 0 )
+ if (rLink.m_nStructParent != -1)
{
aLine.append( "/StructParent " );
aLine.append( rLink.m_nStructParent );
@@ -4720,7 +4720,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
iRectMargin = 1;
}
- if (0 < rWidget.m_nStructParent)
+ if (-1 != rWidget.m_nStructParent)
{
aLine.append("/StructParent ");
aLine.append(rWidget.m_nStructParent);