summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-07-20 11:54:26 +0200
committerAndras Timar <andras.timar@collabora.com>2023-07-31 21:41:16 +0200
commit7e38de6c11306a14b3b8ea67de712723e4083e5d (patch)
treedc7bf94256fe12d866bf790946cc657188ae42ae
parent9d7b52ce8469d0da082849a98127a929f8a9df16 (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> (cherry picked from commit 49dca4be647733507b2082a9c74187076a4a8d9b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154628 Reviewed-by: خالد حسني <khaled@libreoffice.org>
-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 47bf5edbaf48..2e79a3289ec3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -3644,7 +3644,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 ");
aLine.append(rScreen.m_nStructParent);
@@ -3877,7 +3877,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);