summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2022-03-04Remove useless comment on a commented line since always (sal/w32/file_dirvol)Julien Nabet
git history gives: commit b76cb86eaa0aec1d02c5ff29c5a43e1e7a675b27 Author: Oliver Bolte <obo@openoffice.org> Date: Wed Sep 9 09:38:41 2009 +0000 CWS-TOOLING: integrate CWS mhu20 where it was already commented and from sal/osl/w32/file.cxx then digging a bit more gives: commit 73cd79644d4355de483b0d0c04fba034ac02795b Author: Rüdiger Timm <rt@openoffice.org> Date: Mon Oct 17 13:52:03 2005 +0000 INTEGRATION: CWS perform05 (1.5.52); FILE MERGED where it's also already commented. => No need to keep this Change-Id: I3e8892e8c8f4e76d2e05a8bd158e77418a12eb38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131030 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-04Avoid "ThreadSanitizer: unlock of an unlocked mutex"Stephan Bergmann
...in (somewhat contorted) test code Change-Id: I247a30e580b3d458eb748a833100a662c9890d99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130991 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-04tdf#98705 Replace GetCaseCorrectPathName with GetLongPathNameWKunal Pawar
Change-Id: I1d03267cd67da4c155248b585ca59dc5191d28f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130144 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-04Drop commented out wrong testsMike Kaganski
Change-Id: Ief086996f94978d2ffd6879a6c3e5b0b2312dffe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130962 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-04Enable tests in rtl_str.cxxMike Kaganski
And disable the tests that try to use nullptr where it's not accepted. Change-Id: I1cd031e371485fdd57e7691565376253a01049c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130938 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-03Deduplicate some char replacement functionsMike Kaganski
Change-Id: Ie65224066941dbab89abb6fc91e6cbfbc45bf201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130901 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-03-03Use a more conventional begin() / end() syntaxMike Kaganski
Also would potentially enable use in std range algorithms that take different end sentinel type. Change-Id: Ia75005caa7ce44302fc8612f5717a41d11087622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130902 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-02Unify normal/shortened, null-terminated/with-length comparisonsMike Kaganski
Change-Id: Ie154efd1e0d9b49601200ac896d5d5dd0422d504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130832 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-02Drop useless indirection and unused templateMike Kaganski
Change-Id: Icbcf56c30c9d901a4436f56a1648a7c8e7504848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130817 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-02Unify and deduplicate to[U]Int[_WithLength]Mike Kaganski
Change-Id: I05e71b36030da0a91c24b3926ee1d069912849f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130815 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-01No need to memset the allocated buffer in new_WithLengthMike Kaganski
Other places that allocate, specifically newFromStr_WithLength and ensureCapacity, don't initialize the memory. Change-Id: Iad5301313312aac24948afefb27925d52fe3c673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130762 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-28Use 'assert' where appropriateMike Kaganski
Change-Id: Id7ecf874745fb32406bcd2250a954aaf3a345103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130667 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-28Deduplicate string buffer codeMike Kaganski
Change-Id: Ia23974ad3a827c84bb1a5d633a953625aea2576a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130663 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-27More replacement functions deduplicationMike Kaganski
Change-Id: I700074cddf1be937f5fdaf90e6cc0b533a3c57ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130633 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-27Unify creation of character string copyMike Kaganski
Change-Id: Ifef89cfd98771f247a308fab58da410a7079ecfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130632 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-27Deduplicate newToAscii*CaseMike Kaganski
Change-Id: I55f4f43375037ad4247f592bc981d8718c12de68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130631 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-27Simplify newTrimMike Kaganski
Change-Id: I36e2f8b0f0f4829fba32e637fe61cebe9e67cf91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130630 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-27Deduplicate more comparison functionsMike Kaganski
Change-Id: I93aba36b7cde268e358bd96b55183533ddc70b16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130603 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-26Slightly cleanup newReplaceStrAtMike Kaganski
Change-Id: I230aa635aa797038055bdbc9453a5daa98412f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130465 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Slightly optimize newReplaceAllFromIndexMike Kaganski
Change-Id: Ie73a5e8c44458123ef03096e3e8f6c9e41c48814 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130466 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Deduplicate rtl_uString_newReplaceFirst*Mike Kaganski
Change-Id: I6e09fd8e8acc06290423c1c44cc0c175b0c47e0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Make an -fsanitize=undefined workaround conditionalStephan Bergmann
...that had been introduced with b5cb4935c268f12e63b61e035b455b0a59e67aa2 "Work around undef conversion of large double to float" but should no longer be necessary with <https://github.com/llvm/llvm-project/commit/9e52c43090f8cd980167bbd2719878ae36bcf6b5> "Treat the range of representable values of floating-point types as [-inf, +inf] not as [-max, +max]" added towards Clang 9. Thanks to Mike Kaganski for pointing me at this old code and at Richard Smith's comment at <https://cplusplusmusings.wordpress.com/2013/03/26/testing-libc-with-fsanitizeundefined/>. Change-Id: I8ecf115fcf6b1ebf621cb4567f8d31ac9b10ef1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130531 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-25Don't invent another strlenMike Kaganski
Change-Id: I7f7b7029ac03b1f06f4d9c2612b9b008b033baea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130538 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Use some rtl functionsMike Kaganski
Change-Id: I12fe2f5fe447e2bc6567e3d0375f1671e781697e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130515 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-25Deduplicate some comparison functionsMike Kaganski
Change-Id: Iffeb4323c99649d45387981ec583fdcff207ec4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130512 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-24Deduplicate rtl_*String_newConcat*LMike Kaganski
Change-Id: I9712cd8a2798fe5493dffd557e68239d9db3b7aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130501 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-24Deduplicate rtl_*str_valueOf{Float,Double}Mike Kaganski
Change-Id: Ie3254fbf6178f4e623fd8209b58e9f19d2c46d2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130480 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-24Fix warning textMike Kaganski
Change-Id: I42d0b3a19809a288630cfba6c01bcd5c4fde7702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130454 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-24Deduplicate valueOf*Int*Mike Kaganski
Change-Id: Ib9da148c371f52ee8da2848581bb8a024f97de96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130479 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-23Use rtl::isAsciiMike Kaganski
Change-Id: Iab88c3281f3dd1ba1668b3372420c97087c14da5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130381 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-23Simplify NewCopy a bit; avoid direct use of memcpyMike Kaganski
Change-Id: I197978604d0dfa997c95b907715ce891211621f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130380 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-23Deduplicate newFromStr*Mike Kaganski
Change-Id: I01dd9d70affdfa048af6bd7455301e662290e662 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130370 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-23Deduplicate shortenedCompare*_WithLengthMike Kaganski
Change-Id: Ie1ba2787036955976f43217e64af889a314a2e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130325 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-23Drop obsolete codeMike Kaganski
Change-Id: Ia362d00c7637370f4dc967763892269909f06578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130369 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-22Deduplicate newReplaceMike Kaganski
Optimize some places for single character case for that Change-Id: I99b2abd2fd3c89a98ed1d84f7b70ed4def83da2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130371 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-18Define policy to optimize to_decimal to our use caseMike Kaganski
We don't need it to strip trailing zeroes (we do that ourselves anyway); also we don't need it to handle negatives. Makes doubleToString ~5% faster in my testing. Change-Id: Ie3c4e3fec1899364af54fda3f7141678a95359d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130120 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-17Use Dragonbox to implement doubleTo*String*Mike Kaganski
This header-only library is accurate in decimal representation of doubles; provides API that allows to create custom representation - so it's possible to use custom decimal separators and grouping. This allows to unify all corner cases: integers, numbers close to DBL_MAX, up-rounding to the next decade. Note that Dragonbox creates the shortest decimal representation of the number, that is unambiguously convertible back to the same number; thus it may hide trailing digits that are unneeded for such conversion. The functional changes are minimal, and beneficial: 1. Rounding numbers close to DBL_MAX now takes into account the bEraseTrailingDecZeros argument, as it should, allowing to have "1.8E+308" for rounding DBL_MAX to 2 decimals without trailing zeroes, instead of previous "1.80E+308". 2. Incorrect rounding is fixed in some cases, e.g. 9.9999999999999929 rounded to 10 previously using rtl_math_DecimalPlaces_Max. 3. Representing the number in the shortest way may change display of some printed numbers. E.g., 5th greatest double is represented as "1.797693134862315E+308" instead of a bit longer, but giving the same double on roundtrip, "1.7976931348623149E+308". This would generally look better for some numbers similar to the famous 0.1, where users would likely expect more "round" representation where it's unambiguous (but we still truncate to 15 significant decimals anyway - so there's no point in pretending to provide exact digits for actual binary representation). These are reflected in the unit tests affected by the change. Change-Id: I05e20274a30eec499593ee3e9ec070e1269232a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129948 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-17Deduplicate some codeMike Kaganski
Change-Id: Ib05624739cce31b08fc409f238d447ed8d99bad9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130016 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-17Bump Linux Clang baseline to 8.0.1Stephan Bergmann
...as discussed in the mail sub-thread starting at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088476.html> "Also bump Linux Clang baseline to 12.0.1 (was: Bump --enable-compiler-plugins Clang baseline?)", and clean up newly-obsolete __clang_major__ checks Change-Id: Idacb9148b019c07e138277df3a085ba71c64a8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130028 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-16Related: tdf#147421: optimize O(U)String's replaceAll*Mike Kaganski
... and underlying low-level C functions. Change-Id: I78c2dd75e272e6d3cdd2cfae007ca0a0ec1635e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129942 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-16De-duplicate some codeMike Kaganski
Change-Id: I355fd800e09cef0776408375bd4d6053048d7eb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129943 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-03Call SymInitialize only onceMike Kaganski
Also simplify the logic by passing fInvadeProcess = false there, since passing true is the same as calling SymRefreshModuleList explicitly. Fixes an overlook from commit 853a058ca6b75b0fb14e232911eb9f9553574736. Change-Id: I296f06845a9f92375908d72e69574c2ecd190028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129338 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-01-19WASM setup as non-multiuser, desktop buildJan-Marek Glogowski
Change-Id: I2ee6e006554cf1e5e5e42c2f4f73d8788bff8f4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128585 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-19WASM more initial bits and piecesJan-Marek Glogowski
All the small stuff, which is needed for the WASM build, but is not really worth an extra patch. * No soffice.sh script needed for WASM * WASM soffice.bin executable extension is html * Some small additional SAL_LOG output * Default to colibre icon theme * Test for qt5 even without X11 * Remove emconfigure artefacts at the end of the configure run * No oosplash for WASM * Disable the Office IPC thread * Suppress -Wno-enum-conversion for Cairo builds * Fix libnumbertext by using gb_EMSCRIPTEN_CPPFLAGS * Map EMSCRIPTEN to LINUX nls * No extra newlines for missing icon theme images * Print the missing dependency in some gbuild error messages * Copy Qt WASM loader, HTML template and SVG logo for binaries * Especially build the vcldemo for Emscripten Change-Id: I356370c72cc09357411e14d0c00762152877a800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128584 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-18Add HAVE_(UNIX_)DLAPI config header defineJan-Marek Glogowski
..., add the configure test flags and rename DLOPEN_LIBS to UNIX_DLAPI_LIBS. Initinally convert two dlsym callers to use HAVE_DLAPI and osl_getAsciiFunctionSymbol. There are a lot of places, which still use -ldl and even more direct dlsym calls; good opportunity for many simple EasyHacks. Change-Id: I4f2d2f7cb079a075af8f9d01eb5ee45de40c7f03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128523 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-11Fix ISO C++11 -Wwritable-stringsJan-Marek Glogowski
osl/unx/nlsupport.cxx:863:18: warning: ISO C++11 does not allow \ conversion from string literal to 'char *' [-Wwritable-strings] Change-Id: I45da986ad8992716df9d1f9a0cc443fdb9cd46ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128213 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-10Use one define for the common NLS archsJan-Marek Glogowski
Just some refactoring. Change-Id: I9edae9bce381dcd9fdcb98471d461d00220fea57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128218 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-08Unify condition names and fix "else" pathsJan-Marek Glogowski
Drop Build prefix and settle on Lib and Exe prefixes. Also add a note about the "else" part of the condition and fix offenders. While at it, define COND_LIB_SAL_TEXTENC to be used by sal to prevent diverting coditions in build and cxx code. Change-Id: I944587ca1ccbe46b765d1a631a7214c8126fe951 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128136 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-07Use CreateThread instead of _beginthreadexMike Kaganski
Change-Id: I4a106a670daaca85cefed08c7baeaa980841a233 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128117 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-07loplugin:redundantcastStephan Bergmann
Change-Id: Ia68f492ebd4ac81feb44e736c53f0f4a2d99274d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128096 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>