summaryrefslogtreecommitdiff
path: root/cppu/qa
AgeCommit message (Collapse)AuthorFilesLines
2018-01-15More loplugin:cstylecast: cppuStephan Bergmann1-3/+3
Change-Id: I728a40ab6ef4aa44fbe328abdf244e6b5fac9d04
2017-12-07loplugin:salcall handle static methodsNoel Grandin1-1/+1
Change-Id: Id6820abec4b8ca8bee26d62b333fd30b42a14aec Reviewed-on: https://gerrit.libreoffice.org/46007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: cppuStephan Bergmann5-349/+349
Change-Id: I438346398fd8430cf4357b8a3d8e9f423966f2ca
2017-10-04add << operator for css::uno::ExceptionNoel Grandin1-11/+0
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-13Enable -Wunreachable-codeStephan Bergmann1-1/+1
...motivated by <https://gerrit.libreoffice.org/#/c/41565/2> adding dead code at the end of a switch statement, after the last case's "break". -Wunreachable-code appears to work well on Clang, while it appears to have no effect on GCC. Most of the affected places are apparently temporary/TODO/FIXME cases of disabling code via "if (false)", which can be written with an extra set of parentheses as "if ((false))" to silence -Wunreachable-code on Clang (which thus needed loplugin:unnecessaryparen to be adapted accordingly). In some cases, the controlling expression was more complex than just "false" and needed to be rewritten by taking it out of the if statement to silence Clang. One noteworthy case where the nature of the disabled code wasn't immediately apparent: Sep 12 16:59:58 <sberg> quikee, is that "if (false)" in ScExponentialSmoothingDialog::ApplyOutput (sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx) some work-in- progress or dead code? Sep 12 17:02:03 <quikee> sberg: WIP, but you can remove it Sep 12 17:04:47 <sberg> quikee, I'll wrap the false in an extra set of parentheses for now, to silence -Wunreachable-code (I wouldn't want to remove it, as I have no idea whether I should then also remove the "Initial value" comment preceding it) Sep 12 17:07:29 <quikee> sberg: both are different ways to calculate the "intital value"... so no Another case where the nature of the dead code, following while (true) loops without breaks, is unclear is sd/source/ui/remotecontrol/BluetoothServer.cxx, where I added TODO markers to the workarounds that silence the warnings for now. basic/source/sbx/sbxvalue.cxx had a variable of type double, of automatic storage duration, and without an initalizer at the top of a switch statement. Clang warning about it is arguably a false positive. Apart from that, this didn't find any cases of genuinely dead code in the existing code base. Change-Id: Ib00b822c8efec94278c048783d5997b8ba86a94c Reviewed-on: https://gerrit.libreoffice.org/42217 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-02loplugin:casttovoid: cppuStephan Bergmann1-4/+4
Change-Id: I5f2880701f42000e15c148f3c14a211fbbcf2ef1
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-28loplugin:salunicodeliteral: cppuStephan Bergmann1-1/+1
Change-Id: I0bb182f258439e6ce7bc7c54d68da4db1581ff19
2017-04-28loplugin:cppunitassertequals: cppuStephan Bergmann1-41/+89
Change-Id: I0497e726ca8c75b84acf3a8d177cfe4883ee2517
2017-04-28Remove now-duplicate css::uno::Type operator <<Stephan Bergmann1-11/+0
...was missing from 06c1dc4c09ba816affb8b65e8215bcd56a81df91 "LIBO_INTERNAL_ONLY: printing of css::uno::Reference/Type" Change-Id: Ifb3f8f72bfeb1038f01797aab9afb5f5059f9d5b
2017-04-14update cppunit to 1.14.0Markus Mohrhard1-6/+0
Change-Id: I95fa42f4ef0580734b605df859c1660b29adb8b2 Reviewed-on: https://gerrit.libreoffice.org/36499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-04-12clang-tidy: readability-else-after-returnNoel Grandin2-14/+18
run it against sal,cppu,cppuhelper I had to run this multiple times to catch all the cases in each module, and it requires some hand-tweaking of the resulting output - clang-tidy is not very good about cleaning up trailing spaces, and aligning things nicely. Change-Id: I00336345f5f036e12422b98d66526509380c497a Reviewed-on: https://gerrit.libreoffice.org/36194 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-04make UNO enums scoped for internal LO codeNoel Grandin2-35/+39
this modifies codemaker so that, for an UNO enum, we generate code that effectively looks like: #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR enum class XXX { ONE = 1 }; constexpr auto ONE = XXX_ONE; #else ...the old normal way.. #endif which means that for LO internal code, the enums are scoped. The "constexpr auto" trick acts like an alias so we don't have to use scoped naming everywhere. Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4 Reviewed-on: https://gerrit.libreoffice.org/34546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin1-2/+2
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann2-8/+4
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-21Delete the "Any-to-Any" template specializations for LIBO_INTERNAL_ONLYStephan Bergmann2-80/+63
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-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann1-3/+3
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-19cppu: fix loplugin:cppunitassertequals warningsMiklos Vajna2-27/+27
Change-Id: I1a459954c84290d340a887212fd1f839f4ebe715 Reviewed-on: https://gerrit.libreoffice.org/28229 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-31teach refcounting clang plugin about uno::ReferenceNoel Grandin1-2/+9
uno::Reference is only allowed to used with classes that have a ::static_type member. So convert all those places to rtl::Reference. Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and uno::Reference to make this a little smoother? Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3 Reviewed-on: https://gerrit.libreoffice.org/25516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30Some clean up of uses of css::uno::Any::setValueStephan Bergmann1-5/+3
Change-Id: I04e8aef35a6083b61d775c8eb3f96757da2b31bd
2016-05-06cppu: replace boost::is_same with std::is_sameMichael Stahl1-5/+5
Change-Id: I7014737403da4b53b83488d17399b1c214b7a5db
2016-05-03Handle wchar_t as native C++11 type on windowsDavid Ostrovsky1-60/+0
The option /Zc:wchar_t- prevented to use wchar_t as a built-in type according to the C++ standard. In Visual C++ 6.0 and earlier, wchar_t was not implemented as a built-in type, but was declared in wchar.h as a typedef for unsigned short. Now, years later after the end of life this outdated toolchain, there is no reason not to use native type. The only issue could be the ABI compatibility. But on a quick look at least, it looks like none of the mangled C++ symbols in the stable URE interface actually depend on wchar_t. We forgot to get rid of /Zc:wchar_t- in 5.1. Do that for LibreOffice 5.2, though. Change-Id: I8d6b380660859efa44c83c830734978d31d756a0 Reviewed-on: https://gerrit.libreoffice.org/22589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-25Cannot extract Any to sal_uInt32Stephan Bergmann1-84/+0
...which has the same underlying type as sal_Bool Change-Id: Ief5a9b9a4d286488efe6e67ee72e7cc23d6f4075
2016-04-08tdf#94306 replace boost::noncopyable in cppuhelperJochen Nitschke2-4/+8
and related modules. Replace with C++11 delete copy-constructur and copy-assignment. Change-Id: I18aa9fe4ff696f9b5472cbe4cd0097cb174618b7 Reviewed-on: https://gerrit.libreoffice.org/23904 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-18Avoid -Werror,-Wdelete-non-virtual-dtor with current Clang trunkStephan Bergmann1-2/+4
Change-Id: I5300cd6ff2c924a4acc01ba7f4478a0db50aa08c
2015-11-28Adapt to true wchar_t in clang-clStephan Bergmann1-7/+14
Change-Id: I14c2dc0be12151b5d4ea2ba3b65030f6f4494905
2015-11-18Use C++11 char16_t for sal_UnicodeStephan Bergmann1-0/+53
...in LIBO_INTERNAL_ONLY, __cplusplus, non-MSVC case. It turns out that sal_Unicode happens to not be mangled into any symbols that make up the stable URE interface, so (for LIBO_INTERNAL_ONLY, at least) we are free to replace the typedef to sal_uInt16 with a typedef to any integral type layout-compatible with that. (sal_Unicode does appear in some symbols in sal's PRIVATE_textenc.1 section, but that is private between the sal and sal_textenc libraries, so changing those symbols does not require a change of SONAME.) C++11 chart16_t is the obvious choice (and will ultimately allow using u"..." to write literals of type array-of-sal_Unicode). Reportedly, char16_t is supported since GCC 4.4 and Clang 2.9 but will only be available in MSVC 2015. For plain C, we continue to use sal_uInt16. We could theoretically use C11 char16_t from <uchar.h>, but at least the Mac OS X 10.11 SDK still does not offer that C11 header. For MSVC, we continue to use wchar_t (which is actually unsigned short, due to /Zc:wchar_t-) for now. Potential options there include dropping /Zc:wchar_t- and using true wchar_t, or using C++11 char16_t once support for MSVC 2013 is dropped. Some code needed to be adapted that was written in a way assuming that sal_Unicode is unsigned short (which indicates that changing sal_Unicode for non-LIBO_INTERNAL_ONLY would be an ABI change). OUStringBuffer::append can now differentiate between being called with sal_Unicode (to append a single character) and erroneously being called with sal_uInt16 (intending to append a number's textual representation, for which the sal_Int32 overload must be used instead). Bugs found are 379fe0409e7973b36210cffa3dd1dfd4032f0ecc "Assume that this code wants to append a number, not a character" and dc148335a6a438848325f24c49198fba81043279 "Assume this wants to append the numerical representation." The GDB support for pretty-printing of sal_Unicode-related data in solenv/gdb/libreoffice/sal.py can presumably be simplified now. Change-Id: I445b3a80e65b7cb004d9e08b38bdc9ee93bc9401 Reviewed-on: https://gerrit.libreoffice.org/20036 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-18Clean upStephan Bergmann1-443/+407
Change-Id: I9ce96ac26efd6fb46f78aa6462d693113b359bb5
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann2-90/+90
Change-Id: I17eb40b2923793280ea220e519f97563c8490a19
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann2-12/+12
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann1-4/+4
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-07-29com::sun::star-css in cppu,cppuhelperNoel Grandin1-8/+8
Change-Id: I84a412f587fd66f6c0610f083e61cf0fa079d4d9 Reviewed-on: https://gerrit.libreoffice.org/17384 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe1-2/+2
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-01Add support for cppu::UnoType<void>Stephan Bergmann2-1/+2
Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann3-291/+81
Change-Id: Ied1a4e7226de4ae1d1c24af90ae9397ba80f404a
2014-12-19Remove unused */qa/checkapi/Stephan Bergmann1-30/+0
...superseded by CppunitTest_odk_checkapi Change-Id: I5df89a1a12f496984deab153f0ba2734323c1293
2014-10-31Removed duplicated includesAndrea Gelmini3-4/+0
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6 Reviewed-on: https://gerrit.libreoffice.org/12160 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-05-13Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part11Julien Nabet1-16/+14
Change-Id: Ibe0a1006aba2b6cbd87c0bd6ca3acbf9ba7b0fbe
2014-04-24add missing modelines to idl filesThomas Arnhold2-0/+6
Change-Id: If52651c70ee659c83ef127da4fe5e266cfe7eec2
2014-04-09Clean up function declarationsStephan Bergmann2-13/+12
Change-Id: I2478861e79bbb0f6d7e8a0b7bc59a81f457d92dc
2014-04-03Cosmetics (to ease work related to finding unused functions)Stephan Bergmann1-4/+4
Change-Id: I88b7659fdfdcba43e69ef7489573b28952c8328c
2014-04-03remove unnecessary scope qualifier from sal_Bool usesNoel Grandin1-7/+7
i.e. convert "::sal_Bool" to "sal_Bool" Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
2014-03-26First batch of adding SAL_OVERRRIDE to overriding function declarationsStephan Bergmann2-12/+12
...mostly done with a rewriting Clang plugin, with just some manual tweaking necessary to fix poor macro usage. Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-02-27std::exception retrofit sequelStephan Bergmann2-4/+4
Change-Id: Ide9234c50592fe4f12eb1f6ea836ad60ce4697df
2014-01-22Let C++ inline functions return bool instead of sal_BoolStephan Bergmann1-3/+3
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Change-Id: Ife614637082036dd17412f247be79233326c4f0b
2013-12-16fdo#72598 Remove SunStudio cruft from code baseJelle van der Waa1-18/+0
Change-Id: I5150eec33228e18e274a8ae4effd3f185851b7f4 Reviewed-on: https://gerrit.libreoffice.org/7103 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2013-11-14-Werror,-Wunused-member-functionStephan Bergmann1-0/+14
Change-Id: I557d9628478b0cddf5a2b176403bdd67db5a0695
2013-10-22Bin comments that claim to say why some header is includedTor Lillqvist1-1/+1
They are practically always useless, often misleading or obsolete. Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-09-19Unlike idlc, unoidl doesn't support out-of-range byte constsStephan Bergmann2-4/+0
Change-Id: Ib1c98ea10a2d05e74a3aae9b2868a69c66efa543
2013-05-07Avoid warnings about unused test functionsStephan Bergmann1-43/+49
Change-Id: I6b2a40c4b95555c4d8bf0d8674fce46accd49965