Commit Graph
358 Commits
Author SHA1 Message Date
Xisco Fauli 211b320492 CppunitTest_filter_pdf: drop unused condition
Change-Id: I90a89e34e4b240ab01f0e125684291b10897b904
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209282
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-19 11:31:45 +02:00
Miklos Vajna 379714cd65 tdf#166779 engine filter: test "use model first to obtain selection"
Fails with commit 58ba249df5 (tdf#166779:
use model first to obtain selection, 2025-05-29) reverted.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4534e44219c7a1507c4909e5aa5dc1afb7e21617
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2196
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit dee5e7fe025a8019b70da4866e0554cf20ccf1ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206356
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-12 14:38:23 +02:00
Khaled Hosny 6857ff0ef8 tdf#118792: Add support for font-variation-settings in SVG export
Change-Id: If560fee38f7b97349264477404eee82f3b7b2cc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203287
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-08 10:09:49 +02:00
Samuel Mehrbrodt 491a8a566a tdf#168135 Add test
Ensures that sub- and superscripted text have the same height

Change-Id: I5fb65f1317462d17d26200a0b547e0ec0e7cb38d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202184
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
2026-03-23 09:26:45 +01:00
Xisco Fauli efaa7a2a87 CppunitTest_filter_textfilterdetect: split single test into different ones
it fails on Windows

Change-Id: Iba2a045c963e06a79d3222bb6327acb5074940b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201118
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-03-06 15:35:47 +01:00
Xisco Fauli ba3fb9026c merge UnoApiText and UnoApiXmlTest
in preparation for a follow-up commit

Change-Id: I3449c031696fe3ab13d4832e2671da08eb483cdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199552
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-18 21:17:13 +01:00
Xisco Fauli 3696d3d9b9 UnoApiTest: deactivate lok in tearDown
Change-Id: I8fbacbb7fe0e3ec3e9fc4801e345b2ffbdc9c8cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199537
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-02-17 16:29:31 +01:00
Xisco Fauli 6577d2a942 UnoApiTest: merge loadFromURL and loadWithParams into one
Change-Id: Ib58c211542018f07303cadacda86e3419062401e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199297
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-12 20:58:05 +01:00
Xisco Fauli a9491be1f1 filter, xmloff, svx, oox: only load one document per test
Change-Id: Ibb07c8069e6ce8965739c7ccef52c41bb1f04422
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198968
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-02-09 17:02:24 +01:00
Xisco Fauli d2c12c44fe UnoApiTest: merge save and saveWithParams into one
it allows to simplify the code a bit since the
TestFilter is passed as the first parameter.

In preparation for a follow-up commit

Change-Id: I316c88e1583dc7d9b04876883b971bdfa54e8967
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198588
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-03 16:49:32 +01:00
Mike Kaganski 4ed617ea72 Use ScopedConfigValue in places where the values weren't restored
The config changes that didn't restore initial values could potentially
affect other tests in the same test suite, so that could create test
order dependency.

Change-Id: I53cc2fe4e545852d0bcec865da31f2e2a7896d40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198505
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-02-02 10:02:08 +01:00
Xisco Fauli 46d70b0278 tdf#168054: filter_svg: Add tests
Change-Id: Ie32e143762436d43247563f6ca01a1c4ecc7f431
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198325
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-01-28 23:00:23 +01:00
Mike Kaganski c103d337bd tdf#170396: implement SVG export support for dashed lines
Commit b71d9a6d15 (do not apply line dashing
in drawinglayer (tdf#136957), 2021-04-29) made sure that metafiles pass
dashing information in LineInfo of MetaPolyLineAction, instead of altering
the polyline itself. Since SVG export ignored dashing information in
MetaPolyLineAction, the exported lines were solid since that patch.

This patch introduces respective export support, emitting stroke-dasharray
attribute. As far as I see, it has exactly the same semantics, and renders
correctly in chrome and firefox. It also imports OK into Draw.

Ref: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/stroke-dasharray

Change-Id: Ifb634a4f3608ee5c2c76727ef4416b80f8f90709
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197618
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-01-20 10:13:30 +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
Xisco Fauli d41090ffd1 tdf#169154: filter_textfilterdetect: Add test
Change-Id: Ie89ba838fe33b2143ba8f97867837e5696150c19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196193
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-12-24 15:13:29 +01:00
Mike Kaganski 7f198b27f4 Drop class utl::MediaDescriptor, and use comphelper::SequenceAsHashMap
utl::MediaDescriptor was just a SequenceAsHashMap with a few added
methods. It made it more difficult to assign a SequenceAsHashMap to
MediaDescriptor, without real upsides. In many places, the class was
used not as media descriptor, but just as helper to create sequences.

This change puts the string constants and the former methods into a
namespace utl::MediaDescriptor.

It would be also good to drop comphelper::NamedValueCollection, which
is basically a twin of comphelper::SequenceAsHashMap (TODO).

Change-Id: Ia9b69c5a2ad153ecc654944c419c1880252ed86e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-12-06 18:18:32 +01:00
Gabor Kelemen 663551c5c4 tdf#146619 Run IWYU again on include/test
Change-Id: Ia2fe7435e0fbd6185c40655cd6c5ae93d39c7963
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193916
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2025-11-30 18:25:35 +01:00
Jussi Suominen 6642f0baa4 tdf#168520 Rename testTdf114428 to testTdf114428_ignore_xml_declaration
Change-Id: I64926ad99b73ff5d68de62003e26d0bddc327475
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194372
Code-Style: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2025-11-25 13:05:05 +01:00
Xisco Fauli 801dc48c6f UnoApiTest: Add enum for filter names
and use it in save/saveAndReload

Change-Id: I3d82ab54119ab6c35587ea706c82254a5c39dbd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194158
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-11-18 21:11:02 +01:00
Jaume Pujantell c37dafb727 lok: pdf: recalculate margin comment size
After commit 3a633abe5c6a884d152c73737debe215a980c79d "lok: pdf export
comments in margin", on online comments from pages 2 and above were
printed as if the space was much smaller, with one or two characters per
line. This patch fixes that.

It also changes the pdf export test to not have to use things internal
to the sw module.

There is no accompanying test to this change because due to differences
between how the test suits runs LOK and how online does it, the issue
can't be reproduced in a cpp unit test.

Change-Id: Ie603c74dc5fa4bc320102e7144535735e47f89a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191641
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9ff8618f0f224d42af8d35bbafbe3850ed4a2093)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192737
Reviewed-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Tested-by: Jenkins
2025-10-20 21:57:30 +02:00
Jaume Pujantell 2d2166759e lok: pdf export comments in margin
Enable print comments in margin for PDF in LOK without tiled comments.
Right now comments are only printed if they are being shown in the LO
document which excludes LOK without tiled comments. Also the post-it
manager and annotation window assume in some places that MapMode is used
and correctly set, which is not the case in LOK.

Adapted an existing test about printing comments in margin to test also
for LOK.

Change-Id: I362cb89ade6d4f53832fd9a722196d214360aae6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189511
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3a633abe5c6a884d152c73737debe215a980c79d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192728
Tested-by: Jenkins
Reviewed-by: Jaume Pujantell <jaume.pujantell@collabora.com>
2025-10-20 17:33:05 +02:00
Ujjawal Kumar bec29bda90 tdf#162153 Unit tests for Markdown Filter
Change-Id: I45cbc3ecbe0434ef7c852433266a8957c98ae365
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187449
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
Tested-by: Jenkins
2025-07-11 11:23:14 +02:00
Mike Kaganski a6eb3588d9 tdf#166789: use text width from DXArray in MetaActionType::TEXTARRAY
DXArray gives much more reliable data compared to font width, which
is known to require complex corrections (see tdf#127471 and commit
3d33e4ce39).

This fix uses tspan's `lengthAdjust` and `textLength` attributes for
automatic justification, which are already documented as early as in
SVG 1.0 ( https://www.w3.org/TR/SVG10/text.html#TSpanElement ). This
works in LibreOffice and in Chrome, but is not supported in Firefox
yet ( see https://bugzilla.mozilla.org/show_bug.cgi?id=890692 ).

I considered using these attributes on `text` element level, which
is supported in both browsers - but that breaks text elements with
multiple tspans. The `transform` attribute can't be used with tspan
both in Chrome and in Firefox, which creates the same problem, and
has an additional drawback that tspan offsets need tweaks.

Change-Id: I7d4bbb7542a9d60e53bdf6f6cac7fae0729e6e48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186033
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-05-30 16:34:32 +02:00
Jonathan Clark 235aebe31e tdf#91315 Implemented RTL support for SVG export
Previously, the direction attribute was not set on text tags when
exporting RTL text to SVG. This change adds the missing attribute.

Change-Id: I57770c1cc44f10c3c43ccac2f5a17c1422c34d35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176869
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-11-20 19:42:35 +01:00
Xisco Fauli a38a22c7e5 UnoApiTest: rename load to loadFromURL and use it everywhere
Change-Id: Ie67eebec74f783fa0c29acfb23bb83bc582812b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175724
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-29 09:11:37 +01:00
Miklos Vajna 1e75155c69 cool#9992 lok doc sign: allow injecting sign cert/key during pdf export
Interactive signing via the .uno:Signature command parameters were
possible, but headless PDF export had no similar parameters.

The primary difference is that the interactive signing works with the
sign certificate of the SfxViewShell, while PDF export has its own
vcl::PDFWriter::PDFWriterContext::SignCertificate.

Fix the problem similar to what commit
80723fccbb (filter: allow PDF export to
sign from the cmdline, 2022-02-03) did, but here we don't refer to an
already configured sign certificate by name, we take the sign cert/key
from parameters instead.

Test this in the NSS case where it's known to work, ignore the mscng
signing case for now.

Change-Id: Ib0c171736d2554fb3678ae4b8842541c43f9f3dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175644
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-10-25 17:01:33 +02:00
Mike Kaganski 8f25697591 tdf#163295: XMLFilterDetect: make sure to only detect own types
Since commit 872dba61a1 (INTEGRATION:
CWS xmlfilter01 (1.1.2.3.2.1.16); FILE MERGED, 2003-04-04),
XMLFilterDetect service uses Clipboardformat field in filterdetect.
Thus, it detects any file starting with "<?xml" and having string
"pwi" as "writer_PocketWord_File", because writer_PocketWord_File.xcu
has the text "doctype:pwi" as the value of its ClipboardFormat.

The problem is: since commit 1e6e891016
(restore PocketWord filter, this time backed by libwps, 2020-09-27),
this format is not handled by XMLFilterDetect service. So the filter
mis-detects some else filter's data, which then isn't accepted there.

This change makes the code of FilterDetect::detect to make sure that
it only processes its own data, checking DetectService property, too.
I didn't remove the ClipboardFormat property value from the mentioned
XCU, because (1) I don't know if it may be used by other code; and
(2) because it allows to have the sensible unit test.

Change-Id: I02fafe8df10f64640305d45cf1461b0a37552630
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174607
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-07 16:55:12 +02:00
Mike Kaganski a6a6921123 Use good old string literals in assertXPath and friends
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.

Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-05 10:06:44 +02:00
Caolán McNamara 623eb17d6b tdf#155488 svg export "peek-ahead" didn't see MapMode changes
normal 'playback' case is ok, but during the peek-ahead to get text positions
then the MapMode was skipped over so the rotate values were created with
the wrong MapMode.

Change-Id: I2b51dbc1b15e8d0d24b00b2bd4decb4c71772208
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173260
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-12 20:32:05 +02:00
Miklos Vajna 0a89d65e6b tdf#162782 SVG export: fix handling of semi-transparent text inside a list
Open the bugdoc, try to export as SVG, results in an assertion failure
in debug builds, the produced XML would not be well-formed.

Commit 666f252457 (SVG export: fix lost
semi-transparent text on shapes, 2020-07-17) added support for text
opacity on shapes, but this assumes that the entire shape has the same
opacity, while this shape has 3 paragraphs and only the middle one has
an opacity set, at a text span level. Additionally, it's a bullet, so
the text (for the bullet, has no transparency set) starts before the
transparency metafile action would start. This means that the existing
logic won't realize that opacity should be exported using the
fill-opacity attribute instead of a <g> element.

Fix the problem by checking for the isTextShapeStarted() case in
SVGActionWriter::ImplWriteMask(): if we're already inside text, then we
always want to map a transparency mask to the fill-opacity attribute
instead of a <g> element.

Leave the shape-level code at SVGTextWriter::setTextPosition()
unchanged, that continues to deal with per-shape text opacity.

Change-Id: I8cb0ca2e839fba911a75e1925cf79145f69af151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172856
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-09-04 16:07:34 +02:00
Xisco Fauli 83a8d5a275 BootstrapFixture: get rid of mxComponentContext
Change-Id: I0318485c3c0159277e47096e0c7e0df8ed109ea4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169865
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-02 15:35:00 +02:00
Noel Grandin e1d980bef0 loplugin:ostr in filter
Change-Id: I9468cb2bf7b3614e5ee2e1ca6969282041699371
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167302
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-08 11:15:29 +02:00
RMZeroFour 6817c668cd tdf#147021 Replace SAL_N_ELEMENTS with std::size
As part of the efforts in #145538 to replace the SAL_N_ELEMENTS()
macro with std::size() and std::ssize(), this commit performs the
necessary changes for a few files in the filter/ module.

PS-2: Replace an std::size call with sizeof, and one with std::ssize

Change-Id: Icac6470cdff762f828651153d0abc5f40b8e5d7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165592
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-02 10:38:58 +02:00
Mike Kaganski 4c65ab9095 Enable CVE tests on Windows by default
Since commit c16969b9bc
(tdf#84553 Detect and warn of Windows Antivirus., 2020-02-08),
it is checked that antivirus is disabled in $SRC_ROOT and $BUILDDIR.

This reverts commit a6b2c618cb
(disable cve tests by default on windows, 2014-10-01).

Change-Id: I3816e97cfb4559f7647167ed291b75468b03dc4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164612
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-09 15:18:00 +01:00
Andrea Gelmini 21fd278a45 Fix typo
Change-Id: I0e9dd35f8dd03e9bfd71b1ae84a2715dff948a27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163415
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-02-15 09:25:00 +01:00
Jaume Pujantell 6565e46f3e tdf#159704 svx: preserve text when getting grpahic from sdrobject
When getting a Graphic object from an SdrGrafObj with text the text was lost.

Change-Id: I3a8316511e502b832b65dc72faebaf8c00923c38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163293
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit d0241915eba35c9dc0cc42f322df798a270db00f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163342
Tested-by: Jenkins
2024-02-14 14:51:16 +01:00
Xisco Fauli ac2949ddaf UnoApiXmlTest: factor out common code
Change-Id: I5c7f76b61a0dab8b4ebd1ac4680a7c25f982680c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163307
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-13 16:10:03 +01:00
Michael Stahl 2048db4dc8 tdf#105844 unotest,xmlsecurity: fix tests on MacOSX
The new tests fail with:

> core/xmlsecurity/qa/unit/signing/signing2.cxx:
> 252: Assertion
> Test name: testPasswordPreserveMacroSignatureODFWholesomeLO242::TestBody
> equality assertion failed
> - Expected: 1
> - Actual  : 4

This is because only the first test that runs sees the testing CA
certificates that are copied in MacrosTest::setUpNssGpg(); when the
second test runs, they have somehow vanished.

This is because apparently SQLite on MacOSX, unlike on Linux, monitors
the file descriptors of its database files, and then invalidates itself
when setUpNssGpg() via osl::File::copy() renames and unlinks the
existing database files:

> cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode renamed while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/cert9.db.osl-tmp
> cppunittester[29873:5483181] [logging] invalidated open fd: 5 (0x20)
> cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/cert9.db.osl-tmp
> cppunittester[29873:5483181] [logging] invalidated open fd: 5 (0x11)
> cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode renamed while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/key4.db.osl-tmp
> cppunittester[29873:5483181] [logging] invalidated open fd: 6 (0x20)
> cppunittester[29873:5483181] [logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: core/workdir/CppunitTest/xmlsecurity_signing2.test.user/key4.db.osl-tmp
> cppunittester[29873:5483181] [logging] invalidated open fd: 6 (0x11)

Split MacrosTest::setUpNssGpg()/tearDownNssGpg() into functions
setUpX509() which only does something on the 1st invocation, and
setUpGpg()/tearDownGpg() which may be invoked per-test (they could also
be run once for the whole test suite, but not obvious how to do that);
PDF related tests don't need GPG.

Presumably this is (along with the WNT-specific problem fixed in commit
3e9a700091) the reason why most of the
tests not only accept the expected result of SignatureState::OK but also
SignatureState::NOTVALIDATED.

Change-Id: I59b85ca651cecaccfdea729ed1e645c53079c8bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162693
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-30 10:23:32 +01:00
Mike Kaganski a01a642ebb UnoApiTest::loadFromURL -> UnoApiTest::loadFromFile
The old name was misleading (it doesn't take an URL, but a filename);
also, now it's easier to grep for it - doesn't get mixed with
vcl::graphic::loadFromURL.

Change-Id: Ib88d2194200a6a54d2326971e0306ba39f0c7025
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161578
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-03 07:51:28 +01:00
Mike Kaganski fbf025b490 Make testHybridPDFFile Windows-only, and filenames in repo ASCII-only.
See https://lists.freedesktop.org/archives/libreoffice/2023-December/091265.html
for details.

Change-Id: I73f4a48c9b71adc42354f099dcc98aff56e3fc43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160246
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-02 21:55:03 +01:00
Mike Kaganski a5a49657dc tdf#158442: fix opening hybrid PDFs on Windows
Commit 046e954595 (Try to revert to use
of file_iterator from boost on Windows, 2023-10-31) had introduced a
problem that pdfparse::PDFReader::read couldn't create file_iterator
for files already opened with write access: mmap_file_iterator ctor
on Windows used single FILE_SHARE_READ as dwSharedMode parameter for
CreateFileA WinAPI; and that failed, when the file was already opened
using GENERIC_WRITE in dwDesiredAccess - which happens when opening
stream in TypeDetection::impl_detectTypeFlatAndDeep.

Fix this by patching boosts' mmap_file_iterator constructor to use
FILE_SHARE_READ | FILE_SHARE_WRITE, like we do in osl_openFile.

But there was a pre-existing problem of using char-based CreateFileA
API, which disallows opening any files with names not representable
in current Windows codepage. Such hybrid PDF files would still fail
creation of the file_iterator, and open as PDF.

Fix that by further patching boost to have wstring-based constructors
for file_iterator and mmap_file_iterator on Windows, which would call
CreateFileW.

Change-Id: Ib190bc090636159ade390b3dd120957d06d7b89b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160218
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-01 16:13:38 +01:00
Stephan Bergmann 1b19c6b7d0 Extended loplugin:ostr: filter
Change-Id: I1c45cecb97789a3fc229084de1b7b4968d6069c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159699
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 07:27:05 +01:00
Stephan Bergmann e0c33ec15f loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2023-10-07 00:47:20 +02:00
Mike Kaganski d9f2193b72 Fix a DPI-dependent test
Change-Id: I228b927c4daac3a4da0819e490a9963b514b4c16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155731
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-16 13:10:49 +02:00
Dr. David Alan Gilbert 7bec1689fc tdf#145538,tdf#147021: qa: range based loops
A bunch of range based loop changes in various qa
sections that also take out about 1% of SAL_N_ELEMENTS

Change-Id: I8ef000e9aa400cd8363b48f6175f6ab258cefbd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152422
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-02 16:58:57 +02:00
Samuel Mehrbrodt 19e3bab1a8 tdf#77650 Add option to place comments in margin (PDF Export)
This was somehow possible already when the document was printed with
comments in margin before - but it was not possible to set this option
when exporting a PDF via dialog or API.

To use this setting via API, set the "ExportNotesInMargin" property.

Change-Id: I97a80c5b3b3b2cde669496fd881a41ea0acc5c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143234
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-11-28 11:24:57 +01:00
Miklos Vajna 574db5efa9 Related: tdf#54053 PDF export: add UNO API to customize the watermark rotation
The watermark direction is currently either 0 degrees for landscape
pages or 270 degrees for portrait pages.

The problem is many people expect 45 degrees rotation angle or some
custom angle in general, and we provide no way to control it.

Fix the problem by adding a new "WatermarkRotateAngle" PDF export filter
option to specify the rotation angle explicitly. Note that the watermark
text is still centered, and the text size is decreased to still fit the page
boundaries. To keep things simple, do this shrinking by going with a
size that matches the shorter dimension of the page, instead of some
more complex iterative approach.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkRotateAngle":{"type":"long","value":"450"}}' test.odt

Change-Id: I1fee14c333e68c92cf4c65ec100e04dcf024f907
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143229
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-24 16:30:31 +01:00
Miklos Vajna c130063895 Remove some unused includes
Mostly com/sun/star/frame/Desktop.hpp is unused after inheriting from
UnoApiTest.

Change-Id: Ifba307353a11a14e033a230a291314bee86b51c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143190
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-24 08:09:53 +01:00
Miklos Vajna d1dd9b9733 Related: tdf#54053 PDF export: add UNO API to customize the watermark font name
The font name of the watermark text is currently hardwired to Helvetica,
a sans-serif font.

The problem is that this looks bad in case your document uses serif or
monospace fonts. Or perhaps your document uses a single font and you
want to make sure that the watermark uses exactly the same font.

Fix the problem by adding a new "WatermarkFontName" PDF export filter
option to specify the font name explicitly.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkFontName":{"type":"string","value":"Times"}}' test.odt

Change-Id: I2f065e1517236695b0a95369bdcd803125018587
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143143
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-23 15:47:03 +01:00
Miklos Vajna 175e514c93 Related: tdf#54053 PDF export: add UNO API to customize the watermark font size
The font height of the watermark text is currently automatic: we start
with a value based on the page size and then decrease it till the text
fits.

The problem is that sometimes you want a smaller value, but specifying
this was not possible.

Fix the problem by adding a new "WatermarkFontHeight" PDF export filter
option to specify the font size explicitly.

Example cmdline usage:

soffice --convert-to pdf:writer_pdf_Export:'{"Watermark":{"type":"string","value":"draft"}, "WatermarkFontHeight":{"type":"long","value":"100"}}' test.odt

Change-Id: Iceab943b7a995badfcdc6b12ecc9264e39e4a3a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143135
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-11-23 10:42:55 +01:00