Files
loongoffice/vcl/qa/cppunit/pdfexport/data/link-wrong-page.odp
Miklos Vajna 01dbb38680 tdf#61274 sd PDF export: fix links ending up on wrong pages with hidden slides
SdPage::IsExcluded() decides if a slide is hidden,
SdXImpressDocument::render() checks for this and returns early if
needed. In that case PDFExport::ExportSelection() detects that the
produced metafile has no actions and avoids creating a PDF page.

Then Impress links are created using the
vcl::PDFExtOutDevData::CreateLink() call in
drawinglayer::processor2d::VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(),
not specifying the PDF page number explicitly. This means the link is
created on the "current" page number, set in
vcl::PDFExtOutDevData::SetCurrentPageNumber(), called by
PDFExport::ExportSelection(), but that filter/ code can't know about
hidden slides in sd/.

Fix the problem by setting the page number again in
SdXImpressDocument::render(), that way the link created by drawinglayer
will end on the correct page.

Change-Id: Ic29e345d45bc7c944d65e6e450f1d742dd0e9f8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90299
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-03-10 20:40:38 +01:00

12 KiB