summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2 daysfix leak in ZCodecNoel Grandin1-17/+17
Change-Id: Ifec23a2e83a4327d954a9978ee3885a1f0889d6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
10 daysloplugin:unnecessaryparen small improvementNoel Grandin1-2/+2
when calling a function, and passing only one arg, but the function has defaulted args, we were ignoring this case. Change-Id: I86517f18e30531127664088ddc09ef96dbd8bdf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115033 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
14 daysloplugin:stringadd simplify some *StringBuffer operationsNoel Grandin1-6/+6
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28ofz#33769 Integer-overflowCaolán McNamara1-4/+4
Change-Id: I067db0452650cf3e8bc887abac74c4ff796d4ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114768 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-28use string_view in INetURLObject::encodeNoel Grandin2-24/+24
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-27loplugin:moveoptNoel Grandin1-2/+1
An attempt that did not find anything convincing enough to finish it up and make it permanently active. So just leave it in /store for now. Change-Id: I1750e177655a4a510da100f880ba81bf762be277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114742 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27use more string_view in tools/streamNoel Grandin1-17/+17
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-22no need to create temporaries when appending number to O[U]StringBufferNoel Grandin2-15/+15
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-22no need to create a temporary when appending to OUStringBufferNoel Grandin1-3/+3
Change-Id: If31ac18f08618f805d82c0e49179e3ae9afb124f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114466 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-20reduce copy pasta with Color::GetLuminance()Luboš Luňák1-0/+14
Change-Id: I2eda3607a3be6ee56f0a9ddd14131be783b9698a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114294 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-19use more string_view in OString APINoel Grandin1-3/+3
some parts of the OString seem to have fallen behind its more popular sibling OUString. Change-Id: Ie6d64c3005b2df5da49ba79d0c38282dd5057a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114252 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-14ofz#33235 Integer-overflowCaolán McNamara1-1/+1
Change-Id: I7a717a5bfdd58f22de3dcd61fe4aad67d1463a42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-10ofz#32973 Integer-overflowCaolán McNamara1-2/+9
Change-Id: Ib290468b4c7388b80da627138435b98feaed354b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113921 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09Recheck include/ with IWYUGabor Kelemen1-0/+1
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09ofz#33038 Floating-point-exceptionCaolán McNamara1-1/+2
Change-Id: Ibe4a6667f5a14b5d94f2dbb92ad611ecba4984f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113821 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein1-2/+4
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-04-07ofz#32965 move fpe fix of ofz#17212 into toRationalCaolán McNamara1-4/+3
Change-Id: Ica301357f45fd289c41234b8a7059ab0ff264321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113703 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-06update pchesCaolán McNamara1-2/+1
Change-Id: I835c8fcc237ece5cf9d7a3b261645139d022e9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113652 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-05Use std::gcd instead of boost versionMike Kaganski1-13/+3
Change-Id: Iba3bd7cbab01a99f46e7b2f5632fd3b11e70458d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113598 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-05ofz#32885 regard as invalid fractions that will FPE boost::integer::gcdCaolán McNamara1-0/+6
Change-Id: I59befe0cd21be54d1c94bb28e3d9c01f1483c104 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113574 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-02vcl: move Fraction reading/writing to GenericTypeSerializerTomaž Vajngerl3-35/+71
Change-Id: Iccacaa7fd9cffe1d99f76def854c2150bb4d94f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113499 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-25tdf#58745 - Detect end of month when extending a date listAndreas Heinisch2-0/+36
Change-Id: Icaa64a493598dc4bb8f2d6d076ad4300e2e4dde6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112976 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-03-24cid#1474353 experiment to silence Untrusted loop boundCaolán McNamara1-1/+1
the value *is* surely sanity checked here despite coverity's bleating that it has passed through std::min unchanged when it is the min value Change-Id: Ic4f2b718832f88528f842280b4c0e04c4b3a9444 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113031 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein1-0/+0
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-19silence coverity unchecked return value from library on xmlText* functionsCaolán McNamara1-10/+10
Change-Id: I651abb00d8ae1bdbf758a6a0176fd8912531a585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112753 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-14loplugin:unusedmethodsNoel1-61/+0
Change-Id: I851eba4ca80eac9ee5896df53fbcd0f5ad125763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-13update pchesJulien Nabet1-2/+2
Change-Id: Id6dfae9fb97fbe3fc89b9f2e083d7a3d5c1d36d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112411 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann2-25/+36
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05Revert "Fix typo in code"Stephan Bergmann1-1/+1
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 Gelmini1-1/+1
Change-Id: Ib8b306a27d25a34e784aeeb72708b0d5d1511f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110394 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-01-28add string_view variants of methods to O[U]StringBufferNoel1-3/+3
and update the stringview loplugin to detect cases where we can use these new methods. Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-20ofz#29691 revert throw SvStreamEOFExceptionCaolán McNamara2-28/+18
reasonably sane code like s.ReadUInt32(a).ReadUInt32(b).ReadUInt32(c).ReadUInt32(d); if (s.good()) // use a, b, c d; stopped working. FWIW on a short read we retain whatever was in the variable before the read, rather than overwrite it with new random data, so sal_uInt32 a(0xdead); s.ReadUInt32(a); assert(s.good() || a == 0xdead); the msoffice ppt/escher/xls/doc filters especially speculatively parse and rely on a variables preinit value in the case of a short read. commit b345a2bab0d6f981049951a86b172ce49ce7d4c2 cid#1470786 Uncaught exception commit 71aec4726a94dcde1169fd293dbecfeb0e840e6d ofz#29528 uncaught exception commit bed03603f6cae264abb9e5b58aa2ab00448d92ff ofz#29414 uncaught exception commit 684885a99a1eb7ad943e9736166d4bb1468663be ofz#29443 uncaught exception commit 93574ac7768d247ed754ecda322e54e4bd447e43 ofz#29251 Abrt commit 413db68d95bd39d34e6a6b81a7c5c9478ced0514 ofz#29152 short read commit f400e883044143f999c460375a293647b4a57244 ofz#29151 short read commit 96ea80a725dfe4ef38993f78917c243f13e3beb5 ofz#29129 Abrt on uncaught exception commit 646a635efe6eecbc3d1dd3a7cbb02a278c6f3be5 ofz#28931 Indirect-leak commit b0e573f18629d28fe3179c12d0d434653f92fc93 ofz#29030 Abrt in xlsfuzzer commit 95407c39168d186ee44e67b1a6a4bcf592c58b84 ofz#28902 uncaught exception commit 45175d655ad3773df1c006182108cf25e87b1091 oss-fuzz: tgafuzzer doesn't pass sanity check commit b82fc702bae9d6190bda1b4818a47cfa197df6d8 oss-fuzz: psdfuzzer doesn't pass sanity check commit e7c76d604a4694e6568bf10c2a06a786f1096319 oss-fuzz: epsfuzzer doesn't pass sanity check commit 901e5e7c9170184e286ea3e46fce406136aa9572 oss-fuzz: xlsfuzzer doesn't pass sanity check commit 127bfab61c297df06fd8e71e709bc4362cb89d21 oss-fuzz: pngfuzzer doesn't pass sanity check commit 77387ae00ae27e3f8bcdf7bccf97fb2db8f196b7 oss-fuzz: mtpfuzzer doesn't pass sanity check commit 974ffa79b0fef4ca76558bb8b16bce84af3aaf6c oss-fuzz: xlsxfuzzer doesn't pass sanity check commit 6d6d104cbb382d0045e1f04b12d268992fa5c624 oss-fuzz: bmpfuzzer doesn't pass sanity check commit a7d1d107ec58d3b00b4019c89edddcff71ca6ff3 oss-fuzz: qpwfuzzer doesn't pass sanity check commit 898993aa62276f59480df8af1da4bad530829b56 oss-fuzz: pcxfuzzer doesn't pass sanity check throw/catch parts of commit 8c9a4ff511a3b1d84a7a6d08a1b153c07f164abb throw exception in SvStream when reading past end of file Change-Id: Ic49c249768b17b64d8e868655dbc05b31906c2e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109621 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-18make internals of ::Color privateNoel1-22/+22
was made public in commit d487d6e082bc7ce652217578ffd37397a59cc3ca rework Color to have R,G,B,A public variables but it's best to keep them private since we're changing the internal representation - and there is surprisingly little that depends on accessing the internals anyhow. Change-Id: I234d80fb33105f7bf5b865fb7c8194d893b09878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-17tools: support reading xml namespace with XmlWalkerTomaž Vajngerl3-0/+17
Adds methods namespaceHref and namespacePrefix for reading the current element's namespace prefix and the href. Change-Id: I1c16857c6fc0bdfde2d983d8f42f153111119029 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109442 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-01-16make the Color constructors explicitly specify transparencyNoel1-2/+2
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-15Make JsonWriter::writeEscapedOUString() handle surrogate pairs properlyTor Lillqvist1-3/+15
It is wrong to iterate over UTF-16 code units one by one. We have OUString::iterateCodePoints() to iterate over Unicode code points. The two UTF-16 code units of a surrogate pair (for a non-BMP code point) should not be encoded separately to UTF-8 bytes. It is the code point that should be encoded (to four bytes). Change-Id: Ica4341308deb6618c9c2da8dcee8a11ef4e8238d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-01-15cid#1471704 workaroundNoel Grandin1-2/+4
Coverity complaints that "nVal = nNum[0] in bigint.cxx:84 is an assignment of overlapping memory" But this is essentially a tagged union, so it's actually fine. Workaround the warning by using a temporary (which the compiler will optimise away anyhow) Change-Id: I0fda945f831b1cdd7b33f7cb671a744150990bf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109294 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-14cid#1471346 Uncaught exceptionCaolán McNamara3-38/+39
Change-Id: I535affd6597636aa32e1cf9c6005238f9503ef6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109266 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-12transparency->alpha in tools::ColorNoel1-1/+1
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-06bIsBig member is redundantNoel Grandin1-38/+21
we can just use nLen != 0 to get the same information Change-Id: I2406322aa8b7cfc5e276818df763c6de08397454 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-06move the bigint based Scale() implementations to one central placeNoel Grandin1-0/+16
Picking the best looking one in the process. Change-Id: I77f9236fcd21f883a23fe2f43f20336f17b44cc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108831 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-05tdf#96505 : Get rid of cargo cult long integer literalsumutbayramoglu1-2/+2
Change-Id: I7b269fb5bafceba071ebe649a696ef61301c4018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107366 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann2-2/+2
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-28tools: json: fix missing escaped charsHenry Castro1-0/+21
When client side tries to show the "Macro Security Warning" message dialog, it fails to parse the JSON objects Change-Id: Id73c291ddd9cf739d63d69f06094eacb7b43a2f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108287 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-12-24Revert "add sal*Int64 conversions to BigInt"Stephan Bergmann1-77/+0
This reverts commit 5dae4238ea6e21df42f4437a43d152954fc494fd, which appears to have ambiguitiy problems not only on Windows, but generally with 32-bit builds like <https://ci.libreoffice.org/job/gerrit_android_x86/1518/>: > /home/tdf/lode/jenkins/workspace/android_x86/tools/source/generic/bigint.cxx:501:18: error: conversion from 'int' to 'const BigInt' is ambiguous > *this *= 10; > ^~ > /home/tdf/lode/jenkins/workspace/android_x86/include/tools/bigint.hxx:58:5: note: candidate constructor > BigInt(sal_Int32 nValue) > ^ > /home/tdf/lode/jenkins/workspace/android_x86/include/tools/bigint.hxx:66:5: note: candidate constructor > BigInt( double nVal ); > ^ > /home/tdf/lode/jenkins/workspace/android_x86/include/tools/bigint.hxx:67:5: note: candidate constructor > BigInt( sal_uInt32 nVal ); > ^ > /home/tdf/lode/jenkins/workspace/android_x86/include/tools/bigint.hxx:68:5: note: candidate constructor > BigInt( sal_Int64 nVal ); > ^ > /home/tdf/lode/jenkins/workspace/android_x86/include/tools/bigint.hxx:69:5: note: candidate constructor > BigInt( sal_uInt64 nVal ); > ^ Change-Id: I674b14c342ece3e170185b7ce2f34ccb8ff91c7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108186 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-24add sal*Int64 conversions to BigIntNoel Grandin1-0/+77
we have the capability, so lets use it Change-Id: Ie5aa7999bb457d274bbcc07ba5c4e6ee2f286df1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24custom literal for Degree10Noel Grandin3-7/+7
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-20use CLZ intrinsic in tools::FractionNoel Grandin1-42/+15
which commonly maps to a fast hardware instruction. Change-Id: I65d6b4ce03a1813f014aa7ec7fc8f95aa38832d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108018 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-19speedup rational_FromDoubleNoel Grandin1-5/+5
multiplying/dividing by a power of 2 is much cheaper than the equivalent operation on a factor of 10. Change-Id: I31a7196a07649336378be867c67eb8a89fe6765f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108019 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-18throw exception in SvStream when reading past end of fileNoel2-18/+28
to avoid chasing weird problems where we read past the end of file, which leads to random data in the variable we read into. I expect a couple of possible regressions from this change (1) memory leaks caused by non-exception-safe memory handling. Of which there should not be much because we're pretty good about using smart pointer classes these days. (2) Broken files which used to load, will no longer do so. These will have to be debugged by putting a breakpoint on the SvStreamEOFException constructor, and examining the backtrace to see where we should be catching and ignoring the exception to make the code continue to handle such broken files. Change-Id: I351be031bb083a3484a9a1b650a58892700e6fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>