913 Commits
Author SHA1 Message Date
Caolán McNamara b77bd9a0c8 pdf import: check the sizes before building the png scan lines
dismiss unreasonable sizes and ImageStream::getLine returns null when it
could not allocate its line buffer.

Change-Id: I193038c0ff8e2f0ed68235569fc72ff7028db2c2
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/10751
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit a463e295ab095ece7939997482f6d38cb8ca6a5a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210415
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-02 16:11:45 +02:00
Caolán McNamara 21124741e0 ofz: pdf, check record againsts max allowed size
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I51a31c1e09d2b5d5a413c5345c40998e032f09d6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6117
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit e230b10b7cd2d5d8623cdba0877ec68f67003690)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207659
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-06 13:06:56 +02:00
Caolán McNamara dcf16d610a ofz: pdf, clamp stream Length to the bytes actually read
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I155f3eddbd204069084b50f52f7cc6328fb053eb
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6118
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 332e8831e0b0e580dae0d77a0ec27bd267af6b29)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207660
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-06 12:29:35 +02:00
Xisco Fauli b08afae7e4 poppler: upgrade to 26.06
Downloaded from https://poppler.freedesktop.org/poppler-26.06.0.tar.xz

Change-Id: Idbcf3baf344f7400dad28d06e4a2b18118e647f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205964
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-04 09:04:34 +02:00
Muhammad Naeem 884db13b71 tdf#147021: Use std::size() instead of SAL_N_ELEMENTS in several modules
Verified: make Library_tk Library_lng CppunitTest_sax_xmlimport Library_PresentationMinimizer Executable_xpdfimport
Change-Id: I1b7c30fda2b72cdc3fe1cf6bf802f15624aee148
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204771
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2026-05-11 15:31:06 +02:00
Xisco Fauli a427db4f20 poppler: upgrade to 26.04
Downloaded from https://poppler.freedesktop.org/poppler-26.04.0.tar.xz

Change-Id: I1e43d4a63da2f380b613718a897c3973ec9e16ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203153
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-02 16:10:33 +02:00
Gabor Kelemen eb087d25b3 tdf#146619 Use more forward declarations in include/drawinglayer
Change-Id: I5911dfb1cfc2bfd291758334b69123cfbce559a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199387
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-22 12:08:33 +01:00
Mike Kaganski e18a815190 Use rtl::isAscii(Hex)Digit and o3tl::convertToHex
Since some code needs flexibility in error handling, where hardcoded
error value of -1 wasn't handy, o3tl::convertToHex was changed to
accept the error value as its template parameter.

Change-Id: Ifc771cc8fa29a801d4556dea969fc3ea7e620df5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199367
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-02-14 11:40:50 +01:00
Xisco Fauli 3c29b709cd poppler: upgrade to 26.02.0
* external/poppler/missinginclude.patch has been fixed upstream

Downloaded from https://poppler.freedesktop.org/poppler-26.02.0.tar.x

Change-Id: I7641b7b544e853a86563dbe312af4b36444dea8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198803
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-06 17:21:15 +01:00
Gabor Kelemen c8cc15d483 Fix some non self contained headers in module sd sdext
Change-Id: Ib574b48a30baa4d7bd7609cf31063fe860703a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196635
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-18 17:46:26 +01:00
shark 7eabaec02e tdf#165234 use lambdas instead of boost::bind
Change-Id: I502a783154fdced0526ac3dbcdf0d5b795fbb416
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197186
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2026-01-17 14:10:57 +01:00
Gabor Kelemen b63115f3fa tdf#146619 Use more forward declarations in include/vcl/[d-g]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[d-g]*

This shaves off about 150M input

Change-Id: I2b15257451d4b392dca3e5d07f4a443ee653b04c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196395
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-11 21:38:37 +01:00
Mike Kaganski 2d68362dac enable-msvc-analyze: C6011: Dereferencing NULL pointer
C:\lo\build\workdir\UnpackedTarball\poppler\poppler\Object.h(258) :
warning C6011: Dereferencing NULL pointer 'cString'. See line 257 for an
earlier location where this can occur.: Lines: 254, 255, 256, 257, 258

See https://gitlab.freedesktop.org/poppler/poppler/-/issues/1658.

Change-Id: Id6778ad6f2d04dfbc2a1ef753bd0b6bda55ababc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196953
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-01-10 15:02:10 +01:00
Xisco Fauli b307d254a8 poppler: upgrade to 26.01.0
Adapt external/poppler/poppler-config.patch.1 after
commit 808094b11c07b1895bc9a1d03e338584045e6087
Author: Albert Astals Cid <aacid@kde.org>
Date:   Fri Dec 5 01:59:41 2025 +0100

    cmakedefine -> cmakedefine01

Downloaded from https://poppler.freedesktop.org/poppler-26.01.0.tar.xz

Change-Id: I8cf88d535e6fbd85fa0761fa23ac790c01711e01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196684
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-01-08 22:40:24 +01:00
Mike Kaganski 7b04ef05cd Drop some uses Sequence::getConstArray
Similar to commit b280efcb9b
(Drop some uses Sequence::getConstArray, 2025-12-07).

Change-Id: Ieac325a660fe64e8172c5ed139380caa3d26a73c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195200
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-12-08 10:00:21 +01:00
Đoàn Trần Công Danh 89841fc694 Fix memory leak with poppler-25.10.0
https://gerrit.libreoffice.org/c/core/+/192743, which fixes ftbfs with
poppler 25.10.0, unfortunately introduced a memory leak when building
with poppler 25.10.0 or later.  `pOwnerPasswordStr' and
`pUserPasswordStr' ownership are supposed to be transfered to
`pDocUnique', but is now orphaned.

This change fix that said memory leak.

Change-Id: I545d461c07f033b41a4276665483b44fa401a3bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192645
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-10-24 09:56:14 +02:00
Xisco Fauli ae83e57750 poppler: upgrade to 25.10
Downloaded from https://poppler.freedesktop.org/poppler-25.10.0.tar.xz

Change-Id: I05f89f4177312a148a5a15cd1f1b206d1dc01a86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192743
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-10-20 21:19:32 +02:00
Noel Grandin 40e5bc6e68 lets have just one getB2DRange function/method
Change-Id: I5081abca177c6fb8bd21d971d93dc115d57de294
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192589
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-10-19 12:13:53 +02:00
Xisco Fauli b4e581f3e3 poppler: upgrade to 25.09.0
Downloaded from https://poppler.freedesktop.org/poppler-25.09.0.tar.xz

Change-Id: Ic7f3abd64d129543dcdc370816a0d69e5a59be90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190513
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-02 12:35:00 +02:00
Mike Kaganski f0b6299a8e Simplify PDF signature search using std::search
Change-Id: I143b195e23d0e4969744ec7eca6e7d365dab9e0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190290
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-27 19:43:08 +02:00
Caolán McNamara 05fb33a429 cid#1662135 Variable copied when it could be moved
and

cid#1660117 Variable copied when it could be moved
cid#1659950 Variable copied when it could be moved
cid#1659946 Variable copied when it could be moved
cid#1659945 Variable copied when it could be moved
cid#1659936 Variable copied when it could be moved
cid#1659933 Variable copied when it could be moved

Change-Id: Ib6cbb6751a230e62b416b33ca082b279a2ecb878
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189318
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-08-10 22:32:18 +02:00
Dr. David Alan Gilbert 393f24a891 sdext,pdfimport: cid#1662134: Uninitialized members
Change-Id: I2fc93feb4f48bcd8e1d4eaa3f7291878505c813f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189316
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-08-10 22:01:35 +02:00
Dr. David Alan Gilbert 2383fae366 tdf#44729 sdext,pdfimport: Hide transparency groups 'for soft mask'
In PDF, 'Transparency groups' are used to group objects for compositing.
One variant of those is a transparency group that doesn't actually
get directly composited, but is used as a 'soft mask' to modulate
the effects of another group when the other group is composited.

So far we've not done anything for transparency groups, where
softmasks are used that means the softmask gets rendered as a visible
object - often a big semi-transparent polygon covering the rest.

Add 'group' elements into the tree for Transparency Groups and mark
them.
During tree walks skip the 'for soft mask' transparency groups.

This improves tdf#44729 which prior to this patch is mostly
seen as a big black page because it's covered with the soft mask
misrendering.

Since it also stored the transparency group it also means we can
attack the real rendering of those later.

Change-Id: Ieb1eb56b15d8def5c842c1d84349173ccca630dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188455
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2025-08-09 15:54:58 +02:00
Dr. David Alan Gilbert e750353139 tdf#44729 sdext,pdfimport: Add Group elements
Add a new tree element 'group' which represents a collection of other
elements but doesn't necessarily give a specific output node.
Later patches will add some flags and use those to change the output.

Change-Id: I981d345873436f6f9ffc9de67123f38de1e3d86a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188454
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-08-09 15:54:49 +02:00
Dr. David Alan Gilbert 56d8b1a916 tdf#44729 sdext,pdfimport: Route transparency group down
Route the calls from the wrapper down to the pdfiprocessor layer.

Change-Id: I646adf4acc884cccecd08da6fcdca4cfa8841954
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188453
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-08-09 14:59:55 +02:00
Dr. David Alan Gilbert f365a63a4a tdf#44729 sdext,pdfimport: Pass begin/end Transparency Group
Pass the begin/end of transparency groups down from the wrapper,
for now just with the 'forSoftMask' flag.

Change-Id: Id3f69a943a16166106ce23cb600cc85c26c505ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188452
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-08-09 14:59:43 +02:00
Caolán McNamara b1ec05b4b1 cid#1662031 Variable copied when it could be moved
and

cid#1660225 Variable copied when it could be moved
cid#1660211 Variable copied when it could be moved
cid#1660185 Variable copied when it could be moved
cid#1660173 Variable copied when it could be moved
cid#1660168 Variable copied when it could be moved
cid#1660166 Variable copied when it could be moved
cid#1660165 Variable copied when it could be moved
cid#1660163 Variable copied when it could be moved
cid#1660152 Variable copied when it could be moved
cid#1660149 Variable copied when it could be moved
cid#1660147 Variable copied when it could be moved
cid#1660145 Variable copied when it could be moved
cid#1660142 Variable copied when it could be moved
cid#1660140 Variable copied when it could be moved
cid#1660137 Variable copied when it could be moved
cid#1660136 Variable copied when it could be moved
cid#1660135 Variable copied when it could be moved
cid#1660128 Variable copied when it could be moved
cid#1660124 Variable copied when it could be moved
cid#1660122 Variable copied when it could be moved
cid#1660117 Variable copied when it could be moved
cid#1660114 Variable copied when it could be moved
cid#1660110 Variable copied when it could be moved
cid#1660109 Variable copied when it could be moved
cid#1660105 Variable copied when it could be moved
cid#1660104 Variable copied when it could be moved
cid#1660102 Variable copied when it could be moved
cid#1660100 Variable copied when it could be moved
cid#1660098 Variable copied when it could be moved
cid#1660080 Variable copied when it could be moved
cid#1660079 Variable copied when it could be moved
cid#1660078 Variable copied when it could be moved
cid#1660075 Variable copied when it could be moved
cid#1660071 Variable copied when it could be moved
cid#1660070 Variable copied when it could be moved
cid#1660064 Variable copied when it could be moved
cid#1660063 Variable copied when it could be moved
cid#1660060 Variable copied when it could be moved
cid#1660058 Variable copied when it could be moved
cid#1660053 Variable copied when it could be moved
cid#1660050 Variable copied when it could be moved
cid#1660049 Variable copied when it could be moved
cid#1660046 Variable copied when it could be moved
cid#1660042 Variable copied when it could be moved
cid#1660028 Variable copied when it could be moved
cid#1660023 Variable copied when it could be moved
cid#1660022 Variable copied when it could be moved
cid#1660021 Variable copied when it could be moved
cid#1660020 Variable copied when it could be moved
cid#1660017 Variable copied when it could be moved
cid#1660013 Variable copied when it could be moved
cid#1660005 Variable copied when it could be moved
cid#1660003 Variable copied when it could be moved
cid#1659999 Variable copied when it could be moved
cid#1659998 Variable copied when it could be moved
cid#1659995 Variable copied when it could be moved
cid#1659993 Variable copied when it could be moved
cid#1659989 Variable copied when it could be moved
cid#1659988 Variable copied when it could be moved

Change-Id: I2a30c8a2ac8785050d49b98635b0b406535b185a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189056
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2025-08-07 20:51:26 +02:00
Andrea Gelmini 684b987fa5 Fix typo
Change-Id: I1849b05acd6cd2553375b2375810862c12ffbf7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188419
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-07-26 20:22:42 +02:00
Dr. David Alan Gilbert a102aeb72c sdext,pdfimport: Fix opacity during axial fills
There's a corner case where some fills use the stroke opacity
rather than the fill opacity;  Poppler has a test case for this
for the axial case, and a comment saying they've compared it
with acroread but can't find any spec wording for it.

It's the top left box of:
  https://gitlab.freedesktop.org/poppler/poppler/-/issues/178

We can enable it for other fills if we find examples.

Change-Id: Ib5d34494f2e5ed2cb964d407599f06530f34283e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187455
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-07-25 02:11:12 +02:00
Dr. David Alan Gilbert 2f2f56f47f sdext,pdfimport: Fix stroke clipping
The bounding clipping I added back in:
  abfbca2719 ("tdf#85428: Clip strokes")

breaks 'thick' closed polygons, losing the closed flag.
That's fixed by changing the bStroke flag to the clipper
like done in svdpdf.cxx and svdfmtf.cxx

This fixes the rendering of the top right box in:
  https://gitlab.freedesktop.org/poppler/poppler/-/issues/178

Change-Id: Ib2ef27bef9860420b231cceaa2b0568c443d7f2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187435
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-07-11 00:32:25 +02:00
Dr. David Alan Gilbert 744b0b4634 sdext,pdfimport: Fix stroke opacity export
updateStrokeColor was reading the Fill opacity not the stroke opacity.

Fixes opacity of the top right box in:
  https://gitlab.freedesktop.org/poppler/poppler/-/issues/178

Change-Id: Ie35d99a085df41b902185510b7801d58c409c532
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187410
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2025-07-09 23:04:01 +02:00
Caolán McNamara e75369aff8 use gperf -fpic friendly version mode
nm -S --size-sort --print-size instdir/program/libmergedlo.so| grep ' [Dd] ' | c++filt | tail -n 10

before:
... 00000000000027f0 d aFmFormShellSlots_Impl
... 0000000000002920 d pRGBTable
... 0000000000003b80 d vcl::pdf::BuildinFontFace::m_aBuildinFonts
... 0000000000004140 d C.16.0
... 0000000000004d80 d (anonymous namespace)::aMethods
... 00000000000066a8 d aRTFTokenTab
... 000000000000cf60 d xmloff::(anonymous namespace)::wordlist
... 000000000000cf60 d xmloff::token::getNames(int)::{lambda()#1}::operator()() const::sppcTokenNames
... 00000000000172c0 d oox::(anonymous namespace)::wordlist
... 00000000000172c0 d oox::TokenMap::getUtf8TokenName(int)::{lambda()#1}::operator()() const::sppcTokenNames

after:
... 0000000000002790 d STR_ARR_SVT_LANGUAGE_TABLE
... 00000000000027a8 d RID_STRLIST_FUNCTION_NAMES
... 00000000000027f0 d aFmFormShellSlots_Impl
... 0000000000002920 d pRGBTable
... 0000000000003b80 d vcl::pdf::BuildinFontFace::m_aBuildinFonts
... 0000000000004140 d C.16.0
... 0000000000004d80 d (anonymous namespace)::aMethods
... 00000000000066a8 d aRTFTokenTab
... 000000000000cf60 d xmloff::token::getNames(int)::{lambda()#1}::operator()() const::sppcTokenNames
... 00000000000172c0 d oox::TokenMap::getUtf8TokenName(int)::{lambda()#1}::operator()() const::sppcTokenNames

See also: https://www.akkadia.org/drepper/dsohowto.pdf

Change-Id: Ic1141c466d06d79d71e573c5f283cd1f089d7067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187578
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-09 16:49:00 +02:00
Gabor Kelemen 3ad35d16ec USE_ASSIGN_ACTOR is never defined
since 2009 commit ef43d23e18

Change-Id: Ie2594a11fb52be469edd337c7c575c96425adb49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187106
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-07-01 09:36:42 +02:00
Mike Kaganski 35256f5b36 Let Hash take const void* instead of const unsigned char*
It makes no sense to insist on a random type, only to reinterpret_cast
it everywhere. An opaque void fits the case perfectly.

Change-Id: If945b1c59d98c5f561350db649f29fe8036e7cdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186982
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-06-26 06:38:59 +02:00
Xisco Fauli 04b92e6eab tdf#167010: fix build when poppler is older than 25.2.0
After
commit 4f13305178
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Wed Apr 2 16:27:00 2025 +0200

    poppler: upgrade to 25.04.0

and the upstream commit
commit 5d71c95d08aa0e097f711254e1c69ee0cf275328
Author: Nelson Benítez León <nbenitezl@gmail.com>
Date:   Sun Jan 5 21:33:23 2025 +0000

    Detect malformed Streams in Annot Appearances

Change-Id: Id308aac0331a77aca88ebf8e31bf3aa0a688533a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186599
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-06-18 08:47:24 +02:00
Dr. David Alan Gilbert 32534b76ea tdf#162826: Move pdf pwdinteract
Move sdext's pwdinteract that provides getPassword() into vcl/source/pdf
so it can also be used for the PDFium based import.

Change-Id: Iab0f6fd0814986622624cdb2c523f1c60caddcc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185470
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2025-06-13 22:03:52 +02:00
Mike Kaganski b42fad8a35 Use ReadLine taking OStringBuffer to reduce allocations
Change-Id: Ib180a1c67346eb6ce8cfbb6549b6e31e1b7911a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186073
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-05-31 16:53:45 +02:00
Gabor Kelemen 9bc5b89c14 Remove obsolete fw declarations from sdext/
found with bin/find-unneeded-includes --fwdecl

Change-Id: I63327d7a046d7fc781e6c9c793cb7dc8990754d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183902
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-05-09 15:42:21 +02:00
Xisco Fauli 0ee2636304 poppler: uggrade to 25.05
Downloaded from https://poppler.freedesktop.org/poppler-25.05.0.tar.xz

Change-Id: Icd2b318cc01bedc5baeb4445a463a136ed6d7c48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184953
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-05-05 11:12:22 +02:00
Caolán McNamara d2d70d8a31 cid#1646742 Dereference after null check
Change-Id: Id159ca8de614671db51fafb0e487d4d4f4548fbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184703
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-04-28 11:35:37 +02:00
Caolán McNamara 36d9217cb4 cid#1646746 COPY_INSTEAD_OF_MOVE
Change-Id: I6e0ef99fd8bf4240e9b79bc0fca0257d80419509
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184701
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-04-28 11:35:22 +02:00
Noel Grandin fbe05bc89a loplugin:bufferadd extend it to find some more places
where we can simplify *StringBuffer usage

Change-Id: Ic2005b886b486a6627a43f8dcfba3258cb168921
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184428
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-04-22 11:53:07 +02:00
Andrea Gelmini 5f01c903ef Fix typo
Change-Id: Ia182a613e0252ba5aece75647f3d4c0aac0a18d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184411
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-04-22 09:56:45 +02:00
Andrea Gelmini df48b8f02c Fix typo
Change-Id: I90e161f632880a41634c4e8225501623899d2648
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184410
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-04-22 09:54:39 +02:00
Dr. David Alan Gilbert 6acfaaca97 sdext,pdfimport: Update password helper to use DocumentPasswordRequest2
PDFPasswordRequest currently uses task::DocumentPasswordRequest
but the test harnesses TestInteractionHandler only
supports DocumentPasswordRequest2.
So update to use '2', the only difference seems to be a flag to
say whether we're opening or modifying a file, in the PDF import
it's always a case of opening.

Change-Id: I9822179db344fff3743e8c25a0c222338c1ad49e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184081
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-04-22 04:39:51 +02:00
Dr. David Alan Gilbert 7bf563ff45 sdext,pdfimport: Fix password encoding on plain PDF import
Use ISO_8859_1 rather than UTF8.
Found on the 'encrypted_hello_world_r2.pdf' in the PDFium source.

Fixes: 2bbe15a2ce ("tdf#55425 sdext,pdfimport: Replace checkEncryption")
Change-Id: If69c897235352fd0133306004094edf9f9765020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183994
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-22 04:39:35 +02:00
Dr. David Alan Gilbert d629416be0 tdf#55425, tdf#66580: sdext,pdfimport: embeddedFile password entry
Add password entry for the new embeddedFile based detection.

Note that we need to decrypt to be able to get pdfium to open the
PDF at all, and fundamentally it's needed to read the filename.
But that does mean we need the password during the detect phase.

Change-Id: I67473158863ac6eb2ee389659449cf3b5582c579
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183860
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-04-22 04:39:02 +02:00
Dr. David Alan Gilbert 7c46138b61 tdf#55425, tdf#66580: sdext,pdfimport: Tame password prompts
If one stage in the PDF detect asks for a password and the user
tries and gives up, don't try asking for it again.
After the next patch we've got another place that asks, so it can
get annoying.

Change-Id: I83f670cb452bed17443330b27b10b6a8224427af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183993
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-22 04:37:56 +02:00
Dr. David Alan Gilbert f3fd83098f tdf#55425,tdf#66580: sdext,pdfimport: Always stash password
Always stash the password in the detect phase, even if it's not
a hybrid.  This lets the plain PDF import use that password.

Change-Id: Iebcd85428ebf81ea483543892687cf2ed56473ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183992
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-22 04:37:35 +02:00
Dr. David Alan Gilbert 0d4d256309 tdf#55425, tdf#66580: sdext,pdfimport: Extract the embedded file
At this point we're pretty sure the embedded file is a hybrid.   Extract
it.

Change-Id: Id1aa42136692a1500a08455c6e7af5af3576b431
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183952
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-22 04:37:20 +02:00