summaryrefslogtreecommitdiffstats
path: root/include/com
Commit message (Collapse)AuthorAgeFilesLines
* More loplugin:cstylecast: cppuStephan Bergmann2018-01-153-4/+4
| | | | Change-Id: I728a40ab6ef4aa44fbe328abdf244e6b5fac9d04
* provide uno::Sequence with ostream output operatorThorsten Behrens2018-01-131-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>
* More loplugin:cstylecast: cppuStephan Bergmann2018-01-121-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
* Typo in comment ("from" vs. "to")Stephan Bergmann2018-01-081-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
* Avoid using O[U]StringConcat lvalues containing dangling refs to temporariesStephan Bergmann2017-11-112-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>
* loplugin:includeform: UNO API include filesStephan Bergmann2017-10-2310-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
* use more OUString::operator== in forms..salNoel Grandin2017-07-131-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>
* add COVERITY_NOEXCEPT_FALSECaolán McNamara2017-06-062-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>
* teach redundantcast plugin about functional castsNoel Grandin2017-05-301-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>
* Revert "Fix typos"Stephan Bergmann2017-05-181-1/+1
| | | | | This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
* Fix typosAndrea Gelmini2017-05-181-1/+1
| | | | | | | | | Only replaced "iff" with "if" Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581 Reviewed-on: https://gerrit.libreoffice.org/37782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
* LIBO_INTERNAL_ONLY: printing of css::uno::Reference/TypeStephan Bergmann2017-04-282-0/+27
| | | | | | | ...as will be needed by some upcoming replacements of CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Ie2b2b982b02f2bf48e2e8be7ba642198029c8698
* Remove redundant 'inline' keywordStephan Bergmann2017-03-034-42/+42
| | | | | | | | | | ...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* add 'explicit operator bool' to our reference classesNoel Grandin2017-01-261-0/+9
| | | | | | | Change-Id: I91cfbe2646dcc55b98d2b809c49c9ea073f54f58 Reviewed-on: https://gerrit.libreoffice.org/33517 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Delete the "Any-to-Any" template specializations for LIBO_INTERNAL_ONLYStephan Bergmann2016-11-212-0/+58
| | | | | | | | | | | | | | | | | | | | | | | i.e., css::uno::Any function template specializations Any::has<Any>() const Any::get(Any const &) const operator >>=(Any const &, Any &) operator <<=(Any &, Any const &) that don't make much sense (the first is always true, the rest can be replaced with operator =, which additionally supports move semantics). For 3rd-party compatibility, do this only for LIBO_INTERNAL_ONLY, however. However, some generic template code did benefit from operator >>= working also for Any, so make up for that with a new (LIBO_INTERNAL_ONLY, given that operator >>= still covers if fine for !LIBO_INTERNAL_ONLY) fromAny, complementing the existing toAny. Change-Id: I8b1b5f803f0b909808159916366d53c948206a88 Reviewed-on: https://gerrit.libreoffice.org/30022 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* use SAL_DEPRECATED in uno::ReferenceNoel Grandin2016-07-041-2/+2
| | | | | | | | | and fix a couple of usages that have crept in Change-Id: Ia3e7fcc05dac6e0d205e69c0e0372c74653e7c5e Reviewed-on: https://gerrit.libreoffice.org/26851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
* css::uno::Any move semantics (for LIBO_INTERNAL_ONLY)Stephan Bergmann2016-06-062-0/+38
| | | | Change-Id: Ib582a744321e0f209395651ac2edffe30152ffba
* remove various crutches for boost::bind/boost::mem_fnMichael Stahl2016-05-131-10/+0
| | | | | | | | | | These aren't used any more, and the C++11 std equivalents don't use get_pointer() overloads. Change-Id: Ib97a6a595863e21a1621c63709ea2b28f6550fde Reviewed-on: https://gerrit.libreoffice.org/24982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
* Better fix for Windows-only codeStephan Bergmann2016-05-041-1/+1
| | | | Change-Id: I8437ec66b615754d71c726f715a6beeb4a0f7dda
* Fix Windows-only codeStephan Bergmann2016-05-041-1/+1
| | | | Change-Id: Iaf6d668f65e31c60dba8140d789f6578ef461264
* While at it, delete Any functions on sal_Bool*Stephan Bergmann2016-05-041-0/+7
| | | | | | | (at least for LIBO_INTERNAL_ONLY), to help further reduce the occurrences of sal_Bool across the code base Change-Id: I70654a0cb56655984c717b7b894f26c9ab47536e
* Enable Any functions on sal_uInt16 for LIBO_INTERNAL_ONLYStephan Bergmann2016-05-032-0/+8
| | | | | | | | | | | | ...where sal_uInt16 no longer clashes with sal_Unicode after e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 type on windows". This allows to consistently use Any ctor instead of makeAny, regardless of argument type, in LIBO_INTERNAL_ONLY code. Change-Id: I9acdcc48be71a90d17013959c8275454e8fa01a0 Reviewed-on: https://gerrit.libreoffice.org/24620 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Clean up makeAny functionsStephan Bergmann2016-05-032-24/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let the templated makeAny(v) just call Any(v), so that any special handling of argument types needs to be only done for the Any ctor, not also for makeAny (both the original makeAny implementation and the Any ctor implementation internally use cppu::getTypeFavourUnsigned to determine the UNO type, so this does not cause any difference in behavior): * The specialization of makeAny for bool can be dropped. * The overload of makeAny for OUStringConcat is replaced with an overloaded Any ctor, so that Any(s + "foo") works now, too. Curiously, only the Any ctor had been deleted for a sal_uInt16 argument (which can conflict with sal_Unicode), but not makeAny. So introduce a specialization of makeAny for sal_uInt16, so that that continues to work. (For backwards compatiblity in the non-LIBO_INTERNAL_ONLY case; and in the LIBO_INIERNAL_ONLY case we're moving away from the sal_uInt16/sal_Unicode clash anyway thanks to C++11 char16_t, so it is arguably better to allow makeAny for sal_uIn16 than to prohibit it.) Change-Id: I7803703769730024863bb4e5b1b3416b81bd8960
* Prevent Any::setValue from reinterpreting bool* as sal_Bool*Stephan Bergmann2016-05-031-0/+12
| | | | | | | | | | | | | ...which only happens ot work in environments where sizeof (bool) == 1. The simpler alternative is to use the operator <<= template without passing explicit UNO type information, anyway. The std::nullptr_t overloads are needed to disambiguate calls with a nullptr argument. (Which can at least be meaningful for VOID, but for other types what it happens to do is store a default value of the given type.) As std::nullptr_t is only C++11, this all needs to be LIBO_INTERNAL_ONLY. Change-Id: Iff06a6ba94250bd4ae4afc937c2a2bfa75f0888f
* Prevent Any ctor from reinterpreting bool* as sal_Bool*Stephan Bergmann2016-05-031-0/+16
| | | | | | | | | | | | | ...which only happens to work in environments where sizeof (bool) == 1. The simpler alternative is to use the Any ctor template without passing explicit UNO type information, anyway. The std::nullptr_t overloads are needed to disambiguate calls with a nullptr argument. (Which can at least be meaningful for VOID, but for other types what it happens to do is store a default value of the given type.) As std::nullptr_t is only C++11, this all needs to be LIBO_INTERNAL_ONLY. Change-Id: I0f72c73a088ef96e069c3ed8c78546b16d89b50a
* Improve documentationStephan Bergmann2016-04-271-0/+5
| | | | Change-Id: I13683f971bf56f6c5e226d749e60ccb25af559a5
* Use cast to bool to normalize sal_Bool valuesStephan Bergmann2016-04-201-6/+4
| | | | Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
* Remove excess newlinesChris Sherlock2016-02-091-2/+0
| | | | | | | | | | | | | | | | | | | A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
* More loplugin:nullptr automatic rewrite (within templates)Stephan Bergmann2015-12-102-5/+5
| | | | Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
* add move assignment and constructor to uno::ReferenceNoel Grandin2015-12-032-0/+37
| | | | | | | | | | | | "perf stat" says: Before 14,009,233,975,201 cycles After 13,660,876,595,941 cycles i.e. shaved roughly 2% of the cycles Change-Id: If604a125a8a5040281abd699678d0c791d5bbb51 Reviewed-on: https://gerrit.libreoffice.org/20350 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* Use injected class nameStephan Bergmann2015-11-162-10/+10
| | | | | | | Change-Id: I22bf0f7024538ea7a6c2c328a6647d3aeb478141 Reviewed-on: https://gerrit.libreoffice.org/20000 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Missing includes (for NULL)Stephan Bergmann2015-11-106-0/+15
| | | | Change-Id: Id2359f6ff4bddb2afbc0b346e17cd858f00179e3
* loplugin:nullptr (automatic rewrite)Stephan Bergmann2015-11-106-17/+17
| | | | Change-Id: I17eb40b2923793280ea220e519f97563c8490a19
* Any.h: Fix declaration hides class member warningDavid Ostrovsky2015-08-011-4/+4
| | | | | | | | | This fixes warning C4458 issued by MSVC 14.0 (aka VS2015) compiler. Change-Id: I48ed50bb54232d70460495d6d6a9e100fb90b869 Reviewed-on: https://gerrit.libreoffice.org/17444 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: David Ostrovsky <david@ostrovsky.org>
* Workaround seems no longer necessary for MSVC 2013Stephan Bergmann2015-07-061-3/+3
| | | | | | ...but C2514 is still there Change-Id: I818fed066b0ddaf5c30e6057285151d8a575c373
* loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann2015-06-082-34/+34
| | | | Change-Id: I2d60f21219adfe9935ad69620f3a7bd856f96376
* Update @since tags LO 4.5 -> 5.0Stephan Bergmann2015-04-102-2/+2
| | | | Change-Id: Idb2e46fcaa080d6763d2e3ed963f7673a2353eb2
* A UNO Any can't contain an AnyStephan Bergmann2015-04-082-0/+17
| | | | | | | | ...and css::uno::makeAny<css::uno::Any>() was never meant to be used. Introduce css::uno::toAny for the (template-code) cases that shall return an Any for both Any and non-Any inputs. Change-Id: Ifa977d73f1da71b2fedde7e8140b19497c4a0257
* Add support for cppu::UnoType<void>Stephan Bergmann2015-04-011-2/+2
| | | | Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
* Deprecate getCppuType et al in favor of cppu::UnoTypeStephan Bergmann2015-04-013-4/+96
| | | | | | ...which doesn't suffer from the sal_uInt16 vs. sal_Unicode ambiguity. Change-Id: I4de265145e720615652e88b6a68e03903ad8cba2
* Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann2015-04-012-4/+4
| | | | Change-Id: Ied1a4e7226de4ae1d1c24af90ae9397ba80f404a
* Reduce to static_cast any reinterpret_cast from void pointersStephan Bergmann2015-03-312-49/+49
| | | | Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
* Visible function type RTTI for Clang -fsanitize=functionStephan Bergmann2015-01-264-4/+4
| | | | | | | | | | ...by adding some further SAL_DLLPUBLIC_RTTI type annotations (cf. b4f6b26b5a1a78fecfa95ec2eb7ac8b80495d8aa "SAL_DLLPUBLIC_RTTI for proper RTTI visibility for LLVM") and by making sure relevant function types do not use incomplete types in their parameter and return types (which would make the RTTI hidden). Change-Id: Id7aadcbc0704b9759968ae36266fc9ce11a2e340
* These extern "C" functions are in the global namespaceStephan Bergmann2015-01-052-11/+11
| | | | Change-Id: I75bdb9ac71a3d36eeaf0b846e25d22a0aa923895
* Mark function declarations as CPPU_DLLPUBLIC, not only definitionsStephan Bergmann2015-01-052-3/+5
| | | | | | | | | <http://msdn.microsoft.com/en-us/library/8fskxacy.aspx> "Importing into an Application Using __declspec(dllimport)": "Using __declspec(dllimport) is optional on function declarations, but the compiler produces more efficient code if you use this keyword." Change-Id: I149306049987b2406622d7a0dc5dde92d283a5b3
* No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLYStephan Bergmann2014-12-191-2/+2
| | | | Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
* css::uno::Sequence ctor with initializer_listStephan Bergmann2014-12-122-0/+25
| | | | | | | | | | | (though LIBO_INTERNAL_ONLY, as it needs C++11, so cannot in general be used in URE client code; I think it's better to not offer it outside LO at all, than based on a feature-check macro, and thus catch accidental misuses of it via CppunitTest_odk_checkapi) ...plus adapting binaryurp/ to use the new feature Change-Id: I9a88a0e9eac5daf72896470e8b6a1deb1a6fc88f
* cppu: clean up public headers with include-what-you-useMichael Stahl2014-11-186-6/+8
| | | | | | | | Unfortunately iwyu gets quite confused by the weird cyclic dependencies between various foo.h/foo.hxx and cppumaker generated headers, so it's not obvious if any improvement here is realistic... Change-Id: I0bc66f98b146712e28cabc18d56c11c08418c721
* Fix common typos. No automatic tools. Handmade…Andrea Gelmini2014-11-121-1/+1
| | | | | | | Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* optimise UNO Sequence destructorNoel Grandin2014-10-021-3/+6
| | | | | | | | | | to avoid expensive function calls until the refcount reaches 0 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, slightly changing it to add a uno_type_sequence_destroy to uno/sequence2.h instead of a uno_type_destructSequence to uno/data.h. Change-Id: I3bbff3294f2b515fc3c68c4c6c1cb16829f5cc44