summaryrefslogtreecommitdiff
path: root/sax
AgeCommit message (Collapse)Author
2022-10-20remove commentNoel Grandin
that no longer makes sense after commit 25a7b268555d73248594b9d485b69cd0e4cf34cf (HEAD -> master) Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Oct 20 12:47:39 2022 +0200 SAL_WARN->SAL_INFO in sax Change-Id: I298df432d61f90e558251cd1c0e8d3c220423c5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-20SAL_WARN->SAL_INFO in saxNoel Grandin
This does not provide any value during normal debugging Change-Id: I6797183e64a3e7e90e1cc6b5ecdb92faa53d01d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-12crashtesting: exception during dtorCaolán McNamara
Change-Id: I9874778ba79540cfde32bf59c3a63ebb72889dc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141215 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-11use std::unique_ptrCaolán McNamara
Change-Id: Ibb3d71c8d50e1ad7236a6fe01ff83d3cd1a866f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141214 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-28avoid some ref-counting in a hot pathNoel Grandin
Change-Id: Ibae87fc4e2fbe11d52cd89134a253ac2215134a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140690 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-08-18tdf#39593 Ruduce copy/paste code in Converter::converterDurationLiu Hao
Change-Id: Ic1b82b244ff614c8d5ab44f32bdc728deee24165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138465 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-01use more string_view when dealing with attributesNoel Grandin
which means we don't need to call strlen on them, since we already know how long they are. Change-Id: Iefc76f38a23250e87a65c27df3634d562464a760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-28tdf#119840 remove some OUString allocationNoel Grandin
Change-Id: I488db37b3a60feb351d1ecd46278f6d5c3cdde5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-22elide some makeStringAndClear() callsNoel Grandin
Change-Id: I3b80d0f5b6d39c071242bc6ccc1e4333886c835d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137309 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-06micro-optimisation in FastAttributeListNoel Grandin
Change-Id: If684357b8849258af213f06a52f71ea81ffac1e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-06shave some cost off SaxContextNoel Grandin
most of the time, we can skip the ref-counting associated with these string fields Change-Id: I7afc1aa08f3337d7c61478eab92abc2cdd2b9d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-09loplugin:unusedmethodsNoel Grandin
Change-Id: Ib89ab59f7ad7e90b2a44ddd122176cde904fba4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135520 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-27clang-tidy modernize-pass-by-value in saxNoel Grandin
Change-Id: I0357c7e3f5ae1d0a560057ac756b1118917a5e11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-08osl::Mutex->std::mutex in SaxExpatParserNoel Grandin
Change-Id: I9d99497dfbc67cd4dd690da9db58aab0db114d36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134021 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-06remove unnecessary sequenceToContainerNoel Grandin
If we are not going to manipulate the resulting vector, then it is actually slower, since we have to allocate more storage for the vector Change-Id: I65677007d105f4783603df74113ebed6db0b551b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133963 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in saxStephan Bergmann
Change-Id: I3aec9eecc35eeabd2be61c73a57cff220843c9b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133791 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27add string_view wrappers for rtl::math::stringToDoubleNoel Grandin
Change-Id: I114bec72cb933238675e539a8388a607226827cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-20use more FastAttributeIter::toViewNoel Grandin
Change-Id: I8a8ad5456fea349a45fca0aa468313cb04aa02f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-18tdf#133603 increase cache size in CachedOutputStreamNoel Grandin
modern devices require bigger chunks of data to keep them busy Change-Id: I356327718fc20d937364b6ee726b0e94b4199e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131734 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-12Introduce FastAttributeList::add(NS) taking std::u16string_viewMike Kaganski
... and simplify some places removing explicit conversions from OUString to OString. Change-Id: I4cdf9f3ee3101b3d00a0bbba53a983ed3bebce4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131445 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-10tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroGautham Krishnan
Change-Id: If35c679839b39a01e474f7b0b0abee570e85bdd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130798 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-03crashtesting: assert that !rtl::isAscii in xmlError messageCaolán McNamara
probably detected since: commit 089ce740f9f97f9c7b13e37a31acfc94984e9a3e Date: Thu Feb 24 17:45:18 2022 +0300 Deduplicate rtl_*String_newConcat*L or similar Change-Id: I389d0875463f2ac59fda9266b168bdc35c82de95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130917 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-02Remove 'const' from for loop variableHossein
In the commit f63a6f2e396fa41ed1338dcec874e06159cafa9f, a for loop is converted into a range-based for loop. The pointer is used to change the nodes using xmlUnlinkNode() and xmlFreeNode(), thus the 'const' should have not been used. The reinterpret_cast does not change the constness, thus I have removed the const from the loop variable, and it will no longer be a const reference. Change-Id: If4c61017ea77f464230bb5802f6fc928acc7a7e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130792 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-01tdf#145538 - Use range based for loopsDeep17
Change-Id: I489a13330501ddfa1556a523f8334460505c0e61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130658 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-02-14Recheck modules s[a-c]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I867e1f7a2c44210de3281b36e22708a5d32ddb7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129476 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-04Add a clarifying comment regarding the use of UTF-8Stephan Bergmann
...justifying that 2f3a0bfbfe110c0837b3c7e04f9ad0969d6e56e4 "tdf#147088: Also handle U+FFFE, U+FFFF invalid XML 1.0 characters" added code that assumes `string` is UTF-8 while carelessly removing the "assuming we're writing UTF-8" disclaimer comment that had been added with 8b25b67d5268abbb260da968cc23b6f6c8dd31af "escape invalid XML characters with _xHHHH_ when writing escaped" Change-Id: I0866da2bbbc536b2feb977c35b164459b745d918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129422 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-01tdf#147088: Also handle U+FFFE, U+FFFF invalid XML 1.0 charactersStephan Bergmann
Change-Id: Ieec81fcde41e3508c6a9aa4250d7050db2fbb442 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129296 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-20WASM make test file loading workArmin Le Grand (Allotropia)
Change-Id: Ic34104534c3e0e73791cf867bfb2e1246dc79cf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128653 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-04osl::Mutex->std::mutex in FastSaxParserImplNoel Grandin
Change-Id: I3bb067a0aafe8d7ca1171ab7119acbf94323725c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127915 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-04osl::Mutex->std::mutex in FastSaxParserImplNoel Grandin
Change-Id: I5f93c3d1373f8d5a95d8069b1f8381c45e11a875 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127916 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24Use rtl functions instead of own surrogate checking/combiningMike Kaganski
Change-Id: I3eb05d8f5b0761bc3b672d4c855eb469f8cc1a29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127375 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-11-19Use more basegfx::deg2rad<N> and basegfx::rad2deg<N>Mike Kaganski
Change-Id: I9dc57628b98f67994d546f6887e96389be1efe62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125568 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30Prepare for removal of non-const operator[] from Sequence in saxMike Kaganski
Change-Id: I9df7229f55347bd4477626595cab459065cc4bb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124381 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-04drop 'using namespace std' in sax/sc/scaddins/sfx2/shellJulien Nabet
Change-Id: I422a6d5b0151115203fd2d7c0fc5597903d3ec8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123064 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-01clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: Ic5abfe2d047750d8dfd3ae8cc733fa15d34ea505 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-12include optional header for std::optionalCaolán McNamara
Change-Id: I5e2c42498691d1fccf5122720e56bf44462ce21d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120382 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-12flatten FastSaxParserImpl a littleNoel Grandin
The EventList instances are movable (and are really just pointers to buffers of data), so no need to use unique_ptr Change-Id: Ic3e13e949f5a61ee9cc5fcf8da9e22094e8ab9da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120342 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-07-31osl::Mutex->std::mutex in EntityNoel Grandin
Change-Id: Ia9201dc4998a592ef4adaa39666f67a0935e8161 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119745 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-25use officecfg to retrieve OdfDefaultVersionNoel Grandin
Change-Id: Id54b98d978965e7ce304b83d5eff7d6c844a41d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119474 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-21Use existing rtl_math_stringToDoubleStephan Bergmann
...like it is also already done in LineParser::readDouble in sdext/source/pdfimport/wrapper/wrapper.cxx (esp. since the code should be changed to use C++17 std::from_chars once that is available in all our baselines), reverting again the introduction of rtl_str_toDouble_WithLength in b1df9c67349cf4cc5be4128d797aefb87f50e38f "[API CHANGE] reduce cost of numeric conversion" Change-Id: If7e3a15649f80093d3407157412fd3deb3a38b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119318 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-07-21Use existing rtl_str_toInt64_WithLengthStephan Bergmann
...like it is also already done in LineParser::readInt32 in sdext/source/pdfimport/wrapper/wrapper.cxx (esp. since the code should be changed to use C++17 std::from_chars once that is available in all our baselines), reverting again the introduction of rtl_str_toInt32_WithLength in b1df9c67349cf4cc5be4128d797aefb87f50e38f "[API CHANGE] reduce cost of numeric conversion" Change-Id: I2789f8ec55c8d89150d1c68e6b353a1d2e1d1703 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119301 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-07-17[API CHANGE] reduce cost of numeric conversionNoel Grandin
on a hot path, since we already know the length of these strings. Which requires adding some new variants of our string conversion functions Change-Id: I1877f8f3c72934c07f14eec7e73bbe8d7b0f1808 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119065 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-14Improve loplugin:stringviewStephan Bergmann
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for operator call arguments. (The "rather than copy, pass subView()" diagnostic is already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly for operator call arguments.) (And many call sites don't even require an explicit [u16]string_view, esp. with the recent ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator += overloads". Just some test code in sal/qa/ that explicitly tests the O[U]String functionality had to be excluded.) Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-03loplugin:stringadd improvement for appending numbersNoel Grandin
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 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 makeStringAndClear() when appending to bufferNoel Grandin
it just creates an unnecessary temporary Change-Id: Ide3cd99b2ac4f2a621e5d55ce4bdc95d05430709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114467 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>