summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2023-07-31Resolves: tdf#153517 Use tools::Duration for FillSeries with (date+)timeEike Rathke5-19/+557
This is a combination of 3 commits. Related: tdf#153517 Introduce class tools::Duration xChange-Id: I73ea6e162c73382ba470a306ce2852dbff3d1314 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153202 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit eac63ab120a181a1dff6317ee3d223327080e992) Conflicts: include/tools/datetime.hxx Resolves: tdf#153517 Use tools::Duration for FillSeries with (date+)time xChange-Id: I18567fdac512ee786ce4b0785b01b2ae6da7450e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153203 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 30c48379c7b791edc615e7691691e344baa455a3) Fix TB Jenkins_Linux_Ubsan (duration.cxx) /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 xChange-Id: I3804cc4ff4011a7f3b393b82b27f0c805682fbb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153254 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 99d01ff26fe69ccc66f49b3ddd43b258c3687f2c) Change-Id: I18567fdac512ee786ce4b0785b01b2ae6da7450e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153209 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-16-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): toolsPatrick Luby1-0/+5
(The "clang-format off" in tools/source/misc/json_writer.cxx is necessary because otherwise the code between the SAL_WNODEPRECATED_DECLARATIONS_PUSH/POP macros would be ill-formatted in a way that would trigger loplugin:indentation.) Change-Id: I98af7311e1980829d94aa93f88acf11f0d67d5e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152776 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-05-25jsdialog: encode properly control charactersSzymon Kłos1-0/+9
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>
2023-05-23linking: api: use JsonWriterSzymon Kłos1-0/+26
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>
2023-04-18fix bug in json_writerJaume Pujantell1-1/+5
Ruler stores null-terminated strings in fixed length char arrays, so when creating a JSON a string might end earlier that it's size sugsests. Change-Id: Icdcaf35f9ce54c24dcd36368dc49bb688a2a65ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150558 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-12tdf#82984 tdf#94915 zip64 support (import + export)Attila Szűcs1-9/+14
Implemented import + export for "Zip64 Extended Information Extra Field", (in "Local file header" and "Central directory file header") and for Data descriptor. Focused only to be able to handle files with over 4GB uncompressed size, in the zip archive. The 64k filecount, and the 4GB compressed size limit is probably still present Tried to follow pkware .ZIP File Format Specification, Some cases were not clear to me and/or some zip compressing tool may not perfectly follow the standard, like 'extra field' should be 28 bytes long, but its reader now can read shorter (or longer) 'extra field'. Replaced some 32bit codes with 64bit codes, in stream handling, in deflater. Tested with an ods file that contained a content.xml that bigger then 4BG+ (import + export + reimport) on windows. I think 4GB+ files import/export would be too slow fot unittest. So, for unit test, used the small but zip64 format files, that was attached to the bugzilla tickets Note: It helps with Bug 128244 too (1 of the unittest tests it), but that ods file missing manifest.xml, so LO won't be able to import it. Change-Id: Idfeb90594388fd34ae719677f5d268ca9a484fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147306 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-02-24I get "warning: unsupported syscall: __sys_prlimit64" in WASM so avoid thatTor Lillqvist1-1/+1
Change-Id: I8a9a19d3c7757e1b7e1d194c439280a9d4824c3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144876 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147564 Tested-by: Tor Lillqvist <tml@collabora.com>
2022-11-22Calculate null-date days to assert only onceEike Rathke1-1/+4
Massively called it is really unnecessary to do that each and every time. The debug build is slow enough.. Change-Id: I06525e4ca1fa23a1d49dd735370eb157157800e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143127 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-11-22Avoid second null-date check of convertDateToDaysNormalizing()Eike Rathke1-1/+7
This is micro-optimization, but.. Change-Id: Ic5d43bc0ce9343cf194e189777109636d3b587c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143126 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-11-22Related: tdf#152114 Move some tools' Date class algorithms to comphelper::dateEike Rathke1-211/+17
So they can be reused, specifically in connectivity/source/commontools/dbconversion.cxx Change-Id: I8b2b59e3cb078a73d5f670f0756404471009cf9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143114 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-11-18ofz#53450 Integer-overflowCaolán McNamara1-1/+1
Change-Id: Iccabfb8991a4dca6ec05565f01f6cff82c642d27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142934 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-17ofz#53450 Integer-overflowCaolán McNamara1-2/+2
Change-Id: I106e703714083631c67d7b8a84180c3c485953d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142814 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ic1fb0ea483954f2994a87e05f33b320da3795227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142661 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-11-06-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): toolsStephan Bergmann4-10/+13
(The "clang-format off" in tools/source/misc/json_writer.cxx is necessary because otherwise the code between the SAL_WNODEPRECATED_DECLARATIONS_PUSH/POP macros would be ill-formatted in a way that would trigger loplugin:indentation.) Change-Id: Ic96787865d4c96be07c41f4939893420dfa04046 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-27add some more asserts in Fraction::MakeFractionNoel Grandin1-1/+9
which I missed when inlining code in commit 8ac4dd510bd5f41882db0b647797674b06339f4e Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Oct 27 08:48:25 2022 +0200 tdf#123419 optimise ImplMakeFraction Change-Id: Ifd271ce89cea29a22d41b8e143e27df118f8df3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-27rational_ReduceInaccurate unnecessary hereNoel Grandin1-1/+0
as pointed out by mike kaganski, since we are already dealing with 32-bit values Change-Id: Ic621757f2d9a689e54c47f36cc6ba85a322c500e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-27tdf#123419 optimise ImplMakeFractionNoel Grandin1-0/+40
which is very hot here. Push it down into Fraction, where we can skip the construction of boost::rational intermediate values Change-Id: I7e5f18456a252a159d3a50e9297168e5ba9e1588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141894 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-24tdf#133768 speed up temp file creationNoel Grandin1-0/+2
Use DELETE_ON_CLOSE attribute, so we can avoid calling osl_removeFile. Shaves 5% off the export time. Change-Id: I4fef8f181ef7a92c4805cc5996c3a17800a22602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141718 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-22Fix StartWritingUnicodeTextMike Kaganski3-4/+54
Its comment in include/tools/stream.hxx tells: Switch to no endian swapping and write 0xfeff It was introduced in commit 3c2105e07d29b2069349e1a54e08463d359f988f Author Eike Rathke <er@openoffice.org> Date Fri Dec 22 00:19:05 2000 +0000 new: read/write Unicode or Bytecode and included a call to SetEndianSwap( FALSE ). That call was dropped in commit 8130714148d58dd2bf1ef12dcc6dd6d5838be0d1 Author Noel Grandin <noel@peralex.com> Date Mon Jan 05 08:47:31 2015 +0200 fdo#84938: replace NUMBERFORMAT_INT_ constants with 'enum class' (likely by accident). To simplify the fix, drop redundant m_nEndian: m_isSwap is enough. Change-Id: Ia9a0fe2d55563e7ba21bd4cf17c4ca999c6feaf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141521 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-16Simplify a bitMike Kaganski1-5/+2
Change-Id: Ia983d24c539ab37bcc6457630634142cd5826056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141399 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-07ofz#52191 Integer-overflowCaolán McNamara1-7/+7
Change-Id: I97daf9327c55229fe7da546164d398353e0696a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141046 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-14move ErrCode to comphelper and improve debug output stringNoel Grandin1-0/+1
need to move it, because modules "below" vcl want to use the debug output method Change-Id: Ibcaf4089a1e0b3fcc0b5189c7ebf1aae90f50b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-30ofz#50761 Integer-overflowCaolán McNamara1-6/+6
Change-Id: I8681e7b1b128e7ca33142b7120ad2d4bb3227493 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139019 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-28cid#1500491 silence Untrusted loop boundCaolán McNamara1-0/+1
Change-Id: I508337b8a8482b5aaa056a564a0dfa39cbbb4b56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138943 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-24tools: test Rectangle::Normalize()Chris Sherlock1-0/+98
Change-Id: Ia3fec45b2b6dd0011910c8db5819e161485336c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138713 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-24tools: rename Rectangle::Justify() to Rectangle::Normalize()Chris Sherlock2-7/+7
Jusify() normalizes the rectangle so both the Width and Height are positive, without changing the location of the rectangle. It ensures that the x and y coordinates will be moved to the top left of the rectangle. The name is strange, so renaming Justify() to Normalize(). Change-Id: Idbf163e65e52a798e38f785b8961b8042cf0cf2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137379 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann2-372/+1
...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-18cid#1500387 alternative silence Resource leakCaolán McNamara1-1/+3
This reverts commit d40bfecddcac38006ee989d8072fb2b453cf6b9f for a different approach Change-Id: I8e058efbff214456b91346ce16e7eba7a89a8a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138480 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-17cid#1500387 silence Resource leakCaolán McNamara1-2/+1
Change-Id: I847e2be95ad0c56246279e25ac3081967f8f6855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138393 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-16cid#1509285 Use of 32-bit time_tCaolán McNamara1-4/+4
Change-Id: I5aea4aaa6da8cd974234ab3f0c36212d436e11df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138332 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-13tdf#145614 Convert #define to constexprehsan1-7/+7
Change-Id: If783e2fbb65cae8e9c79ad9718f344dedf9dfe4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135074 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-08-09tools: json writer test does not need to use test::BootstrapFixtureChris Sherlock1-9/+3
Change-Id: Iea7fa63ca7a3208d065ac2960998041672fc8d7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136231 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-09tools: prefix member variables with an 'm'Chris Sherlock1-37/+37
Also updated debug pretty-printers Change-Id: I5204bb8f1c6a47677ad3c49d6579c090ea69aedc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137388 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-07-18tools: 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>
2022-07-12use a read-only stream when reading graphic dataLuboš Luňák3-0/+42
EmbeddedObjectRef::GetGraphicStream() creates a writable SvMemoryStream, read the graphics data into it and then returns the stream, which will be afterwards used to decode the graphics. But if the data is broken, incorrect seeking may cause a seek way past the buffer, and since the stream is writable, it would be done and cause problems such as running out of memory. The VersionCompatRead class is one such place that reads size from the stream and then seeks based on the read data. Add SvMemoryStream::MakeReadOnly() that will change the stream to be read-only after the initial read of the data into it. Change-Id: I1d44aabaf73071a691adafa489e65e4f5e3f021d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137002 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-07-11tools: rename getHeight/Width() to GetOpenHeight/Width()Chris Sherlock2-6/+9
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-20elide some makeStringAndClear() callsNoel Grandin2-2/+4
Change-Id: I4420042f7c8fdf743b888d6f7c1c0d2d3e0b877e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-18cid#1506306 Uninitialized scalar fieldCaolán McNamara1-0/+3
Change-Id: I2daf370dc68dff19f1be538744d7241c080d8149 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136077 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-18o3tl: ensure that the initializer of enumarray contains enough elementsMichael Stahl1-0/+1
Currently this silently succeeds. Turns out oox already contains some too-short initializers, let's guess the missing properties are all invalid. One downside of the templated parameter pack approach in the enumarray ctor, as witnessed in vcl/win/window/salframe.cxx, is that argument types can no longer be implicitly deduced and thus need to be spelled explicitly now in certain cases. There were also three uses of enumarry with V being unsigned short (aka sal_uInt16) that started to cause narrowing conversion errors now and needed to be adapted: In editeng/source/uno/unonrule.cxx the obvious fix was to use the proper type for V. In sw/source/core/unocore/unosett.cxx with its odd mix of saL_Int16 and USHRT_MAX, lets keep things that way for now (probably awaiting later clean up) and use casts to avoid the implicit narrowing. And in sw/source/filter/ww8/wrtw8esh.cxx the ESCHER_Prop_* values, while presumably conceptionally of type sal_uInt16, are plain #defines (thus of type int), so rather than changing V to int it looked more consistent to explicitly cast the ESCHER_Prop_* vlaues to sal_uInt16. (And in tools/source/fsys/urlobj.cxx the poor loplugin:redundantfcast started to unhelpfully kick in for (only) the first argument now.) Change-Id: If06c29e673ec7e565e283c6f447889cf1f777cb7 Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135970 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-17Rectangle: split SetSize into SetWidth/SetHeightJan-Marek Glogowski1-17/+0
... and inline the functions. Change-Id: I9285c72e8524f8f0a2d242bfd4cd29edf6d1ed73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135811 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-06-15Add unit tests for ZCodecofftkp2-0/+124
Add unit tests that check compressing->decompressing a file should result in the same file. This is done by comparing the CRC32 before and after. The same tests also implicitly test that compression/decompression works by checking the return value of ZCodec::EndCompression. Cases added for both mbGzLib=true/false. Change-Id: I5516760eba5f233c20331cef83fd0b1a1603373f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135233 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-12Add compression support for GZ through ZCodecofftkp1-7/+45
ZCodec uses zlib to deflate. That file has code to allow for compressing to GZ but it's wrapped in defines. There's places in code where there's need for zlib headers (ie. svx/source/gallery2/codec.cxx:71) and there will be need for gz header compression when EMZ/WMZ/SVGZ export support is added. Made compression functions care about mbGzLib bool. Also added a SetCompressionMetadata function to set metadata which are otherwise impossible to know (such as filename, which is needed in the header) Change-Id: Ic01050262b0b15e0632564b139c66656afac4611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135213 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
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