summaryrefslogtreecommitdiff
path: root/include/com
AgeCommit message (Collapse)Author
2016-11-21Delete the "Any-to-Any" template specializations for LIBO_INTERNAL_ONLYStephan Bergmann
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>
2016-07-04use SAL_DEPRECATED in uno::ReferenceNoel Grandin
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>
2016-06-06css::uno::Any move semantics (for LIBO_INTERNAL_ONLY)Stephan Bergmann
Change-Id: Ib582a744321e0f209395651ac2edffe30152ffba
2016-05-13remove various crutches for boost::bind/boost::mem_fnMichael Stahl
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>
2016-05-04Better fix for Windows-only codeStephan Bergmann
Change-Id: I8437ec66b615754d71c726f715a6beeb4a0f7dda
2016-05-04Fix Windows-only codeStephan Bergmann
Change-Id: Iaf6d668f65e31c60dba8140d789f6578ef461264
2016-05-04While at it, delete Any functions on sal_Bool*Stephan Bergmann
(at least for LIBO_INTERNAL_ONLY), to help further reduce the occurrences of sal_Bool across the code base Change-Id: I70654a0cb56655984c717b7b894f26c9ab47536e
2016-05-03Enable Any functions on sal_uInt16 for LIBO_INTERNAL_ONLYStephan Bergmann
...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>
2016-05-03Clean up makeAny functionsStephan Bergmann
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
2016-05-03Prevent Any::setValue from reinterpreting bool* as sal_Bool*Stephan Bergmann
...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
2016-05-03Prevent Any ctor from reinterpreting bool* as sal_Bool*Stephan Bergmann
...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
2016-04-27Improve documentationStephan Bergmann
Change-Id: I13683f971bf56f6c5e226d749e60ccb25af559a5
2016-04-20Use cast to bool to normalize sal_Bool valuesStephan Bergmann
Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
2016-02-09Remove excess newlinesChris Sherlock
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>
2015-12-10More loplugin:nullptr automatic rewrite (within templates)Stephan Bergmann
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
2015-12-03add move assignment and constructor to uno::ReferenceNoel Grandin
"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>
2015-11-16Use injected class nameStephan Bergmann
Change-Id: I22bf0f7024538ea7a6c2c328a6647d3aeb478141 Reviewed-on: https://gerrit.libreoffice.org/20000 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-10Missing includes (for NULL)Stephan Bergmann
Change-Id: Id2359f6ff4bddb2afbc0b346e17cd858f00179e3
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I17eb40b2923793280ea220e519f97563c8490a19
2015-08-01Any.h: Fix declaration hides class member warningDavid Ostrovsky
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>
2015-07-06Workaround seems no longer necessary for MSVC 2013Stephan Bergmann
...but C2514 is still there Change-Id: I818fed066b0ddaf5c30e6057285151d8a575c373
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann
Change-Id: I2d60f21219adfe9935ad69620f3a7bd856f96376
2015-04-10Update @since tags LO 4.5 -> 5.0Stephan Bergmann
Change-Id: Idb2e46fcaa080d6763d2e3ed963f7673a2353eb2
2015-04-08A UNO Any can't contain an AnyStephan Bergmann
...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
2015-04-01Add support for cppu::UnoType<void>Stephan Bergmann
Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
2015-04-01Deprecate getCppuType et al in favor of cppu::UnoTypeStephan Bergmann
...which doesn't suffer from the sal_uInt16 vs. sal_Unicode ambiguity. Change-Id: I4de265145e720615652e88b6a68e03903ad8cba2
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann
Change-Id: Ied1a4e7226de4ae1d1c24af90ae9397ba80f404a
2015-03-31Reduce to static_cast any reinterpret_cast from void pointersStephan Bergmann
Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
2015-01-26Visible function type RTTI for Clang -fsanitize=functionStephan Bergmann
...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
2015-01-05These extern "C" functions are in the global namespaceStephan Bergmann
Change-Id: I75bdb9ac71a3d36eeaf0b846e25d22a0aa923895
2015-01-05Mark function declarations as CPPU_DLLPUBLIC, not only definitionsStephan Bergmann
<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
2014-12-19No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLYStephan Bergmann
Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
2014-12-12css::uno::Sequence ctor with initializer_listStephan Bergmann
(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
2014-11-18cppu: clean up public headers with include-what-you-useMichael Stahl
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
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-02optimise UNO Sequence destructorNoel Grandin
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
2014-09-24fix build with coverity 7.0.2 and gcc 4.8.3Caolán McNamara
these "forbid use with ambiguous type" things already appear with deleted markup in Any.h which is included by Any.hxx WARNING: cov-emit returned with code 2 "coverity/include/com/sun/star/uno/Any.hxx", line 163: error #1810: function "com::sun::star::uno::Any::has<T>() const [with T=sal_uInt16]" (declared at line 244 of "coverity/include/com/sun/star/uno/Any.h") cannot be specialized because it is deleted bool Any::has<sal_uInt16>() const; ^ "coverity/include/com/sun/star/uno/Any.hxx", line 604: error #1810: function "com::sun::star::uno::Any::get<T>() const [with T=sal_uInt16]" (declared at line 243 of "coverity/include/com/sun/star/uno/Any.h") cannot be specialized because it is deleted sal_uInt16 Any::get<sal_uInt16>() const; Change-Id: I7d8b8ee1015c3e598143a2240297ce81a9e36987 Reviewed-on: https://gerrit.libreoffice.org/11611 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-15"commas at the end of enumerator lists are a C++11 extension"Luboš Luňák
So says Clang, if -Wc++11-extensions is used, GCC warns with -Wpedantic. Change-Id: I4f94b2f8d1b12644055dcd402f0ed8038d3a7171
2014-07-03Catch invalid null pointer operations earlyStephan Bergmann
Change-Id: I324d5a6e84e0d2121d8e4612e074b44ed5127b11
2014-06-16SAL_WARN_UNUSED_RESULT for static Reference::query functionStephan Bergmann
...which the recent loplugin:staticcall changes showed was occasionally used apparently under the assumption that it was non-static and changed the object it was called on. Change-Id: I989a2a4ed3886d7f370855c9e8c1867e646c059b
2014-06-05various: remove SAL_THROW macroNoel Grandin
Change-Id: I9464179a736b91f5bc32eb5e5e89b3b4e3da3494
2014-05-23remove boilerplate in UNO Exception constructor callsNoel Grandin
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-09Enforce "There is no css::uno::Sequence<bool>"Stephan Bergmann
While some uses of Sequence<bool> might silently work, it would be too dangerous to accidentally pass them around to other places that correctly expect Sequence<sal_Bool> instead, so best to rule them out completely. Change-Id: Ia60c839218c079cc42b4310d1315d95b6f2c68fd
2014-04-24Sequence::operator[]: let's cast the other side to unsigned tooMichael Stahl
Change-Id: I30845477e5dfbf5c90702bb0b6acb7955fcbe684
2014-04-24Sequence::operator[]: silence -Werror=strict-overflow warningsMichael Stahl
GCC 4.8.2 warns when index is a subtraction expression; the real problems in that case will be found by the "index >= 0" check. Change-Id: I4c3f0bdb7996e433b1693eb7dcbafb9610b5dbcf
2014-03-01Remove visual noise from includeAlexander Wilms
Conflicts: include/framework/preventduplicateinteraction.hxx include/sfx2/sfxbasecontroller.hxx include/sfx2/sfxbasemodel.hxx include/toolkit/awt/vclxtabpagemodel.hxx include/vcl/field.hxx include/vcl/settings.hxx Change-Id: Ibccf9f88c68267a3d7e656012b51eaf644c418c2 Reviewed-on: https://gerrit.libreoffice.org/8272 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-18Any: consistently use explicit specialization instead of overloadingStephan Bergmann
Should be transparent to client code. Change-Id: I5632fba87242ff9cb9a6b3481a179fa3e92c618b
2014-02-17cppu: sal_Bool -> boolStephan Bergmann
Change-Id: I1288f1f6f38d1475b4eb5272509e479bd9f2552d
2014-01-31[API CHANGE] Remove UNOIDL "array" and "union" vaporware remnants from cppuStephan Bergmann
This leaves only aborting stubs (for SONAME stability) for typelib_static_array_type_init typelib_typedescription_newArray typelib_typedescription_newUnion and completely removes corresponding typelib_ArrayTypeDescription typelib_UnionTypeDescription structs and C++ inline getCppuArrayType* functions. None of this should ever have been called by client code anyway, so while technically an API change it should not matter for practical purposes. Change-Id: I23769d104d545533bf578762b79994e269d78c22
2014-01-31Remove UNOIDL "array" and "union" vaporware remnantsStephan Bergmann
...and deprecate what cannot be removed for compatibility. Change-Id: I1ea335af775b867b468b8285113631167729a92a