Commit Graph

325 Commits

Author SHA1 Message Date
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough.  (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)

Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently.  (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.)  C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.

Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10 16:42:16 +02:00
0b1e4a3067 Prevent Any::setValue from reinterpreting bool* as sal_Bool*
...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-03 15:26:01 +02:00
a5810faae3 clang-tidy modernize-loop-convert in d*
Change-Id: I0830a41b48e884ef63d32b5873c7007195659bb9
2016-04-25 11:57:07 +02:00
6009d33823 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I5cd8fd979fd4caa3d7cde599096627bfdd0dec7e
2016-04-20 17:25:39 +02:00
29ad0f5d16 dbaccess: replace boost::bind with C++11 lambdas
Change-Id: I84d7e2e3b00985815fb1945fbaf87cf5944bd8e6
Reviewed-on: https://gerrit.libreoffice.org/24116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-18 08:42:26 +00:00
6b2d75f966 cppcheck: noExplicitConstructor
Change-Id: I68310e2abc8f0ca114adb2b52f82157a0f455202
2016-04-04 11:16:06 +01:00
1aa4df615f use SAL_N_ELEMENTS in for loops
for with
  git grep -n 'for.*sizeof'

Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f
Reviewed-on: https://gerrit.libreoffice.org/23569
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-31 08:00:13 +00:00
2b60e64c18 Use const_iterator when possible (whole dbaccess)
Change-Id: I3d10a7914353b384fc7a2195a70398869f675211
Reviewed-on: https://gerrit.libreoffice.org/23570
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-03-28 18:39:16 +00:00
4331b137fd Resolves: tdf#92617 don't crash if insertRow gets triggered during insertRow
insertRow notifies listeners that it is going to insert contents,
if a script listens to that and eventually triggers insertRow again then
one inside the other causes corruption and pestilence

Change-Id: I6b568d0a67f6108536d58c407b79d02bf29f297a
2016-03-17 14:51:27 +00:00
414a66587b convert StandardSQLState to scoped enum
Change-Id: Ia0a1526140cfed35a73a6fea1a173d2fb5005960
2016-02-25 13:50:26 +02:00
bf7690bc1b convert EComposeRule to scoped enum
Change-Id: I5a2e4f6f6f0f353c75dff85e865608b12c2104f9
2016-02-25 13:50:25 +02:00
761e55d368 convert SQLExceptionInfo::TYPE to scoped enum
Change-Id: I2f21a742bc649fc42f89aebac2691c6054cd20d8
2016-02-25 13:50:25 +02:00
752cd07d08 InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25 08:52:03 +02:00
f7c23897a3 loplugin:unusedmethods unused return value in dbaccess
Change-Id: Ia7ec0209a635f8482b6ccbaa7ba48a8c6da79090
2016-01-11 10:49:24 +02:00
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
23ae179392 Typo: NOTIFY_LISTERNERS_CHECK->NOTIFY_LISTENERS_CHECK
Change-Id: Ie4c7a7dee81c2a0890ddc8bd083c2e3fee584f7e
2015-12-31 11:48:22 +01:00
9e36549c68 dbaccess: small cleanup
Change-Id: Id0a0aa66ffd5788873fa5dc99fcc1b912c0e90fa
2015-11-28 09:38:52 +01:00
25aec383f9 use initialiser for Sequence<OUString>
replaced using:
git grep -lP 'Sequence.*OUString.*\(\s*1\s*\)'
| xargs perl -0777 -pi -e
"s/Sequence<\s*OUString\s*> (\w+)\(\s*1\s*\);
.*\[0\] = (\S+);/Sequence<OUString> \1 { \2 };/g"

Change-Id: I20ad0489da887a9712982531c3b127339bb8b3b9
Reviewed-on: https://gerrit.libreoffice.org/19969
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 12:18:55 +00:00
89c4edc13f loplugin:nullptr (automatic rewrite)
Change-Id: I2bba104b1bff30910864e45b5b032533099742ff
2015-11-10 10:31:22 +01:00
18ce0560aa loplugin:stringconstant
Change-Id: Id5a07591a1d3a7264a0a979f25e8c2c859ec0492
Reviewed-on: https://gerrit.libreoffice.org/19767
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-04 09:42:42 +00:00
9c1f700aff improve refcounting loplugin to check SvRef-based classes
Change-Id: I2b3c8eedabeaecd8dcae9fe69c951353a5686883
Reviewed-on: https://gerrit.libreoffice.org/17521
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-05 11:26:04 +00:00
7dc5e8731f com::sun::star->css in dbaccess
Change-Id: I4fbdd3fb7d1e0ad4423148aaaed3a15aebb26d14
2015-08-03 13:38:44 +02:00
799cc41b53 Fix typos
Change-Id: I70b03c152f63e48341dc5629a99b0eeab7b497c0
Reviewed-on: https://gerrit.libreoffice.org/16834
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2015-07-08 05:48:18 +00:00
b55166d266 Revert "return and use std::vector from OInterfaceContainerHelper"
This reverts commit e57314f61f67b093510c5a8a8f34a62126ba8734.
2015-06-29 10:11:53 +02:00
e57314f61f return and use std::vector from OInterfaceContainerHelper
since most of the time we don’t need a heavyweight uno::Sequence.
Adds a new method getElementsAsVector().

Change-Id: I9e72bef0c0c723ffd0dd7d4152db5baec6784a7a
Reviewed-on: https://gerrit.libreoffice.org/15747
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-06-29 07:25:22 +00:00
3b4180a8c6 coverity#1308442 Uncaught exception
Change-Id: Id86fbd119c5da322dadadbfd65cbb09dcc403f38
2015-06-27 18:24:56 +01:00
b4e6dd8200 handle getParameters being called before execute()
Change-Id: If81e745ee15df3848c6577a9e979672523718daf
2015-05-30 17:32:50 +02:00
8607f8b552 tdf#82591 ORowSetBase::getRow handles insert row correctly
and critically for this bug, modified row, too.

Change-Id: I11c418d8926cabe81fcdb65d7293a4283e566f7a
2015-05-30 17:32:48 +02:00
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
cc7ae77764 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I2d1b59cf13c3944b24ad54dc63e20b83a9c8a015
2015-04-01 08:38:29 +02:00
0f46d90621 callcatcher: update unused code
Change-Id: I08e99a019fd2ec16e2c995035e4bcc09678ef92b
2015-02-17 11:44:56 +00:00
671bf2330a dbaccess: use constructor feature for ORowSet
Change-Id: Iabb04fde096e8d0bb92b3d796310354df5985e9a
2015-02-09 08:09:27 +01:00
294cea0f5b that better be the case
Change-Id: Ic0262292e207146c563b8830243a80104f94f903
Reviewed-on: https://gerrit.libreoffice.org/14176
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2015-01-25 18:17:56 +00:00
d7c9a1d9d6 fdo#88475 RowSetBase: reposition cache before interrogating it
This partially reverts:

  commit d20232a77565f46fedc0b556f4d50addff4d3559
  Author: Lionel Elie Mamane <lionel@mamane.lu>
  Date:   Thu Dec 6 13:22:06 2012 +0100

      Don't force refresh when higher up code did not request it

      Change-Id: I0f415c96fc05c1d776d14885751aef020c42f4ae

which did not take into account that the cache is shared with the
clones.

Finish the above commit more deeply, that is
more aggressively avoid moving the cache if we don't need to:
when we merely reposition the cache in case another RowSet(Clone)
has moved it, no need to force a move and by that to force a refresh.

Change-Id: I28d62673fdf10ee6507d38bb7c79c08e4b40902f
2015-01-22 13:18:53 +01:00
c79fe32dad Some more loplugin:cstylecast: dbaccess
Change-Id: Iaa409f0f36df63235b38bf3a02dad22ad0762a26
2015-01-20 09:06:46 +01:00
17fe6b54cd dbaccess: Use appropriate OUString functions on string constants
Change-Id: I1d63c9123ad985cb3424b0ac0ad30c12e39f8170
2014-12-18 14:12:24 +01:00
195674627c fdo#84658 on reexec, cancel modification before resetting IsModification state
Change-Id: I878bff4d36ca1c2dd9474c937b03d0b366a6e911
2014-10-06 12:23:22 +02:00
a28e7f7aa9 loplugin: cstylecast
Change-Id: Ie478d1fcfd3b64d7a2128887c216b5e0b4501ab9
2014-10-03 15:20:04 +02:00
03a2b4a80c fdo#82151 when constructing column object, replace m_aCurrentRow by a function
The passed m_aCurrentRow becomes out-of-date as soon as the current row changes.
This also hides an implementation detail of ORowSet to ORowSet(Data)Column.

Change-Id: Ib9188743e5dd6dec240e9f5fd3fd9655c6761abc
Reviewed-on: https://gerrit.libreoffice.org/10792
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2014-08-06 13:49:32 +00:00
1e1b2c563d Don't leak the previous cache
Change-Id: I61cb1c608a7de8efc63533085e86c6c17c05f545
Reviewed-on: https://gerrit.libreoffice.org/10793
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2014-08-06 13:48:45 +00:00
8923103eee coverity#706376 Uncaught exception
Change-Id: Ic18823fd60826c144058df32c27ab25d58664e30
2014-07-21 13:59:34 +01:00
968f633b24 coverity#706382 Uncaught exception
and

coverity#706377
coverity#706378
coverity#706382

Change-Id: I17f672e31867b1be77c16a8a6e121a8f67df7c90
2014-07-01 16:43:05 +01:00
ef242d3ac8 Typo rong->wrong
Change-Id: I9665d0bd8eccfb16a53eeb733954cdc59af8ccdd
2014-06-22 23:35:48 +02:00
db7042cdba janitorial: update function name in SAL_INFO output
Change-Id: Ie01599c8f3ae465998113dd8bfd2a33b27d0a39d
2014-06-16 21:58:05 +02:00
21f2efbe5f dbaccess::ORowSet: separate impl_rebuild_throw
Used by two different callers that wanted different things.
Also, freeResources now always positions on BeforeFirst.
It is only called with _bComplete==false by execute()-related code.

Change-Id: I3e34f77ce37c239d8d3d6a8cd7514b125b049de6
2014-06-16 21:58:05 +02:00
767e15343f clean up fdo#79427 fix: force BeforeFirst only at execute(), not updateRow()
Change-Id: Iaa881d055923702acbb96862d187af41a6ded730
2014-06-16 21:58:05 +02:00
44cd9a17ca fdo#79427 after execute() a ResultSet is expected to be BeforeFirst
Change-Id: I38091d1ee2161d6e32da3a0bde60e3fc008aa83d
Reviewed-on: https://gerrit.libreoffice.org/9794
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2014-06-16 06:47:33 +00:00
ea41de0ba5 dbaccess: remove SAL_THROW macro
Change-Id: I01e43d6171dc2381ff8c151d5716e9ffede24822
2014-06-05 08:17:49 +02:00
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
b09b5f8f7c Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part19
Change-Id: Iab50c52a132c90389992ef68c2d31df95a193ab9
2014-05-22 23:21:18 +02:00