summaryrefslogtreecommitdiff
path: root/sot
AgeCommit message (Collapse)Author
2023-08-18use more Reference::query instead of UNO_QUERY_THROWNoel Grandin
since querying with exceptions is consideably more expensive Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09use sal_uInt64 when dealing with stream positionNoel Grandin
Change-Id: I2869e115941b3e1f52911d58d54ec1b2831d0524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155524 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-31do not throw DisposedException when inside a dispose() methodNoel Grandin
There is no need to do this, as the documentation of css.lang.XComponent::dispose at udkapi/com/sun/star/lang/XComponent.idl states: After this method has been called, the object should behave as passive as possible, thus it should ignore all calls Otherwise, the effect of throwing here is mostly to disturb the flow of logic in caller code, preventing other parts of teardown from proceeding smoothly. Change-Id: I30e6d1b35f85b727debf4405a995fdc0a4fccde6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152450 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-30Use getXWeak in sotMike Kaganski
Change-Id: I68d6b7393b367b68206c92cd65705326c5aeda7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150870 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-14loplugin:stringviewparam improvementsNoel Grandin
improve the check by checking for methods that exclude using string_view, rather than checking for methods that __can__ use string_view, which leads to exposing some holes in our o3tl/string_view.hxx coverage. Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-14CppunitTest_sot_test_sot: remove duplicated assertMiklos Vajna
This was added in commit 29d4ecf32392bc94ab0ba9e73fd79eba65c23fdb (tdf#115574 sot: fix Excel -> Writer paste, 2018-03-29), where it was hard to consider 4 bugreports at the same time, so I wrote asserts for each bugreport. But at the end 1 bugreport is a superset of an other one, so just moving the 2 comments next to each other having 2 asserts instead of 3 leads to a simple removal of the duplication. Change-Id: Iaedccf5ac498dd6842c25b60b507e63332daddf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148847 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-28no need to allocate ucbhelper::Content separately in UCBStorage_ImplNoel Grandin
it is only one pointer big Change-Id: Id60710eca9a170733ebba4120359e03f384f9962 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147945 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-24osl::Mutex->std::mutex in OLESimpleStorageNoel Grandin
Change-Id: I3ff011fa4829bd7230ddaa8fc2d34ade47f09b0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147466 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-14move ErrCode to comphelper and improve debug output stringNoel Grandin
need to move it, because modules "below" vcl want to use the debug output method Change-Id: Ibcaf4089a1e0b3fcc0b5189c7ebf1aae90f50b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-28cid#1500658 silence Resource leakCaolán McNamara
Change-Id: I799c44990d2a2cca3b843c3c64774d4d49e4a8b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138946 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-14cid#1504592 Big parameter passed by valueCaolán McNamara
and cid#1504665 Big parameter passed by value cid#1505368 Big parameter passed by value revert the clang-tidy modernize-pass-by-value changes that coverity warns about Change-Id: Id92fdc8d1caeed9eaf7ff1e9e745938e5a971a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135803 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-10new loplugin:moveitNoel Grandin
look for local variables that can be std::move'd to parameters off by default, since it doesn't do proper data flow analysis Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-03Use o3tl::make_unsigned, nStrLen is known to be non-negative hereStephan Bergmann
Change-Id: Ibb51c5b47edefe3f22a3d4335bc3136988c65486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135355 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-01The return value of those getLength functions is guaranteed to be non-negativeStephan Bergmann
...so use o3tl::make_unsigned when comparing it against an expression of unsigned integer type, instead of casting that expression to a signed type Change-Id: Ic47c6d96919b2aba2d16ce6d1a2a8e4c5761a480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135219 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-30clang-tidy modernize-pass-by-value in sotNoel Grandin
Change-Id: I1ff31ae1291a82630ae32185077e369bbdfd3a0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135127 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19reserve vector in StgCache::Commit()Noel Grandin
Change-Id: I7d1253c9c8bba5801f942cb79f63d56d26481c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134601 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-12tdf#121740 avoid some temporary OUString constructionNoel Grandin
Change-Id: Id70349e0e8f7d79bad693663ec3dc2963e0834b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134205 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in sotStephan Bergmann
Change-Id: I43830efeb1671838317c5667f77c609a319a4aea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133776 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-03-01Recheck modules s[f-t]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I1f520aad1b1c942ad5616d96851016fc366ac58f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130203 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-27cid#1500380: silence Resource leakJulien Nabet
Change-Id: Ib938b921343359b91f42fc68d89bf9eda32132d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130626 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-10use less SvStream::Flush()Noel Grandin
Flush() turns into a sync() on the device, which is pretty slow. Most of the time all we actually want to do is to flush the internal buffers from the SvStream. So expose the FlushBuffer method and use that where possible. And also means we don't need the mbDontFlushOnClose flag on SvStream any more. Change-Id: Ibe089b88b325f0fdc565200a97ce72cd26b7fcfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-03Windows format name is FileGroupDescriptorW for Unicode stringsMike Kaganski
See also commit 5fb9f4ffa9284c7248e2e82210506babaad4044d tdf#145964: Windows format name is FileNameW for Unicode strings and commit 52e1d0ca6ad38b4b4fdc77b0951ad26f0ac18ec5 Windows format name is UniformResourceLocatorW for Unicode strings We don't use other standard clipboard formats which have W variants. Change-Id: I45afac76fe3db406c8a761f48eee9e931fd50d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126276 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-03Windows format name is UniformResourceLocatorW for Unicode stringsMike Kaganski
See also commit 5fb9f4ffa9284c7248e2e82210506babaad4044d tdf#145964: Windows format name is FileNameW for Unicode strings TODO: replace one remaining format from CFSTR_* family that we use (see https://www.codeproject.com/Reference/1091137/Windows-Clipboard-Formats): FileGroupDescriptor -> FileGroupDescriptorW. That one needs more complex handling. Change-Id: I4d4ad83099854768cf36c7b3d89059d79c8e77f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126213 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-01tdf#145964: Windows format name is FileNameW for Unicode stringsMike Kaganski
Otherwise SIMPLE_FILE clipboard format arrives encoded in ACP, and fails for any characters not representable in ACP. Change-Id: Ice8cfd98955e3ef49682aa21b41a313786b291f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126131 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-28use more OInterfaceContainerHelper3 in sotNoel Grandin
Change-Id: I4d8fbb90a9850199caa29e97f2080fd49c48bcef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24loplugin:stringliteraldefine in comphelperNoel Grandin
Change-Id: I60ccd6049db65fef2397798ab916b0d1e24c0fdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-18rtl::Static->thread-safe static in sotNoel Grandin
Change-Id: I208b4feff95013a787f3ca7828c88c9457e78ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125424 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in sotMike Kaganski
Change-Id: I5d6da6ce158fb29ff37452281d28c297795b4cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124391 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-06clang-tidy:clang-analyzer-optin.performance.PaddingNoel Grandin
noting that XMLTokenEnum was already being treated as being limited to 32-bits, we bitmask it together with namespaces Change-Id: Ic48f2a662452d1b8e022078d31a723d2ac65aef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I39b9ac81d65f4a269293824642c1b2ec593c0584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-10Missing includeStephan Bergmann
(for std::unique_ptr, with recent libstdc++ 12 trunk) Change-Id: I61b7823dd740ea7cdfe0d7403a50ac73b24d1c4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120229 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-03Consolidate on C++17 std::scoped_lock instead of std::lock_guardNoel Grandin
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-01osl::Mutex->std::mutex in FileStreamWrapper_ImplNoel Grandin
Change-Id: Id4488b7722c9cf14157ed9333a0eb74de96834d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119830 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31getArray->getConstArrayNoel Grandin
Change-Id: I951dd4a02c9ead98e7eb13ae2995ba2e1e57b38a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29rtl::Static -> static localNoel Grandin
Change-Id: Ib8d9a24659a37e6b94237d98f030cd2be00bcb39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119665 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-11Simplify Sequence/vector initializationsJulien Nabet
Change-Id: Ib02e25b4600666185cf0f8d0cc8d5c64186789c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117064 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-10loplugin:unnecessaryreturn SotStorageStream::CommitNoel Grandin
Change-Id: Icfd32ea8b29aa544b71d0c4fc6bc67c06f81e327 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116987 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-10Simplify Sequences initializations (sot/stock/svl/svtools/svx)Julien Nabet
Change-Id: Iec21851d69f4a8d5f557e9ed2d30e5f680cd62c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116943 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-01no need to allocate these on the heapNoel Grandin
Change-Id: I46de98204ec705bd2f6a618cb0cfae5149cea84e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116475 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-07convert sal_uLong in sotNoel Grandin
Change-Id: I51027e731ce6581ebea08b1f5eb88472c3c27550 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28use string_view in INetURLObject::encodeNoel Grandin
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-12update PCHsCaolán McNamara
Change-Id: Id3728ac0011d3deed7e56081e3a854c7fa5336f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-08update PCHsLuboš Luňák
Change-Id: Ia9d04447f927e270a55500e7f35723a729bc01dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113801 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
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-03-21update pchesCaolán McNamara
Change-Id: I60e61133c305673bb305e41957f5414820c7c358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>