1058 Commits
Author SHA1 Message Date
Xisco Fauli c64f9804ac expat: upgrade to 2.9.0
With this new version, the build started to fail with
error: ‘XML_Size XML_GetCurrentColumnNumber(XML_Parser)’ is deprecated: please use XML_GetCurrentColumnNumber64 instead [-Werror=deprecated-declarations]
so we need to check the expat version in case the system expat
is older than 2.9

Also add 0001-fix-XML_GE-is-not-defined-evaluates-to-0-Werror-unde.patch
to fix
error: "XML_GE" is not defined, evaluates to 0 [-Werror=undef]
1087 | # if XML_GE == 1
| ^~~~~~
cc1plus: all warnings being treated as errors

Change-Id: If4f1d652941b7766ed94b65a6eaa018f37c89387
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211867
Tested-by: Jenkins
Tested-by: René Engelhard <rene@debian.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-10-06 22:29:58 +02:00
Andrea Gelmini ab6ec04dd8 Fix typos
Change-Id: I8b4a9933b3c3df1871a7eb94023f0d0fd451afd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209902
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-25 11:32:16 +02:00
Tomaž Vajngerl 9a09794354 Move the Calc solvers from sccomp into the sc module
Relocate the whole solver component out of the standalone sccomp module
and into sc. This moves the SolverComponent base class, the CoinMP and
Swarm solvers, the differential evolution and particle swarm headers, the
UNO service registration, the scc string resource, and the two unit tests.
The now-empty sccomp module is removed.

The solvers are Calc specific. Moving them inside sc is the first step
toward letting them work directly with ScDocument, and eventually clone a
document or its sheets so trial calculations can run in parallel. That
direct access is only possible from inside sc, so the relocation has to
come first.

This is a pure relocation with no behaviour change. The translation domain
stays "scc" and its polocation still points at "sccomp", so the existing
translations keep loading unchanged. Re-homing the scc translation domain
into sc is left as a follow-up.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I5b972daae4c51f04ca394fc9a92f89ac0c4dd599
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3832
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 7f1bea8723761f97c053f2e7e46aab7081b1bb21)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208080
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-19 02:18:56 +02:00
Xisco Fauli 859226d30b l10ntools: handle cases like desc_en_US.txt in en-US
Seen with da_DK dictionary which contains desc_en_US.txt

Change-Id: I9fce4b1da6907a1d26f5ab7846ac2c44034877a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206369
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-12 08:52:13 +02:00
Xisco Fauli f1c0f94229 msvc: remove obsolete warning suppressors
Change-Id: I4128ab5ac0494d515d84d8208bf8d8065d2359c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206014
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-05 08:44:23 +02:00
Pierre ed663ada46 tdf#158237 Use C++20 contains() instead of find() and end()
Change-Id: I6688c62b13e9e1dce5f6cd077fafc1d5a6adbae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192660
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2025-10-23 20:24:51 +02:00
Christian Lohmaier 8f0759cadd tdf#72476 allow qtz/keyID language also with --enable-release-build
…by manually specifying it as part of the --with-lang switches
surprisingly enough this wasn't just a matter of adding the qtz language
code to the corresponging language list variables used by make, but also
was directly coupled to the ENABLE_RELEASE_BUILD environment variable
for some parts.

Change-Id: Icc985d9e7428ab932de09bd31e86e5ea7551f6fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192874
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2025-10-23 13:44:58 +02:00
Olivier Hallot 691fe77311 tdf#168443 Add <meta> description in Help pages
Core part.
- add <description> as translatable string.

Change-Id: Ifaee57ae34607f2a90a74f03f89909fc471db434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191082
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
2025-09-17 15:56:24 +02:00
Simon Chenery 033faa1c55 tdf#145538 Use range based for loops in xrmmerge.cxx
Change-Id: Id759af2df7f147991cb9ac1efd7010123415e2ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189973
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2025-08-26 01:09:19 +02:00
Nilesh Patra fd48da7236 tdf#147021 Replace SAL_N_ELEMENTS() macro with std::size() in localize.cxx
Change-Id: I99d81d219254e225af6a804e5adc3eecbb588d1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189835
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
Tested-by: Jenkins
2025-08-18 23:54:32 +02:00
Mike Kaganski c8afc1eb73 Deduplicate and simplify PoIfstream::open
Use a common implementation; do not create a temporary OString,
where we only need a view of existing std::string.

Change-Id: I1ba29d2600ac03279a19dbf2919ac80d3f8a620c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187945
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-07-16 11:58:56 +02:00
Xisco Fauli 297dc9b6c5 tdf#166813: improve pocheck script
* Check the number of opening and closing parentheses,
brackets and square brackets are the same
* Check {&DialogHeading} and {&DialogDefaultBold} are
at the beginning of the string.
the translation here
* Check [ProductName] is kept. It's just a warning
so pocheck doesn't remove the translation here

Change-Id: Ica06e22ec547375b84ed829da12178b5976b357c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187554
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-07-09 18:36:20 +02:00
Christian Lohmaier 2d92871441 add Abkhaz (ab) langaugepack
Change-Id: I100b6c5b34d9c377ab2458dda1cf9af14767c6f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179892
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-01-12 15:00:39 +01:00
Christian Lohmaier 448954835f add Tagalog (tl) langauge- & helppack
Change-Id: I9fdb30215f6b64ae025a7e8e468e84426044ff80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175503
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-10-23 18:22:36 +02:00
Xisco Fauli b20877920e tdf#163486: PVS: check stream read instead of EOF
V1024 	The 'aIfstream' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data.

Change-Id: I253513c47ec1482882bbfb1c6e32e25c15ace99c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175475
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-23 16:57:07 +02:00
Xisco Fauli 95feb2877e tdf#163486: PVS: check stream read instead of EOF
V1024 	The 'aInput' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data.

Change-Id: Ie0c6d1928dad804b21d3c9920cc1de8035ea0367
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175476
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-23 15:30:55 +02:00
Xisco Fauli f558eb09dc tdf#163486: PVS: check stream read instead of EOF
V1024 	The 'aStream' stream is checked for EOF before reading from it, but is not checked after reading. Potential use of invalid data.

Change-Id: I4f7b10bc896d13a31a97ed0dbacd413de990eb89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175363
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-22 12:43:28 +02:00
Eike Rathke 8afc6cb5aa Add Santali, Ol Chiki {sat-Olck-IN} [0x06B3] to language list
Change-Id: I3924672759bc12f1ee8a022e8b35c862aefff06d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174901
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-10-14 18:36:38 +02:00
Caolán McNamara 490e64cdc8 cid#1607175 Overflowed constant
and

cid#1606656 Overflowed constant

Change-Id: I278d3745ca5d22defde8ab268e644e9ee312a3cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173751
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-22 20:10:23 +02:00
Caolán McNamara 2f4c8f896f cid#1606656 Overflowed constant
Change-Id: I1503ebd911abf6e1e2060ce6dc3f0ac05e325982
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173666
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-19 15:43:13 +02:00
Zainab Abbasi 2b25d81905 tdf#145538 Use range based for loops
Change-Id: I18d00da91253d6ce3b4d2c5af94d919a84309a3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170329
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2024-07-22 17:59:03 +02:00
Caolán McNamara d33d592801 cid#1554791 COPY_INSTEAD_OF_MOVE
and

cid#1554819 COPY_INSTEAD_OF_MOVE
cid#1554837 COPY_INSTEAD_OF_MOVE
cid#1554881 COPY_INSTEAD_OF_MOVE
cid#1554882 COPY_INSTEAD_OF_MOVE
cid#1554884 COPY_INSTEAD_OF_MOVE
cid#1554891 COPY_INSTEAD_OF_MOVE
cid#1554892 COPY_INSTEAD_OF_MOVE
cid#1554897 COPY_INSTEAD_OF_MOVE
cid#1554904 COPY_INSTEAD_OF_MOVE
cid#1554918 COPY_INSTEAD_OF_MOVE
cid#1554928 COPY_INSTEAD_OF_MOVE
cid#1554931 COPY_INSTEAD_OF_MOVE
cid#1554944 COPY_INSTEAD_OF_MOVE
cid#1554945 COPY_INSTEAD_OF_MOVE
cid#1554959 COPY_INSTEAD_OF_MOVE
cid#1554960 COPY_INSTEAD_OF_MOVE
cid#1554963 COPY_INSTEAD_OF_MOVE
cid#1554966 COPY_INSTEAD_OF_MOVE
cid#1554969 COPY_INSTEAD_OF_MOVE
cid#1554973 COPY_INSTEAD_OF_MOVE
cid#1555011 COPY_INSTEAD_OF_MOVE
cid#1555012 COPY_INSTEAD_OF_MOVE
cid#1555015 COPY_INSTEAD_OF_MOVE
cid#1555044 COPY_INSTEAD_OF_MOVE
cid#1555051 COPY_INSTEAD_OF_MOVE
cid#1555055 COPY_INSTEAD_OF_MOVE
cid#1555063 COPY_INSTEAD_OF_MOVE
cid#1555068 COPY_INSTEAD_OF_MOVE
cid#1555073 COPY_INSTEAD_OF_MOVE
cid#1555074 COPY_INSTEAD_OF_MOVE
cid#1555078 COPY_INSTEAD_OF_MOVE
cid#1555080 COPY_INSTEAD_OF_MOVE
cid#1555091 COPY_INSTEAD_OF_MOVE
cid#1555099 COPY_INSTEAD_OF_MOVE
cid#1555101 COPY_INSTEAD_OF_MOVE
cid#1555121 COPY_INSTEAD_OF_MOVE
cid#1610739 COPY_INSTEAD_OF_MOVE
cid#1608424 COPY_INSTEAD_OF_MOVE
cid#1608059 COPY_INSTEAD_OF_MOVE
cid#1607952 COPY_INSTEAD_OF_MOVE
cid#1607653 COPY_INSTEAD_OF_MOVE
cid#1607614 COPY_INSTEAD_OF_MOVE
cid#1607592 COPY_INSTEAD_OF_MOVE

Change-Id: Ie9f922a9fe1b8001dfab31e2741fe8bd5558e442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170802
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-20 23:03:28 +02:00
Christian Lohmaier e8392bc1c9 allow low-translation-completion-langs for dev-builds (e.g.: Sundanese)
will be included when using --with-lang=ALL in non-release configuration
(i.e. tinderbox provided daily builds), but not when using
--enable-release-build.
Change the way how configure fetches the list of all supported languages
from a fancy sed call to running make with a dummy-recipe.

Change-Id: I8bbea5fd95d37eac5bbce2e55ae34830b0ab4ebb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168334
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-06-02 19:26:46 +02:00
Caolán McNamara 5d3d7cd656 cid#1546281 COPY_INSTEAD_OF_MOVE
and

cid#1546278 COPY_INSTEAD_OF_MOVE
cid#1546276 COPY_INSTEAD_OF_MOVE
cid#1546247 COPY_INSTEAD_OF_MOVE
cid#1546244 COPY_INSTEAD_OF_MOVE
cid#1546243 COPY_INSTEAD_OF_MOVE
cid#1546220 COPY_INSTEAD_OF_MOVE
cid#1546209 COPY_INSTEAD_OF_MOVE
cid#1546207 COPY_INSTEAD_OF_MOVE
cid#1546206 COPY_INSTEAD_OF_MOVE
cid#1546205 COPY_INSTEAD_OF_MOVE
cid#1546197 COPY_INSTEAD_OF_MOVE
cid#1546180 COPY_INSTEAD_OF_MOVE
cid#1546172 COPY_INSTEAD_OF_MOVE
cid#1546165 COPY_INSTEAD_OF_MOVE
cid#1546164 COPY_INSTEAD_OF_MOVE
cid#1546158 COPY_INSTEAD_OF_MOVE
cid#1546151 COPY_INSTEAD_OF_MOVE
cid#1546135 COPY_INSTEAD_OF_MOVE
cid#1546132 COPY_INSTEAD_OF_MOVE
cid#1546129 COPY_INSTEAD_OF_MOVE
cid#1546128 COPY_INSTEAD_OF_MOVE
cid#1546122 COPY_INSTEAD_OF_MOVE
cid#1546117 COPY_INSTEAD_OF_MOVE
cid#1546113 COPY_INSTEAD_OF_MOVE
cid#1546106 COPY_INSTEAD_OF_MOVE
cid#1546099 COPY_INSTEAD_OF_MOVE
cid#1546091 COPY_INSTEAD_OF_MOVE
cid#1546085 COPY_INSTEAD_OF_MOVE
cid#1546069 COPY_INSTEAD_OF_MOVE
cid#1546063 COPY_INSTEAD_OF_MOVE
cid#1546062 COPY_INSTEAD_OF_MOVE
cid#1546058 COPY_INSTEAD_OF_MOVE
cid#1546056 COPY_INSTEAD_OF_MOVE
cid#1546051 COPY_INSTEAD_OF_MOVE
cid#1546040 COPY_INSTEAD_OF_MOVE
cid#1546030 COPY_INSTEAD_OF_MOVE
cid#1546028 COPY_INSTEAD_OF_MOVE
cid#1546015 COPY_INSTEAD_OF_MOVE
cid#1546001 COPY_INSTEAD_OF_MOVE

Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10 11:57:12 +01:00
Stephan Bergmann 52a8d560d8 Extended loplugin:ostr: l10ntools
Change-Id: I259867d548c3a6b5322d38584270a325b93f1776
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160117
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-30 09:00:00 +01:00
Stephan Bergmann 2718e9c1d5 Extended loplugin:ostr: l10ntools
Change-Id: I6c46535568ac6c29784e9336198b51c79c9e3859
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159695
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 07:28:07 +01:00
Stephan Bergmann f6f0091885 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: l10ntools
Change-Id: I4878e2209b8499e02b7a6c13867b1a3aa4dad7e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158204
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19 23:20:34 +02:00
sahil 0c45d90cfb tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I7217c04aa13082c1d2006c0c6a145b1b4fdbac0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155003
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-07-28 07:07:11 +02:00
Noel Grandin e266d448f4 loplugin:stringstatic look for more strings
that can be initialised at compile-time instead of runtime

Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-27 13:10:44 +02:00
Noel Grandin c45bc08dc6 loplugin:stringview whitelist getLength and isEmpty
Change-Id: I38f3410c0b25ff579879b9de1f266af4d8fd51e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150256
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-12 12:57:22 +02:00
Noel Grandin eaf071397a new loplugin:unnecessarygetstr
which prevents constructing unnecessary temporaries via getStr()

Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-09 20:51:44 +02:00
Noel Grandin bd17c9c949 loplugin:stringadd also check O[U]StringBuffers
For similar code sequences that can be improved.

Also move containsComment from collapseif plugin code to
plugin.cxx so we can use it from stringadd.

Change-Id: Ie07d9aedf2c31cb0b2080e1b8584294d7046a8e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149217
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-06 13:51:06 +02:00
Stephan Bergmann 27eb23369f Work around system(3) dropping DYLD_LIBRARY_PATH on macOS
...which caused `make translations` fail for me with

> [POT] pot.done
> dyld[96290]: Library not loaded: @__VIA_LIBRARY_PATH__/libuno_sal.dylib.3
>   Referenced from: <CD4F28D6-E3BE-3126-B861-C90BF3E14492> .../workdir/LinkTarget/Executable/cfgex
>   Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@__VIA_LIBRARY_PATH__/libuno_sal.dylib.3' (no such file), '/usr/local/lib/libuno_sal.dylib.3' (no such file), '/usr/lib/libuno_sal.dylib.3' (no such file, not in dyld cache)
> Error: Failed to execute .../workdir/LinkTarget/Executable/cfgex -i .../connectivity/registry/ado/org/openoffice/Office/DataAccess/Drivers.xcu -o .../workdir//pot/connectivity/registry/ado/org/openoffice/Office/DataAccess.pot

(This is the opposite case to 17cfd43e28 "Avoid
external processes picking up instdir/program/libxml2.so.2".  Here, the
executables called from Executable_localize are LO-internal executables that
need the libraries in instdir/.  There, the scripts called from
Executable_localize in turn only call external tools that shall not accidentally
pick up LO-internal libraries from instdir/.)

Change-Id: Ib1aa240ee47a21d14ec0463fee85bebe82453cee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143118
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-23 08:47:26 +01:00
Stephan Bergmann 337691db0e Simplify previous fix
...e735de2051143347b7283c85ad80b0e2412522dc "Avoid some unnecessary, wrong
downcasts during `make translations"

Change-Id: If6110e16698302b3d43b2192cf0f0e0d0fddb57b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143026
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-22 08:14:09 +01:00
Stephan Bergmann 17cfd43e28 Avoid external processes picking up instdir/program/libxml2.so.2
...which is a problem in ASan builds, as seen with a failing `make check`:

> xgettext: symbol lookup error: .../instdir/program/libxml2.so.2: undefined symbol: __asan_init
> xgettext: symbol lookup error: .../instdir/program/libxml2.so.2: undefined symbol: __asan_init
> xgettext: symbol lookup error: .../instdir/program/libxml2.so.2: undefined symbol: __asan_init
> xgettext: symbol lookup error: .../instdir/program/libxml2.so.2: undefined symbol: __asan_init
> xgettext: symbol lookup error: .../instdir/program/libxml2.so.2: undefined symbol: __asan_init
> Traceback (most recent call last):
>   File ".../solenv/bin/uiex", line 25, in <module>
>     input = check_output(["xgettext", "--add-comments", "--no-wrap", ifile, "-o", "-"], encoding="UTF-8")
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/subprocess.py", line 465, in check_output
>     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/subprocess.py", line 569, in run
>     raise CalledProcessError(retcode, process.args,
> subprocess.CalledProcessError: Command '['xgettext', '--add-comments', '--no-wrap', '.../basctl/uiconfig/basicide/ui/basicmacrodialog.ui', '-o', '-']' returned non-zero exit status 127.
> Error: Failed to execute .../solenv/bin/uiex -i .../basctl/uiconfig/basicide/ui/basicmacrodialog.ui -o .../workdir//pot/basctl/messages.pot

The solution is similar to e854abe076 "Avoid
external processes picking up instdir/program/libnspr4.so" used in various
tests.  And as Executable_localize appears to only be called in that one place
in the recipe of `make translations`, for simplicity make the library path
override a required fourth argument for that executable.

Change-Id: Ia6326ac0bb12ea75a8b3df51f7fbf12b88aca634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142999
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2022-11-21 16:45:02 +01:00
Stephan Bergmann cb24017c84 Clean up CfgParser::aStack
This is apparently some very old, very poor XML parsing code full of
questionable design decisions.  The silliness of pushing onto the opened-element
stack also entities that don't have a closing tag (but which cannot easily be
changed, see the added comment about CfgStack::GetAccessPath) caused consistent
memory leaks when Executable_cfgex is executed during the build.  While those
leaks are harmless, they might cause people to nevertheless try to clean them up
in various ways (see the abandoned
<https://gerrit.libreoffice.org/c/core/+/142718> "asan: fix leak in
ExecuteAnalyzedToken/Push"), so just clean up those broken-by-design excess
aStack elements.

Change-Id: I849109906c6b102d9aa90300c2bada360c727d4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143001
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-20 22:40:27 +01:00
Stephan Bergmann e735de2051 Avoid some unnecessary, wrong downcasts during make translations
> l10ntools/source/xmlparse.cxx:491:51: runtime error: downcast of address 0x603000000610 which does not point to an object of type 'XMLParentNode'
> 0x603000000610: note: object is of type 'XMLDefault'
>  00 00 00 00  30 44 a7 dd a0 55 00 00  00 05 10 6e a4 7f 00 00  80 00 00 00 60 60 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'XMLDefault'
>  #0 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:491:51
>  #1 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:481:9
>  #2 in HelpParser::CreatePO(rtl::OString const&, rtl::OString const&, XMLFile*, std::basic_string_view<char, std::char_traits<char>>) at l10ntools/source/helpmerge.cxx:91:20
>  #3 in sal_main_with_args(int, char**) at l10ntools/source/helpex.cxx:124:17
>  #4 in main at l10ntools/source/helpex.cxx:47:1

and

> l10ntools/source/xmlparse.cxx:523:44: runtime error: downcast of address 0x6030000007c0 which does not point to an object of type 'XMLParentNode'
> 0x6030000007c0: note: object is of type 'XMLData'
>  00 00 00 00  e0 53 d5 c0 46 56 00 00  d0 00 00 00 40 60 00 00  f0 07 00 00 30 60 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'XMLData'
>  #0 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:523:44
>  #1 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:492:80
>  #2 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:481:9
>  #3 in HelpParser::CreatePO(rtl::OString const&, rtl::OString const&, XMLFile*, std::basic_string_view<char, std::char_traits<char>>) at l10ntools/source/helpmerge.cxx:91:20
>  #4 in sal_main_with_args(int, char**) at l10ntools/source/helpex.cxx:124:17
>  #5 in main at l10ntools/source/helpex.cxx:47:1

and

> l10ntools/source/xmlparse.cxx:526:48: runtime error: downcast of address 0x603000000820 which does not point to an object of type 'XMLParentNode'
> 0x603000000820: note: object is of type 'XMLComment'
>  00 00 00 00  28 06 92 a9 17 56 00 00  d0 00 00 00 40 60 00 00  40 00 00 00 20 61 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'XMLComment'
>  #0 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:523:44
>  #1 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:492:80
>  #2 in XMLFile::CheckExportStatus(XMLParentNode*) at l10ntools/source/xmlparse.cxx:481:9
>  #3 in HelpParser::CreatePO(rtl::OString const&, rtl::OString const&, XMLFile*, std::basic_string_view<char, std::char_traits<char>>) at l10ntools/source/helpmerge.cxx:91:20
>  #4 in sal_main_with_args(int, char**) at l10ntools/source/helpex.cxx:124:17
>  #5 in main at l10ntools/source/helpex.cxx:47:1

Change-Id: I1e2c6bf802aa03b5b1eb21532e98fa22d966e683
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143000
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-20 22:39:54 +01:00
Julien Nabet bf9ce4e056 asan: fix leak in lcl_MergeLevel
Direct leak of 2000 byte(s) in 2 object(s) allocated from:
0 0x55906afe399e in malloc (/home/julien/lo/libo_perf/workdir/LinkTarget/Executable/treex+0xff99e) (BuildId: 5b19224d0ca2120a)
1 0x7fd51a4abfd7 in xmlEncodeSpecialChars (/lib/x86_64-linux-gnu/libxml2.so.2+0x31fd7) (BuildId: 008b52a46ddf3013589362f7f678f7a6c8dd1e56)
2 0x55906b023403 in (anonymous namespace)::lcl_MergeLevel(_xmlDoc*, _xmlNode*, unsigned char const*, MergeDataFile*, rtl::OString const&, rtl::OString const&) treemerge.cxx
3 0x55906b0232d4 in (anonymous namespace)::lcl_MergeLevel(_xmlDoc*, _xmlNode*, unsigned char const*, MergeDataFile*, rtl::OString const&, rtl::OString const&) treemerge.cxx
4 0x55906b0232d4 in (anonymous namespace)::lcl_MergeLevel(_xmlDoc*, _xmlNode*, unsigned char const*, MergeDataFile*, rtl::OString const&, rtl::OString const&) treemerge.cxx
5 0x55906b0226ef in TreeParser::Merge(rtl::OString const&, rtl::OString const&, rtl::OString const&) treemerge.cxx
6 0x55906b02c0dd in sal_main_with_args(int, char**) treex.cxx
7 0x55906b02baad in main (/home/julien/lo/libo_perf/workdir/LinkTarget/Executable/treex+0x147aad) (BuildId: 5b19224d0ca2120a)
8 0x7fd519e46189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

Change-Id: I9882cd63b91967d9b8998ba25545c11a3168e739
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142717
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-11-15 19:38:32 +01:00
Stephan Bergmann 46875d8347 A better fix for C++23 P2266R1
After 6d6a143913 "Address some of the sprintf in
vcl/source/fontsubset/cff.cxx", --with-latest-c++ builds that pick up a C++23
compiler that implements
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2266r1.html> "P2266R1:
Simpler implicit move" started to fail with something like

> vcl/source/fontsubset/cff.cxx:2061:16: error: no viable conversion from returned value of type 'char[64]' to function return type 'OString'
>         return aDefaultGlyphName;
>                ^~~~~~~~~~~~~~~~~
[...]
> include/rtl/string.hxx:313:5: note: candidate constructor [with T = char[64]] not viable: expects an lvalue for 1st argument
>     OString( T& value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() )
>     ^

etc.  So I figured there should be something better than
433ab39b21 "Adapt implicit OString return value
construction to C++23 P2266R1" (which this commit reverts, modulo its conflicts
in comphelper/source/xml/xmltools.cxx and
sc/source/filter/xcl97/XclExpChangeTrack.cxx) to address the underlying issue in
a way that keeps code that works up to C++20 also working in C++23.

(The fix is only relevant for non-explicit constructors that involve
NonConstCharArrayDetector and non-const lvalue references, not for other
functions involving those.  OUString has a similar constructor but which is
explicit, and OUStringBuffer doesn't have any similar constructors at all, so
this only affects OString and OStringBuffer constructors.)

Change-Id: I31cf16b9507899f5999243f8467dfa24bc94c5ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142455
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-08 17:28:32 +01:00
Mike Kaganski 3d236177be Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name
to show that the result is not an O(U)String.

Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-11 12:46:01 +02:00
Noel Grandin 6cac364376 clang-tidy modernize-pass-by-value in l10ntools
Change-Id: Icf07a0f3784f0f39fa6b141a24aa25fddab71901
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136272
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-23 08:54:00 +02:00
Noel Grandin 9f1701d01d use more o3tl::getToken
found by inspecting call sites of OUString::getToken

Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05 12:57:00 +02:00
Noel Grandin b9c806b9e3 address potential find/rfind failures
in the conversion in
    commit 74957c7d2f
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Wed Apr 13 13:54:22 2022 +0200
    use more string_view in l10ntools

where the prior code might have been relying on the -1 returned by
indexOf and lastIndexOd

Change-Id: Ief5dedccbaf4e14e5f59aa3c2f7481ff0bb7e2e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133027
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-15 14:06:06 +02:00
Noel Grandin 74957c7d2f use more string_view in l10ntools
Change-Id: I93958e8e2dc1e172413ff697d6b6be975cff064d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132956
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 16:11:27 +02:00
Noel Grandin fdfd517a6f loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents

Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 08:38:53 +02:00
Noel Grandin cbaf1fbaa6 loplugin:stringview more o3tl conversion
look for call sequences that can use string_view and the new o3tl
functions in o3tl/string_view.hxx

Also add a few more wrappers to said #include file

Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-12 12:42:15 +02:00
Noel Grandin b24a4d255d use more string_view
found by tweaking the loplugin:stringview and making it whitelist
getLength

Change-Id: Ic15d3703d1fb07658e99e1db1c89e2fa5bc70c19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132771
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10 20:15:16 +02:00
Noel Grandin e4ff847fe0 loplugin:stringview check for getToken and trim
since we now have o3tl versions of those that work on
string_view.

Also improve those o3tl functions to support both string_view
and u16string_view

Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10 12:59:38 +02:00
Noel Grandin 3a88b513fd loplugin:stringviewparam convert methods using trim
for which we add a new o3tl::trim method

Change-Id: I9d37b6264eea106aa2f3502bd24b8cccf7850938
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08 10:26:10 +02:00
Noel Grandin 1927b51993 loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind

Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 13:31:19 +02:00