Commit Graph

232 Commits

Author SHA1 Message Date
Julien Nabet
b33788cb6b Typos
Change-Id: I665a56fcad10e136e949a10497f6ab8813af9968
2015-03-25 21:19:59 +01:00
Noel Grandin
b2d2d72a7e loplugin:constantfunction: basic
Change-Id: I1c9a33cefb68bec978b2a922c2c3ef00f2a7a1b4
2015-03-24 10:31:17 +02:00
Julien Nabet
5f6fcb4e7c Typos
Change-Id: Ibc378fa5f515de61bb768b4ef082638b40c94e00
2015-03-08 16:45:30 +01:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Stephan Bergmann
4130c64355 Some more loplugin:cstylecast: basic
Change-Id: Ib22bc7408d333a7080fa44c9c3ac9535ccf00752
2015-01-20 09:06:45 +01:00
Caolán McNamara
7f476fea47 boost::unordered_map -> c++11 std::unordered_map
Change-Id: I28438000c2b0a8e6ce4f5640f861f572c0cb83c8
2014-12-27 23:00:45 +00:00
Stephan Bergmann
39ddeb53c0 basic: Use appropriate OUString functions on string constants
Change-Id: I43f99ba6759b0f8f633af784beaec583dbab0b9e
2014-12-18 14:12:23 +01:00
Stephan Bergmann
0f5e917024 Introduce rtl::OUStringLiteral1
...to use single ASCII character literals "more directly" in the OUString API
(instead of having to go via an intermediary OUString ctor call).  Especially
useful for character literals that are defined as const variables or via macros
("direct" uses of character literals in the OUString API can often simply be
replaced with single-character string literals, for improved readability).

(The functions overloaded for OUStringLiteral1 are those that are actually used
by the existing LO code; more could potentially be added.  The asymmetry in the
operator ==/!= parameter types is by design, though---writing code like

  'x' == s

is an abomination that shall not be abetted.)

Change-Id: Ic5264714be7439eed56b5dfca6ccaee277306f1f
2014-12-17 16:39:33 +01:00
Michael Weghorn
93124f7710 reduce scope of local variables
This eliminates some of the warnings from Cppcheck report of
2014-11-29.

Change-Id: Ic4bf3bd8f5982d2ea2f25a28c0dd61084c59af11
Reviewed-on: https://gerrit.libreoffice.org/13331
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-12-06 14:12:31 +00:00
Caolán McNamara
12bcfec04f markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05 14:58:00 +00:00
Noel Grandin
705c48d32e fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.

Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-05 08:44:19 +02:00
Caolán McNamara
cb0e009a9e document array_vs_singleton dismissals
Change-Id: I8d7eb4c01197e885abca717c7814c61a7641ac9d
2014-10-30 10:10:09 +00:00
Noel Grandin
059f5a95b2 loplugin: cstylecast
Change-Id: Ic7c9c978baf5602a508aff5976220a02ed03a680
2014-10-02 07:37:19 +02:00
Noel Grandin
5bce329040 SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.

Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:47:44 -05:00
Noel Grandin
37b9ea92ba convert SBX flag bits to type-safe enum
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817
Reviewed-on: https://gerrit.libreoffice.org/11070
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-26 04:30:03 -05:00
Caolán McNamara
d438c470d7 coverity#1231668 Unchecked return value
Change-Id: Ia7e47b5d42e9a488b3952f12d607b3f17661c44d
2014-08-17 16:39:21 +01:00
Noel Grandin
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
Norbert Thiebaud
42fcd888ae coverity#735397 dead code
Change-Id: If8d82a39af7a506f42b6c13d8408ffc479b564e7
2014-07-01 12:44:06 +02:00
Caolán McNamara
a7fcb3ed07 clang: Returning null reference
Change-Id: I2cfc14e73696a027283dfa5eef98f784505dc5a3
2014-06-26 16:29:13 +01:00
Thomas Arnhold
dd8f095940 WaE: warning C4101: 'ex' : unreferenced local variable
Change-Id: Ib8b71b50fe52a7cc4e261626549ac3e067851797
2014-06-04 08:30:26 +02:00
Kohei Yoshida
5a827671d1 Avoid static local of a singleton. This crashed writer unit tests.
Change-Id: I7c5f2d372676cdb317a8dad636bf1aab7dd5db37
2014-05-29 21:59:42 -04:00
Takeshi Abe
a71ae24a23 Avoid possible memory leaks in case of exceptions
Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67
2014-05-29 09:29:15 +09:00
Caolán McNamara
3d046b753d coverity#706235 Uncaught exception
Change-Id: I06321ca2b686207a1d9bd698461aedf84daf31e1
2014-05-28 13:49:50 +01:00
Caolán McNamara
9986fe77f4 coverity#706234 Uncaught exception
Change-Id: I7542008369ed3433cd8bfce7702f036148195516
2014-05-28 13:49:50 +01:00
Caolán McNamara
cf16d4eb9d coverity#706232 Uncaught exception
Change-Id: I07e13af4f4578d5d6823b6d10aa9c37d04ecc395
2014-05-28 13:49:49 +01:00
Stephan Bergmann
a77a7f6083 Fix memory leak
...by using css::uno::Type instead of a naked typelib_TypeDescription.

Change-Id: I387692265e9e032cb5ed6519739ebb3307db6f28
2014-05-28 14:34:12 +02:00
Stephan Bergmann
b8a329989c Fix memory leak (missing typelib_TypeDescription_release)
...by radically simplifying TypeToIdlClass().  It is unclear to me why this was
so complicated.  The only mildly plausible reaons would be that the old code
was careful to return null instead of throwing an exception for an unknown type,
but the TypeToIdlClass-call-sites either strongly expect a non-null return value
(by dereferencing it without any further checking) or use OSL_ASSERT or similar
to verify it.  So lets hope this is good.

Change-Id: I3e24eb6117e84c9d33f4c5f0e2fa88da4c4f2c30
2014-05-28 14:34:12 +02:00
Noel Grandin
e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Julien Nabet
b09b5f8f7c Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part19
Change-Id: Iab50c52a132c90389992ef68c2d31df95a193ab9
2014-05-22 23:21:18 +02:00
Julien Nabet
68741d0055 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part13
Change-Id: Ieecfd7ccb10c75ac639d0ba8e7cb588607097c2a
2014-05-15 22:52:22 +02:00
Julien Nabet
5ec7a589be Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part8
Change-Id: Ie16923d17541e84e0d7424fffe37caf410786abf
2014-05-10 06:19:42 +02:00
Thomas Arnhold
9e436082af dflt -> default
Change-Id: I89f1f5771eb7d96da233a8c7386b906b2a3a9c3e
2014-05-06 07:19:09 +02:00
Noel Grandin
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00
Thomas Arnhold
618a0f8c03 whitespace for include statements
Change-Id: I76bd0ef07a2fa134e948724cecdf539ffe6ccb8a
2014-04-15 13:43:13 +02:00
Thomas Arnhold
8d202fa72f typo: paramter -> parameter 2014-04-14 12:32:54 +02:00
Stephan Bergmann
cc725643fd Clean up function declarations and some unused functions
Change-Id: I63c4c61847fea4500b667a5ea9f2b32207692033
2014-04-09 10:12:02 +02:00
Noel Grandin
1eee88dd6b basic: sal_Bool->bool
Change-Id: I1c084ca86c0b1308eb2fc1451ba34d2e702c6a7f
2014-04-07 13:53:50 +02:00
Stephan Bergmann
362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00
Stephan Bergmann
567ef6d578 Second batch of adding SAL_OVERRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: Ie656f9d653fc716f72ac175925272696d509038f
2014-03-27 18:12:18 +01:00
Noel Grandin
f288d7dcbd basic: sal_Bool->bool
Change-Id: Id4952b6f97f9e8f917fea5651dee91499d109e48
2014-03-27 13:45:08 +02:00
Noel Grandin
96710f8e46 convert OUString::match to OUString::endsWith
Convert code like:
    rTxt.match( "---", rTxt.getLength()-3 )
to:
   rTxt.endsWith( "---" )

Change-Id: Iada74c5e714f7234f25b326526843a36255d5599
2014-03-19 08:55:21 +02:00
Stephan Bergmann
25cedf1dc7 Introduce com.sun.star.beans.theIntrospection singleton
...deprecating com.sun.star.beans.Introspection (single-instance) service.

Change-Id: Ica2e3a3541c7dcb1aab79222c5abf40d6988c882
2014-03-07 10:33:07 +01:00
Stephan Bergmann
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
Alexander Wilms
6a38eace8c Remove visual noise from basic
Change-Id: I10865b94f67de39e9dbcbe71ede42aa94d81db61
Reviewed-on: https://gerrit.libreoffice.org/8234
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-25 21:09:17 +00:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Stephan Bergmann
12f1faf7bf svl: sal_Bool -> bool
Change-Id: Ic31455a1f5ffffa35d4fdde901dd70734207b6f4
2014-02-20 08:17:00 +01:00
Stephan Bergmann
bd20500cf3 Simplify access to theCoreReflection singleton
Change-Id: I9901991a320b87895230a92095c9c7d3109380a6
2014-02-07 12:03:03 +01:00
Noel Grandin
d366c9b20e remove unnecessary sal_Unicode casts in various places
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-14 08:17:32 +02:00
Norbert Thiebaud
8b308d510e basic: include <> for external includes
Change-Id: I4715bbe853d60ef15f20a4d2441c688003ca568e
2013-11-11 22:37:24 -06:00
Noel Grandin
e9c4ee996d remove unnecessary use of OUString constructor in BASIC module
Change-Id: Iee86ce9200285647d5031cb2f89266a52704dd44
2013-11-11 11:21:25 +02:00