diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-10 18:10:07 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2020-03-21 15:02:19 +0100 |
commit | d61012dd84dc418c8cd4e90122f431997aafa634 (patch) | |
tree | 76f0a66c2fe2c538a619c4b3d881036d2570c068 /sd | |
parent | tdf#100706: get blink cursor delay for MacOS (diff) | |
download | core-d61012dd84dc418c8cd4e90122f431997aafa634.tar.gz core-d61012dd84dc418c8cd4e90122f431997aafa634.zip |
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.
(cherry picked from commit 01dbb38680aa39a4d3bc7afd05d44a4b2c9bc6ab)
Conflicts:
vcl/qa/cppunit/pdfexport/pdfexport.cxx
Change-Id: Ic29e345d45bc7c944d65e6e450f1d742dd0e9f8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90551
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6f7510488a30..8bc98bbc6693 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1884,6 +1884,14 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides())) ) return; + if (pPDFExtOutDevData) + { + // Calculate the page number in the PDF output, which may be smaller than the page number in + // case of hidden slides. + sal_Int32 nOutputPageNum = CalcOutputPageNum(pPDFExtOutDevData, mpDoc, nPageNumber); + pPDFExtOutDevData->SetCurrentPageNumber(nOutputPageNum); + } + std::unique_ptr<::sd::ClientView> pView( new ::sd::ClientView( mpDocShell, pOut ) ); ::tools::Rectangle aVisArea( Point(), mpDoc->GetSdPage( static_cast<sal_uInt16>(nPageNumber) - 1, ePageKind )->GetSize() ); vcl::Region aRegion( aVisArea ); |