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
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>
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>
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>
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
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>
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>
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
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>
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>
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
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
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>
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
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>
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>
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>