summaryrefslogtreecommitdiff
path: root/ucbhelper
AgeCommit message (Collapse)Author
2022-04-29Revert "use more string_view in ucbhelper"Noel Grandin
This reverts commit d9c3f05dcb6c03633bbcc8d88e55237a0855d9a5. This is likely a pessimisation since the OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos ); was previously likely mostly just copying the whole string in which case it would return the same object. Change-Id: I1e09630f0095d194deb72f70bba2d65c04771487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133491 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28use more string_view in ucbhelperNoel Grandin
Change-Id: Ief60eda8be8e184b9d637ab84fec2f8740c04396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-12Recheck modules [uU]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: If710445176681de8e0a0b6c65f58ecaca19dbccf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132768 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08use more subView when converting to Int32Noel Grandin
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-06No need to call makeStringAndClear to pass a string viewMike Kaganski
Change-Id: Ic794e91da7a8cc405116104544f02d1b659b753a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129553 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-21fix opengl slide transitionNoel Grandin
regression from commit 62efb188668a3296591dcfa3658185e2f982e356 use comphelper::WeakComponentImplHelper in SlideShowVie Switch notifyEach to leave the mutex locked after being called, because that seems to compose better - because after a call it is in the same state that was when we entered the call. Change-Id: I42e80cc7be1b65ed8cab24ab7c11210e056d916d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-14make comphelper::OInterfaceContainerHelper4 more threadsafeNoel Grandin
(*) make all the methods that require an external mutex take a std::unique_lock as a parameter, so that call sites cannot forget (*) make the forEach method drop the lock when firing listener methods, to reduce the odds of deadlock Change-Id: I0a80e3b3d1c1c03b7de4a658d31fcc2847690903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-14no need to hold OInterfaceContainerHelper4 by unique_ptrNoel Grandin
when empty, it is only a single pointer big anyway Change-Id: I3e45dd705c4bef3799435617db1a4192d62860e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128403 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in CommandProcessorInfoNoel Grandin
Change-Id: I7de1e3e822b272fa4719c9113089c5e4852498ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in PropertySetInfoNoel Grandin
Change-Id: I6db00939e9896fc2798d2eea09a7675fb9504f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127542 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in ResultSetMetaData_ImplNoel Grandin
Change-Id: I58d67d1d52241eeb01b98972779238b7abae5a68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in ResultSet_ImplNoel Grandin
Change-Id: I1c1900e94893b42a3ad4a5ef58f0cfe277305344 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127544 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ucbhelper::PropertyValueSetNoel Grandin
Change-Id: Ie4d3392e26a24ff3ffd9869809bb48bee7fcc2bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127067 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ResultSetImplHelperNoel Grandin
Change-Id: I7567369120593579740e23668d3426a25377a105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-17use more OInterfaceContainer3::notifyEachNoel Grandin
Change-Id: I0dd6e9f1514792e73a31e81896d09c27c1912318 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126966 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22use more OInterfaceContainerHelper3 in ContentImplHelper_ImplNoel Grandin
Change-Id: Id4e4fca8a5a4e2d050752e666a843e7d8661ec0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125635 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in ucbhelperMike Kaganski
Change-Id: I06b04e3eed46aba8aac528b2c394d60e733533a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124405 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-31Fix OSL_ENSURE in ucbhelperJulien Nabet
Following: https://cgit.freedesktop.org/libreoffice/core/commit/?id=6d200d8e739595bd4c6310bede7d66e3c05fbb85 loplugin:moveparam in ucbhelper Change-Id: I90bf228932887f66b7f9d2e61d2d17bfa91d1935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124531 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-10loplugin:moveparam in ucbhelperNoel Grandin
Change-Id: Id6b03af5ecd662ce2e390bb76819cfe5d2ec05ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06loplugin:moveparam in ucbhelperNoel Grandin
Change-Id: I1b9cc0366fb8e9b2525a56816ae4f76737a31b73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-07no need to use UNO_QUERY hereNoel Grandin
Change-Id: I1bfe8238d7c08f27d2b21f9fe79712aba045c812 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120152 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20no need to allocate Sequence separately in CommandProcessorInfoNoel Grandin
Change-Id: I7f423dbbe9d7251a99397f1293239333fe7b0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119216 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20no need to allocate Sequence separately in PropertySetInfoNoel Grandin
Change-Id: If4843c3f419fac59ae8ce52b4004ce2dbb736f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20no need to allocate Sequence separately in PropertySetInfoNoel Grandin
Change-Id: Ibe558facd380e832faaf450a36249620b98ee786 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-13inline some typedefsNoel Grandin
Change-Id: I1608e03ff9f6fbc55987010e88897e034b690b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-22no need to create temporaries when appending number to O[U]StringBufferNoel Grandin
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395 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-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-02-18loplugin:referencecasting add check for new rtl::Reference operatorNoel
rtl::Reference now has a conversion operator to uno::Reference, so look for places where we can simplify the code and use that. Change-Id: Ic81db50d670bed5e875300577d4bf5f3599cc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-18tdf#123936 Formatting files in module ucbhelper with clang-formatPhilipp Hofer
Change-Id: Ic18cb095646f060046f83663f7b369533ffb481a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105723 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-11Drop some unused function parametersStephan Bergmann
Change-Id: I41ad8001e78ea82bf4d893b5faaa28400ff6efcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105575 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-14More fixes of uses of now-explicit OUString ctor taking raw sal_Unicode pointerStephan Bergmann
...in Windows-only code, after c927aab29ebfff1ce3ac0b2f27ae343025a9890c "Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicit". Interestingly, these occurrences were accepted by MSVC and only cause errors with clang-cl, so happened to go unnoticed until now. Change-Id: I33e7653e28a21541ef793b4b0750abb6037752db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104314 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-21Fix typosAndrea Gelmini
Change-Id: Iaf1d4aed07d1e6fcfe2392fb65cbd2fa196bcc1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101099 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-20Use OSL_UNREACHABLEStephan Bergmann
...in those places that used some code conditional on ENABLE_LTO to work around (non-)unreachability wranings. This removes all uses of the ENABLE_LTO C/C++ macro, so it can go completely. Change-Id: I67544986cb2d3fcd8051caf87c5129bd1086408c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101087 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-16loplugin:unusedmethodsNoel Grandin
Change-Id: I2dd10873be73256a3689233c7b1e37bde8f685ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03loplugin:flatten in ucbhelperNoel Grandin
Change-Id: Ic5a8ce908671bd492395bff01aa211b8bdd74ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: ucbhelperStephan Bergmann
Change-Id: Ie5e160e577ba0acc83617b2f4f2ca97b9d3f6da7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97727 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-10compact namespace in ucb..uuiNoel Grandin
Change-Id: I644d5e418028b4b4e66cf67b20a1155a689acab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>