Commit Graph

1693 Commits

Author SHA1 Message Date
Andrea Gelmini
133da6ed83 Fix typos
Change-Id: Ia3e6f17217b837517faa588ea7f2e72dc5aff6aa
Reviewed-on: https://gerrit.libreoffice.org/57767
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-07-20 18:55:16 +02:00
Noel Grandin
65e41592a6 pass SvStream around by std::unique_ptr
and give utl::OStreamWrapper a new constructor so that it knows it is
taking ownership of  the SvStream, which appears to fix several leaks

Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b
Reviewed-on: https://gerrit.libreoffice.org/57187
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-10 08:30:21 +02:00
Stephan Bergmann
1d27776504 Improved loplugin:redundantcast (const-qualified typedefs): forms
Change-Id: Iaf50a40576e0fc1dde1e221a791bda6e183e5072
Reviewed-on: https://gerrit.libreoffice.org/56696
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-29 22:46:50 +02:00
Andrea Gelmini
9abc8884a7 Fix typo
Change-Id: I73aa1fe0f37b9cb5f44042850c952d3f9e425f79
Reviewed-on: https://gerrit.libreoffice.org/56231
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-06-21 13:01:50 +02:00
Noel Grandin
46d9abb1f1 loplugin:useuniqueptr in OClickableImageBaseModel
Change-Id: Ia262bb241d26197f93023f47a7164d0231cc8b70
Reviewed-on: https://gerrit.libreoffice.org/56188
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-21 09:38:50 +02:00
Noel Grandin
e1b922a2b3 loplugin:useuniqueptr in frm::ODatabaseForm
Change-Id: I55a0ee19476d1e656cd9ff82d44666d43ba4ca58
Reviewed-on: https://gerrit.libreoffice.org/56189
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-21 08:24:55 +02:00
Noel Grandin
9375d1bb04 loplugin:useuniqueptr in StandardFormatsSupplier
Change-Id: I54e0b958f4b6e6b6d99b7e82c327817cf2967e3d
Reviewed-on: https://gerrit.libreoffice.org/56186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-21 08:20:49 +02:00
Noel Grandin
1c4cd77bee forms - move the Bitmap accessing code inside BitmapEx
Change-Id: I58d5200332c133146adb6bb99b4b88697f03990a
Reviewed-on: https://gerrit.libreoffice.org/55313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-05 14:44:28 +02:00
Jochen Nitschke
8ddca0648a tdf#42949 remove unused compheler includes ..
and fix the fallout

Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e
Reviewed-on: https://gerrit.libreoffice.org/54882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05 10:56:36 +02:00
Arkadiy Illarionov
62667aac83 tdf#96099 Remove some trivial std::vector typedefs
Change-Id: I21171bd90b5e19fe8e5b8f2d125b6dfcb9a8b766
Reviewed-on: https://gerrit.libreoffice.org/55198
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-06-03 09:38:42 +02:00
Noel Grandin
3a51daeace Improve re-throwing of UNO exceptions
(*) if we are already throwing a Wrapped*Exception, get the
exception using cppu::getCaughtexception.

(*) when catching and then immediately throwing UNO exceptions,
use cppu::getCaughtException to prevent exception slicing

(*) if we are going to catch an exception and then
immediately throw a RuntimeException, rather throw a
WrappedTargetRuntimeException and preserve the original exception information.

Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558
Reviewed-on: https://gerrit.libreoffice.org/54692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25 21:46:49 +02:00
Noel Grandin
0e384e1080 loplugin:unnecessaryvirtual improvements
look for virtual methods where all of the overrides of the method are
empty

Change-Id: I87d99a0b647700a8d53498e0ab5f0437d3508553
Reviewed-on: https://gerrit.libreoffice.org/54060
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-10 11:34:18 +02:00
Andrea Gelmini
f6fb5a17da Fix typos
Change-Id: I92078fdece135754744d85424956dbb071f3899e
Reviewed-on: https://gerrit.libreoffice.org/53638
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-05 09:24:40 +02:00
Noel Grandin
9a831a6c19 remove no longer necessary operator new/delete overrides
and use "using" statements for the places where the overrides were
resolving ambiguities

Change-Id: Icb1d1a41f19e00f28a19947aa2c40bd5778fff94
Reviewed-on: https://gerrit.libreoffice.org/52993
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-17 09:09:33 +02:00
Jochen Nitschke
b4d36b5dcf remove some unused comphelper includes
and fix the fallout

Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359
Reviewed-on: https://gerrit.libreoffice.org/52894
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-15 11:17:24 +02:00
Caolán McNamara
8ed2fb306f weld linkeditdialog
which enables changing FileDialogHelper over to welded

Change-Id: I988342a6574cb7ed09b2724929e8c7117474a56c
Reviewed-on: https://gerrit.libreoffice.org/52388
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-06 16:48:12 +02:00
Noel Grandin
0e493cae40 new loplugin:dbgunhandledexception
enforce that DBG_UNHANDLED_EXCEPTION is called first in a catch block,
otherwise it cannot do it's job properly

Change-Id: I906436c6861212c44f8f21552ccbceb54f15c6e1
Reviewed-on: https://gerrit.libreoffice.org/52303
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03 14:54:55 +02:00
Noel Grandin
4450b2a166 pass area param to DBG_UNHANDLED_EXCEPTION
and update sallogareas plugin to enforce this

Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a
Reviewed-on: https://gerrit.libreoffice.org/52249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03 08:38:50 +02:00
Jochen Nitschke
9401c7c28a remove unused processfactory.hxx includes
and fix fallout

Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee
Reviewed-on: https://gerrit.libreoffice.org/52206
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-01 12:11:26 +02:00
Julien Nabet
070dbae6b4 Use for-range loops in forms
Change-Id: I23f63f2a98ce64513f5cb4b06e373b5ec9509d62
Reviewed-on: https://gerrit.libreoffice.org/51445
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-17 08:23:33 +01:00
Tomaž Vajngerl
6c6b2c886e forms: Don't create a GraphicObject URL if we have xGraphic anyway
Change-Id: Ia80df77372ed08abc4ff816515c216c26d8330b4
Reviewed-on: https://gerrit.libreoffice.org/51326
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-15 23:15:40 +01:00
Noel Grandin
a498b12dc1 use more Color in editeng..forms
Change-Id: If6c862e7bb61cd78c3379afde11b528a74162900
Reviewed-on: https://gerrit.libreoffice.org/50860
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-07 08:35:04 +01:00
Noel Grandin
e2cb154195 convert COL_ constants to be of type Color
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48
Reviewed-on: https://gerrit.libreoffice.org/50373
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-28 07:34:27 +01:00
Jochen Nitschke
35fc452721 remove unused vclunohelper.hxx includes
Change-Id: I68178379e5493d0e738861a4dce5aa6e4b58cd22
Reviewed-on: https://gerrit.libreoffice.org/50393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27 15:00:06 +01:00
Noel Grandin
c98d330302 replace Color(COL_*) with COL_*
using

    git grep -lwP "Color\s*\(\s*(COL_\w+)\s*\)"
    | xargs perl -pi -e "s/Color\s*\(\s*(COL_\w+)\s*\)//g"

and then some manual fixup where the resulting expression no longer
compiled

Change-Id: I0e268d78611c3be40bba9f60ecfdc087a36c0df4
Reviewed-on: https://gerrit.libreoffice.org/50372
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27 11:28:29 +01:00
Noel Grandin
e5012e53b9 use scanline when reading pixel data
extracts code from the innermost part of fairly hot loops

And add a GetIndexFromData method to make the call sites a little easier
to read.

Change-Id: I4ce5c5a687ecdb6982562a0aafce8513d86f9107
Reviewed-on: https://gerrit.libreoffice.org/49337
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-07 10:08:30 +01:00
Noel Grandin
f38e35338e clean up some include guard terminators
found with
   git grep -n -A10 '#endif // INCLUDED' | grep -v endif | grep -v vim |
grep -v -- '--'

Change-Id: I7ae67cd7c1313e76f059fb8e6afb723caca8a6d7
Reviewed-on: https://gerrit.libreoffice.org/49244
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-06 07:38:58 +01:00
Julien Nabet
6363d6036b Typo: invlidateParameters->invalidateParameters (forms)
Change-Id: Ia25e5e9968038849d539f9bc112a4a56e6190277
Reviewed-on: https://gerrit.libreoffice.org/49088
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-01 18:23:40 +01:00
Julien Nabet
ea89dabf8b Modernize a bit forms
by using for-range loops
+ use returned iterator by erase call

Change-Id: Ia41c9fae190dbad6a25b62a9b15ad51e89dd2906
Reviewed-on: https://gerrit.libreoffice.org/48759
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-27 23:51:14 +01:00
Julien Nabet
a30652295b tdf#108473: don't let empty date in datetime in forms
If only an hour is given (so no date part), copy behavior for table and query
and put 30/12/99 by default

Change-Id: Ifb371758538d2d11bd02b101a347d34816b6fddf
Reviewed-on: https://gerrit.libreoffice.org/48665
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins <ci@libreoffice.org>
2018-01-26 14:41:05 +01:00
Stephan Bergmann
280cc19829 Fix odd check for nFieldLen range, assuming typos
The code used the odd combination of checking signed nFieldLen for != 0 and
<= USHRT_MAX, and then converting to sal_Int16 (not sal_uInt16) ever since
bf4154eb53 "initial import".  But there are indeed
various MaxTextLen properties in offapi of type short, not unsigned short, so
for one assume that checking for <= SAL_MAX_INT16 (not SAL_MAX_UINT16) was
actually intended.  And, for another, also assume that checking nFieldLen for
> 0 instead of != 0 was intended.

Change-Id: I119ef3ce71ee397cb6cbca714bca154e29e6599d
Reviewed-on: https://gerrit.libreoffice.org/48348
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23 07:56:35 +01:00
Noel Grandin
3b666f6819 remove some sal_Bool remnants
Change-Id: I0a9637aca523a73fbdbbd22f9ad735d6d1ba6898
Reviewed-on: https://gerrit.libreoffice.org/48273
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-22 07:04:29 +01:00
Stephan Bergmann
c6a62b3694 More loplugin:cstylecast: forms
Change-Id: Ide91ff51ef5c048272d742547597d6c66fc3abea
2018-01-15 09:05:33 +01:00
Andrea Gelmini
866fc4ddd3 Fix typos
Change-Id: Icc5fc590a6a90e30afa5f61028d4dd0279fbe120
Reviewed-on: https://gerrit.libreoffice.org/47861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-14 16:40:13 +01:00
Stephan Bergmann
1099ae1c16 More loplugin:cstylecast: forms
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: I91065e9ff1c160e5becda1ffa033de7c1b48b7f3
2018-01-12 20:23:58 +01:00
Stephan Bergmann
e4f9d06214 Use = for initialization
...so that an automatic loplugin:cstylecast rewrite (with a to-be-committed
enhanced loplugin) won't rewrite that to -Werror,-Wvexing-parse

  sal_Int16 nDefaultState( sal_Int16(TRISTATE_FALSE) );

Change-Id: Ic02374a34c67284dfbbb829a76fe7af9f7599411
Reviewed-on: https://gerrit.libreoffice.org/47752
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-11 17:40:27 +01:00
Stephan Bergmann
c45f9bc43d loplugin:redundantcast: forms
(after a to-be-committed improved loplugin:cstylecast would have rewritten the
C-style casts into static_casts)

Change-Id: Ife5e10c33c8e6abefd303445b8820c0d6f2d3307
2018-01-11 17:37:53 +01:00
Mike Kaganski
4e144751f1 loplugin:unusedindex
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146
Reviewed-on: https://gerrit.libreoffice.org/46652
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-18 07:36:32 +01:00
Stephan Bergmann
6f4f5677ac No need to keep these whitelisted functions decorated with SAL_CALL
The only effect SAL_CALL effectively has on LO-internal code is to change non-
static member functions from __thiscall to __cdecl in MSVC (where all other
functions are __cdecl by default, anyway).  (For 3rd-party code, it could be
argued that SAL_CALL is useful on function declarations in the URE stable
interface other than non-static member functions, too, in case 3rd-party code
uses a compiler switch to change the default calling convention to something
other than __cdecl.  But loplugin:salcall exempts the URE stable interface,
anyway.)

One could argue that SAL_CALL, even if today it effectively only affects non-
static member functions in MSVC, could be extended in the future to affect more
functions on more platforms.  However, the current code would already not
support that.  For example, 3af500580b
"loplugin:salcall fix functions" changed FrameControl_createInstance in
UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even
though its address (in ctl_component_getFacrory, in the same file) is passed to
cppuhelper::createSingleFactory as an argument of type
cppu::ComponentInstantiation, which is a pointer to SAL_CALL function.

Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6
Reviewed-on: https://gerrit.libreoffice.org/46436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14 13:03:06 +01:00
Noel Grandin
3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
Noel Grandin
dd0dceb511 loplugin:salcall handle static methods
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-12-07 11:25:55 +01:00
Stephan Bergmann
19f9a7e298 Remove unused #include <vcl/metaact.hxx> from vcl/outdev.hxx
...and fix the fallout

Change-Id: Ie514bd95d5a9f990a887566619031e9844c40b92
Reviewed-on: https://gerrit.libreoffice.org/45195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-06 20:25:51 +01:00
Stephan Bergmann
d14e0d46e6 Replace deprecated std::bin2nd with lambda in forms
(as std::bind2nd is gone by default at least from recent libc++ in C++17 mode)

Change-Id: Ia2c7970fd10e328a8b4a09e101ac3a89876c3d69
Reviewed-on: https://gerrit.libreoffice.org/45863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05 16:17:58 +01:00
Noel Grandin
9a06b99d2f loplugin:salcall fix non-virtual methods
first, since those are safer to change than virtual methods

Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe
Reviewed-on: https://gerrit.libreoffice.org/45798
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05 07:32:46 +01:00
Stephan Bergmann
a2656563f1 loplugin:unnecessaryparen: Warn about parentheses around literals
...that are not composed of multiple tokens, like ("foo" "bar").  Also don't yet
warn about Boolean literals, which are sometimes wrapped in parentheses to
silence unreachable-code warnings.

To avoid multiple warnings about code like

  f((0))

switch to generally using a set of ParenExpr to keep track of which occurrences
have already been handled.

Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc
Reviewed-on: https://gerrit.libreoffice.org/45317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-27 14:04:40 +01:00
Andrea Gelmini
d6d58bbef9 Fix typos
Change-Id: Ib138f971c4efcc67c68c901c9f08b4d1d95cdde2
Reviewed-on: https://gerrit.libreoffice.org/44933
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-20 11:23:12 +01:00
Noel Grandin
570eed8ce4 loplugin:finalclasses in forms
Change-Id: I0f849fd104699e2861aaba2d4be38168e80703b0
Reviewed-on: https://gerrit.libreoffice.org/44189
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-02 10:56:53 +01:00
Julien Nabet
98b03cdc63 Replace lists by vectors (forms)
Change-Id: Id0215a1044f330ffe6d09875d2f0ed6d4aa0b4f0
Reviewed-on: https://gerrit.libreoffice.org/44179
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-02 04:50:29 +01:00
Noel Grandin
8c9b5a901d loplugin:constantparam in connectivity
Change-Id: Ia13d0931bbdf642fe04119ea1112788fb143eba8
Reviewed-on: https://gerrit.libreoffice.org/44110
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-01 07:12:36 +01:00
Stephan Bergmann
7340b6a951 loplugin:includeform: forms
Change-Id: I770fe656a390045e850e967074545bf5dac7f335
2017-10-23 22:46:08 +02:00