summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2021-01-22Make JsonWriter::writeEscapedOUString() handle surrogate pairs properlyTor Lillqvist
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109474 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-21Changes to the color classdante
Before colors could be only converted to string rrggbb. Now also supports RRGGBB. It can also be converted back into a color. Change-Id: Ifb89d554b434c243c4f0956ee680ec23de823339 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-20tools::Polygon::Clip() is broken with bezier curves (tdf#137068)Luboš Luňák
It preserves the points, but not the flags. Work this around by temporarily converting to B2DPolygon, where it works. Change-Id: I120264fbc4c7c508386f23a06435891199565aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106188 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-11-18tdf#123936 Formatting files in module tools with clang-formatPhilipp Hofer
Change-Id: I0f66d02e67388cc4d21c5e96bf84b6848e8de63a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105721 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-18Reduce variable scopeMike Kaganski
Change-Id: Ie1adad9228c4eadbe0d314c0dc27057e84cd721a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106037 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-17Fix vcl_svm_test after making tools::Long 64-bit on _WIN64Mike Kaganski
Just don't rely on details of Point implementation. Change-Id: I0cd0d6b7cacbf2751803a854d78e4b099ccf197f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105978 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2020-11-17simplify BigInt, remove isSetNoel
no need for such a thing to be "nullable", just default it to zero, as one would be expect for such a type. Change-Id: Ic8b78ca3288355c90820135b9ced2c865ff7606e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105970 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-16Instead of labs, use overloaded absStephan Bergmann
...more likely to pick an appropriate version for the involved integer types, esp. after the recent long -> tools::Long changes Change-Id: Ia91259ca35aaf74b0e907de6831fc926f30057f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-16replace std::max(std::min()) with std::clampNoel
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-14BigInt's non-big value type is currently sal_Int32Mike Kaganski
Change-Id: Iaca11d6279e17cf6301ef35d416829377c0ec964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105841 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-13Revert "remove BigInt::operator tools::Long()"Noel Grandin
This reverts commit 1397a1c8e4995b0dd336478e564880fe8ad91d1d. Reason for revert: Some discussion required Change-Id: Id39ee8260790e0722c5bf8338b0b76ca34da83d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105539 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-12Simplify comparison operatorsMike Kaganski
Change-Id: I9f1b386ddb4d7d5377151c54baee207b2444c7d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105541 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-12remove BigInt::operator tools::Long()Noel
which was introduced in commit adf0738d2dbfa742d0e9ef130954fb4638a8e90d Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Jan 3 14:25:15 2018 +0200 long->sal_Int32 in BigInt presumably to make the conversion easier. Instead just fix the call-sites to select a better conversion, BigInt only returns 32-bits of precision anyway. Change-Id: I2e4354bcfded01763fe3312a715ef37800297876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11Improved starmath colordante
Color.hxx has now documentation ( even if it is quite obvious if you know RGB standar ). Color.hxx has been reordered in more coherent order, but kept format. Some changes on Color.hxx dynamics. Color.hxx starmath colors list Now colors are managed by starmathdatabse. The path is open for simple addition of colors, there are no more infinite switches with color tokens here and there. To add a color, just put it in Color.hxx and register it in starmathdatabse.cxx. Do not forget to change array size in starmathdatabase.hxx. Now mathml supports RGB colors in #RRGGBB format ( import and export ). New colors have been added. Only the HTML Css1 are available via UI. New colors will be added. I intend to finish Css2 and dvipsnames ( latex colors ) on posterior patches. RGBA command has been unlocked for compatibility reasons. However will be displayed as RGB. Added color #RRGGBB. Improved qa color test on mathml to test RGB on mathml. TODO for someone on the UI team: - Add a color picker. - If it is a color with name: - It will add in the code "color " + starmathdatabase::Identify_Color_DVIPSNAMES( colorvalue ).pIdent +" " - If not: - It will add in the code "color " + starmathdatabase::Identify_Color_DVIPSNAMES( colorvalue ).pIdent +" "+ colorvalue.getRed() +" "+ colorvalue.getGreen() +" "+ colorvalue.getBlue() +" " - Note that those will habe eType with value TRGB or TRGBA. Change-Id: I47af37bd191b3099e8e6e08e7a5fb1a8a227bbf2 Change-Id: If971473ddcc34739439818dba9a62ca3494a4473 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11make tools::Long 64-bit on Windows platformNoel Grandin
This is only for the 64-bit windows platform. I don't see the point in messing with the 32-bit platforms, they are (a) become more and more rare (b) unlikely to even have enough available process memory to load extremely large calc spreadsheets The primary problem we are addressing here is bringing Windows-64bit up to same capability as Linux-64bit when it comes to handling very large spreadsheets, which is caused by things like tools::Rectangle using "long", which means that all the work done to make Libreoffice on 64-bit Linux capable of loading large spreadsheets is useless on Windows, where long is 32-bit. The operator<< for tools::Rectangle needs to be inside the tools namespace because of an interaction with the cppunit printing template stuff that I don't understand. SalPoint changed to use sal_Int32, since it needs to be the same definition as the Windows POINT structure. Change-Id: Iab6f1af88847b6c8d46995e8ceda3f82b6722ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-28tdf#123476 filter: try to detect 0-byte files based on extensionMiklos Vajna
A 0-byte ("empty") pptx file is obviously junk input, so it's not surprising if the catch-all generic_Text filter is chosen to open it in Writer at the end. But we can do better: if we really get an empty file URL with an extension we can recognize, that we can fake the filter type / filter name, so the empty "presentation" opens in Impress, and also a re-save works as expected. This builds on top of commit 8a201be240b6d408d15166be7ffc576b9e123634 (fdo#68903 Import .tsv and .xls plain text files in Calc by default, 2013-10-27), just the new way works for all supported file extensions and also with filters which would not handle empty input (e.g. pptx refuses the import if the ZIP storage is broken). Change-Id: Ie01650a5eb6ca42c35e090133965467b621bb526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104939 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-10-28std::set->o3tl::sorted_vector in MultiSelectionNoel Grandin
Change-Id: I88a77f4b07e5aaccc42e6fb6e5bd0366f57381a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104899 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-28convert some more long -> tools::LongNoel
grepping for stuff in template params this time Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19add tools::Long typedef and use it in toolsNoel
first step to switching long to a 64-bit type on 64-bit windows Change-Id: I640d807426dfe713c7a8984ef560575f8288dbeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-17tdf#124176: Use pragma once instead of include guardsmariamfahmy
Change-Id: I9d5fe8d61286c2fe167d4733c36e1fc3976d0b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104446 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-04loplugin:reducevarscope in toolkit..unotoolsNoel
Change-Id: I439b9f456ac0bfaa3eb9bf17472053bd4787e828 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-28Fix SSE2 cpuid checksDr. David Alan Gilbert
As per afb62b0e96e9bf91ec99857cc16ddb094bcaa3be swing the actual check into a separate file and make only that file be compiled with the specific flag. Change-Id: If848a041fc3a26cfaa79f945d63f6c43f8cf3772 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103497 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-28Fix SSSE3 cpuid checksDr. David Alan Gilbert
As per afb62b0e96e9bf91ec99857cc16ddb094bcaa3be swing the actual check into a separate file and make only that file be compiled with the specific flag. Change-Id: I7f75453f21271f38e0099bdf6b40f9138d8b4cff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103496 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-22Fix AVX2 cpuid checksDr. David Alan Gilbert
At the moment test_cpu_runtime_detection_AVX2.cxx is compiled with -mavx2 to allow it to use the intrinsics; however the compiler jumps at the chance to use newer instructions outside the actual test; in my case using AVX in the string manipulation in addTestsToSuite when my CPU doesn't actually have AVX. Swing the actual check into a separate file and only compile that with the extra flag. We probably need the same change for the SSE* checks as well. Change-Id: I1683231932fff264a87c96ac95ac1d24b921163a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103075 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-17osl+tools: fix Windows Arm64 buildJan-Marek Glogowski
Change-Id: I17cbc1c8474880024921f476aa602d61978da868 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102851 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-09-12Replace remaining uses of sal_CharJulien Nabet
+ remove sal_Char check on compilerplugins Change-Id: I0f7da14e620f0c3d031d038aa8345ba4080fb3e9 Change-Id: Ia6dba4f27b47bc9e0c89159182ad80a5aee17166 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-07Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicitStephan Bergmann
...and in turn add OUString::operator = and OUString::operator += overloads that take a std::u16string_view. Without making the ctors explicit, the operator overloads would have caused ambiguities when called with raw sal_Unicode pointers/non-const arrays, as those can convert to both OUString and to std::u16string_view. But the std::u16string_view operator overloads will generally be useful when changing OUStringLiteral similarly to 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String", at which point many existing uses of OUStringLiteral will be replaced with uses of std::u16string_view. Implementing this change turned up a need for an operator = overload for OUStringNumber, which has thus been added. No such need turned up for a corresponding operator += overload, but which can easily be added when the need arises. It also revealed that the operator == overloads between an OUString and a raw sal_Unicode pointer/non-const array were implemented rather inefficiently, creating a temporary OUString from the raw argument. Those have been improved. Preceding commits have already taken care of many dubious or simply unnecessary implicit uses of the now-explicit OUString ctors. This commit makes explicit the few remaining reasonable uses. (And in some cases needed to change variable initialization syntax from using parentheses to using curly braces, to avoid the most vexing parse issue. And needed to explicitly add OUString ctors from char16 const[2] string literal lvalues in a conditional expression in writerfilter/source/ooxml/OOXMLFastContextHandler.cxx that are only necessary because MSVC apparently still insists on doing array-to-pointer decay there.) All of this only affects LIBO_INTERNAL_ONLY. Change-Id: I7ce31162e9be1c3ff3c0bd184a34b535ec56be9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102098 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-01Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: I4db1681869907f050ea224ed24dcb7469a50eb20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101792 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-30Goodbye O[U]StringView, welcome O[U]String::ConcatStephan Bergmann
O[U]StringView had an odd mixture of uses. For one, it was used like std::[u16]string_view, for which directly using the latter std types is clearly the better alternative. For another, it was used in concatenation sequences, when neither of the two leading terms were of our rtl string-related types. For that second use case introduce O[U]String::Concat (as std::[u16]string_view can obviously not be used, those not being one of our rtl string-related types). Also, O[U]StringLiteral is occasionally used for this, but the planned changes outlined in the 33ecd0d5c4fff9511a8436513936a3f7044a775a "Change OUStringLiteral from char[] to char16_t[]" commit message will make that no longer work, so O[U]String::Concat will be the preferred solution in such use cases going forward, too. O[U]StringView was also occasionally used to include O[U]StringBuffer values in concatenation sequences, for which a more obvious alternative is to make O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat machinery. Change-Id: I1f0e8d836796c9ae01c45f32c518be5f52976622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101586 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-18loplugin:unusedvarsglobalNoel Grandin
tackle some read-only vars. Mark some of them const to make it obvious they are not really used, and to make the constantparam plugin see more data. Change-Id: Ia25927745866746aa1aa9d5affd5857ad9f9ee24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100895 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-06loplugin:flatten in toolsNoel Grandin
Change-Id: I6e5c07f4e63b949afb8c259d623a0711a86db021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100188 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03Missing include (std::max; Windows --disable-pch)Stephan Bergmann
Change-Id: I31d44c0a1791c58c0fc348fb2ec42fe2e2ec4323 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100003 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-21Fix uses of char16_t*/wchar_t* stream insertersStephan Bergmann
...that are helpfully deleted in C++20, as now implemented at least by VS 2019 16.6.4 when using --with-latest-c++ Change-Id: Iaf80f793e73fc90768bb146c9cf3d300d6747c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99170 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: toolsStephan Bergmann
Change-Id: I832fbcde277a87ab873ce3477a6886c7002e24ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97709 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01loplugin:constantparamNoel Grandin
Change-Id: Ie9d4761747f7e97f63f34394b5a8b9f0bb287a0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97528 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-29tools: fix 32bit Android buildMiklos Vajna
tools/source/misc/json_writer.cxx:289:34: error: format specifies type 'long' but the argument has type 'sal_Int64' (aka 'long long') [-Werror,-Wformat] mPos += sprintf(mPos, "%ld", nPropVal); ~~~ ^~~~~~~~ %lld 1 error generated. Change-Id: Ieacf2f521f77292d61fa714bf584c9e2045c2e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97367 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-25use tools::JsonWriter for dumping property treeNoel Grandin
Change-Id: I8f55af19ba10b71bd621e69b27000ab7cb565309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-25Fix typosAndrea Gelmini
Change-Id: I2bccc7beb2e9dfccd84b118a33a7aee9753a8be1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97040 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-06-24fix JsonWriter::reallocBufferNoel Grandin
was not updating mSpaceAllocated Change-Id: Ie5404e58c6520d32b72c19ddfa58b2ab2b895199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-24Add test as an example how to add CPU intrinsics supportTomaž Vajngerl
Also makes sure that if the CPU dataction or compiler detection doesn't work correctly, the test could potentially crash. Change-Id: If0862c0a736c8e1f5ba1117b248918e4c1fb2f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96779 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-22Consolidate unique_ptr deleters calling freeStephan Bergmann
Change-Id: I57a977dbb521270a466d464df8c31c364179ec20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96854 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-21Avoid one more unhelpful -Werror=stringop-truncationStephan Bergmann
...after cb95276e6e6bf12a1c06d5c252551e55c788fcb2 "use JsonWriter for the rest of ITiledRenderable", similar to de32eb539bbcf291f9968ae12696e1317fdb855d "Avoid unhelpful -Werror=stringop-truncation" Change-Id: I8782a8a936a5ff0351b6e6d171a00cb8f4a1b2d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-20use JsonWriter for the rest of ITiledRenderableNoel Grandin
and fix bug in buffer reallacotion where mPos pointing at the beginning of the new buffer instead of at the correct index inside it. Change-Id: Ie1ffaa176f6165e2cec85c93adc945312eff38e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-19asan: need to use malloc instead of new for tools::JsonWriterNoel Grandin
because the LOK API expects memory returned from those calls to be malloc'ed Change-Id: If6fbfb60c433bd6e58bc90a9a90a90663e2e1c60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96676 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-19Fix typosAndrea Gelmini
Change-Id: I887a86506b700a21b56bbc66d8b3b2e1bcec0da5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96651 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-06-18Avoid unhelpful -Werror=stringop-truncationStephan Bergmann
...emitted at least by recent GCC 11 trunk (even with --disable-optimized, where optimization level traditionally has some impact on what warnings of this kind are emitted exactly): > tools/source/misc/json_writer.cxx: In member function ‘tools::ScopedJsonWriterNode tools::JsonWriter::startNode(const char*)’: > tools/source/misc/json_writer.cxx:42:12: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation] > 42 | strncpy(mPos, "\": { ", 5); > | ~~~~~~~^~~~~~~~~~~~~~~~~~~ etc. Change-Id: Id96964b178b61879cf2373c5b418f5c9df4a226f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96593 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-06-18new json writer for LOKNoel Grandin
we shave about 3 memory copies off in the process, and make the class play nicely with our string types. Change-Id: I1f614fb35b1de499ac99e3b33ac638ad81054bed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96393 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>