186 Commits
Author SHA1 Message Date
Andrea Gelmini c455a75578 Fix typos
Change-Id: I620dbd48232d8d2c7e99586d3445654880699cae

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209806
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-25 15:46:10 +02:00
Gabor Kelemen c511c65434 tdf#146619 Use more forward declarations in include/tools
Change-Id: Iab2938f82a9fd7ef3334d69c4fd07a9d963a9e24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198237
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-02-01 09:23:01 +01:00
Mike Kaganski fbefacef9e Simplify and fix SvGlobalName comparison
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-12 10:39:41 +01:00
Mike Kaganski 70153b7350 Make some SvGlobalName ctors constexpr
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-12 08:54:59 +01:00
Stephan Bergmann 4280a32579 -Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): tools
(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-11-06 01:13:45 +01:00
Noel Grandin f757f152b1 use more string_view in tools::SvGlobalName
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-28 16:10:16 +02:00
Mike Kaganski 9003593c9e Simplify SvGlobalName::GetHexName
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-09 20:41:39 +01:00
Mike Kaganski a3e8bacbdb Flatten SvGlobalName::MakeId
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-09 15:24:21 +01:00
Mike Kaganski 4e0ba699ab Simplify SvGlobalName
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-09 06:11:39 +01:00
Mike Kaganski 20354bce87 Prepare for removal of non-const operator[] from Sequence in tools
Change-Id: Ifff56df8da9b0b9e4d4e96d6b09f490807e96f52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124402
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-31 18:41:42 +01:00
Noel Grandin 03d8a92091 clang-tidy:readability-redundant-member-init
Change-Id: I8590d67f064dd74da42c0e3bf543f2aadbd2b893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121693
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-06 09:04:17 +02:00
Philipp Hofer 1582d9a2c5 tdf#123936 Formatting files in module tools with clang-format
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-18 12:04:58 +01:00
Noel Grandin 1a53e60d44 sal_Char->char in tools
Change-Id: Id8be02e445ac439439b2f78ba4a7376dd19ce360
Reviewed-on: https://gerrit.libreoffice.org/85744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23 15:12:29 +01:00
Noel Grandin c68be56c29 size some stringbuffer to prevent re-alloc
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9
Reviewed-on: https://gerrit.libreoffice.org/81278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23 08:55:00 +02:00
Mike Kaganski d51db77c8d Remove some memset calls
Replace them with default initialization or calloc

Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 09:53:42 +02:00
Noel Grandin 6e4a2540d4 new loplugin:noexceptmove
idea from mike kaganski

look for places where we can mark move operators as noexcept, which
makes some STL operations more efficient

Change-Id: Id732b89d1fcadd5ceb0ea2b9d159fed06136330f
Reviewed-on: https://gerrit.libreoffice.org/78251
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-30 08:12:07 +02:00
Noel Grandin c95d91ee35 improve subtyping when dealing with tools::WeakReference
tweak the templating to make it easier to declare a WeakReference that
points to a subclass for a weak-capable class.
Which lets us declare some fields with more specific types, and dump a
lot of unnecessary casting.
And make WeakBase be inherited from virtually, so we don't end
up with weird states where two weak refernces could point to two
different parts of the same object.

Change-Id: I3213ea27e087038457b0761b5171c7bce96e71f3
Reviewed-on: https://gerrit.libreoffice.org/48650
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-27 17:19:26 +01:00
Stephan Bergmann 8456c2ba40 More loplugin:cstylecast: tools
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: Ifb9ebc9623c8df14ea0d4c907001bd16c5b9ae59
2018-01-12 20:13:01 +01:00
Noel Grandin a566fd1c1a loplugin:unusedmethods
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1
Reviewed-on: https://gerrit.libreoffice.org/45386
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-29 07:28:57 +01:00
Noel Grandin c605c8d078 SvPersistStream dead
since commit 1e4b1e4a1a
"Removing unused SfxItemPool serialisation from editeng"

Change-Id: I8a3cd36a13b7d2322047c2035e0f23c70ca9cdf0
Reviewed-on: https://gerrit.libreoffice.org/40880
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-08 20:56:44 +02:00
Noel Grandin 5e028ad5dc simplify some string handling in tracing calls
Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3
Reviewed-on: https://gerrit.libreoffice.org/39159
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 14:38:14 +02:00
Caolán McNamara d0069e5189 add COVERITY_NOEXCEPT_FALSE
to markup dtors that coverity warns might throw exceptions
which won't throw in practice, or where std::terminate is
an acceptable response if they do

Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4
Reviewed-on: https://gerrit.libreoffice.org/38318
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06 14:15:43 +02:00
Noel Grandin de8caac6be replace SVSTREAM_OK with ERRCODE_NONE
since the first is #define'd to the second, and offers no extra value

Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450
Reviewed-on: https://gerrit.libreoffice.org/38406
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-06 08:15:57 +02:00
Fakabbir Amin f9f0b6ac12 tdf#43157 Cleanup DBG_ASSERT in pstm.cxx
Change-Id: Ibc7b7399ccc827168768ee94b6e75e4116fc95c9
Reviewed-on: https://gerrit.libreoffice.org/33882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-08 16:58:21 +02:00
Chris Sherlock 3b85b72d64 errinf.hxx moved out of tools and into vcl module
ErrorInfo has a hard depency on VCL, yet is in the tools package. It is more
appropriate to have it reside in the VCL module.

Change-Id: Ica54a46c3a7f86cf0331ed7245234bea69c05650
Reviewed-on: https://gerrit.libreoffice.org/36839
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 10:55:17 +02:00
Chris Sherlock a1909515e8 tools: cleanup tools/source/ref/errinf.cxx
Make the code more readable, some whitespace formatting changes and
changed ppDcr, etc. to clearer variable names.
Change-Id: I9d0f3eec6607376b6648241cea80922f11d9773e
Reviewed-on: https://gerrit.libreoffice.org/36837
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-24 00:13:04 +02:00
Chris Sherlock f3281c0954 tools: change internal DynamicErrorInfo struct name
Change of an internal struct's name in errinf.cxx - renaming EDcrData to
DynamicErrorRegistry as EDcr makes very little sense to me. EDcrData is
an internally used struct consisting of collections of error data, error
handlers and error contexts, and uses only DynamicErrorInfo instances.

Change-Id: I79d7f7db5d9550dffca6adcb2a286a2d6e1fa2e7
Reviewed-on: https://gerrit.libreoffice.org/36836
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-23 21:24:31 +02:00
Jens Carl 6b4a149a65 tdf#39468 Translate German comments
Translate German comments and terms in UnoControls/, editeng/, filter/,
odk/, reportdesign/, sd/, sfx2/, starmath/, svl/, svtools/, toolkit/,
tools/, writerfilter/, and xmloff/.

Change-Id: Ibc401a425ddfdf41e4e4a78600f3fbce8cfaa2b1
Reviewed-on: https://gerrit.libreoffice.org/35992
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-03 19:25:49 +00:00
Stephan Bergmann 6291574d94 Remove unused #include <ctype.h>
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-23 17:55:31 +01:00
Stephan Bergmann 692424b805 No need for a temporary OString here
Change-Id: I94115baf51dcb52999d97ad1dc3302b109990b04
2017-03-23 17:04:54 +01:00
Stephan Bergmann bd556163d9 Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
Change-Id: I83576b55ca421abfe056eb7b66f8f74782100a09
2017-03-22 21:32:40 +01:00
Stephan Bergmann 7778d9f51b Prevent calls to rtl/character.hxx functions with (signed) char arguments
...that would implicitly be sign extended (for plain char only if it is signed),
so non-ASCII char values would trigger the isUnicodeCodePoint assert.

Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91
Reviewed-on: https://gerrit.libreoffice.org/35523
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-22 09:00:57 +00:00
Noel Grandin b24a9f8b35 make o3tl::strong_int constructor explicit
Could have sworn I did this originally, somehow it got lost.
Also fix a thinko in tools::ResId I introduced in commit
2b70fb58be
"Use o3tl::strong_int on RESOURCE_TYPE"

Change-Id: Id3b39962255297010cd1feaaca6d822168311081
Reviewed-on: https://gerrit.libreoffice.org/35108
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14 06:08:20 +00:00
Stephan Bergmann b100342d42 Remove odd check that writeUInt32 indeed writes four bytes
If you look at the oldest available version of SvPersistStream::WriteDummyLen in
8ab086b6cc "initial import", it looks like there
was an issue with whetever earlier way was used to reserve a four-byte space in
the stream with "Sun sp" (whatever that shall mean).

Change-Id: I861a445ae72f1ced502f70917707336eb5dddf04
2017-02-27 14:29:52 +01:00
Noel Grandin e2e76df7e4 create strong_int template and use it in tools::UniqueIndex
an experiment to see how useful a strong_int template works out

Change-Id: Ib77700350f0fa3b018a1926233adf7a40d728d16
Reviewed-on: https://gerrit.libreoffice.org/34072
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-13 09:38:13 +00:00
Noel Grandin bcad173faa Reapply "create ErrorHandlerFlags scoped enum for error handling flags""
This effectively reverts commit 32cae6a2ea.

Change-Id: I15bb0a5c4acaeee6d47dd93a71601d9687d701bc
Reviewed-on: https://gerrit.libreoffice.org/34028
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09 05:47:36 +00:00
Caolán McNamara ff82f13b68 drop unused error strings
includes ERRCODE_SFXMSG_STYLEREPLACE

which has the knock on effect that the flags argument
can be removed from a bunch of methods

Change-Id: I72b58bc2a19376bb4609e61aa44e71f734efb333
2017-02-08 12:18:41 +00:00
Michael Stahl 653e181fb8 Revert "remove ugly operator* in DynamicErrorInfo"
This reverts commit b5e3f8a5fa.

The problem is this:

==24217== Conditional jump or move depends on uninitialised value(s)
==24217==    at 0x29A25FCE: SfxObjectShell::SetError(unsigned int, rtl::OUString const&) (objmisc.cxx:220)
==24217==    by 0x29A35E6E: SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (objstor.cxx:2300)
==24217==    by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765)
==24217==    by 0x29A6BC48:
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (sfxbasemodel.cxx:1802)

The commit is bogus because it introduces a
DynamicErrorInfo::GetErrorCode(), which overloads
ErrorInfo::GetErrorCode(), which is used at least in
DynamicErrorInfo_Impl::RegisterEDcr() and used to return a constructor
argument of DynamicErrorInfo but now returns pImpl->lErrId,
which is what this statement is trying to initialize.

Ultimately this causes my clang+ASAN build to fail because the
uninitialized error code happens to be detected as a mere Warning:

Test name: testMathMalformedXml::Import
assertion failed
- Expression: !xComponent.is()
- loading succeeded: sw/qa/extras/ooxmlimport/data/math-malformed_xml.docx

Change-Id: I9141144e0bc356ee54279948f2fce036d1831a86
2017-02-07 23:02:57 +01:00
Michael Stahl 32cae6a2ea Revert "create ErrorHandlerFlags scoped enum for error handling flags"
This reverts commit 05e78bde26.

Depends on the other commit that needs reverting
2017-02-07 23:02:28 +01:00
Noel Grandin 05e78bde26 create ErrorHandlerFlags scoped enum for error handling flags
Change-Id: I30c80979c87bad7bc98f36a158c31c88d80d1caf
Reviewed-on: https://gerrit.libreoffice.org/33991
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07 12:04:35 +00:00
Noel Grandin b5e3f8a5fa remove ugly operator* in DynamicErrorInfo
I can see why you'd want to hide this horrible tunnelling of
information with objects registering themselves in a global list.
Urrgh.

Change-Id: Ib151a0d2d5a4508dc456e52883e488ce56d9a095
Reviewed-on: https://gerrit.libreoffice.org/33984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07 09:12:58 +00:00
Noel Grandin e5c1e15eda loplugin:expandablemethods in toolkit..tools
Change-Id: I7221bf131d28804ee93474b11973bbc066cc2764
Reviewed-on: https://gerrit.libreoffice.org/30268
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-26 06:50:03 +00:00
Noel Grandin 96e9ffa647 loplogin:singlevalfields in include/
Change-Id: I27842162fcf82120ecb811ee8e89e187430931fc
Reviewed-on: https://gerrit.libreoffice.org/28931
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-16 06:19:38 +00:00
Michael Stahl b647996a9b replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.

Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15 12:01:11 +02:00
Noel Grandin 8ae8e5d12e cid#1371171 Missing move assignment operator
Change-Id: I3150428f130823cdb1584e30c54f5591896214cf
2016-08-29 09:23:46 +02:00
Noel Grandin c9b4e29813 loplugin:constparams in tools
Change-Id: Iea05efbb90a0a95fefd18ae9673095a31422f06c
Reviewed-on: https://gerrit.libreoffice.org/27137
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13 06:38:12 +00:00
Gökhan Gurbetoğlu 9b9e5cfd2f tdf#99589 - tolower / toupper - dangerous to Turks ...
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683
Reviewed-on: https://gerrit.libreoffice.org/26537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-23 09:59:49 +00:00
Michael Stahl 62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Noel Grandin 8e8a88ec1a loplugin:unusedfields
Change-Id: Ieed5f4d9411478d2568b8e5f4bbe0782bd1d309d
Reviewed-on: https://gerrit.libreoffice.org/25724
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:32:07 +00:00
Noel Grandin 0f67254548 clang-tidy modernize-loop-convert in toolkit to uui
Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4
Reviewed-on: https://gerrit.libreoffice.org/24921
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13 08:10:29 +00:00