summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2022-07-19tools: try to work around DavGetHTTPFromUNCPath() not URL-encoding pathMichael Stahl1-1/+6
This was added in commit 20b1e6440aacab043753e93be4499e939a80b05b "tdf#126121: WebDAV redirection detection" and it works fine when i test it on my local Windows 10, returning an URL with encoded path. The logs from the customer system however show a http URL containing an unencoded ' ' in the path, which curl_url_set chokes on. Try to encode the returned URL with rtl_UriEncodeKeepEscapes, which should hopefully work in either situation. Change-Id: I6862fe0828307a13b0004b192153747d85bb3a42 (cherry picked from commit 66e25aad35cf538da86bdd0157428f4bed95258d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137173 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 54aebc2c8ff25f17a4083fe6c60c38c4f391af12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137177 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-06-03Use more appropriate type for MultiSelection::nCurSubSel et alStephan Bergmann1-22/+26
(In MultiSelection::LastSelected, there is no need to set nCurSubSel (to a potentially negative value) before setting bCurValid to false, as nCurSubSel is only ever used after checking that bCurValid is true.) Change-Id: I3c23c89fbb7b4ef962436476f6576af9fe623fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135354 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-30tdf#147021 Use std::size() instead SAL_N_ELEMENTS macroRoman Kuznetsov1-3/+4
Change-Id: Id91ca2d7002b3743ecaed7b40edda3f85e080884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135061 Tested-by: Jenkins Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
2022-05-24no need to call makeStringAndClear hereNoel Grandin1-2/+2
we are passing it to a u16string_view arg Change-Id: Ieef467fde2acccedf41381e97e93034fffceca22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24no need to call makeStringAndClear hereNoel Grandin1-20/+13
we are passing the OUStringBuffer to a method that takes a u16string_view, which means makeStringAndClear() is wasted effort Change-Id: Ib8012f06f18508351d04d5f61cdc032a051faa84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20elide temporary OUStringBuffer in INetURLObjectNoel Grandin1-53/+54
which requires a version of replaceAt for OUStringBuffer, which I'll put in comphelper::string:: for now Change-Id: I70b319b018e29a7dac26965dd92f6c4f9ea470ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-16no need to stat a dir when opening a temporary fileNoel Grandin1-6/+12
it can never be a dir Change-Id: Ib1c234cb20387cd075a19e13e6656738be88716b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13add SvStream::ReadLine(OStringBuffer... to reduce OString allocationNoel Grandin1-3/+10
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13sw content controls, dropdown: add LOK APIMiklos Vajna1-0/+17
- expose the available list items in a new "items" key of the LOK_CALLBACK_CONTENT_CONTROL callback - add a new lok::Document::sendContentControlEvent() function to be able to select a list item from the current drop-down - add a new listbox to the gtktiledviewer toolbar to select a content control list item when the cursor is inside a dropdown - add tests for the array API of tools::JsonWriter Change-Id: I47f1333a7815d67952f7c20a9cba1b248886f6dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134256 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-05-07This condition is apparently fatalStephan Bergmann1-1/+2
...as mnPoints is the size of mxPointAry (see also 323df76698be1e554ba3342f56a812517a25437a "Revert 'tdf#147919 PPTX export: fix curved and bent connector shape'") Change-Id: I10b9c6bd25bc88754d2d52e851c3871621b0d517 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133980 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-06tdf#103954: Z compressed graphic formats support for EMF/WMFofftkp1-7/+16
- Added .emz and .wmz file opening support - Added a function to check for Z compression that all z comp. formats can use - Added 3 unit tests for emf/emz/wmz files and the example files have been checked with a different tool (File Viewer 4) - emf/emz file detection changed from magic byte checking to extension checking, like wmf/wmz does Change-Id: I3e433fd23d18482648a51cd04b8f467368e97b62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132456 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-03Adapt Base64::decodeSomeChars to change from OUString to std::u16string_viewStephan Bergmann1-1/+1
...in 9c95415de877af1430ab5b7123e11dedd0ea622c "Let comphelper::Base64::decode* take std::u16string_view" Change-Id: I42b1552fba80568b422cb60ccc99a7ab8664f2d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133711 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin1-2/+2
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-29use more string_view in INetURLObjectNoel Grandin3-74/+76
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28use more string_view in tools::INetMIMENoel Grandin1-3/+3
Change-Id: I3bfa5a1402835c21ec70b8d995f79a2edaa6577d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133549 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28use more string_view in tools::SvGlobalNameNoel Grandin1-3/+3
Change-Id: I814744d250d6ce0ec7049daf215a506adb4f1ac5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133548 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28use more string_view in tools::ColorNoel Grandin1-7/+7
Change-Id: I0203aff3af19d3994af5325538520469ab2900ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133541 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27use more string_view in toolsNoel Grandin2-13/+19
Change-Id: I15ca12f35a66994cb90a0ccf60a1ce0f8efcfecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26add o3tl::toUInt32Noel Grandin1-1/+2
Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-25use string_view in CompareProtocolSchemeNoel Grandin1-4/+3
Change-Id: I3584042d0341d5c1b4f4e742e25e9eb0aa26f1da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-12include OutputDevice MapMode in SalLayoutGlyphsCache key (tdf#148400)Luboš Luňák2-0/+19
The mapmode also affects the layout of the glyphs. Change-Id: I9492bc4d3d9e991ef8ab5dc30ce424e44cbc79f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132822 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-05Fix typosAndrea Gelmini1-1/+1
Change-Id: Ifed6fa039466e580d911af91288c4a37bce08aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132560 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2022-04-05add tools::Guid class to generate, parse GUID valuesTomaž Vajngerl2-0/+124
Change-Id: Ie4d8fad4d8f22c8277c22c21b7a9eb3e7c9e4f1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132513 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-04-02Recheck modules t* with IWYUGabor Kelemen17-35/+13
See tdf#42949 for motivation Change-Id: I109fa07d52721fd10354de07a2ed995ffa2f27c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132369 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-31tdf#148253: fix matching algorithmMike Kaganski3-35/+89
Using 'flag' as a "continue the loop" marker allowed to continue processing wildcard after its last character - not crashing because it was a subview of a larger string with separators, but failing the match. Change-Id: I308058b68c59d5719f3c8b5f5656998a95a9ba09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132336 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-20add system-libfixmathRene Engelhard1-1/+12
Change-Id: Ia0bd884d6fefde77c75889bf2ea831ebf1b401cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131876 Tested-by: Jenkins Tested-by: René Engelhard <rene@debian.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: René Engelhard <rene@debian.org>
2022-03-19reduce down to the part and config we are using and move to toolsCaolán McNamara2-0/+173
Change-Id: Ifaddc59c3c7834808d368c138a5ec7c0b80db14c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-13ofz#45527 detect too many points earlierCaolán McNamara1-1/+2
Change-Id: I7716ca8b9de9312bcaabf1d16e60dbac7ae87e52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-13pass reference to the target vector insteadCaolán McNamara1-9/+8
no logic change intended here Change-Id: I680914a6a41cceab41f68456e98de5f3b4a8a639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131491 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-12no need to temporary OUString hereNoel Grandin1-5/+5
Change-Id: Iffd95fcf4fd1f9aac0ba77effc3c63eedce69adf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-12tdf#147921 Filesave DOC: wrong layout and then all missing from 7.3Noel Grandin1-17/+21
regression from commit 990b2cb056788f7f412656a303456d90c003cf83 Author: Noel Grandin <noel@peralex.com> Date: Mon Jun 21 13:00:07 2021 +0200 simplify and improve Wildcard Cannot pass a string_view into something expecting a char* because then it gets the length wrong. Change-Id: I638660a1e9a8a0d17e4d2f77500b3f01365a43d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131396 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-10tdf#113066 tdf#142204 EMF Implement SETARCDIRECTIONBartosz Kosiorek2-15/+28
Change-Id: I30206c68ecf1829ba0094e6259b8ed7dc05f2e9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131103 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-03-06ofz: Use-of-uninitialized-valueCaolán McNamara1-3/+3
Change-Id: I41554dec3819efcd8e28f82bb732141c85414e9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131074 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-05ofz: Use-of-uninitialized-valueCaolán McNamara1-1/+6
Change-Id: If75e11dc26aae51d658dddd464135dd8a4f965ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131054 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-28cid#1500555 try +taint_sanitize instead of -taint_sourceCaolán McNamara1-2/+2
Change-Id: I2a0f9ef243c3f17717afed8809b1e3fbc033c6f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130706 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-24cid#1500555 try -taint_source function annotation tag on function bodyCaolán McNamara1-2/+4
Change-Id: Iecc87e118e5c5a85ae40e1ae79348883ea328d8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130482 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-23cid#1500555 try -taint_source function annotation tagCaolán McNamara1-1/+0
Change-Id: I237a22968024814d578d387e99ae96b748382e00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130433 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-21cid#1500555 silence Untrusted loop boundCaolán McNamara1-1/+2
and others, we're not bothered that the contents of the string might have been constructed using byte swapping Change-Id: I0d0c2e0667bf270e2c15624c59312f3f203bb83c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130246 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-09Simplify SvGlobalName::GetHexNameMike Kaganski1-25/+8
Use a single sprintf instead of ten, and don't use interim OStringBuffer to convert to OUString in the end. Change-Id: I5dcbec85d64af3a30b4bb64f12090e5320421013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129734 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-09Flatten SvGlobalName::MakeIdMike Kaganski1-54/+46
Change-Id: I5b592162d0fad3e57cfe9ad6d4b2252e7f7596d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129709 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-09Simplify SvGlobalNameMike Kaganski1-129/+48
Its data only takes 16 bytes, the same as std::string_view on 64-bit platforms, which is considered trivial. No need to use cow_wrapper that would itself take 8 bytes, and have the performance penalty. Also reuse the conversion to sequence from comphelper. Change-Id: I3e3177ea759bf22d099aaa5402559196c5934ee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129679 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-03cid#1497939 Division or modulo by zeroCaolán McNamara1-0/+3
and cid#1497937 Division or modulo by zero Change-Id: I24f939e19791d811845a476c68125f40bb78f9c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129400 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-31jsonwriter: ensure correct number of bytes is availableSzymon Kłos1-2/+37
In some functions author forgot that addCommaBeforeField() can add additional two characters. I didn't change cases where more bytes than needed are requested. Additional change is that in debug mode there is a marker at the end of allocated buffer - we check that after every write to detect overflow. No need to request more space for a marker as we always allocate "needed size * 2". Change-Id: I28066797b0ba833e408b0a731abc01b7fd989da3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126535 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129163 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-23Improve DBG_UNHANDLED_EXCEPTION output a bitStephan Bergmann1-1/+2
For example, in de3898aecb11307789644a1814e9cbb1ee4cc29b "Add missing test dependency" it would have output > warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: "URL at svx/source/unodraw/unoshape.cxx:1600" rather than > warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: URL svx/source/unodraw/unoshape.cxx:1600 making it slightly clearer that what follows "URL" is not the value of that URL but rather the source location where the exception was thrown. Change-Id: Ia3abd232fce3d95a8b66ff4ed5bab2fcc248df2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128788 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-15tdf#146754: consider xyz:123 as host:port when parsing URLs smartMike Kaganski2-2/+55
... rather than scheme: and path. Change-Id: I9a48310b585b8fa3e31635f877a91f1560b065f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128457 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-10use less SvStream::Flush()Noel Grandin3-11/+5
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>
2022-01-02Introduce OUString::unacquired(const OUStringBuffer&)Mike Kaganski1-4/+2
... and avoid OUStringBuffer::toString when the temporary is used for checking current buffer content Change-Id: I114178f3e74ca3e4a3e517763f9eaab4797b7deb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127478 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-27osl::Mutex->std::mutex in lockFileNoel Grandin1-5/+5
Change-Id: I5ebd56741568ecd25677af57e8c91389c69ddaad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127596 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-26Avoid OUStringBuffer::toString where possibleMike Kaganski1-2/+2
Change-Id: I99abbe97a48b2077e28d6221fb70036e5e412657 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127479 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-25Simplify INetURLObject::parseHostOrNetBiosName a bit moreMike Kaganski1-11/+9
Change-Id: Ie22e7a142aabd2c0f12c34945ad0858f5bd868a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127451 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>