7517 Commits
Author SHA1 Message Date
Andrea Gelmini f1c58464ac Fix typos
Change-Id: I38b80f7bbf93192b7e2e00a426b72b77eb33bf1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210568
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-10 21:28:54 +02:00
Andrea Gelmini 6e696502fc Fix typos
Change-Id: I3e012ec27be31748afd2486366ede02939ca3cf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210567
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-10 21:27:55 +02:00
Caolán McNamara 8568a3191d cid#562978 silence Out-of-bounds access
coverity only takes the tag when it sits on the line directly above the
statement, and the rest of the tree spells out the FALSE classification

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I2cb97c3314a7b612b8fe5bbe2270c7436d1d0717
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10507
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 260f71263c7a37290d50a182ab1e8616a4b99de3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210288
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-31 20:25:20 +02:00
Caolán McNamara cf45ff8f40 cid#563264 Unchecked return value
cwd is left empty when the conversion fails, and searching an empty
path is not a no-op, it looks for the file under / instead

so only search when we got a path back

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I915103cfd446ff87f0116d832b48e4432c0be862
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10099
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit e2552aaae8b103940e16b03cbb15a277afe74c0e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210287
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-31 17:33:11 +02:00
Andrea Gelmini 3968c6ebcb Fix typos
Change-Id: I0d45e4d6ece2ece63fe209126f05113969cda7fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210176
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-29 16:08:23 +02:00
Caolán McNamara 5e3fe53bdb cid#562881 Double unlock
the double-unlock finding is a bit bogus, but there is a real oddity
here worth fixing.

since:

commit 6c9909dee4
Date:   Fri Oct 22 14:11:39 2021 +0200

    fix std::unique_lock unlocking

84a54f6c38 moved the end() test inside
the guard, but left the dereference outside it

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia439ebffc9179e74d926efc7c3ea7dec2fc1f7db
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9964
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 791c9f631b0ce352d356f5486ba537c9a4d3f8fc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210134
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-27 21:14:20 +02:00
Andrea Gelmini b852cb2c39 Fix typos
Change-Id: Iaade8f3adc17b9ff20d1295050e3534b1d940356
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210052
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-27 15:01:16 +02:00
Andrea Gelmini 14022fd7d9 Fix typos
Change-Id: Ifdabd2826fa1f147aedf38945409c2192c989d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210073
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-27 14:01:20 +02:00
Andrea Gelmini 98bf6a9ecb Fix typos
Change-Id: I0dd6582c44f2b92b3dd8f0bdfab14db4fa437735

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209771
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 15:48:26 +02:00
Andrea Gelmini c8c0bb4ec8 Fix typos
Change-Id: I5455cb033f895ee4e06297896f0fd1cd8be1ca71

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209769
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 15:39:41 +02:00
Andrea Gelmini 370d43f2e9 Fix typos
Change-Id: I0dd6582c44f2b92b3dd8f0bdfab14db4fa43773a

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209772
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 15:35:03 +02:00
Andrea Gelmini b5e9a38e7d Fix typos
Change-Id: I3e51eda80647bbb7996a8cfab637160b4aeaf0a6

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209770
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 06:52:22 +02:00
Andrea Gelmini 467e3b4f49 Fix typos
Change-Id: I8000ee277d51b91e8e04c99afa4327a4245e435f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209475
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-22 10:26:48 +02:00
Andrea Gelmini ca8e2627d7 Fix typos
Change-Id: I067ecc337f9e2e927d8cdff1c74b22581aac9a6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209416
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-20 19:09:43 +02:00
Xisco Fauli e1f9e8beb4 Revert "sal: remove MD2, SHA, HMAC_MD5 digests"
it breaks the published API

This reverts commit e4892750c3.

Change-Id: Id072882efc432cdbc3c20a6bcece1369f9a78bf4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209385
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-20 15:43:22 +02:00
Xisco Fauli aac090211d Revert "sal: remove rtl_createNamedUuid"
it breaks the published API

This reverts commit 3bad9e2daa.

Change-Id: If6f0b7f8d4a52415bd9fdacde20d9ec1643f590e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209384
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-20 15:43:08 +02:00
Michael Weghorn acb6bb7219 sal: Return std::optional<OString> in getModulePathFromAddress
Return std::optional<OString> instead of using a bool
return value and a rtl_String** out param.

This allows switching callers from using the low-level rtl_String
to using OString.

Change-Id: I1d38bbc927e7c5e6a12c18ac61e4b37c68b181f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207544
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-02 15:55:01 +02:00
Michael Weghorn 855be6e23f sal, android: Drop unused libreofficekit_set_javavm
This was introduced in

    commit f43483ce36
    Date:   Mon Feb 18 13:25:40 2019 +0100

        android: Expose setting of the JavaVM.

        Needed when we use the liblo-native-code as a library.

, but is unused. Apparently, it was needed for the Collabora
Online Android app in the past (see corresponding commit [1]),
but that one no longer uses this repo.

[1] https://github.com/CollaboraOnline/online/commit/91280ea90565dcbd81e77f3ed74e2ac2039a91f4

Change-Id: I9a6ebe275d894ca3d2bdbd7dcdf53751c6d15940
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207538
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-07-02 15:54:53 +02:00
Michael Stahl e4892750c3 sal: remove MD2, SHA, HMAC_MD5 digests
These are all obsolete and unused:
`rtl_Digest_AlgorithmMD2`
`rtl_Digest_AlgorithmSHA`
`rtl_Digest_AlgorithmHMAC_MD5`

Adapt `rtl_digest.cxx` to use some random other digest instead.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I886297bec6fafbc56afabd212517a8f4478f3253
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4669
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 2e0c87ff340d7ea99afd638ebb9bd7bb36e53afc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207148
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-23 13:16:38 +02:00
Michael Stahl 3bad9e2daa sal: remove rtl_createNamedUuid
This has never been called in the git history, other than by its test.

Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ic233632a3656fe125f71a944afdedb8687627e78
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4670
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit fbf2894e11b2411c3fd9c06fa0cc490c6570bdc7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207149
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-23 11:22:49 +02:00
Simon Chenery fbb8ae9c69 tdf#147021 avoid use of SAL_N_ELEMENTS macro in convertsimple.cxx
Change-Id: Ic17fd5f6ca2549a7581e061b8251a954a20b032a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201945
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2026-06-01 10:01:56 +02:00
Stephan Bergmann 811769f009 Consistently use __EMSCRIPTEN__ instead of EMSCRIPTEN macro
...as emsdk 5.0.3 deprecated the predefined EMSCRIPTEN macro (see
<https://github.com/emscripten-core/emscripten/commit/506052bd8b4e23ded7f2351c62ca3b24d40c8cf3>
"Warn about usage of deprecated EMSCRIPTEN macro. NFC (#26381)"), causing
failures like

> In file included from static/source/unoembindhelpers/PrimaryBindings.cxx:29:
> In file included from include/sfx2/viewsh.hxx:35:
> In file included from include/editeng/outliner.hxx:32:
> In file included from include/tools/color.hxx:26:
> include/osl/endian.h:66:15: error: macro 'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead [-Werror,-Wdeprecated-pragma]
>    66 | #elif defined EMSCRIPTEN
>       |               ^
> /home/sberg/emsdk/5.0.4/emsdk/emscripten/main/cache/sysroot/include/emscripten/emscripten.h:35:66: note: macro marked 'deprecated' here
>    35 | #pragma clang deprecated(EMSCRIPTEN, "use __EMSCRIPTEN__ instead")
>       |                                                                  ^

To avoid confusion, also suppress the -D$(OS) in
solenv/gbuild/platform/unxgcc.mk that would unnecessarily keep defining
EMSCRIPTEN.

Change-Id: Ic1f187cf1c6417cd95d4092e9cea01a665bd1b2f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/34
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 50291c2ed83bdb49bb827a4a12905d94b8c42035)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205167
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-14 10:11:38 +02:00
Balazs Varga 130d35d198 Revert "tdf#126742 make Windows file handling more unx-like"
This reverts commit 2b4cd99d33.

The 2021 commit framed Windows' write-share enforcement as a
divergence from Unix to be eliminated. The premise inverts the
situation: Unix's lack of mandatory write-share enforcement is a
known weakness, not a property to copy. LO's cooperative .lock-file
mechanism implicitly relied on the kernel guarantee Windows
provided.

The commit predicted "no new scenario will be created" because LO's
Unix path already worked this way. But it missed the silent-overwrite
manifestation reported as tdf#157943: any second writer to the same
path - another process, an external app, or even a separate write
path within the same LO instance - can now silently clobber the
first writer's data, because the kernel no longer rejects their
concurrent write open. Tests don't catch this because they verify
that writes succeed, not that competing writes don't silently lose
each other's data.

The intra-process OLE-edit scenario the 2021 commit addressed is
handled at the right layer (OLE-link activation) in the follow-up,
without weakening the cross-process guarantee.

Change-Id: Ie12d16a8be1516bdd45d1b89155f3ca2615d658c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2003
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204939
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
2026-05-10 09:28:15 +02:00
Neil Roberts ab871d3af9 [API CHANGE] rtl/string: Add startsWith/endsWith for a single character
A lot of places in the code are calling OUString::endsWith with a string
containing a single character. Similar to lastIndexOf, this patch
provides overloads to the two methods to have an optimised version for
the case when there is only one character.

It would be kind of nice if the compiler could handle this optimisation
itself, but it’s unlikely to work because the string version of endsWith
ends up calling rtl_ustr_shortenedCompare_WithLength which isn’t inline
and is defined outside of a header.

The main incentive to do this is to make it easier to change calls to
lastIndexOf that should really be endsWith, as in tdf#171853.

Change-Id: Iaba5a7db3211eb12b0a83f441c0a81e664da6eea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204363
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-04-30 06:33:28 +02:00
Jakub Trzebiatowski 0430226229 tdf#129606 move approxDiff to rtl::math and fix ARM64 rounding errors
Move the approxDiff heuristic from the sc unnamed namespace to rtl::math and
disable floating-point contraction (FMA) for this function.

On ARM64 (Apple Silicon), the use of Fused Multiply-Add (FMA) results in
higher intermediate precision during floating-point operations. While
mathematically more accurate, this prevents legacy rounding heuristics in
approxDiff and approxValue from detecting and cleaning rounding artifacts
in series generation (e.g., 1.1 - 1.0).

Disabling fp-contract forces intermediate rounding to 64-bit IEEE 754
limits. This ensures the noise expected by the approximation logic is
present, restoring consistency with x86-64 behavior and fixing issues where
values like 6.0 are incorrectly rendered as 6.00000000000001.

Change-Id: I54a0f748be6cf817db1f3bdcfd2b355320c3a617
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203233
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Tested-by: Jenkins
2026-04-08 20:37:27 +02:00
Balazs Varga 75d5723027 tdf#170297: skip AccessCheck for remote drives in osl_getFileStatus
The tdf#150118 fix used AccessCheck to check write permissions when
FILE_ATTRIBUTE_READONLY is not set. However, AccessCheck uses a local
impersonation token which does not reflect the network credentials
used by the SMB redirector, causing files on remote drives to be
incorrectly marked as read-only.

Skip the AccessCheck logic for remote drives by detecting UNC paths
(\\server\share\...) and mapped network drives (via GetDriveTypeW
returning DRIVE_REMOTE).

regression after: 1b5d039d8b

Change-Id: I7f1514db89655e8607f64da3d62e8e29c23105f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199997
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Balazs Varga <balazs.varga@collabora.com>
2026-02-23 17:23:50 +01:00
Christian Lohmaier ab214fc9f3 uunxapi.cxx: add pre/postmac headers for sandboxed build
side-effect of dec1441f716c7631622b9b3e32fdbc666502c006 that removed
unnecessary Carbon.h headers and along with that the premac one that
would have been applied also to sal/osl/unx/uunxapi.cxx

Change-Id: I058e074d3ba7fb42d1ca70e497c6219820597119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198551
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2026-02-02 17:03:12 +01:00
Mike Kaganski 3a54d9870f Simplify use of COMReference a bit
1. Avoid explicitly specifying COM_QUERY in calls to QueryInterface
   (it is implied from the name).
2. Drop redundant ctor and set() that duplicate QueryInterface.
3. Allow ThrowIfFailed without a message.

Change-Id: I75b545e534efb7e57da131dfd40a2a49d204efac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198033
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-01-24 13:36:50 +01:00
shlok3640 f268a212e7 [API CHANGE] tdf#49602: Remove legacy osl/profile Implementation
Change-Id: Ida2f39cd657f846c4b31fa88a46ef3e02baabdf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196372
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-23 19:36:08 +01:00
shlok3640 6c3050ea8c tdf#49602: Add unit test for non-recursive bootstrap macro expansion
Change-Id: Iae7c8d92976696472314591111a908466a3d82a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196564
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-22 08:18:28 +01:00
shlok3640 2ad97afee0 tdf#49602: Implement manual parsing of .ini files in bootstrap.cxx
Replaced legacy osl::profile with manual parser using osl::file. The
code now reads .ini file line by line to find section and keys. Added
SAL_WARN to alert if a profile file fails to open. Also, section headers
are matched by looking at the content between brackets.

Change-Id: I67ede84cde5911cd35d3944de1cebeef03f82ee0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196192
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-22 08:17:58 +01:00
Gabor Kelemen c1caac6cd6 Fix some non self contained headers in module sal sc
Change-Id: I9c3d383cbe205ec1b11f9e61b299d76fd079ea57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196634
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-18 17:46:12 +01:00
Tor Lillqvist 7b1bb740a7 Add some DISABLE_DYNLOADING ifdefs to osl/w32, as for unx
Lots of things will have to be tweaked to build core statically for
Windows. This is just one small isolated and fairly obvious trivial
commit. (Assuming that in the disable-dynloading case, for Windows we
want to drop the same dynamic library loading functions in osl as for
Unixish systems.)

Change-Id: Ica0a00d7a3d5b85e5eb933ebd5722824fbf5deeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197503
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-17 20:58:40 +01:00
Stephan Bergmann 64c0efa33f Don't consider semantics for three-segment bootstrap var refs erroneous
I had added that comment back in 4a415c4c5a
"INTEGRATION: CWS sb83 (1.39.26); FILE MERGED", but on second thought, it might
be better to consider a three-segment botostrap variable reference of the form
${file:section:key} (which are hardly used anywhere, if at all, anyway) to do
something special:  It reads the "'osl' profile" <file> and uses the value (if
any) for the given <section> and <key>, without expanding it any further, by
design.

That's in line with what the documentation in OOo's CVS
udk/www/common/man/concept/uno_default_bootstrapping.html said,

>                                 <li>
>                                 Allow indirect expansion of variables through 'osl' profiles:
>                                 <br/>
>                                 KEYVALUE=${sversionrc:versions:StarOffice6.0}
>                                 <br/>
>                                 The first part of the indirection is the file to use for
>                                 expansion, the second part is
>                                 the section and the third part is the key. After expansion the
>                                 variable KEYVALUE has
>                                 the value of the matching key of the sversionrc.
>                                 </li>

and what the original code in OOo's CVS porting/sal/rtl/source/macro.cxx
ArgParserState::expandTerm did,

>                 // do we have a section?
>                 OUString value;
>                 if (section.getLength())
>                 {
>                         // expand from profile
>                         oslProfile hProfile;
[...]
>                 }
>                 else
>                 {
>                         // expand from ini:

And it's also in line with the documentation in include/rtl/bootstrap.h stating

>    An ini-file is only allowed to have one section, which must be named
>    `[Bootstrap]` with the square brackets.
>    The section may be omitted.

Which implies that the <file> in a ${file:section:key} reference is not actually
a bootstrap ini-file (but rather an "'osl' profile"), because those bootstrap
ini-files should not have multiple sections anyway.

Change-Id: Iaf6e97a61fe5a4a330451794a62067b4add20a05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196674
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-07 17:19:19 +01:00
Stephan Bergmann 1ffc2b44e4 Actually use "..."_tstr
...after 6fce450b8a "Introduce "..."_tstr as a
companion to "..."_ostr/u"..."_ustr in template code" had introduced it for
exactly this piece of code

Change-Id: I767a9f39456d6c58c5ac0478110a0c66434b0e54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196626
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-07 08:06:21 +01:00
Stephan Bergmann 49ef699834 Adapt to fix of C++ LWG 172
...<https://cplusplus.github.io/LWG/issue172> "Inconsistent types for
basic_istream::ignore()"

Change-Id: I3a19b0528cd5c532501a09e4df706e50d9411d5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194423
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-11-24 12:50:17 +01:00
Nguyen 99d6cfe00c tdf#147021 Use std::[s]size() instead of SAL_N_ELEMENTS() macro
Change-Id: I8de92ddceca8eea0e5cd8d951df7168df4183889
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194048
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2025-11-24 01:01:05 +01:00
Yui Nguyen 87f3123c5e tdf#143148: Use pragma once instead of include guards
Changes header files of sal/osl/unx and w32

Change-Id: Ic0d611e73bb0f9677831a306afe9efd1d7abafe2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194060
Tested-by: Jenkins
Reviewed-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2025-11-16 11:05:29 +01:00
Mike Kaganski 1134053435 Improve some messages in CppunitTest_sal_osl
compareFileName function concealed the important info, so at the place
where assertions were made, no file names were shown. This e.g. gave:

 C:/Users/user/lo/LIBO-C~1/sal/qa/osl/file/osl_File.cxx(2038) : error : Assertion
 Test name: osl_FileStatus::getFileURL::getFileURL_001
 assertion failed
 - Expression: compareFileName(aFileURL, aTmpName6)
 - test for getFileURL function:

This change intends to make the results more useful, showing names.

Change-Id: Id47636327180e1d2e52f4cfe79a33b63468d0166
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193018
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-10-27 11:24:02 +01:00
Gabor Kelemen a20e7520c3 Sanity check all IwyuFilter files
This should not complain anymore:

for i in $(ls -1 */*yaml) ; do mod=$(echo "$i" | cut -d '/' -f1 ) ; bin/find-unneeded-includes --sanitycheck "$mod"; done

Change-Id: I5c4b99f5cb58c6f696b127c81edd6d323104cd7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191829
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-10-14 19:44:19 +02:00
Mike Kaganski 1a4f72f03b tdf#150118: fix call to AccessCheck
It turns out, that despite PrivilegeSet argument is documented as
optional, the function fails without it. So my advise to avoid it
was incorrect after all.

Also, SAL_WARN takes area as the first argument, and a stream as
the second. It makes no sense to "recode" GetLastError result: it
is most informative as is.

Change-Id: Ifd4d4ddc96f5e001c898f7331148b47aeee77f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192227
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-10-11 17:27:04 +02:00
Balazs Varga 1b5d039d8b tdf#150118 check file permissions on windows if have no readonly
attribute already set on a file. Check if the file has write
access, if not, set the read only flag.

Change-Id: Id3b16ffffd1d5aeb09feed7b5ff2da51fba9174c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192150
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
Tested-by: Jenkins
2025-10-10 16:24:26 +02:00
Mike Kaganski d32c664c3d tdf#168673: approx equality threshold no less than 1/2 15th significand
01:26,47 is 0.001000810185185185, which has 16 significant decimals. It
is converted to string as "0.00100081018518519" (15 significands).

The problem was, that when criterion "=0.00100081018518519" is used to
check value 0.001000810185185185, the two numbers differ in five least
significant bits, but rtl_math_approxEqual uses 0x1p-48 to ignore last
four bits only. This is a common problem for numbers close to 1.0E(N).

This change introduces a second threshold, in addition to "only take
into account 48 signigicant bits of mantissa": it calculates the value
of half of 15th decimal unit of the smaller absolute value, and uses
the greater of the two thresholds for the approximate equality.

Change-Id: I2f98ab23c94ca3a2949c3762fbfb6ea563eef94b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191883
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-10-05 14:15:36 +02:00
Mike Kaganski 7a887b1710 Use make_unique_for_overwrite for buffer created for overwrite
It's also interesting, if this function is supported by our baseline
compilers.

Change-Id: Ia1bd6ce1328ccdecfe7b880064e538ef586b8c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191809
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-10-03 10:13:47 +02:00
Stephan Bergmann c5c8e28959 Avoid some lopluign:unusedmember false positives
Change-Id: Iad8ff67ed9df8d242ff996b8a1082ad85b2e6dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191322
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-22 16:53:44 +02:00
Caolán McNamara 9d584509f7 cid#1666316 Uninitialized pointer field
Change-Id: I0225372b5e3741033eb0a9ecff1583f24f0f16ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191309
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-09-22 11:17:35 +02:00
Mike Kaganski b6feccc9a2 Replace dtoa with fast_float for faster string-to-float parsing
fast_float implements C++17 from_chars for floating-point types, which
is still unavailable even in the latest versions of compilers e.g. for
macOS. It is maintained, unlike dtoa; it is said to be adopted as the
from_chars implementation for gcc. It is header-only, which simplifies
many things.

Change-Id: I6b597d4d35a076930e6e35f4f8cff3ca84f48ba1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191248
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-21 08:17:39 +02:00
Mike Kaganski 4f98b46d39 Small normalization/cleanup
Change-Id: Ia1d3f6ae8f61ff2c3c380e191d16cdb9e23e6083
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191146
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 15:20:50 +02:00
Mike Kaganski 9984520ea5 Simplify bSign handling
No need to put the minus to the buffer, process it in conversion,
check a second special case string, and reset bSign, when we can
handle unsigned number, and negate it as needed.

Change-Id: I6b9bfb06ab984017fa0078225a1c7281a7b8a99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191145
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-20 14:54:55 +02:00
Mike Kaganski daded1002c Encapsulate buffer management in stringToDouble
Use a struct for that, and its 'insert' method, to avoid repeating code,
and make the logic more transparent.

Change-Id: I90fd4879e1b680ededc3aa4692fb6f59eeb5916c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191144
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 12:44:28 +02:00