summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2023-10-11The other OStringLiteral ctor should be non-explicit tooStephan Bergmann
It had been missed by 31cd6fd0f3c856a81a03d0229de1c4d10442844f "Make OStringLiteral ctor non-explicit", and now prevented u8"..."_ostr from compiling. Change-Id: Ifb214fba0957b0d26b11daae6190ffa9d21713f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157823 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Delete OUString UTF-16 string literal ctor/assignment opStephan Bergmann
...that have been made unused by 7ef3d937415185ef66e32dd3043783eddcd03db5 "loplugin:ostr: Rewrite some uses of O[U]String to use ""_ostr/u""_ustr literals". (And which means we can remove the relevant code from that plugin again.) (This also found a handful of remaining uses that had been hard for the plugin to discover, along the lines of > std::map<OUString, int> m = {{u"foo", 0}}; being represented by a > DeclStmt 0xdaca578 <line:103:5, col:50> > `-VarDecl 0xdac9150 <col:5, col:49> col:29 s11 'std::map<OUString, int>':'std::map<rtl::OUString, int>' cinit destroyed > `-ExprWithCleanups 0xdaca548 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' > `-CXXConstructExpr 0xdaca508 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' 'void (initializer_list<value_type>, const std::less<rtl::OUString> &, const allocator_type &)' list std::initializer_list > |-CXXStdInitializerListExpr 0xdaca480 <col:35, col:49> 'initializer_list<value_type>':'std::initializer_list<std::pair<const rtl::OUString, int>>' > | `-MaterializeTemporaryExpr 0xdaca468 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' xvalue > | `-CXXBindTemporaryExpr 0xdaca448 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' (CXXTemporary 0xdaca448) > | `-InitListExpr 0xdac9df0 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' > | `-CXXConstructExpr 0xdaca408 <col:36, col:48> 'const std::pair<const rtl::OUString, int>' 'void (const char16_t (&)[4], int &&) noexcept(_S_nothrow_constructible<const char16_t (&)[4], int>())' list > | |-StringLiteral 0xdac91b8 <col:38> 'const char16_t[4]' lvalue u"foo" > | `-MaterializeTemporaryExpr 0xdaca3f0 <col:46> 'int' xvalue > | `-IntegerLiteral 0xdac91d8 <col:46> 'int' 0 > |-CXXDefaultArgExpr 0xdaca498 <<invalid sloc>> 'const std::less<rtl::OUString>':'const std::less<rtl::OUString>' lvalue > `-CXXDefaultArgExpr 0xdaca4b8 <<invalid sloc>> 'const allocator_type':'const std::allocator<std::pair<const rtl::OUString, int>>' lvalue Clang AST.) Change-Id: I496fe9d4d5e1a033cb7b27b4e04b303f8ddbed4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157756 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-01Fix iOS build breakages when building on macOS SonomaPatrick Luby
Change-Id: I347e48e9da69c8c9b15581a5afa5c61cdd1d380d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157411 Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Patrick Luby <plubius@neooffice.org>
2023-09-29Drop some newly obsolete __cplusplus version checksStephan Bergmann
...after 1eef07805021b7ca26a1a8894809b6d995747ba1 "Bump baseline to C++20". Which revealed that at least for VS 2019 16.11.30 (but not for at least VS 2022 17.7.4), in /clr mode (e.g., when compiling cli_ure/source/climaker/climaker_app.cxx), the -std:c++20 is effectively ignored, and compilation of such source files failed with > include\rtl/string.hxx(191): error C2955: 'rtl::OStringLiteral': use of class template requires template argument list > include\rtl/string.hxx(88): note: see declaration of 'rtl::OStringLiteral' > include\rtl/string.hxx(191): error C7592: a non-type template-parameter of type 'rtl::OStringLiteral' requires at least '/std:c++20' > include\rtl/string.hxx(397): error C2955: 'rtl::OStringLiteral': use of class template requires template argument list > include\rtl/string.hxx(88): note: see declaration of 'rtl::OStringLiteral' etc. To work around that, keep the 27d1f3ac016d77d3c907cebedca558308f366855 "O[U]String literals (unusable for now, C++20 only)" functionality disabled when compiling /clr sources (i.e., where _MANAGED is defined) for that old compiler. Change-Id: If62ceef5f8e55a828b880f197111fe387e4953fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157205 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-28cid#1546363 Unused valueCaolán McNamara
Change-Id: I416db8a528b4db3f4d4449ec371c0935b29568ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157350 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-26tdf#157448: ignore FILE_ATTRIBUTE_READONLY when FILE_ATTRIBUTE_DIRECTORY is setMike Kaganski
Change-Id: I3fbcf15924b30e2c7fe5501e706cdaf32921e103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157263 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-09-24Drop some newly obsolete __clang_major__ version checksStephan Bergmann
...after 6ef2d358ac053ce0f6de9cf0f8f25e8bae66d441 "Adapt Clang and GCC minimum version checks" Change-Id: Ib25fbb76211d1bda1d230de771f207960e645421 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157204 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-24Drop some newly obsolete __GNUC__ version checksStephan Bergmann
...after 6ef2d358ac053ce0f6de9cf0f8f25e8bae66d441 "Adapt Clang and GCC minimum version checks" Change-Id: I5f3bcda2ce8e0e093af3bdd9d2cca741a5b95306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157202 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-19tdf#146619 Remove unused includes from sal/ [cpp files]Gabor Kelemen
Change-Id: I11a54c1ddf73c16ce46a0d1c375bf43157870db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155856 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-30tdf#146619 Remove unused includes from sal/osl/unxGabor Kelemen
Change-Id: Icc9cd3410cde2589ea51385c651243e11cc2f1d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155855 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-22tdf#146619 Remove unused includes from sal/qaGabor Kelemen
also drop now-unused osl_Condition_Const.h Change-Id: I40beb5b1ad49c126a126bb444d5f66703664d56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155820 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-14tdf#146619 Remove unused includes from sal/ [headers]Gabor Kelemen
Change-Id: I8fae71e5053950441a2e0920590264c2cb858924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155546 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-12Use less boost_headers in salGabor Kelemen
Change-Id: I2403143fc5c33c95755f1c7f5d6c8f9dbff23226 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09tdf#146619 Remove unused includes from sal/ [system.hxx]Gabor Kelemen
Change-Id: I30f3ce338e86f1a6dad5e16023ce4c883079fbcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155351 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-08-09Use _beginthreadex instead of CreateThreadMike Kaganski
The documentation for ExitThread [1] has this comment: A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multithreaded version of the CRT. If a thread created using CreateThread calls the CRT, the CRT may terminate the process in low-memory conditions. Since ~all our code uses CRT, be safe and use _beginthreadex. [1] https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread Change-Id: If3e566592e921b00240e08aa759d8cdbc421d44b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155513 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-07Remove unused header fileGabor Kelemen
Seems like it was committed accidentally Change-Id: Idc086b7b92ef9c4a8b3bafa2114b7da3e8d42618 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155350 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-08-07Drop unnecessary header osl_Mutex_Const.hGabor Kelemen
It only contained a single define used in a single file Change-Id: If9f16ab13bb28d2923b97390f1acb013101d0a09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155349 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-04Avoid a Clang template instantiation bug with libstdc++ and C++20Stephan Bergmann
See patch set 2 of <https://gerrit.libreoffice.org/c/core/+/155121/2> "Bump baseline to C++20" for how that would affect us here, > /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/basic_string.h:620: error: undefined reference to 'void std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t> >::_M_construct<char16_t const*>(char16_t const*, char16_t const*, std::forward_iterator_tag)' > clang-12: error: linker command failed with exit code 1 (use -v to see invocation) > make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/solenv/gbuild/LinkTarget.mk:841: /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/workdir/LinkTarget/CppunitTest/libtest_sal_rtl.so] Error 1 (<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/145874/>) Change-Id: Ibda1a5687a16e45aa0e77958f2bf547766cb0f48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155343 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-01tdf#146619 Remove unused #includes from C/C++ filesVenetia Furtado
Change-Id: Ia8b406b6a59086160a5167480c6d3bde6574ffbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155029 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-07-31loplugin:stringconstant: Catch some O[U]String::getStr anti-patternsStephan Bergmann
Change-Id: I36bc86fcffc3c10fe44e60d779c9aa48eeed00f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154749 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-31Fix C++20-only "..."_tstr test codeStephan Bergmann
...added by 6fce450b8a66d7e98a4d39528f8591184277e9fa "Introduce "..."_tstr as a companion to "..."_ostr/u"..."_ustr in template code" Change-Id: I779cf8e586b2a57aadfe9e57a546ee613bb505e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155093 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-31Introduce "..."_tstr as a companion to "..."_ostr/u"..."_ustr in template codeStephan Bergmann
...like > *path = "/"; in > template<typename T> oslFileError getSystemPathFromFileUrl( > OUString const & url, T * path, bool resolveHome) in sal/osl/unx/file_url.cxx, where T is either OString or OUString. That can now be replaced with > *path = "/"_tstr; and for OString it will be a no-cost constexpr operation, while for OUString it will still construct the OUString instance at runtime (as did the original code for both OString and OUString). (This change required moving the definition of rtl::detail::OStringHolder around in include/rtl/string.hxx. For consistency, I similarly moved around the definition of rtl::detail::OUStringHolder in include/rtl/ustring.hxx, too.) Change-Id: I7fb3a81b438f98c609684f7e70b7a60068d32fdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154748 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-21tdf#139306 Incorrect nDecPlaces value after clampingVladislav Tarakanov
nDecPlaces clamping diap changed from +-20 to +-309 and buffer is resized for new value Change-Id: Icb2130891598cf02623bbf5bd0273edab529d124 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153815 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2023-07-19Work around MSVC bug with "..."_ostr vs. u"..."_ostrStephan Bergmann
Since 27d1f3ac016d77d3c907cebedca558308f366855 "O[U]String literals (unusable for now, C++20 only)", <https://developercommunity.visualstudio.com/t/Using-same-string-literal-suffix-for-cha/10416970> "Using same string literal suffix for char and char16_t string overloads causes 'no matching overloaded function found'" caused --with-latest-c++ builds to fail with > sal/qa/rtl/strings/test_oustring_stringliterals.cxx(432): error C2672: '""_ostr': no matching overloaded function found > include\rtl/ustring.hxx(3604): note: could be 'rtlunittest::OUString operator ""_ostr(void)' > include\rtl/string.hxx(2402): note: or 'rtlunittest::OString operator ""_ostr(void)' > sal/qa/rtl/strings/test_oustring_stringliterals.cxx(432): error C2672: 'CppUnit::assertEquals': no matching overloaded function found > workdir\UnpackedTarball\cppunit\include\cppunit/TestAssert.h(161): note: could be 'void CppUnit::assertEquals(const T &,const T &,CppUnit::SourceLine,const std::string &)' > sal/qa/rtl/strings/test_oustring_stringliterals.cxx(432): note: 'void CppUnit::assertEquals(const T &,const T &,CppUnit::SourceLine,const std::string &)': expects 4 arguments - 3 provided etc. So help MSVC along by renaming from u"..."_ostr to u"..."_ustr for now. Change-Id: Iad401f0681ac9326b7c57259c5483263ddfbfd4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154634 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-14O[U]String literals (unusable for now, C++20 only)Stephan Bergmann
Change-Id: I0ecd1a8b60a01aefdf0139e3777dc006532764fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154434 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-12Simplify a bitMike Kaganski
Change-Id: Idd3e96d99f13b1e87e2a01de9c9392ead0864de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154323 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-10Fix typoAndrea Gelmini
Change-Id: Ic70380a7a3d8cefca5214ea70b87e92772535c6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154232 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-09No need to clean up the desktop, when the process is finishingMike Kaganski
It will be cleaned up anyway. Change-Id: I67b936ee0d89280555e6d595fd53957952900057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154226 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-09cppunittester: use a dedicated desktop on WindowsMike Kaganski
Since introduction of accessibility tests infrastructure in commit 0185ddd6d5f0324ba57b3fa36229103a6b27138e (Add infrastructure and basic tests including slight UI interaction, 2022-08-01) and the respective tests, running 'make check' on Windows produces pop-up dialogs, while these tests run. These dialogs distract, steal focus, swallow text that I type elsewhere, and may fail the tests if accidental user input interferes with what the tests check. This commit creates a dedicated system desktop for cppunittests, which would be isolated from the active desktop, yet allow creation of windows, thus not preventing accessibility testing. This way, it workarounds unavailability of svp vcl plugin on Windows. Change-Id: I83db54c82bfe98d14171355cc19cdd5767549fdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154194 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-16tdf#143148: Use pragma once instead of include guardsVenetia Furtado
Change-Id: I83c7405c61edd2c92ad624064326ba9c9e971313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153164 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-06-02tdf#145538,tdf#147021: qa: range based loopsDr. David Alan Gilbert
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-05-07Revert a thinko from commit 876010cbc4584249e919c694b8b977fd4e83084eMike Kaganski
Indeed, the cDecSeparator and cGroupSeparator require that the buffer uses the proper character type, otherwise it won't be possible to use Unicode separators in rtl_math_doubleToUString. Change-Id: Id26bed72776475c1be5b092e3ffcff0e75ffe557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-06update loplugin:stringview* for o3tl::iterateCodePointsNoel Grandin
And change o3tl::iterateCodePoints to use sal_Int32 for its second param, to integrate better with places where the parameter comes from an UNO API, which cannot use std::size_t Change-Id: I7b9dd2c9bc7f48e6c4a912f039f1b5dae7beae69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-06Simplify rtl_(u)string_newReplace implementationMike Kaganski
and unify with *ToAscii(Lower/Upper)Case Change-Id: I06999b4f5f34abc8da2860b7f9e279608edb40dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151381 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-06Simplify a bitMike Kaganski
No need to use different temporary objects here Change-Id: I1b47cae8b80adea5426c780003bddf68310a0060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151380 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-05loplugin:unnecessarygetstrStephan Bergmann
The plugin in its current form is probably not intending to find these cases. But it happened to do so on macOS with libc++, where the std::basic_string ctors taking a final defaulted Allocator argument are instead implemented by a pair of overloaded ctors, one taking no Allocator at all (see 671d1c6cd14b28b5960ad56086299bd69533dfd8 "Adapt loplugin:unnecessarygetstr to libc++"). But these changes here are useful regardless, so lets leave it at that. Change-Id: I2776671e2953182bdcad36432951a75f82412ebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151410 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-04Provide std::u16string_view based o3tl::iterateCodePointsStephan Bergmann
...as requested in the comments of <https://gerrit.libreoffice.org/c/core/+/151303> "a11y: Fix returning unpaired surrogates when retrieving characters" (incl. the additional preAdjustIndex parameter). The type of the indexUtf16 parameter obviously needed to be adapted to std::u16string_view's std::size_t. But there is no obvious best choice for the type of the incrementCodePoints parameter (int? std::ssize_t?), so lets leave it as sal_Int32. For simplicity of avoiding a Library_o3tl, and to allow o3tl::iterateCodePoints to be used in the implementation of rtl_uString_iterateCodePoints now, o3tl::iterateCodePoints is provided as an inline function defined in the include file. Change-Id: I8280ca11d2a943bd2b7150a266807b358f321a72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151366 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-02tdf#155122: implement CtrlHandler on WindowsMike Kaganski
Change-Id: Ia766db91030528c320a27a2d608bd0ec0a34f31b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151261 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-02improve windows backtrace_to_stringNoel Grandin
I want to know the symbol address we actually capture, since we seem to getting duplicates in the output of SymFromAddr, I want to know if the fault is in SymFromAddr, or the backtrace capture call. Change-Id: Iece9c204abb780ae6b67a11e6ba77db816351e8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-29Simplify strtmpl.hxxMike Kaganski
Replace bulky and difficult-to-read template argument names with clearer ones; remove excessive whitespaces; reorder to avoid forward declarations (these are remnants from the refactor from macros to templates, when I tried to keep the old structure as close to the original as possible). And also a small code simplification in doubleToString. Change-Id: I901cfb86daf410e85269538f36ebb6b553a4be76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151125 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-22Introduce sal::systools::CoTaskMemAllocated to use RAII for CoTaskMemFreeMike Kaganski
Change-Id: I5553138bfc8dd989e68b8bcc2be981746e8c1e84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150783 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-17loplugin:stringaddStephan Bergmann
Change-Id: I674655aa4bfe38675dd3c9d677a7d7c64b3eaac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150478 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-12Use o3tl::trim in strtmpl.hxxMike Kaganski
Change-Id: I4de8658c36c21fe07fa45f697cf3145c567a95c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150210 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-11fix dbgutil build on win/aarch64 (print stack from cppunittester)Christian Lohmaier
Change-Id: I632607599060e625bda3dabee627ae1ddd6bd709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150102 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2023-04-10Use of O(U)StringNumber for float/double is actually a pessimisationMike Kaganski
They use rtl_(u)str_valueOf(Float|Double), to fill the buffer, and the latter use doubleToString, which creates an rtl_(u)String, copies to the buffer, and releases the rtl_(u)String. So instead just use the rtl_(u)String from rtl_math_doubleTo(U)String directly. Even when the end result is not needed as O(U)String, this would avoid an extra copy step. Also, this avoids separate LIBO_INTERNAL_ONLY implementations. Change-Id: Ib1d9ecebd7876dfff7dc758f89ee4c1536647a50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150150 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-09use more OStringToOUStringNoel Grandin
both because it is more obvious to read, and it takes a string_view, which is handy Change-Id: Ic201cfa0434446f51436d23c33d3f1a919ed65be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150167 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-05Simplify O(U)String::number implementationMike Kaganski
Change-Id: I059f0324597a90aee01c95170a48ac5578f3caee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150037 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-04Make O(U)String::boolean also return an O(U)StringNumberMike Kaganski
Change-Id: I184fa0e4e45662e0fac86076d1c8733a0465bb56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149978 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>