Age | Commit message (Collapse) | Author |
|
Change-Id: Ia290ff4849f4d7eda978c7b1e2c7f36de744056f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110997
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
can just return a pointer here, instead of VclPtr.
Change-Id: I9ab8962cbbe84ed4dfcfd658a6d758112914cb89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I773555180758a97aff37f9bc27de83c355d71521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109761
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"
Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ib4ee991a05335247d65343dfd3c3bcaf214a9e06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105720
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
|
|
UNO dialogs since LibreOffice 4.0 permitted setting HScroll /
VScroll properties to enable scrolling for too large a content.
Conceptually clone this code over to TabPage as well, and register
necessary UNO properties in the toolkit UNO wrappers.
Add missing API documentation also to UnoControlDialogModel,
plus the new properties to the UnoControlTabPageModel
Layout code really doesn't like any extra controls it didn't create
itself - so create scrollbars only on demand.
Change-Id: I67894597ac104320e67ad7989ebf9a7955d99103
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105573
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
Change-Id: I1ef897d38c26d2875432d279fdd50d2e073ad2a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104903
Tested-by: Jenkins
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
(*) create a rewriting plugin to do most of the work, heavily
based on the fakebool plugin
(*) but there are still a number of "long"s in the codebase
that will need to be done by hand
(*) the plugin needs lots of handholding, due to needing to
add #include and update macros
Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
UITest_sort failing
https://gerrit.libreoffice.org/c/core/+/103942
Jenkins Verified-1 Patch Set 7: Verified-1
where UITest_sort failed
Jenkins Verified+1 Patch Set 7: Verified+1
but that's just an android build which doesn't run any tests
This reverts commit b3f2530aa2767ba43cd4702422fc3ed0d37821d6.
Change-Id: I9414e5d7cc5873848f95dab65f03836ccb2ff0c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104194
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
UNO dialogs since LibreOffice 4.0 permitted setting HScroll /
VScroll properties to enable scrolling for too large a content.
Conceptually clone this code over to TabPage as well, and register
necessary UNO properties in the toolkit UNO wrappers.
Add missing API documentation also to UnoControlDialogModel,
plus the new properties to the UnoControlTabPageModel
Change-Id: Iff90f60d0152ca21e4fe61c31315b9e1feab0dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103942
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
Change-Id: I439b9f456ac0bfaa3eb9bf17472053bd4787e828
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...from which an OUString can cheaply be instantiated. This is the OUString
equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into
a consteval'ed, static-refcound rtl_String". Most remarks about that commit
apply here too (this commit is just substantially bigger and a bit more
complicated because there were so much more uses of OUStringLiteral than of
OStringLiteral):
The one downside is that OUStringLiteral now needs to be a template abstracting
over the string length. But any uses for which that is a problem (e.g., as the
element type of a container that would no longer be homogeneous, or in the
signature of a function that shall not be turned into a template for one reason
or another) can be replaced with std::u16string_view, without loss of efficiency
compared to the original OUStringLiteral, and without loss of expressivity.
The new OUStringLiteral ctor code would probably not be very efficient if it
were ever executed at runtime, but it is intended to be only executed at compile
time. Where available, C++20 "consteval" is used to statically ensure that.
The intended use of the new OUStringLiteral is in all cases where an
object that shall itself not be an OUString (e.g., because it shall be a
global static variable for which the OUString ctor/dtor would be detrimental at
library load/unload) must be converted to an OUString instance in at least one
place. Other string literal abstractions could use std::u16string_view (or just
plain char16_t const[N]), but interestingly OUStringLiteral might be more
efficient than constexpr std::u16string_view even for such cases, as it should
not need any relocations at library load time. For now, no existing uses of
OUStringLiteral have been changed to some other abstraction (unless technically
necessary as discussed above), and no additional places that would benefit from
OUStringLiteral have been changed to use it.
Global constexpr OUStringLiteral variables defined in an included file would be
somewhat suboptimal, as each translation unit that uses them would create its
own, unshared instance. The envisioned solution is to turn them into static
data members of some class (and there may be a loplugin coming to find and fix
affected places). Another approach that has been taken here in a few cases
where such variables were only used in one .cxx anyway is to move their
definitions from the .hxx into that one .cxx (in turn causing some files to
become empty and get removed completely)---which also silenced some GCC
-Werror=unused-variable if a variable from a .hxx was not used in some .cxx
including it.
To keep individual commits reasonably manageable, some consumers of
OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat
odd state for now, where they don't take advantage of OUStringLiteral's
equivalence to rtl_uString, but just keep extracting its contents and copy it
elsewhere. In follow-up commits, those consumers should be changed
appropriately, making them treat OUStringLiteral like an rtl_uString or
dropping the OUStringLiteral overload in favor of an existing (and cheap to use
now) OUString overload, etc.
In a similar vein, comparison operators between OUString and std::u16string_view
have been added to the existing plethora of comparison operator overloads. It
would be nice to eventually consolidate them, esp. with the overloads taking
OUStringLiteral and/or char16_t const[N] string literals, but that appears
tricky to get right without introducing new ambiguities. Also, a handful of
places across the code base use comparisons between OUString and OUStringNumber,
which are now ambiguous (converting the OUStringNumber to either OUString or
std::u16string_view). For simplicity, those few places have manually been fixed
for now by adding explicit conversion to std::u16string_view.
Also some compilerplugins code needed to be adapted, and some of the
compilerplugins/test cases have become irrelevant (and have been removed), as
the tested code would no longer compile in the first place.
sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC bug
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template
argument deduction in unevaluated, parenthesized context". That place, as well
as uses of OUStringLiteral in extensions/source/abpilot/fieldmappingimpl.cxx and
i18npool/source/localedata/localedata.cxx, which have been replaced with
OUString::Concat (and which is arguably a better choice, anyway), also caused
failures with at least Clang 5.0.2 (but would not have caused failures with at
least recent Clang 12 trunk, so appear to be bugs in Clang that have meanwhile
been fixed).
Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: If51bf7143116721e8f16272cf8aff797651d5ed1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101880
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
It passed "make check" on Linux
Change-Id: I5beec4b326b7f59103de374dff8169718defc8ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101779
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
This is a prerequisite for making conversion from OUStringLiteral to OUString
more efficient at least for C++20 (by replacing its internals with a constexpr-
generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount,
conditionally for C++20 for now).
For a configure-wise bare-bones build on Linux, size reported by `du -bs
instdir` grew by 118792 bytes from 1155636636 to 1155755428.
In most places just a u"..." string literal prefix had to be added. In some
places
char const a[] = "...";
variables have been changed to char16_t, and a few places required even further
changes to code (which prompted the addition of include/o3tl/string_view.hxx
helper function o3tl::equalsIgnoreAsciiCase and the additional
OUString::createFromAscii overload).
For all uses of macros expanding to string literals, the relevant uses have been
rewritten as
u"" MACRO
instead of changing the macro definitions. It should be possible to change at
least some of those macro definitions (and drop the u"" from their call sites)
in follow-up commits.
Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ib41d80d1e068d66edabdfb36061dd382dc34b04c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I9aa4b1efbecb71141647dbf5d8809482be15d266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100888
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ie5ad0febca0747fa66c2caede619d14e468da032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100498
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I8f4b29620134566f256f05bbab677e83baf20ec7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100031
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
so sync SVTXCurrencyField::ImplGetPropertyIds with
VCLXCurrencyField::ImplGetPropertyIds and use that instead
Change-Id: Ib1f2357cb4ad6b098bcd37f34d3fd680ac9f83f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98895
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I40eb6de30065fe00d5214e0a00b38d02b0deea52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97708
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Id747848b222f69af3293a2095a62542f1e1116d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95215
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
|
|
Change-Id: I6b6cf2a8c6faa461515e8548d3db67e453351085
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95361
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
This reverts LO6.4 commit 5cf057c3365a0feafc8f2e4f4a9e24d69a581999,
in order to fix tdf#133158.
This commit is obsolete, but was left in place since it
seemed to have fixed a problem (in =gtk3 anyway).
But now SAL_USE_VCLPLUGIN=gen behaves differently,
so obviously a fix in one place must have broken another.
Better the problems you have always known than
a new problem, especially since this patch
isn't used to fix anything specific in gtk3 anymore
(since those changes were also reverted).
An earlier gerrit version of this revert (which
didn't just have an ignore-this-clang-rule exception)
half-worked, but failed if multiple documents
were opened.
Change-Id: Ie8ddb7b9669fa46067d04c35e157ea08701df0da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95282
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
90% of cases pass GetSizePixel as the Size arg already
and this aligns Window::Draw with how Window::PaintToDevice
works
Change-Id: If5b024179a4b7a3b099177c2f6d4b1fb006b95ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94644
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I718016b5f9120c18868ed798785af1f8108be25b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94569
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
In the model, changing a tab page's title or enabled/disabled
status is done via methods 'XTabPageModel.setTitle' and
'XTabPageModel.setEnabled'.
Changes to the title and enabled/disabled status are
propagated to the tab page container containing the
tab page (s.a. 25c692c2a94ab83c2c859ac5ab334b62ac8b825e
("ControlModelContainerBase: Use property for enabled status",
2020-05-15)).
Make 'VCLXTabPageContainer' derive from 'XPropertiesChangeListener'
and implement the 'propertiesChange' method defined in that
interface to handle property changes for the tab pages and have
'UnoControlTabPageContainer' forward 'PropertyChangeEvent's
to its peer so they can be handled there.
This way, changes for those tab page properties via UNO
are now properly updated in the UI as well.
Change-Id: I6fa1fadf781575c4ad1d066aed9c3a651b10869d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94402
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Use the property BASEPROPERTY_ENABLED for getting and setting
the status instead of handling it in a custom bool member
variable.
This way, property changes are also automatically propagated
and can be handled by the corresponding listeners.
Change-Id: I3a36ac8738a7caae987894ac9dd271d2713c1e09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94310
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Calling 'addTabPageContainerListener' for the peer
instead looks like it was probably a copy paste mistake
when adding this forwarding in both,
'UnoControlTabPageContainer::addTabPageContainerListener',
and 'UnoControlTabPageContainer::removeTabPageContainerListener'
in commit 559f957fc3e4295b049866efe3582b2aaa17c414
("tabcontrol: notify tab listener", 2010-09-06).
Change-Id: I98f20b9cb3e658143b362118189adfbed85f3b43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94262
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
'mnMaxTextLen' and 'mbSetMaxTextLenInPeer'
are already assigned the same values in the
member initializer list.
Change-Id: I498ff981c25f6b5395400c75ad8c7e0f20ff3a89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94180
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
The only class inheriting from it is ControlContainerBase,
so make the naming more consistent, also to match the
naming pattern used elsewhere.
Change-Id: I91739fb105f97605a3c279100b8c4e666aa3b010
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94139
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
which was relying on the nElementCount field, which was not being
updated. Just delete it and check the map.
Change-Id: If543abcc7c1778a27675a1df69a54325024234b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94133
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I4732e238053b8c9e6813f1bbecd6f613922cb521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93748
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Change-Id: I04cbd84196b5bf31caa4da3140dc65b1dfa20127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93746
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
This broke the event order in basic dialog xml,
which in turn broke macro signatures.
This reverts commit 85f08e3e34bea01456eaf8989ac4f77d3900d5c5.
Change-Id: I49ef2eb200571a0fd862770abc4331b6ea053e2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93564
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
|
|
Found by:
run-clang-tidy-10 -checks=-*,misc-unused-using-decls
Change-Id: I3e95791e223ef01e140a6217e29a9efae428a784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90876
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
This reverts commit 175834ce6a3ba707a6d34aa8de7351574381f481.
Change-Id: I4b524ca1aa9aed2273b5d891a02fc0b360abc94c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Files which could become clang-format conformant with
under 5-percent lines of change relative to the total
count of lines in the file are found by using bin/find-clang-format.py,
and fixed with /opt/lo/bin/clang-format -i <path-of-the-file>
There will be follow-up patches to fix all 'under-5-percent' files.
Change-Id: I4952f350f4d22913ea94689b902ffa26c223ff96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90152
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
|
|
Change-Id: I201b195438ef3df067cfa6db97c3b37b23061142
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89887
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...now that macOS builds are guaranteed to have std::optional since
358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to
Xcode 11.3 and macOS 10.14.4".
The change is done mostly mechanically with
> for i in $(git grep -Fl optional); do
> sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \
> -e 's/\<o3tl::optional\>/std::optional/g' \
> -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i"
> done
> for i in $(git grep -Flw o3tl::nullopt); do
> sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i"
> done
(though that causes some of the resulting
#include <optional>
to appear at different places relative to other includes than if they had been
added manually), plus a few manual modifications:
* adapt bin/find-unneeded-includes
* adapt desktop/IwyuFilter_desktop.yaml
* remove include/o3tl/optional.hxx
* quote resulting "<"/">" as "<"/">" in officecfg/registry/cppheader.xsl
* and then solenv/clang-format/reformat-formatted-files
Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Id5298615f0f3dad6e61955e23367c0345b33f2b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88813
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I39bb417fe7e033a8f368fa04d4a30b2388bcddfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88615
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I88badb1eb586db00a350afbcd6f4903a5623c724
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87988
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ifda9d3a4f05ffa9f611512d5d203e40d67d1c542
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87522
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
|
|
Change-Id: I13e5c59aa673100655f38328b4b6515a1946fb76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87524
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
|
|
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)
o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like
static_cast<sal_uInt32>(n) >= c
used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative. It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives. The only remainging false
positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast
from sal_Int32 to sal_uInt32".
But which of course does not mean that there were no further false positivies
that I missed. So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.
It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now. (The
ultimate fix being to get rid of the macro in the first place.)
Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|