Commit Graph

448 Commits

Author SHA1 Message Date
Stephan Bergmann
1fc6b2f745 tdf#109177: Fix expected type of Orientation attr
Regression introduced with 7e781aa15a "Clean up
uses of Any::getValue() in xmlscript"

Change-Id: I66df1c5aacab1d697438c57418c9100f9dba627a
2017-08-10 11:25:14 +02:00
Noel Grandin
b09deb0753 loplugin:constparams handle constructors
had to change the structure of the plugin considerably, was too messy to
structure it to do the calculations on a per-function basis

Change-Id: I4edee7735f726101105c607368124a08dba21086
Reviewed-on: https://gerrit.libreoffice.org/40516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 14:51:56 +02:00
Noel Grandin
db3860062e extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17 07:23:22 +02:00
Noel Grandin
daf177f703 use more OUString::operator== in test..xmlsecurity
Change-Id: If5bdd1532be44a47ff7cc3b769be3ea585aea562
Reviewed-on: https://gerrit.libreoffice.org/39685
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-14 12:39:20 +02:00
Andrea Gelmini
5f13f34581 Fix typos
Change-Id: Icf25b22857abd97e8b6a72d3d546fd1eed882049
Reviewed-on: https://gerrit.libreoffice.org/39385
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-07-03 11:59:15 +02:00
Stephan Bergmann
dd3df0f4cb loplugin:casttovoid: xmlscript
Change-Id: Iff674c2faed83e30316212336500865fabf59c30
2017-07-02 22:26:57 +02:00
Noel Grandin
71112060e0 loplugin:oncevar various
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6
Reviewed-on: https://gerrit.libreoffice.org/38766
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-29 08:18:35 +02:00
Noel Grandin
513ac8eb79 loplugin:useuniqueptr in various
extending it to find places we can use std::unique_ptr on arrays

Change-Id: I9feb1d12d738d6931e752ecb6dd51cbc1540c81b
Reviewed-on: https://gerrit.libreoffice.org/39255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-27 08:42:36 +02:00
Jochen Nitschke
a5dba7dbec remove unused osl/mutex.hxx includes
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb
Reviewed-on: https://gerrit.libreoffice.org/38905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-18 13:38:25 +02:00
Noel Grandin
83f9325f0d loplugin:unusedfields xmlhelp..xmlsecurity
Change-Id: I7e680e1913c787ce0adad5be1f84668d57ad00b3
Reviewed-on: https://gerrit.libreoffice.org/38821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16 08:24:49 +02:00
Noel Grandin
e4e4d5713e clang-tidy readability-delete-null-pointer
which in turn triggered some loplugin:useuniqueptr

Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64
Reviewed-on: https://gerrit.libreoffice.org/38281
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12 08:43:48 +02:00
Jochen Nitschke
a0b93fe081 cleanup unused css/script/ includes
but keep exception includes in headers for now

Change-Id: I826828675a2d14b906e57068cbced2e790e12bce
Reviewed-on: https://gerrit.libreoffice.org/37846
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20 10:23:38 +02:00
Noel Grandin
389da66dfc remove unused uno::Reference vars
found by temporarily marking Reference as SAL_WARN_UNUSED.

Change-Id: I18809b62654467f890016adcc92576980ced393b
Reviewed-on: https://gerrit.libreoffice.org/37511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12 09:56:01 +02:00
Jochen Nitschke
959496794c cleanup osl/diagnose.h includes
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-05-09 15:41:46 +02:00
Chris Sherlock
97eb00c75e revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
Chris Sherlock
34ca5a2fb5 tdf#43157: convert xmlscript from OSL_ASSERT to assert
Change-Id: I8470851db8f70cbde96ca033ebd5aa515da84510
2017-05-07 08:59:32 +10:00
Miklos Vajna
c113aded3e tdf#107029 xmlscript: fix enum conversion
Regression from commit 0fe6f1a196 (use
actual UNO enums in vcl..xmlsecurity, 2017-04-03), it's important when
changing a sal_Int16 to an enum, then arguments of makeAny() calls of
that variable are explicitly casted the previous type to keep
compatibility.

Change-Id: Ib55eeded34033ce536078919c6fad4d571951cd3
Reviewed-on: https://gerrit.libreoffice.org/36358
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-10 13:10:53 +02:00
Stephan Bergmann
f79c466405 Improved loplugin:redundantcast, static_cast on arithmetic types: xmlscript
Change-Id: I511174aa27bd486e6c046761e481c494c58a67bc
2017-04-06 18:30:16 +02:00
Noel Grandin
f1945405b0 loplugin:redundantcast check for c-style float casts
Change-Id: I86b6f58887cb398a80698f8d8564b5bc3f55eabb
Reviewed-on: https://gerrit.libreoffice.org/36198
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 11:41:46 +00:00
Miklos Vajna
843cb68d00 xmlscript: fix -Werror=maybe-uninitialized
Change-Id: Ifcde2202fcb2cfa1dd226697910c1fbd219a3f83
2017-04-04 16:01:37 +02:00
Noel Grandin
0fe6f1a196 use actual UNO enums in vcl..xmlsecurity
Change-Id: Id862544f27ebcbe8363f93dc83192d0f0cddb5cc
Reviewed-on: https://gerrit.libreoffice.org/36041
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-03 11:05:13 +00:00
Jochen Nitschke
da56de9ac4 remove type decorations on char literals
they are only needed where type deduction fails.
left them in defines for now.

Change-Id: I7f002dd6bc7acc083c73b6c64076de6dd28d0b09
Reviewed-on: https://gerrit.libreoffice.org/35893
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-30 12:21:40 +00:00
Andrea Gelmini
74117f9597 Fix typos
Change-Id: I901ff35ad2e0aa43a421f0996865130514a819bc
Reviewed-on: https://gerrit.libreoffice.org/35663
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 13:10:53 +00:00
Stephan Bergmann
6cb9e6dad7 Remove redundant 'inline' keyword
...from function definitions occurring within class definitions.  Done with
a rewriting Clang plugin (to be pushed later).

Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8
Reviewed-on: https://gerrit.libreoffice.org/34874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03 20:55:50 +00:00
Noel Grandin
c1877a16b3 loplugin:unusedfields
Change-Id: I8a114bcda99f123d230d61b0d0595bfe657cc3c0
Reviewed-on: https://gerrit.libreoffice.org/34513
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-22 06:42:19 +00: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
Julien Nabet
b4fe924e17 Typo: progess->progress
Change-Id: Ic13529f4bc9ac49059a59067c50d5f2c0f569822
Reviewed-on: https://gerrit.libreoffice.org/33902
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-03 21:10:43 +00:00
Noel Grandin
f1d83ac45f loplugin:stringconstant check for unnecessary OUString constructor..
..calls when creating exceptions

Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe
Reviewed-on: https://gerrit.libreoffice.org/33617
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-28 09:22:55 +00:00
Noel Grandin
4511431fb6 improve "unnecessary user-declared destructor" check
to look for inline&empty destructors, where we can just let
the compiler do it's thing

Change-Id: Ibde8800bdfed6b77649c30ebc19921167c33dec3
Reviewed-on: https://gerrit.libreoffice.org/32999
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27 09:49:04 +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
Jochen Nitschke
db2991d159 cppcheck: multiCondition
> Expression is always false becase 'else if' condition matches
> previous condition at line 1130.

Change-Id: Ic56379716ada435ad7e2a00252310bfa50868f04
Reviewed-on: https://gerrit.libreoffice.org/33388
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-22 13:06:07 +00:00
Stephan Bergmann
7c58ebaa02 New loplugin:dynexcspec: Add @throws documentation, xmlscript
Change-Id: If91eee152b0ab5d9137e4dd1dec3c3df3146a783
2017-01-19 18:03:09 +01:00
Noel Grandin
968f6a7f02 new loplugin: useuniqueptr: unotools..xmlscript
Change-Id: I6966d44cff644112dd837adfe7d9c4f459457271
Reviewed-on: https://gerrit.libreoffice.org/33298
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19 11:28:41 +00:00
Noel Grandin
43e8797add use rtl::Reference in ExtendedAttributes
instead of manual acquire/release

Change-Id: Ibf91b19ecace75b7c304f2a1b2acdd8a4ca28452
2017-01-19 13:06:47 +02:00
Noel Grandin
9352318969 use rtl::Reference in ElementBase
instead of manual acquire/release

Change-Id: Ie4d08dffa0b697e8308b4a3ad8e3504dc7a18e35
2017-01-19 13:06:47 +02:00
Stephan Bergmann
9dbb143c25 New loplugin:externvar: xmlscript
Change-Id: Ie35e22e464ab71c864e3fba130d1e7946a83086a
2017-01-09 15:39:11 +01:00
Noel Grandin
2f7ccd102a extend unusedfields loplugin to find fields that can be private
and apply the results in xmlscript

Change-Id: Ib126f6e1576639abfd171e99d9561be9715ece2f
2016-11-17 08:40:27 +02:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4 "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-09-13 13:19:22 +02:00
Noel Grandin
702496391b loplugin:constantparam in vcl..xmlscript
Change-Id: Icf66c08071b154259c9e551342d30331caf2b15a
Reviewed-on: https://gerrit.libreoffice.org/28685
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-07 06:48:56 +00:00
Eike Rathke
6d4f2dcc7c Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendar
... implementing signed years with year 0 gap.
Date(31,12,-1) last day BCE
Date(1,1,1) first day CE

New class Date member functions:
* AddYears(sal_Int16) to be used instead of
  aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap.
* convenience GetNextYear() to be used insted of GetYear()+1
* convenience GetPrevYear() to be used insted of GetYear()-1
* AddMonths(sal_Int32)
* operator=(const css::util::Date&)

New class DateTime member functions:
* operator=(const css::util::DateTime&)

Made some conversion ctors explicit, specifically Date(sal_Int32)

Adapted hopefully all places that used a sal_uInt16 year to use
sal_Int16 where appropriate.

Eliminated some quirks in date handling found on the fly.

Added era handling to i18npool icu calendar setting interface, which
missing was responsible for 0001-01-01 entered in Calc being set as
-0001-01-01, hence subtracting one day resulted in -0002-12-31.

Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f
Reviewed-on: https://gerrit.libreoffice.org/27049
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08 20:41:02 +00:00
Stephan Bergmann
7e781aa15a Clean up uses of Any::getValue() in xmlscript
Change-Id: I863ce5cdf53aee40c12cfe1b8ae4399b7cf006ce
2016-06-27 15:41:42 +02:00
Noel Grandin
0323253a7c remove some manual ref-counting
triggered when I noticed a class doing acquire() in the
constructor and then release() in the destructor.

found mostly by
    git grep -n -B5 -e '->release()'

Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f
Reviewed-on: https://gerrit.libreoffice.org/25806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-06 07:01:34 +00:00
Noel Grandin
95d20a3799 Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference
counting.

This reverts commit 111de438ea.
2016-05-24 11:02:42 +02:00
Noel Grandin
111de438ea remove some manual ref-counting
triggered when I noticed a class doing acquire() in the constructor and
then release() in the destructor.

found mostly by
   git grep -n -B5 -e '->release()'

Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f
Reviewed-on: https://gerrit.libreoffice.org/25363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24 06:54:06 +00:00
Noel Grandin
96fab05132 clang-tidy modernize-loop-convert in writerfilter to xmlsecurity
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3
Reviewed-on: https://gerrit.libreoffice.org/24923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13 08:09:03 +00:00
Stephan Bergmann
11b3262dd1 loplugin:nullptr
Change-Id: I2eb28f3408967d9de4143f6b9212056ac8614d1c
2016-05-12 14:37:32 +02:00
Stephan Bergmann
2894df68fe sal_Bool -> bool
Change-Id: I770a8507cdc1ee56456642b1f878381d6cf9d0b3
2016-05-04 12:53:44 +02:00
Yeliz Taneroğlu
d46bfe1367 tdf#74608 Constructor function for XMLBasicExporter
Change-Id: Ib4721b3f67956a8da48851841ef86bb7b79df1e7
Reviewed-on: https://gerrit.libreoffice.org/24553
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-02 09:56:22 +00:00
Yeliz Taneroğlu
955ca134fd tdf#74608 Constructor function for XMLBasicImporter
Change-Id: I0a2c74c71d1633427598e793d7c211e5283c7a33
Reviewed-on: https://gerrit.libreoffice.org/24559
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-02 09:56:10 +00:00
Yeliz Taneroğlu
2dc8f1b25c tdf#74608 Constructor function for XMLOasisBasicImporter
Change-Id: Iec1c875f6aa34c37ac26a5dac008db547e8965ca
Reviewed-on: https://gerrit.libreoffice.org/24551
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-02 08:37:09 +00:00