diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-12-17 22:39:59 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-12-26 07:52:59 +0100 |
commit | fe40cf26a3b416e4d3a71d4164f94ea10b68631e (patch) | |
tree | 42b6a9a25ce2bef5cb98ce21a52643a598abfad0 /vcl/source | |
parent | cb906a62d1df4be5988a85eed9b63505c78a72ff (diff) |
pdf: /Win entry is deprecated in PDF 2.0 for launch actions
/Win is deprecated, as well as /Mac and /Unix (which we don't
write), so instead write /F directly, not under /Win entry.
Change-Id: Ic6b71f6e7aba8d5e4a22e678f82fa5a70d9b7c5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178674
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178776
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 11badef65241..84e40b463fe9 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3678,10 +3678,21 @@ we check in the following sequence: aLine.append( "/A<</Type/Action/S"); if( bIsUNCPath ) // handle Win UNC paths { - aLine.append( "/Launch/Win<</F" ); - // INetURLObject is not good with UNC paths, use original path - aWriter.writeLiteralEncrypt(url, rLink.m_nObject, osl_getThreadTextEncoding()); - aLine.append( ">>" ); + aLine.append("/Launch"); + // Entry /Win is deprecated in PDF 2.0 + if (m_aContext.Version >= PDFWriter::PDFVersion::PDF_2_0) + { + // So write /F directly. AFAICS it's up to PDF viewer to resolve this correctly + aWriter.writeKeyAndLiteralEncrypt("/F", url, rLink.m_nObject, osl_getThreadTextEncoding()); + } + else + { + aLine.append("/Win"); + aWriter.startDict(); + // INetURLObject is not good with UNC paths, use original path + aWriter.writeKeyAndLiteralEncrypt("/F", url, rLink.m_nObject, osl_getThreadTextEncoding()); + aWriter.endDict(); + } } else { |