Commit Graph

78 Commits

Author SHA1 Message Date
Julien Nabet
254db7f4e8 Postgresql unused POSTGRE_TRACE
there was "#ifdef POSTGRE_TRACE", but it was nowhere to be seen
except in the following purged files.

Change-Id: Id77aef0869d112cb1a5282d8db79da4bc78a56e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89378
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-02-24 22:59:19 +01:00
Gabor Kelemen
1dd9200be9 tdf#42949 Fix IWYU warnings in connectivity/*/*cxx
Except for platform specific drivers/ado and drivers/macab dirs

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I24b741cded8995e29ac3d518aeaa0d60b3c55b56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86317
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-14 10:21:47 +01:00
Stephan Bergmann
c8eaadb5d7 Remaining loplugin:bufferadd
...that had been missing because the plugin didn't implement postRun, so it
didn't report anything when run as part of the shared plugin.  (But did report
the expected warnings when run as a standalone plugin during
CompilerTest_compilerplugins_clang.)

Most fixes are straightforward.  A noteworthy one is PreparedStatement::setBytes
in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx:  The old
preallocation of a 20 character OStringBuffer might have prevented

  buf.append( reinterpret_cast<char *>(escapedString), len -1 );

from potentially throwing std::bad_alloc, which would have caused escapedString
to be leaked.  Even though that 20-character preallocation was likely just
random junk and not meant to address the potential leak, lets address it now.

Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900
Reviewed-on: https://gerrit.libreoffice.org/80925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 09:03:53 +02:00
Julien Nabet
1ec93ef100 Replace getDefaultValue by getColExprForDefaultSettingVal (postgresql)
Change-Id: I8e0eea84a711ce45d991c07d7811094e33bcce38
Reviewed-on: https://gerrit.libreoffice.org/80787
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-15 07:24:26 +02:00
Julien Nabet
0c46c81e04 tdf#128111: "adsrc" doesn't exist from Postgresql 12
Before Postgresql 8.0, there was only "adsrc"
then it's been deprecated
"The adsrc field is historical, and is best not used, because it does not track outside changes
 that might affect the representation of the default value.
 Reverse-compiling the adbin field (with pg_get_expr for example) is a better way to display the default value
"
and finally it's been removed with version 12

See evolution with:
- https://www.postgresql.org/docs/8/catalog-pg-attrdef.html
- https://www.postgresql.org/docs/11/catalog-pg-attrdef.html
- https://www.postgresql.org/docs/12/catalog-pg-attrdef.html

Change-Id: I57e9da423a23b5a96bbb64b0e026b160e9643ab9
Reviewed-on: https://gerrit.libreoffice.org/80722
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
2019-10-13 16:40:15 +02:00
Noel Grandin
4583911575 improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e
Reviewed-on: https://gerrit.libreoffice.org/74559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25 13:53:21 +02:00
Arkadiy Illarionov
1eb8859813 Use hasElements to check Sequence emptiness in chart2..connectivity
Similar to clang-tidy readability-container-size-empty

Change-Id: I41824e8a4ef38d6a35a0ac4421cffcbcd17308e1
Reviewed-on: https://gerrit.libreoffice.org/71802
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-10 10:55:57 +02:00
Gabor Kelemen
d9e0eade62 Remove unused using declarations in directories [a-d]*
Found with:
run-clang-tidy-7 -checks=-*,misc-unused-using-decls

Change-Id: I50f6dfa881ac4e752668e762ade0943aaf28ab96
Reviewed-on: https://gerrit.libreoffice.org/69601
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-27 10:44:44 +01:00
Arkadiy Illarionov
31f96c3e0d Simplify containers iterations in connectivity
Use range-based loop or replace with STL functions

Change-Id: I1f7c1ea19cdc8d450b7ed88a663ba9ccb3249304
Reviewed-on: https://gerrit.libreoffice.org/68974
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09 18:31:12 +01:00
Lionel Elie Mamane
aa41e17e80 postgresql: any execute should close previous ResultSet
not only executeQuery.

Change-Id: I2ee72078c48f622484dba46436f53990a45da364
2018-12-18 22:18:12 +01:00
Lionel Elie Mamane
a9d4f2bebd postgresql: correctly implement XMultipleResults interface
note that we implement it in a very limited way, since we will always
return only a single result.

Change-Id: Idc7927d1a6896b78f6de8627ba857982821ac629
2018-12-18 22:18:12 +01:00
Noel Grandin
48314f2524 improve function-local statics in basic..cui
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee
Reviewed-on: https://gerrit.libreoffice.org/63701
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21 12:28:23 +01:00
Noel Grandin
2c1b7e8d6a clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422
Reviewed-on: https://gerrit.libreoffice.org/61967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19 10:02:39 +02:00
Jochen Nitschke
a53e9b1d62 cppcheck: variableScope
Change-Id: I56b06b4c69bdb501535a43780b6a10d5ceb0c7da
Reviewed-on: https://gerrit.libreoffice.org/61524
Tested-by: Jenkins
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-10-08 17:14:53 +02:00
Jochen Nitschke
7a67d7a7c1 use more thread safe static initializer in postgresql driver
Change-Id: Idb210207112994e1247c35e0dce1c6cd2f80f371
Reviewed-on: https://gerrit.libreoffice.org/53365
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-25 08:31:33 +02:00
kowther
3ec490fc75 tdf#96099: replaced trivial typedef OStringVector
Change-Id: Id6f9fff6b0c4c2c8cd3528d86b58ee39cee47364
Reviewed-on: https://gerrit.libreoffice.org/52524
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-04-07 01:43:32 +02:00
Julien Nabet
8d3d04ef58 Modernize a bit connectivity (part2)
by using for range loops

Change-Id: Ibbc4cdaa78c4c9d88487132a2761ac1040b1ecd8
Reviewed-on: https://gerrit.libreoffice.org/48713
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-27 09:31:10 +01:00
Stephan Bergmann
f8558f8446 More loplugin:cstylecast: connectivity
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: Idbefb16acae20ab137497e78c9bc5dc5634c07fe
2018-01-12 20:27:27 +01:00
Noel Grandin
2e5508a176 loplugin:unnecessaryparen check for (f1()).f2
Change-Id: I93257b0ddd41c649875124d6d5c5faeaa431bae3
Reviewed-on: https://gerrit.libreoffice.org/45218
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-27 10:44:25 +01:00
Noel Grandin
4f4486c61d look for =() in loplugin:unnecessaryparen
Change-Id: I4f9b71ff7767e90987bb40358fc46ed5d1d571d0
Reviewed-on: https://gerrit.libreoffice.org/44944
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-20 12:31:32 +01:00
Noel Grandin
809e2d33b4 create comphelper::RefCountedMutex
and merge the two existing implementations of the idea - SotMutexHolder
from package and RefCountedMutex from connectivity

Change-Id: I87f09f359ac798cf934381a2c75225dab71dd43e
Reviewed-on: https://gerrit.libreoffice.org/38972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-20 14:13:35 +02:00
Andrea Gelmini
0f0ebddb81 Fix typos
Change-Id: Ic54e808956e5cf4e8079942c0ff799f802cd4b6c
Reviewed-on: https://gerrit.libreoffice.org/35053
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-11 05:08:01 +00:00
Noel Grandin
198c41c4fe new loplugin unoany
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89
Reviewed-on: https://gerrit.libreoffice.org/34714
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28 10:17:47 +00:00
Stephan Bergmann
3783df2027 rtl_str_shortenedCompare_WithLength -> OString::startsWith
Change-Id: I3eabdeba10d8d1064f00b817b04f03aad8a6b352
2017-02-08 10:14:20 +01:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Noel Grandin
c0f9bdd3e6 unnecessary use of OUStringBuffer in throwing exceptions
Change-Id: Iec1473264426f19c31e72260dfce9494389e474f
Reviewed-on: https://gerrit.libreoffice.org/33788
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 07:48:21 +00:00
Noel Grandin
1c3e84d819 teach lolugin:stringconstant about calling constructors
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-31 08:56:20 +00:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(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>
2017-01-26 12:54:43 +00:00
Stephan Bergmann
5b2b75ac26 New loplugin:dynexcspec: Add @throws documentation, connectivity
Change-Id: Id8711eaeac65efaa228b60d5786169016bfb61a3
2017-01-19 18:03:24 +01:00
Caolán McNamara
fffb674c1e coverity#1371289 avoid the need for an assignment
Change-Id: I7f9b8d21652c79642f9a2f916ad0609c8abd430b
2017-01-14 20:27:33 +00:00
Caolán McNamara
6bd96eda06 coverity#1371289 avoid the need for an assignment
Change-Id: Ia0efc427d9996eb8414821d07f7e760fb1b35246
2017-01-13 13:46:12 +00:00
Noel Grandin
a2b77b4368 loplugin:singlevalfields in basic..idl
Also fix obvious bug in the initialisation of the
connectivity::odbc::OConnection::m_bClosed field.
Probably closes some kind of connection leak there.

Change-Id: I04579cf91bcd6d6c51c697d83971da4142743a82
Reviewed-on: https://gerrit.libreoffice.org/28932
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-16 08:30:26 +00:00
Jochen Nitschke
32e45a6f2a convert LogLevel constants to scoped enum
rename some variables to distinguish them from type name
use enumarray for log level strings
remove unused DATA member

Change-Id: Id3c38b82e679b3aede5ce790735443e769d5f236
Reviewed-on: https://gerrit.libreoffice.org/28920
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-15 14:10:07 +00:00
Jochen Nitschke
3cc30343be tdf#43157 clean up OSL_ASSERT in connectivity
replace with compile time checks

Change-Id: I9f3dd3b44fe0aa953feaa34a1bc0ccbdc3600899
Reviewed-on: https://gerrit.libreoffice.org/26801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-04 06:51:06 +00:00
Noel Grandin
a52231c785 com::sun::star->css in connectivity
Change-Id: I9489e92dc89a6d83a26ff4f0d9aad26acd28ad9f
Reviewed-on: https://gerrit.libreoffice.org/25537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30 08:37:11 +00:00
Stephan Bergmann
15e410e5af loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I6fada7331ee369c35cbe019db4e730ce56cd1a1f
2016-04-20 17:25:37 +02:00
Jochen Nitschke
150ac9cf05 clean-up: unused using declarations and includes
Searched source for using declarations.
Checked if those symbols reappear in the source file,
even in comments or dead code but not in #include statements.
If they don't reappear, remove the declaration.
Remove includes whose symbol got removed.

Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0
Reviewed-on: https://gerrit.libreoffice.org/24148
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:25:24 +00:00
Julien Nabet
a8ef64199b Use const_iterator when possible (connectivity)
Change-Id: I749e4c3ffa0c89f919459c376edad4804b2b66ca
Reviewed-on: https://gerrit.libreoffice.org/23573
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-03-28 20:28:28 +00:00
Noel Grandin
4dedf654d8 loplugin:unuseddefaultparams in connectivity
Change-Id: I03cc69a924913713a0da819899ce259305b88016
2016-03-03 09:42:49 +02:00
Noel Grandin
383e11040c sequence->vector in postgresql
Change-Id: I57bf8f4404df9f73d9a52c651c9f27784f10c937
2016-02-09 13:44:42 +02:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
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>
2016-02-09 08:18:05 +00:00
Stephan Bergmann
c0bd59c15b loplugin:nullptr (automatic rewrite)
Change-Id: Iefeeb51c2b101c097a8d77a4625f84baf1f2da44
2015-11-10 10:31:20 +01:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Noel Grandin
cb4fa1d1e2 use uno::Reference::set method instead of assignment
Change-Id: I080668f86f0ab8b3bba857ee21411f907ae285c4
2015-10-30 11:08:36 +02:00
Stephan Bergmann
7bff36d45d loplugin:stringconstant: OUStringBuffer: appendAscii -> append
Change-Id: I68b02ad101c4c2165b4618ed5d97cbffc2c43d2d
2015-08-31 08:04:12 +02:00
Noel Grandin
8601307838 loplugin: defaultparams
Change-Id: Id0a933d3507bc0f8145afa04effadf8475c8e210
2015-08-14 10:52:46 +02:00
Stephan Bergmann
17e74bf1a0 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: Id2361bd7b50f4724211661b024583b8a3445500b
2015-04-01 08:36:20 +02:00
Lionel Elie Mamane
79b5bf5cab PostgreSQL statement: use :cppu::WeakComponentImplHelper
Change-Id: I081d375b0249a3b0e47c1dd6db3f86fef272e7fd
Reviewed-on: https://gerrit.libreoffice.org/13925
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-01-15 13:01:00 +00:00
Lionel Elie Mamane
d7a6017e2a PostgreSQL statement: deliver promised XMultipleResults interface
Change-Id: I0bb6df332a6666a0ae96bba38626b2626f880490
2015-01-15 12:49:57 +01:00
Brij Mohan Lal Srivastava
d32be3ace8 fdo#86023 - O[U]String needs a 'clear' method
Added clear() method to OString and OUString class, Updated appropriate call-sites.

Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-14 09:20:38 +01:00