summaryrefslogtreecommitdiff
path: root/include/com
AgeCommit message (Collapse)AuthorFilesLines
2022-05-05Deprecate css::uno::makeAny; completely disable it for LIBO_INTERNAL_ONLYStephan Bergmann2-20/+14
There is just no good reason not to use a css::uno::Any constructor instead, so simplify the code base. For URE backwards compatibility, keep it around as deprecated for !LIBO_INTERNAL_ONLY. Change-Id: I9409d8853cac270d47377a31ba35a1fc23fa9800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133879 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-02Add css::uno::Any(OUStringNumber) overloadStephan Bergmann2-0/+4
...like was already present for css::uno::makeAny, in preparation of getting rid of makeAny Change-Id: Ic838a8297ec65dae75da6a1deb5933d562070753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133679 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15LIBO_INTERNAL_ONLY stuff does not need to be SAL_CALLNoel Grandin2-3/+3
Change-Id: I9d7ccaab19ad20509601642745e3fdaea50304ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129818 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2022-01-15Let loplugin:nullptr look into template instantiationsStephan Bergmann2-4/+4
It missed some occurrences of 0 when only looking into uninstantiated template code, as Clang doesn't model them with an ImplicitCastExpr, even if the target is known to be a (dependent) pointer type. Looking into all template instantiations of course carries the risk that a given use of 0 is meant to be interpreted as a pointer in some and as an integer in other instantiations. But the only case where that happened in the current code base is RegistryValueList::getElement (include/registry/registry.hxx), where {} is arguably a better choice anyway. (And which would presumably also hold for any future such cases.) Change-Id: I708bcfc8bedc0a49c9282d7814eb325afa29905c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128462 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-09uno sequences with different sizes are not equalLuboš Luňák1-0/+2
This should often the case, and should be way faster than the UNO data comparison. Change-Id: Ied648d75779ef3aafd293c36906a1bab66bdeade Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128098 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-12-20Add css::uno::Sequence move assignment operatorStephan Bergmann2-0/+11
Coverity had reported it as lacking, which b0b2d7f040c6a7c5dc1f3949693b368ca54ea3b5 "cid#1495784 Missing move assignment operator" and c4aa4b55e21915ca072daa7db93edabc043f26ab "cid#1495784 Missing move assignment operator" had worked around by instead modifying the calling code. But even though a move constructor would be of little benefit, a move assignment operator does have the slight performance benefit of avoiding some refcount manipulation, so add it anyway. Change-Id: Ibc9ca4557dd8beb6070b3451cb6103a8aadd10e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127188 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-12Add a comment clarifying intended replacement for non-const operator[]Mike Kaganski1-0/+2
Change-Id: Ib6cd01e1da3e23521e2ae385b8f50046000da410 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125103 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-05Drop non-const Sequence::operator[] in internal codeMike Kaganski2-0/+4
This makes all non-const operations on Sequence explicit, to avoid repeated COW checks in loops. Generally it would be desirable to replace uses of Sequence with general-purpose containers wherever possible, and only use Sequence for UNO API calls. This change uncovered a very serious pre-existing problem inherent to the Sequences used e.g. in range-based loops in our code: taking a non-const reference to elements of a sequence, and then modifying them at some later stage, brings a danger to also modify copies of the Sequence, that were created between the points of taking the reference and modifying it. This caused the change to oox/source/drawingml/customshapeproperties.cxx, where CustomShapeProperties::pushToPropSet took begin()/end() non-const iterators to aGeoPropSeq at the start of the loop, and then in the loop modified its elements and copied the Sequence passing it to XPropertySet::setPropertyValue. This was the same also prior to 2484de6728bd11bb7949003d112f1ece2223c7a1, and only happened to not cause problems because of *accidental* use of non-const operator[] on the copy of the Sequence inside SdrCustomShapeGeometryItem ctor, which *inadvertently* triggered COW, detaching the two copies one from another. This only emphasizes that we should minimize use of Sequences in the codebase. I anticipate other similar problems uncovered by this change, that happened to not break existing unit tests. Change-Id: Id691d994a06eb14297c487ebb84d8e062e29fd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123725 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-28Prepare for removal of non-const operator[] from Sequence in includeMike Kaganski1-1/+2
Change-Id: I85ca453f3add5ac5b59dc6f1ccb2cdb55f0a463c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124333 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski2-2/+10
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski2-0/+34
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-24remove uno::Type move constructorNoel Grandin2-14/+0
not necessary for the optimisation I was going for, and actually less efficient than just using the copy constructor Change-Id: I0f2019a0bf032283fb6c8d5d834603ea7a5ce3c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-24uno::Type needs a move operatorNoel Grandin2-0/+26
speeds up some operations where Type is stored in a vector Change-Id: Id7112e51d4e4707bc6d261313e994c6ffef54d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16loplugin:referencecasting in reportdesignNoel1-1/+1
Also, I needed to add castToXInterface() to the upcasting Reference::Reference constructor, to resolve ambiguity in casting to XInterface. Change-Id: Ica60190bc842444c37de56407b586aa267f08372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-01tdf#130978 Add a comment to each published APImsrijita1810-0/+40
Added comment in include/com/sun/star/uno header files Change-Id: Ie483d781f8e7f8e16382660ea2be0d0e47a6a088 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110018 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-21tdf#123936 Formatting files in module include with clang-formatPhilipp Hofer1-5/+3
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-09-25cid#1448292 coverity has difficulty with css::uno::SequenceCaolán McNamara1-9/+0
current attempt isn't working, try a different approach to silence these warnings Change-Id: I0cc97df0897abc665dfbb683d7aa0df55f8affb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103387 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-22__coverity_tainted_data_sanitize__ can't be constCaolán McNamara1-2/+2
apparently, so use const_cast on its input instead Change-Id: Ib0dfd94c144a2509470ca7a9b3b8fbfacbfd7581 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103148 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-20fix __coverity_tainted_data_sanitize__ signatureCaolán McNamara1-1/+1
argument of type "const sal_Int8 *" is incompatible with parameter of type "void *" Change-Id: I0f1dba700516043d54c4e46edae9753312b5ad2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103071 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-12Replace remaining uses of sal_CharJulien Nabet2-2/+2
+ 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-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann2-47/+10
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-23Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLYStephan Bergmann2-12/+6
It looks like an oversight that 904b3d1fceee5827076758ed2a81f80cb73493ca "Up- cast conversion constructor for css::uno::Reference" added it also for external code. Making it LIBO_INTERNAL_ONLY allows to remove workarounds for old MSVC, and may allow to simplify the code further in the future. (Though using std::is_base_of, as suggested in the comment, is not easily possible, as it would cause errors like > include/c++/v1/type_traits:1726:59: error: incomplete type 'com::sun::star::lang::XMultiServiceFactory' used in type trait expression > : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {}; > ^ > include/c++/v1/type_traits:1731:7: note: in instantiation of template class 'std::__1::is_base_of<com::sun::star::beans::XPropertySet, com::sun::star::lang::XMultiServiceFactory>' requested here > = is_base_of<_Bp, _Dp>::value; > ^ > include/com/sun/star/uno/Reference.h:277:18: note: in instantiation of variable template specialization 'std::__1::is_base_of_v<com::sun::star::beans::XPropertySet, com::sun::star::lang::XMultiServiceFactory>' requested here > std::is_base_of_v<interface_type, derived_type> > ^ > ucbhelper/source/provider/getcomponentcontext.cxx:34:9: note: while substituting deduced template arguments into function template 'Reference' [with derived_type = com::sun::star::lang::XMultiServiceFactory] > css::uno::Reference< css::beans::XPropertySet >( > ^ > include/ucbhelper/getcomponentcontext.hxx:29:28: note: forward declaration of 'com::sun::star::lang::XMultiServiceFactory' > namespace lang { class XMultiServiceFactory; } > ^ with incomplete types.) Change-Id: I6da3395df904797cec83c1f6ab24b386527d4cea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92802 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-06loplugin:nullptrStephan Bergmann1-2/+2
...in non-dependent templated code that Clang trunk now apparently processes more aggressively, presumably since <https://github.com/llvm/llvm-project/ commit/878a24ee244a24c39d1c57e9af2e88c621f7cce9> "Reapply 'Fix crash on switch conditions of non-integer types in templates'" Change-Id: Ia3e4bc6cfe7cea9f816e9282563a8b38e40f0cec Reviewed-on: https://gerrit.libreoffice.org/84649 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-03Adapt to C++20 deleted ostream << for sal_Unicode (aka char16_t)Stephan Bergmann1-1/+1
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html> "char8_t backward compatibility remediation", as implemented now by <https://gcc.gnu.org/ git/?p=gcc.git;a=commit;h=0c5b35933e5b150df0ab487efb2f11ef5685f713> "libstdc++: P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << overloads that would print an integer rather than a (presumably expected) character. But in these cases printing an integer is as expected, so add explicit casts. Change-Id: I7c2f1afaa2982b284aef8af183b71466c37142c2 Reviewed-on: https://gerrit.libreoffice.org/84339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-24support O(U)String::number() for fast string concatenationLuboš Luňák1-0/+19
When I did the fast string concatenation, I didn't add any support for number(), which simply returned a O(U)String, and so it did the extra allocation/deallocation, although that could be avoided. In order to support this, number() now returns a special temporary return type, similarly to O(U)StringConcat, which allows delaying the concatenation the same way. Also similarly, the change of the return type in some cases requires explicit cast to the actual string type. Usage of OString::getStr() is so extensive in the codebase that I actually added it to the helper class, after that it's only relatively few cases. Change-Id: Iba6e158010e1e458089698c426803052b6f46031 Reviewed-on: https://gerrit.libreoffice.org/78873 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-08-30loplugin:noexceptmove in AnyNoel Grandin2-5/+5
but we needed to make moveAnyInternals noexcept, which is fine because uno_any_construct is already noexcept Change-Id: Iddbe7666d8649cde4e638099a17484193055f549 Reviewed-on: https://gerrit.libreoffice.org/78283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-30new loplugin:noexceptmoveNoel Grandin2-4/+4
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-26Introduce Sequence::size() instead of specialization of std::sizeMike Kaganski1-10/+10
Change-Id: Id0889a1b51449f3812ba875919595a241f4ec56f Reviewed-on: https://gerrit.libreoffice.org/78139 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-26Generalize comphelper::concatSequences to accept other container typesMike Kaganski1-0/+10
... as second and following arguments. Change-Id: I1c994ec234354805bc702632878fd67a54d271d6 Reviewed-on: https://gerrit.libreoffice.org/78092 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-25cid#1448292 coverity has difficulty with css::uno::SequenceCaolán McNamara1-0/+10
Change-Id: I227a88c566f981ace5e45d0e217a50abbc7f3023 Reviewed-on: https://gerrit.libreoffice.org/78072 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-06-30Fix typoAndrea Gelmini1-1/+1
Change-Id: I4508cc601ac3351f54b0223b15a4705d8f339d7e Reviewed-on: https://gerrit.libreoffice.org/74904 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-30Fix typoAndrea Gelmini1-2/+2
Change-Id: I1b43e186bd6e9de7332513e60f3be1bbe9d8ff82 Reviewed-on: https://gerrit.libreoffice.org/74901 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-30Fix typoAndrea Gelmini1-2/+2
Change-Id: I576da0e09f4a70361c0c5226ce80418680711f55 Reviewed-on: https://gerrit.libreoffice.org/74902 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-30Fix typoAndrea Gelmini1-1/+1
Change-Id: I99dba9443d703d56f0cbe38cb32c7d6963a669cf Reviewed-on: https://gerrit.libreoffice.org/74903 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-01Sequence: Fix typo in commentsMichael Weghorn1-4/+4
Change-Id: I8477be28693f55bea857531707286437ea13d034 Reviewed-on: https://gerrit.libreoffice.org/73296 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin1-0/+12
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin1-0/+20
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 Date: Thu Dec 21 20:08:33 2017 +0900 chart2: suspend/resume setting rects dirty for 3D shapes comphelper::OInterfaceCompare is no longer necessary Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975 Reviewed-on: https://gerrit.libreoffice.org/71537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13fix Sequence ostream operator<< wrt. constMichael Stahl1-1/+1
Change-Id: I924f5d8505f2c2132c79304e19cf89a8ef466ae4 Reviewed-on: https://gerrit.libreoffice.org/67771 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-08add operator* to uno::ReferenceNoel Grandin1-0/+10
like the other smart pointer types Change-Id: I3ac1888c84fc1411cdfc3357b005afbb3b7d8bbe Reviewed-on: https://gerrit.libreoffice.org/65926 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Use constexpr ifStephan Bergmann1-15/+6
Change-Id: I7c34dfb5a83b14afc740772cffe407d4773b07e5 Reviewed-on: https://gerrit.libreoffice.org/64818 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-11Use [[nodiscard]] in SAL_WARN_UNUSED_RESULT where availableStephan Bergmann1-2/+2
...which required some lax placements of SAL_WARN_UNUSED_RESULT to be fixed. Also, Clang unfortunately is rather picky about the relative order of SAL_WARN_UNUSED_RESULT expanding to [[nodiscard]] and uses of the DLLPUBLIC macros (expanding to __attribute__(...) resp. __declspec(..) for clang-cl). Change-Id: Iae6ca36bef97f1864873aefdb5f05c7f5e045ad3 Reviewed-on: https://gerrit.libreoffice.org/60274 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15More loplugin:cstylecast: cppuStephan Bergmann3-4/+4
Change-Id: I728a40ab6ef4aa44fbe328abdf244e6b5fac9d04
2018-01-13provide uno::Sequence with ostream output operatorThorsten Behrens1-0/+79
Alongside Anys and other UNO data types, you can now also stream out Sequences, e.g. in SAL_INFO or SAL_DEBUG statements. Example code: uno::Sequence<sal_Int8> aBuffer... SAL_DEBUG("my buffer: " << aBuffer); Would yield: debug:<pid>: my buffer: 0xb6, 0x61, 0xa8, ... Change-Id: I03b0789372c44a4dd057625824862f43b1b8dfdc Reviewed-on: https://gerrit.libreoffice.org/47779 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-12More loplugin:cstylecast: cppuStephan Bergmann1-6/+6
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: I8531b2dc474b257c63016c8ae80014c7322e5a71
2018-01-08Typo in comment ("from" vs. "to")Stephan Bergmann1-1/+1
...which had been like that ever since the code got introduced with 0fbe22a77289a624e1346ab457734c2f64f8e6fb "css::uno::Any move semantics (for LIBO_INTERNAL_ONLY)" Change-Id: Iacd93a4434a92f2ee8f83ba1d59b0ef0a6c38a42
2017-11-11Avoid using O[U]StringConcat lvalues containing dangling refs to temporariesStephan Bergmann2-4/+18
...in code accidentally using auto like > auto const aURL = uri->getUriReference() + "/" > + INetURLObject::encode( > m_sEmbeddedName, INetURLObject::PART_FPATH, > INetURLObject::EncodeMechanism::All); > > uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY); in <https://gerrit.libreoffice.org/#/c/44569/1> "Properly construct vnd.sun.star.pkg URL" did (causing hard to debug test failures there). So make functions taking O[U]StringConcat take those by rvalue reference. Unfortunately, that also needed adaption of various functions that just forward their arguments. And some code in sc/qa/unit/ucalc_formula.cxx used CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that happened to actually compile (because the structure of the two OUStringConcats was identical), which needed adaption too (but which would arguably better use CPPUNIT_ASSERT_EQUAL_MESSAGE, anyway). Change-Id: I8994d932aaedb2a491c7c81c167e93379d4fb6e3 Reviewed-on: https://gerrit.libreoffice.org/44608 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-23loplugin:includeform: UNO API include filesStephan Bergmann10-48/+48
Change these back to consistently use the "..." form to include other UNO API include files, for the benefit of external users of this API. Change-Id: I9c9188e895eb3495e20a71ad44abfa2f6061fa94
2017-07-13use more OUString::operator== in forms..salNoel Grandin1-1/+1
Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc Reviewed-on: https://gerrit.libreoffice.org/39899 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-06add COVERITY_NOEXCEPT_FALSECaolán McNamara2-3/+2
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-05-30teach redundantcast plugin about functional castsNoel Grandin1-2/+1
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>