Age | Commit message (Collapse) | Author |
|
Change-Id: I32595921bf5ed26699bced3637302692c407d624
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103760
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
It passed "make check" on Linux
Change-Id: Idd33e9f70c9552c341b4d312bc33135f758715b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103449
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
It passed "make check" on Linux
Change-Id: Iae7db8b7627c5e4715860eafda8df98d2cb8f781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103308
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I41a204fbc5e2c9b819fb948c5288f8d7b4195489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103117
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
This will need a real implementation to do system calls, but for
the initial compilation the dummy is sufficient.
Change-Id: Ia16e47fdb8fbf4855f7c5abb0d36d9c922cd1de7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102860
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
|
|
...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: Id6660627e766c6dcd107c3ee483bacb046cae7bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102123
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I76e86bf4d82b33771ea2900517712be57ae7f03d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102232
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
...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>
|
|
Change-Id: I4bee1ec99b69b42b7eea540b04511cbafe5fbd0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102106
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I841cbb2bad3af5f6f6212962d7f15436d5e7bead
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102105
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
|
|
Abort scan of a string beginning with a hashtag, if a comma is found. Otherwise, the compiler raises a syntax error. If
the string ends with a hashtag too, it will be parsed later checking for
a date literal.
Change-Id: I078a2302f5c65206367a00fbc584ffa7b9ede031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102099
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.
Change-Id: Ief7f29d8efaa3d6ac417080f3147a087844621a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100128
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Idbcce18029944ab884cdde03e21190cbb574a00f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102005
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
|
|
Using option base, every array should start at index 1. Previously, it
needed option VBASupport too. Without option compatible, the upper bound
of an array is increased as well in order to preserve the specified
size.
Change-Id: I52885f14914a4636b98258aa428c2123f62482a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101269
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
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>
|
|
In order to prevent type conversion errors, reset a variable of type
SbxERROR to not fixed. Variable will be of type SbxERROR, but can be
converted to any requested type.
Change-Id: Ic856376e3f8232577a5e894a2adb2545c8723033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101419
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: Ie8ebbfd9bdf5916d50161fdf39de963730f051a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100868
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
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>
|
|
Otherwise it will fail assertion in SbxValue::Clear, because
SvRefBase::ReleaseRef would check that its current count is
not zero. In release builds, not doing this would leak.
Change-Id: I80dfc815f8a2b651ff290af10808212281abf246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100879
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
This requires to reset Fixed flag temporarily, as in SbiParser::DefType
for non-image case.
And save the dimensions of the arrays in the custom types correctly:
the dimensions are numbered from 1, not from 0.
The existing unit test (that happened to not test anything actually)
was fixed.
Change-Id: I48c6b6d5d735d9972a2c0dd40345d5db75f87f39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100877
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: Id31299912b822baf9eecbb03cba53339f0528ae8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100867
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Ie429a10a8f54c6779d437ee4bc75a5ea0c427848
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100727
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
look for expressions like
!(a && !b)
which can be expanded out
Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Add some API to O*StringLiteral, to make it easier
to use in some places that were using O*String
Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
The check should prevent error in case when the variable has
wrong type. IsObject returns false e.g. for arrays, which are
valid iterables. So proper check is using GetFullType, which
will give SbxOBJECT for any variable for which GetObject does
not set error.
"Next" should also generate an error for uninitialized loops.
Regression after 5760c94b8847164f9a7a181f031c7c86643944af
Change-Id: Ib58e1cc76ef63aa1ff8a86c9d5dc956e4780fb49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100258
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
As discussed at <https://gerrit.libreoffice.org/c/core/+/99724> "fix shutdown
crash in basic" the code was added in error, and at least clang-cl with latest
MSVC standard library and C++20 mode gives a helpful
> basic/source/sbx/sbxbase.cxx(53,5): error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
> std::move(m_Factories);
> ^~~~~~~~~ ~~~~~~~~~~~
now.
Change-Id: I052efe51d4415838b50de06bb308692fa937b7b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100076
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I7e4780d41dd43383820cc3ae4ce5cfba24a53b7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99942
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
|
|
Change-Id: Iff0cb697a4f8670c897516d23f2701f3716171f3
|
|
another change I am working on slightly tweaks the shutdown ordering
and exposes this problem where two classes both think they own
the same object.
Change-Id: I7477cf7eda5b5729ee3861cb4a1be43bb34d9ea6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ib4a812dd115299d4251d863d0ee275d7acba1c5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99443
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
...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>
|
|
Change-Id: I6078e0712f7983159ea3b3f2060a1c4b69e9d5c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99114
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
1. In SbiRuntime::PushForEach, always initialize SbiForStack::eForType
to avoid handling the loop as simple For loop in SbiRuntime::StepNEXT.
2. In SbiRuntime::PushForEach, just like in SbiRuntime::PushFor, don't
set error, but imitialize the loop properly. This allows to proceed to
SbiRuntime::StepTESTFOR, where the error will be handled gracefully.
3. In SbiRuntime::StepTESTFOR, check for the proper initialization of
the iteration, and set the error.
4. In SbiRuntime::StepTESTFOR, on error, modify the type of iteration
into Error - to make sure that loop ends on next iteration (so only a
single iteration happens inside the Resume Next).
Change-Id: Idd0bab79fb0099fa3ad295b7fc6ab2eb6173f7b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98537
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
E.g., when we redim a copy of an array, the other copy would still have
its old dimensions, so shallow copy would share some array elements
between the now different arrays.
The other possible approach would be to try to modify the original array
to have the ByRef semantics.
Change-Id: Iab272ecbf4ade67048d6a126f17322441c5aa808
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98481
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I69638fd2130c1ba68915906ced62bda2cd883932
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98491
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
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>
|
|
.. and a few cases of instead doing blacklist->excludelist where that
made more sense.
Background and motivation:
https://tools.ietf.org/html/draft-knodel-terminology-02
[API CHANGE] officecfg::Office::Canvas::DeviceBlacklist -> DeviceDenylist
[API CHANGE] officecfg::Office::Canvas::BlacklistCurrentDevice -> DenylistCurrentDevice
[API CHANGE] officecfg::Office::Common::Misc::OpenCLBlackList -> OpenCLDenyList
Change-Id: Ia35e25496bf0cc0692d5de4cb66bfc232d3a869e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98180
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
Change-Id: I1046ee1ea28e19afa51b0e20ee573105ced77535
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97522
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ie5422ac19289693c44ce81548a74bd727bb0be36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97193
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...left over by 27239ad23006b1fd1ddb21467f4c1fd637b560d5 "basic: String ->
OUString",
> // Force length 1 and make char 0 afterwards
> - String aNullCharStr( rtl::OUString(" ") );
> - aNullCharStr.SetChar( 0, 0 );
> + OUString aNullCharStr( (sal_Unicode)0);
> return aNullCharStr;
and
> // Force length 1 and make char 0 afterwards
> - String aNullCharStr( rtl::OUString(" ") );
> - aNullCharStr.SetChar( 0, 0 );
> + OUString aNullCharStr((sal_Unicode)0);
> addStringConst( aPublics, "vbNullChar", aNullCharStr );
Change-Id: Icbf69ff7b92374b690cb5c7f0129c6a494db48f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97031
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I97921d5a6f7e0f6dfc3100e4ea33ba79e5a135dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94573
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
During the loading of numeric constants in StepLOADNC, create variables
of type Variant and convert them to the requested type, i.e.
Variant/Type in order to prevent type conversion errors, when they are
passed to a method with variant parameter types.
Change-Id: I2ab0111b5b53dd2de9523ba7cf12bd2519d050b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96402
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
During the construction of the parameter list of a method,
convert parameters of type SbxEMPTY to their requested type,
since missing parameters are handled differently in StepEMPTY,
where separate parameter information (SbxMISSING) is added.
Change-Id: Ie1e027cfdd652404ec29bd3d05e7daf533468936
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96088
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
|
|
to look for the
x.get() != null
pattern, which can be simplified to
x
I'll do the
x.get() == nullptr
pattern in a separate patch, to reduce the chances of a mistake
Change-Id: I45e0d178e75359857cdf50d712039cb526016555
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ie723d07afcc6e0d5e52bec77617fec326a739415
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95374
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ibf6cef4baa2d3d400d953ac8bc97a66b5901def9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...where the get member function is defined on a std::__shared_ptr base class,
so loplugin:simplifypointertobool used to miss those until now. (While e.g.
using libc++ on macOS found those cases.)
366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool"
was mistaken in breaking isSmartPointerType(const clang::Type* t) out of
isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix
detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had
introduced that indivisible two-step algorithm on purpose.
The amount of additional hits (on Linux) apparently asked for turning
loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed
that the naive adivce to just "drop the get()" is not sufficient in places that
are not contextually converted to bool, as those places need to be wrapped in a
bool(...) functional cast now. If the expression was already wrapped in
parentheses, those could be reused as part of the functional cast, but
implementing that showed that such cases are not yet found at all by the
existing loplugin:simplifypointertobool. Lets leave that TODO for another
commit.
Besides the changes to compilerplugins/ itself, this change has been generated
fully automatically with the rewriting plugin on Linux.
Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
|
|
Change-Id: Idddba2f3fd05265b08dbc88edb6152d34a166052
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|