summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2024-02-06return string_view from some XmlWalker methodsNoel Grandin
elides some OString temporaries Change-Id: Ic07f18eb3c71637593e64128605c1ebfa8e68474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-14Fix system-libfixmathThorsten Behrens
Seems distros start to disagree on whether its liblibfixmath or just libfixmath. Change-Id: I54a42b2ba050980ae632ab3c82254131cad7787e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161969 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-01-09Simplify a bitMike Kaganski
And make sure to write newline, tab, etc. as short \n, \t, etc. Change-Id: I6a8ae36ff2856fce2f756c643c6266debe79f1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161813 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-09lok: external data source listSzymon Kłos
Make possible to filter allowed data sources. It is used for WebDAV curl, WEBSERVICE function, cell external references. Change-Id: Ifc82af31ff1123b5656a21e6a27624fb1616db39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160196 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161772 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-01-08Simplify JsonWriter a bitMike Kaganski
Change-Id: Ifa4278cfd62df4179dd3ae627369c077e31dbd00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161780 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-30no need to use SvLockBytes in formsNoel Grandin
Change-Id: Ide586997d504e0fbdb72aa1db77c49ba3d6007c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-23cid#1471704 Assignment of overlapping memoryCaolán McNamara
overlapping_assignment: Assigning (*this).nNum[0] to (*this).nVal, which have overlapping memory locations and different types. Change-Id: I70d7236af27bf5399ad5eb5553befd2eb33e37db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161202 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-22cid#1546500 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546492 COPY_INSTEAD_OF_MOVE cid#1546468 COPY_INSTEAD_OF_MOVE cid#1546431 COPY_INSTEAD_OF_MOVE cid#1546382 COPY_INSTEAD_OF_MOVE cid#1546350 COPY_INSTEAD_OF_MOVE cid#1546336 COPY_INSTEAD_OF_MOVE cid#1546314 COPY_INSTEAD_OF_MOVE cid#1546152 COPY_INSTEAD_OF_MOVE cid#1546094 COPY_INSTEAD_OF_MOVE cid#1546077 COPY_INSTEAD_OF_MOVE cid#1546047 COPY_INSTEAD_OF_MOVE cid#1545213 COPY_INSTEAD_OF_MOVE Change-Id: Ia51df9f9cbde755db4d2685e34f22676ed5eceff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-20Make BigInt::DivMod public, to allow optimized divisionMike Kaganski
Change-Id: I4f79c30b9ab997d01e59a0dec76986e74abfc11f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161053 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-20Simplify and rename for clarityMike Kaganski
Change-Id: Ic97a2b313c6f7d9da540a8867f01362c2fe7b0d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161052 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-20ofz#65165 Stack-buffer-overflow READ 4 test caseCaolán McNamara
make VALGRIND=memcheck CppunitTest_tools_test Conditional jump or move depends on uninitialised value(s) at 0x13348ADA: BigInt::DivLong(BigInt const&, BigInt&, BigInt*) const (bigint.cxx:306) by 0x13349A0A: BigInt::operator/=(BigInt const&) (bigint.cxx:635) by 0x12A58F67: tools::BigIntTest::testLenB1() (test_bigint.cxx:103) by 0x12A5C6A8: void std::__invoke_impl<void, void (tools::BigIntTest::*&)(), tools::BigIntTest*&>(std::__invoke_memfun_deref, void (tools::BigIntTest::*&)(), tools::BigIntTest*&) (invoke.h:74) if ( (static_cast<sal_uInt64>(aTmpB.nNum[nLenB1 - 1]) * nQ) > ^ nLenB1 is 0 ((nTmp - static_cast<sal_uInt64>(aTmpB.nNum[nLenB1]) * nQ) << 32) + aTmpA.nNum[j - 2]) Since: commit bcbc0857bf4bc24b5ea36e445a367cce0a382da4 Date: Sun Dec 17 21:11:31 2023 +0300 Simplify BigInt Co-authored-by: Mike Kaganski <mike.kaganski@collabora.com> Change-Id: Id8dbff23f7b4312ba666e1443c41b7869713bfbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160953 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-17Simplify BigIntMike Kaganski
Change-Id: I1b88648a84760ea16f32566fe0d88e402c328987 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160888 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-16Drop incorrect conditional compilationMike Kaganski
Since commit 396196d6143e377f83a81557f4630ac7e7ad9471 (BigInt's non-big value type is currently sal_Int32, 2020-11-14), fixed-size sal_Int32 is used in the unit test; so it must not depend on size of unrelated long type. Change-Id: Ida276e87b927381d093796f4137774a18acded82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160857 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-12Simplify and fix SvGlobalName comparisonMike Kaganski
Its operator< (required for stl containers) was not comparing Data4. The defaulted comparison uses a different order, but that shouldn't matter. Change-Id: Id9b9d782b393866100c3e994a3902e7ce9a2676f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160607 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-12Make some SvGlobalName ctors constexprMike Kaganski
Change-Id: Idacca005723b995061dc1df06f98bd584cbfd675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160606 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-11Clean up SvStream API a bitMike Kaganski
Change-Id: Ic9847185e8f551eeb05715902374d7a9a9032f60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160546 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-10Simplify SvStream::WriteDoubleMike Kaganski
Change-Id: I0ece791b5571d3839c936e104016f53cc3b6d5e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160537 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-10Keep original errorMike Kaganski
Fix several SetError implementations, to make sure that original errors are not rewritten, but OTOH warnings could be replaced by errors. Change-Id: Ic5e71b791ff3426ff1144778a610ab77fcbf24d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160530 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-07cid#1545320 Unused valueCaolán McNamara
Change-Id: I772a5d7608b92634b7cfed1c1e1730eab34bee89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160421 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-29Extended loplugin:ostr: toolsStephan Bergmann
Change-Id: I7a585370b7d2a8021b733984e605cae8cc92c774 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160097 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-19Extended loplugin:ostr: toolsStephan Bergmann
Change-Id: I70df74d005c7fca14b1bcb70f4870023bd3af4a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159668 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-07warn about exotic protocols as wellCaolán McNamara
Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151834 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-06tdf#146619 Recheck include/t* with IWYUGabor Kelemen
Change-Id: I005257e458351285b1b35ffe49c8b42834a6db68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156990 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-11-03add some protocols that don't make sense as floating frame targetsCaolán McNamara
Change-Id: Id900a5eef248731d1184c1df501a2cf7a2de7eb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158910 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-01tdf#157820: handle \\?\ prefixes in INetURLObjectMike Kaganski
They are already handled in osl file URL functions. Change-Id: Id0c224bdb79963e7ce52abde57bf05b0a6a81ff5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158741 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-23tdf#130924 replace '*printf' with 'SAL_*' logging macros in toolssahil
Change-Id: I9721bfd3783fd6c5d41b2d9a0e8468c583ede0c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156864 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: toolsStephan Bergmann
Change-Id: I930c794c6f93531ef8d2b91c5e6ad62b486966dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158245 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-18Clean up the remaining uses of OUStringConstExpr, and drop itStephan Bergmann
Change-Id: I30b2ac77b58e2ae1d1e997a0c830c513542b973d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158101 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-05Drop MinMax in favor of std::clampMike Kaganski
Change-Id: I021f524b232ddbe091981444d859d35dd9cd05ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157582 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-03Resolves: tdf#127334 Increase tools::Duration accuracy epsilon unsharpnessEike Rathke
... when converting from double, i.e. to 300 nanoseconds. Empirically determined.. Change-Id: I92c43b5f244923363af5d44bece9c155126ca343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155324 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-27Check / adjust the correct variablesMike Kaganski
mnNumerator / mnDenominator are sal_Int32, so after they were assigned, they can't be out of range. Introduce a gcd initial step to avoid precision loss sometimes. Negative denominator is used quite some time, so drop the obsolete comment, while here. Change-Id: I66b77fb3d69cfd2265ac2ed88344af9cfade405b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-22no need to create OString temporaries when calling XmlWriter methodsNoel Grandin
Change-Id: Ief1101c55a0635dac43a7c4d66dd4ed0d5be70bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154764 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-22avoid some unnecessary string copies in tools::XmlWriterNoel Grandin
Change-Id: I5844a878f3e1d85956eae828e9093b2fd1f5a275 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-16cid#1537992 deadcodeJulien Nabet
since 16b0da38515467bf1819ccd88027934481cc5727 jsdialog: encode properly control characters Change-Id: Ic447a819d3d0b3f9ff66e00f0b05a037ec53a9cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154488 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-13linking: api: use JsonWriterSzymon Kłos
Change-Id: If5bf1897f1aef8db1672789cbee14b90cb96dc08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151959 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154378 Tested-by: Jenkins
2023-07-06make tools::Poly*gon single-arg constructors explicitNoel Grandin
which will help avoid ambiguity in method calls in an upcoming patch Change-Id: Ic7607ac7d95559e0942a84fb3226cfdd6ade22bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154146 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-04jsdialog: encode properly control charactersSzymon Kłos
according to https://www.rfc-editor.org/rfc/rfc7159#section-7 strings in JSON should contain control characters (0x00-0x1f) encoded as \uXXXX Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I1f828f64e57328b5fa2dcf5853afe0d6ea643081 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152262 Reviewed-by: Attila Szűcs <attila.szucs@collabora.com> Tested-by: Attila Szűcs <attila.szucs@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153946 Tested-by: Jenkins
2023-06-27Fix typoAndrea Gelmini
Change-Id: I8dee1f762a39b21e88609d1d108846623d0b8bc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153207 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-06-23Introduce tools::Duration individual time values ctorEike Rathke
Change-Id: I516d3727cbcf6667b32dc963febbf4b753ef6a91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153497 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-23Clamp and assert maximum hours value in Time::init()Eike Rathke
Change-Id: Ia777222f3c797b90663b55499a57025e410b1d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153407 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-22Introduce tools::Duration(sal_Int32 nDays, const Time& rTime) ctorEike Rathke
Change-Id: If002e04536149b49b2249103ac914d17dec3fae6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153409 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-21Change DateTime friend operator-() to return tools::Duration instead of doubleEike Rathke
Change-Id: Ica69b1a8916c73443d9ec91dd35ed126fcf97151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153392 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2023-06-21rbOverflow was already set for bBadNS, unnecessary to set it againEike Rathke
Change-Id: I26e32b25b53be590bc24646803c7442385ec4d3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153393 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-21Introduce double DateTime::Sub() as a substitute for friend double operator-()Eike Rathke
Change-Id: Idb93b3e9b4dcbd09ad7f4253a523fe5be24d0776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153354 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-20Use tools::Duration in friend double operator-() if DateTime has Time setEike Rathke
Change-Id: Iff3e2aad596fdfd1530c46cdeff28b44e5142517 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153327 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-19Fix TB Jenkins_Linux_Ubsan (duration.cxx)Julien Nabet
/tools/source/datetime/duration.cxx:190:77: runtime error: negation of -2147483648 cannot be represented in type 'sal_Int32' (aka 'int'); cast to an unsigned type to negate this value to itself 0 0x7f08bd84936d in tools::Duration::Mult(int, bool&) const /tools/source/datetime/duration.cxx:190:77 1 0x7f08c1c1d27a in tools::DurationTest::testDuration() /tools/qa/cppunit/test_duration.cxx:219:26 Detected thanks to eac63ab120a181a1dff6317ee3d223327080e992 Related: tdf#153517 Introduce class tools::Duration Change-Id: I3804cc4ff4011a7f3b393b82b27f0c805682fbb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153254 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-17Fix typoAndrea Gelmini
Change-Id: I1d7b271eed63dd0272bd92431eaac3e2dfbfe2b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153206 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>