summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2021-04-12Use more std libMike Kaganski
Change-Id: Idc9a619562b278eed513033c7450a16516b7d3a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113980 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-12Unify on std::basic_string_view for indexOfStrMike Kaganski
A follow-up for 5ebccaa07589383653dbd65e58204a82dd3cde09 and 5a11edc795d8a3ef1e15fc4e251f594911403131 Change-Id: I58c1f518967cb98bd7edecd655d5be0d4657a1ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113938 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-10use std lib for sal_Unicode version of indexOfChar_WithLengthNoel Grandin
if possible, which will probably have a better word-at-a-time algorithm. Change-Id: Ia338a0aad81ef450d482701139f131d6d577b737 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113922 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-10use std lib for O[U]String indexOfStrNoel Grandin
if possible, which will probably have faster implementations. Change-Id: I403d4c3c0f5407412a2284a90fd5abc083881d18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-25const OUString -> const OUStringLiteralMike Kaganski
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-15Deduplicate trim implementationsMike Kaganski
Change-Id: I9233e9d6f11d9abf90ff27769673ba67555a9dde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-12Fix typosAndrea Gelmini
Change-Id: I7366c5e7d6c9fb4dd7aa17a5d0405f28179a92af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112399 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-12tdf#126742 make Windows file handling more unx-likeArmin Le Grand (Allotropia)
The bug mentioned happens due to a system-dependent difference: Unx-systems allow files to be opened for write multiple times while our windows implementation until now did prevent that. For that reason an embedded OLE which is still opened in the same LO instance behaves wrong/strange - the e.g. changed size cannot be written (to the file). Since we already have unx-like handling and in that scenario useful sync has to be done anyways, no new scenario will be created. Only Windows implemenation will change to behave closer to unx-like behaviour, I already test-built that on gerrit to make sure all tests for Windows work as before. I thought about this for quite some time, but see no too big risk. For thoughts/discussion please refer to the task. Change-Id: I8dbfd70c2f69d0a013f445e152e597f37fa6ecc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112237 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-04Also check number of invocations in the testMike Kaganski
Change-Id: I4180f14aa633bf0f3f45178c1fd02b52b784f7e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111960 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-04The backtrace() etc API is available on macOS and iOS, tooTor Lillqvist
Change-Id: I9a62391c4d109cd2fd2ab60d92a9e3b631ee6773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111951 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-03-04Improve unit test accuracyMike Kaganski
I didn't take clock resolution into account when created the test, and it failed for me occasionally because the value was slightly less than expected. The typical system tick resolution is documented at https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers Change-Id: Ie48b10d15b14f9ac7d292a2cc9916bcbfff44b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111946 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-03tdf#116983 tdf#136175: retry if failedMike Kaganski
Debugging the test case from the latter bug report shows that indeed the call to OleGetClipboard may fail first time, as jasonkres had suspected in the former bug. So follow the suggestion in tdf#116983, and retry the failing calls several times in case of failure. Many thanks to Telesto for preparing a clear bug report with reliable test case. Co-authored-by: jasonkres Change-Id: Ib3c497da830bc5faac586bcfe1eededa54bfa117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111825 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-27Drop ComPtr and use sal::systools::COMReferenceMike Kaganski
Change-Id: I9eb6d99d883b44943ad69c2c28d4e55716dc34f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111673 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-16tdf#137208 Assume that dladdr provides an absolute pathnameStephan Bergmann
3dfb38a45d6495d357c3359b5b02cde871df6f67 "added getUrlFromAddress (#88338#)" had introduced the call to osl_getAbsoluteFileURL for no documented reason, but it looks unlikely that any relevant implementation of dladdr (as called by getModulePathFromAddress; and where dladdr is a non-POSIX extension on the various platforms) would provide pathnames that are relative to the process's CWD. (Instead, add a check whether osl_getFileURLFromSystemPath succeeds.) Change-Id: If291e9fdf63fc3f42ba7c7e3138d7db5328ed165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111004 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-16Remove dead "defined(ANDROID) && !defined(DISABLE_DYNLOADING)" codeStephan Bergmann
4b7e701024219be48b7f8154a508c79cb0a6fdc1 "Use DISABLE_DYNLOADING on Android" has removed lo_dladdr, so this conditional code is apparently dead, and its clean-up was presumably forgotten in that commit. Change-Id: Icf8e4056366f90837c48dd2fcf45936f8015eb43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110981 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-15Do not remove '/' when it's the only character in the pathMike Kaganski
Follow-up to commit 3380163bc0fb9dab7f289cc36b0eeb0c9b3ddaa9. Change-Id: I5e895755cb4b2432c8ac423d254f493764dead75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110899 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-15Reuse known length of the temp dir pathMike Kaganski
And make this code a bit more C++-ish. Change-Id: I59d4f46698ad4606f09e6ffcae8f205798b427ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110912 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-12Make sure osl_getTempDirURL result doesn't end with / also on unxMike Kaganski
This is consistent with what osl_getTempDirURL does on Windows This is a blind attempt to fix a part of a failure reported on IRC: /lode/dev/core/sal/qa/osl/file/osl_File.cxx:486: Assertion Test name: osl_FileBase::getAbsoluteFileURL::getAbsoluteFileURL_001_1 equality assertion failed - Expected: file:///var/folders/tj/jl7sh26124n4b94tm541m6xr0000gn/T//relative/file1 - Actual : file:///private/var/folders/tj/jl7sh26124n4b94tm541m6xr0000gn/T/relative/file1 - Assumption is wrong: ResultURL is not equal to expected URL That "//" in Expected might be because user's TMPDIR ends with /. Change-Id: I9a9c6e00f63b81dbaf2e8532110dffa58ebe8cc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110784 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2021-02-12Make sure to resolve symlinks in temp path in path testsMike Kaganski
This is a blind attempt to fix a part of a failure reported on IRC: /lode/dev/core/sal/qa/osl/file/osl_File.cxx:486: Assertion Test name: osl_FileBase::getAbsoluteFileURL::getAbsoluteFileURL_001_1 equality assertion failed - Expected: file:///var/folders/tj/jl7sh26124n4b94tm541m6xr0000gn/T//relative/file1 - Actual : file:///private/var/folders/tj/jl7sh26124n4b94tm541m6xr0000gn/T/relative/file1 - Assumption is wrong: ResultURL is not equal to expected URL That "private/" in Expected might be because user's /var is a symlink to /private/var. Change-Id: Ia5b95621dffdae7e0193aca4c3d12c86ed28dceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110785 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2021-02-10Fix creation of some OUString from non-ASCII ordinary string literalsStephan Bergmann
On platforms where char is signed, > OUString aTmpName10(aTempDirectoryURL + "/\xE6\x9C\xAA\xE5\x91\xBD\xE5\x90\x8Dzhgb18030"); would have created, via addDataLiteral (include/rtl/stringconcat.hxx), an OUString containing sign-extended char16_t counterparts of the \x char values (\xE6 -> \uFFE6, etc.). That caused CppunitTest_sal_osl CPPUNIT_TEST_NAME=osl_FileBase::SystemPath_FileURL::getSystemPathFromFileURL_005 under an RTL_TEXTENCODING_ISO_8859_1 locale (e.g., LANG=C, as used by Fedora when executing the %check part of libreoffice.spec) to fail on such signed-char platforms (e.g., Linux x86_64) with > [_RUN_____] osl_FileBase::SystemPath_FileURL::getSystemPathFromFileURL_005 > createTestDirectory failed: 21! > sal/qa/osl/file/osl_File.cxx:267:osl_FileBase::SystemPath_FileURL::getSystemPathFromFileURL_005 > assertion failed > - Expression: (osl::FileBase::E_None == nError) || (nError == osl::FileBase::E_NOENT) > - In deleteTestDirectory function: remove Directory file:///tmp/?????????zhgb18030 -> result: 21 because FileURLToPath -> osl::detail::convertUrlToPathname -> getSystemPathFromFileUrl<rtl::OString> -> decodeFromUtf8 -> convert (all sal/osl/unx/file_url.cxx) would fail to convert those values beyond \u00FF to RTL_TEXTENCODING_ISO_8859_1, ultimately returning osl_File_E_INVAL (i.e., 21). (We could "fix" addDataLiteral in include/rtl/stringconcat.hxx, explicitly converting from char to char16_t via unsigned char, but arguably that concatenation construct should only be used with ASCII-only ordinary string literals, similar to the restrictions for OUString construction from such string literals.) (Before 5a77636c9a638c86fd3de3afb6e88cf48f987b6a "WIN enable osl_File.cxx part of CppUnitTest_sal_osl", that aTmpName10 was constructed as > OUString aTmpName10(RTL_CONSTASCII_USTRINGPARAM( FILE_PREFIX TEST_PLATFORM TEST_PLATFORM_TEMP "/\xE6\x9C\xAA\xE5\x91\xBD\xE5\x90\x8Dzhgb18030" )); but that would have caused similar issues, as RTL_CONSTASCII_USTRINGPARAM uses RTL_TEXTENCODING_ASCII_US which converts non-ASCII chars to RTL_TEXTENCODING_MS_1252 (see comment at aImplUSASCIIByteCvtData, sal/textenc/textenc.cxx), which would have converted e.g. \x9C to \u2018, which then would have failed to be converted to RTL_TEXTENCODING_ISO_8859_1. And that use of RTL_CONSTASCII_USTRINGPARAM had violated the requirements as stated in include/rtl/ustring.h anyway: "Each element of the referenced array must represent an ASCII value in the range 0x00--0x7F.") Whatever this crappy getSystemPathFromFileURL_005 actually wants to prove, it happens to work now also for RTL_TEXTENCODING_ISO_8859_1 locales. Change-Id: I044c4bd3aee4f7ea4f29737b6876cc55e4e6e436 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110714 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-10use zlib crc32() rather our own implementationLuboš Luňák
They compute the same thing, only zlib can do it four bytes at once. Since crc32() is used when loading documents, with larger documents this is a difference than can be measured (not much, but a couple percent of loading time). And we already depend on zlib anyway. Change-Id: I65c5a1f050af717a5a2d6e334e216d42c4e4dbbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110651 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-02-10Be a bit more verbose in that crappy test codeStephan Bergmann
Change-Id: Ic0500db292d52a827f2139cd2cbbc0e8e4274dac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110701 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-10Fix dependency of CppunitTest_sal_osl on CppunitTest_Module_DLL libraryStephan Bergmann
The former only depends on the latter's library, not on actually running the latter test. (Something like > $ make CppunitTest_sal_osl CPPUNIT_TEST_NAME=osl_FileBase::SystemPath_FileURL::getSystemPathFromFileURL_005 > make -j 12 -rs -f Makefile.gbuild CppunitTest_sal_osl > [CUT] Module_DLL > > Fatal error: CPPUNIT_TEST_NAME contains no valid tests > > Error: a unit test failed, please do one of: > > make CppunitTest_Module_DLL CPPUNITTRACE="gdb --args" > # for interactive debugging on Linux > make CppunitTest_Module_DLL VALGRIND=memcheck > # for memory checking > make CppunitTest_Module_DLL DEBUGCPPUNIT=TRUE > # for exception catching > > You can limit the execution to just one particular test by: > > make CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params... > > make[1]: *** [solenv/gbuild/CppunitTest.mk:125: workdir/CppunitTest/Module_DLL.test] Error 1 > make: *** [Makefile:166: CppunitTest_sal_osl] Error 2 thus used to fail rather unexpectedly.) Change-Id: Id6051b192679d598100bbb5eae854bef59af9f44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110698 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-10Fix loplugin:stringliteralvarStephan Bergmann
...detection of OUString( const sal_Unicode * value, sal_Int32 length ) ctor. (On platforms where sal_Int32 is a typedef for int, an argument that already is of type int will not be wrapped in an ImplicitCastExpr to the sal_Int32 typedef.) Change-Id: Ifc5456a62d42c1acad76ea949549dc24bd67201a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110654 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-09loplugin:fakebool followed by loplugin:implicitboolconversion (clang-cl)Stephan Bergmann
Change-Id: I0f61268b2027eb617b2312615ea544387af1b381 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110643 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-09report what value was found in messageCaolán McNamara
Change-Id: I512cedcd46f829b97b62a57d90d5a4a81d024d66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110562 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-08Remove unneeded breaksAndrea Gelmini
Extending this: https://gerrit.libreoffice.org/c/core/+/110512 Change-Id: I1c5bfcddeb0f5619dc848bbf02408cf166bebc8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110521 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05Revert "Fix typo in code"Stephan Bergmann
This reverts commit 3ed9bba283a6a67864c0928186e277240be0d9ba. osl_Pos_Absolut (include/osl/file.h) is part of the stable URE interface; it must not be changed. Change-Id: I1f49923a9351e4be5aee39b10720d38b424feb9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110435 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05osl_File checks: creation in root can also fail because of read-only filesystemChristian Lohmaier
80b7949016fbc6addd54bf9f6cf300c756fd0f8a enabled a bunch of previously disabled checks, but on m1 macs osl_File::open::open_004 fails the assert, because it doesn't fail with E_ACCES, but with E_ROFS. (probably nothing to do with apple silicon, but rather because of Big Sur and using apfs as filesystem) Change-Id: Ibd2168ba5fb9d859ea339713099c9bc8a799fcc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110431 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-02-04Fix typo in codeAndrea Gelmini
Change-Id: Ib8b306a27d25a34e784aeeb72708b0d5d1511f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110394 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-02-03Enable previously disabled file and directory testsMike Kaganski
Change-Id: If94a492fa8ef2167bb4c767802e8ea92405a59e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110337 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-02Do not forget to remove "." and ".." path parts in osl_getAbsoluteFileURLMike Kaganski
A follow-up to commit 6e0fa7d4c7b45c98418c289d1d4715eb9eb133f7. Also enables corresponding unit tests on Windows. Change-Id: I250d1269e06c8ce11ebc0e4ea12171c5755aa42d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110273 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-01Drop FAR/NEAR from 16-bit WinAPI timesMike Kaganski
Change-Id: Idf71c662138c281333a83cc76a9d75cbf086f362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-31Fix typosAndrea Gelmini
Change-Id: Id81d2876dc6ead2de03c21e35b7940fee35bc773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110176 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-31Use C++ thread_local instead of Tls* WinAPIMike Kaganski
Change-Id: I9fdbd6ba0e9b94f286a896053b837e58c75135d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110175 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-30Simplify osl_getGlobalMutex to use function-local staticMike Kaganski
Change-Id: I36df8be817d0f0cb75efa00b0b523f379f67d1d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110126 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-30Reinstate still relevant bits of commentMike Kaganski
... removed in commit 6e0fa7d4c7b45c98418c289d1d4715eb9eb133f7. Change-Id: I6a58ad9d676a5f4b6f654e114eb640d7f82682c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110164 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-30Use function-local static Mutex here instead of global CRITICAL_SECTIONMike Kaganski
Our Mutes uses sritical sections on Windows anyway Change-Id: Ieb4a8431700215758aaf84dc7a8c2db4b4030804 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110158 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-30Don't change process current directory in osl_getAbsoluteFileURLMike Kaganski
This removes the need to synchronize using global mutex, and allows to get correct result when base directory is unavailable. Change-Id: I9ae70a7d0e8f0840a533a2d0d222336cc0bf0b4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110163 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-29Use OUString and its fast concat instead of C string manipulationMike Kaganski
Change-Id: I5c0071460855317024ab6f61e6b3010d12546227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110128 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-29Use MutexGuard instead of direct oslMutex manipulationsMike Kaganski
Change-Id: Ifb2b309e2ffe51e491da83f64c12d9c0956fed4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110127 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-28simplify code, use more subView()Noel
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28add string_view variants of methods to O[U]StringBufferNoel
and update the stringview loplugin to detect cases where we can use these new methods. Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-27Improve loplugin:stringliteralvarStephan Bergmann
...to also consider O[U]String ctors taking pointer and length Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-17cppcheck: zerodivcondJulien Nabet
I don't know if it can happen or if it's a false positive but at least, we're sure now it won't fail Change-Id: Id4620d74c0893b308b9fb45be71ca6c425066ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109470 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-15OUString::matchAsciiL() can be used instead of the fresh startsWithAsciiL()Tor Lillqvist
Revert the addition of the latter. Change-Id: I93636a901cde401b0b7d923e052887f57dd58212 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109315 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>