297 Commits

Author SHA1 Message Date
Caolán McNamara
2f33a8cd23 coverity#1403662 Mixing enum types
Change-Id: Ic5e797c65dfc736a9ef0ab14f3ae563216143947
Reviewed-on: https://gerrit.libreoffice.org/36020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-02 16:31:48 +00:00
Noel Grandin
7acbf45fcc use actual UNO enums in editeng
Change-Id: I58e794f161f3c4dd103985f575bc25202d4989b3
Reviewed-on: https://gerrit.libreoffice.org/35907
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31 06:58:55 +00:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Jens Carl
5aaaa9408a tdf#39468 Translate German comments
Translate German comments and terms in editeng/

Change-Id: I9bd15ca0914b34839d83751f530dd212d91e029e
Reviewed-on: https://gerrit.libreoffice.org/35884
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-03-30 10:14:53 +00:00
Noel Grandin
a34b33d2b9 convert SvxDateType to scoped enum
Change-Id: I5ce04f252642cb3a6c1b08ee22255f6c7b97f0f8
Reviewed-on: https://gerrit.libreoffice.org/35842
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-30 06:26:12 +00:00
Andrea Gelmini
55cc79f33f Fix typos
Change-Id: Ic823a46019138b8bbcacd7b52b48d7d7ead2fde2
Reviewed-on: https://gerrit.libreoffice.org/35629
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 09:27:18 +00:00
Jochen Nitschke
82981b94fe remove useless casts
Change-Id: I900b72372a56d341d18091b0d4721d31002d147f
Reviewed-on: https://gerrit.libreoffice.org/35223
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-15 18:36:37 +00:00
Noel Grandin
9cb57a50d7 convert SvxAdjust to scoped enum
Change-Id: I0df7a5313d6d62d0c657e62ef6014a3ddbab4639
Reviewed-on: https://gerrit.libreoffice.org/34941
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-08 06:30:49 +00:00
Noel Grandin
7139563afe make use of the SfxItemSet::GetItem<T> method
Change-Id: I8201429993129b019a6dd51c203a9f8dcbb2253e
Reviewed-on: https://gerrit.libreoffice.org/34867
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-06 06:00:38 +00:00
Noel Grandin
aadf790bbc remove some unnecessary use of OUString constructor
found with
   git grep -nP '<<= OUString\(\w*[A-Za-z]+'

Change-Id: I43354842f1e0418fb292f2e8e0cb30f1229d1c67
Reviewed-on: https://gerrit.libreoffice.org/34864
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-06 05:59:56 +00:00
Noel Grandin
1cfedbc960 drop SvxNumType and rename SvxExtNumType->SvxNumType
Both of them are abstractions over the css::style::NumberingType
constants.
SvxNumType serves no useful purpose, since it's just a typedef to
sal_Int16.
At least SvxExtNumType wraps up the css::style::NumberingType constants
in a nice enum.

Change-Id: I7b3f97cd42b0aa23aff7a4db4930da86149d4f4e
Reviewed-on: https://gerrit.libreoffice.org/34816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03 12:13:44 +00:00
Noel Grandin
afa675469c use SvxExtNumType in SvxNumberType
and follow the rabbit trail, fixing various other types in the process

Change-Id: I8fc7df3b585df21578ffb28fdd7e5e427b3bfd9d
Reviewed-on: https://gerrit.libreoffice.org/34814
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03 06:45:05 +00:00
Stephan Bergmann
f407666ec9 loplugin:subtlezeroinit: editeng
Change-Id: I2fb3700f00ad76096d048747c8333337d5ffce8f
2017-02-21 07:35:07 +01:00
Tor Lillqvist
b57d51e32f Drop :: prefix from std in [de]*/
Change-Id: I3247894fe022dce7f0aa351bd85fefcd7c545dd4
Reviewed-on: https://gerrit.libreoffice.org/34377
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2017-02-17 18:41:19 +00:00
Noel Grandin
4e19742382 convert EditEngineAttribs to scoped enum
and drop unused EditEngineAttribs_HardAndPara enumerator

Change-Id: Ic1fcddc6adeb5317f96bcef9b6f715b26d901a8d
2017-02-16 12:42:04 +02: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
e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Tor Lillqvist
e1e4efdc71 Typo: s/dependend/dependent/i
Change-Id: If02798894ad6f0e0442ed60aaec6eca40e6dcb61
2017-02-06 16:03:34 +02: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
Noel Grandin
1d7c589d50 loplugin: unnecessary destructor cppcanvas..filter
Change-Id: I009cdd60869a67d210edf879ddb451663a7b8676
Reviewed-on: https://gerrit.libreoffice.org/33491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-24 11:02:35 +00:00
Stephan Bergmann
72828a34e7 New loplugin:dynexcspec: Add @throws documentation, editeng
Change-Id: I4d93bf348b7b6a91aa37f8ce79b0b52a1a7d41ee
2017-01-19 18:03:22 +01:00
Noel Grandin
cd8fdb46fd new loplugin: useuniqueptr: editeng
Change-Id: I6df65eab882780d996ee996b5fef8020186b6d98
Reviewed-on: https://gerrit.libreoffice.org/32958
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-13 13:08:52 +00:00
Jochen Nitschke
a29bd2dabb cleanup tailing backslashes
Change-Id: Idb4bfc97e7d758c58118742affd9a9345c7a99f2
Reviewed-on: https://gerrit.libreoffice.org/32491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-30 18:48:24 +00:00
Caolán McNamara
510f497f05 coverity#1397045 Unchecked return value
and

coverity#1397044 Unchecked return value

Change-Id: I193bd676e417c35450efa91cb5773c78c998b63f
2016-12-12 09:47:41 +00:00
Noel Grandin
a66731982e convert SFX_HINT to scoped enum
Notes

(*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a
dynamic_cast check.

(*) In SC, removed the hint id field from ScIndexHint, no point in
storing the hint id twice

(*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no
point in storing two different hint ids

(*) In some cases, multiple #define's used to map to the same SFX_HINT
value (notably the SFX_HINT_USER* values). I made all of those separate
values.

Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5
Reviewed-on: https://gerrit.libreoffice.org/31751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08 12:35:09 +00:00
Noel Grandin
beb8cfcf32 convert inventorId to scoped enum
SW_DRAWLAYER had the same value as SC_DRAWLAYER, so I merged it into the
ScOrSwDraw enum constant

Change-Id: I5c45d378c00364d11cc960c9e48a6e3f10928724
Reviewed-on: https://gerrit.libreoffice.org/31037
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-21 12:09:09 +00:00
Noel Grandin
30e39e4793 loplugin:expandablemethods in drawinglayer..editeng
Change-Id: Ic7fe13651e18b4eec90ef3fd8d7aab81197e0f39
Reviewed-on: https://gerrit.libreoffice.org/30707
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-09 10:34:31 +00:00
Noel Grandin
2dfc4c0845 loplugin:oncevar in desktop..filter
Change-Id: I21c47cacbcd68f06eea7ccbbfa6d04fc65e2b7ee
Reviewed-on: https://gerrit.libreoffice.org/30564
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-04 13:15:29 +00:00
Noel Grandin
8a22bc93e0 update unnecessaryoverride plugin to find pure forwarding methods
which can be replaced with using declarations.

Is there a more efficient way to code the search? Seems to slow the
build down a little.

Change-Id: I08cda21fa70dce6572e1acc71bf5e6df36bb951f
Reviewed-on: https://gerrit.libreoffice.org/30157
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-28 12:56:17 +00:00
Noel Grandin
6f96e86dae loplugin:expandablemethodds in editeng..extensions
Change-Id: Ibe1929d74ff460955e39f2ccce3056b2051ddf08
Reviewed-on: https://gerrit.libreoffice.org/30013
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19 06:31:43 +00:00
Noel Grandin
954f752cf1 convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange
each name too much, since I can't start identifiers with digits like "100thMM"

And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore.

Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224
Reviewed-on: https://gerrit.libreoffice.org/29096
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05 06:51:20 +00:00
Jochen Nitschke
4563921f23 remove unused parameter
bTotalRanges is never used.
SFX_ITEMSET_NO_DEFAULT_CTOR is no where else used.

Change-Id: Ia35ea875f16a8ca04c2173b01074113f1825f565
Reviewed-on: https://gerrit.libreoffice.org/29248
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-25 18:56:19 +00:00
Noel Grandin
6dd4905a7a loplugin:constantparam in dbaccess..editeng
Change-Id: I1d0dc3d89933d86cd229e503b350fccc1523dedc
Reviewed-on: https://gerrit.libreoffice.org/28833
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-13 06:14:41 +00:00
Caolán McNamara
66f7aaf766 coverity#1372384 Uncaught exception
Change-Id: I4451623ba950b93e0efba5b3ec755622c2bea2bc
2016-09-01 10:40:14 +01:00
Caolán McNamara
396138a6bc Resolves: coverity#705366 Mixing enum types
and

coverity#705367 Mixing enum types
coverity#705371 Mixing enum types
coverity#982694 Mixing enum types
coverity#1027717 Mixing enum types
coverity#1371228 Mixing enum types
coverity#1371242 Mixing enum types
coverity#1371280 Mixing enum types
coverity#1371310 Mixing enum types

MapUnit and SfxMapUnit share the same values and
are freely cast from one to the other.

Now that

commit d30a4298bdb5ba53cd1fe659f2b742f218a2e527
Date:   Thu Aug 11 15:02:19 2016 +0200

    loplugin:unusedenumconstants in package..svtools

removed the SfxMapUnit entries that were directly unused, they
don't match anymore and casting from one to the other is dangerous.

Why there was two of these anyway escapes me, get rid of SfxMapUnit
and just use MapUnit universally

Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e
Reviewed-on: https://gerrit.libreoffice.org/28234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-19 11:25:18 +00:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Stephan Bergmann
018e89337d Improve loplugin:unnecessaryoverride
<sberg> thorsten, remember what that "TODO" in
 SvxAccessibleTextPropertySet::getSupportedServiceNames was to be about exactly,
 in a909acb7009acadffa53e74ea05ddb88803490f1 ?
<thorsten> sberg: that's a nonsense, prolly copy'n'pasted, or a 'please review
 me'
<sberg> thorsten, OK, thanks (that override will eventually go away with
 loplugin:unnecessaryoverride, and the TODO comment be lost)

Change-Id: Iba964c61768459aac4067bbd4e1f7d4f78f6adac
Reviewed-on: https://gerrit.libreoffice.org/27232
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-15 14:08:07 +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
e4651e2003 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I5bb3c63790cb153c0d6f57a681ec6dda71d482be
2016-07-07 18:59:55 +02:00
Noel Grandin
5f2b7007fd improve error message
Change-Id: Id1408cb1d8f04b36ffab65b684a94b14db9d9c50
2016-06-21 09:43:23 +02:00
Stephan Bergmann
82da3d95c1 loplugin:salbool: Implicit conversions from non-Boolean fundamental types
Change-Id: I67eac95686678e6f5a2d60798535b2c65a9ba5d7
2016-06-19 21:29:43 +02:00
Stephan Bergmann
fb7b701c18 Clean up uses of Any::getValue() in editeng
Change-Id: I2bce1aba3e01e5c8d67d47b88cddca1f7ad37a93
2016-06-13 12:10:27 +02:00
Stephan Bergmann
8fec9e7e4c Some clean up of uses of css::uno::Any::setValue
Change-Id: I04e8aef35a6083b61d775c8eb3f96757da2b31bd
2016-05-30 15:14:03 +02:00
Noel Grandin
9eb2e683ab tdf#34465 remove calls to SfxItemSet::Put(const SfxPoolItem&, sal_uInt16)
and put an assert in SfxPoolItem::SetWhich() so nothing new
creeps in.

Change-Id: I6497650fa61ffb2b6941ffff2d471c8f117be1df
Reviewed-on: https://gerrit.libreoffice.org/24324
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-27 07:21:45 +00:00
Noel Grandin
d4d2fc2479 clang-tidy modernize-make-unique
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b
Reviewed-on: https://gerrit.libreoffice.org/25138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19 08:33:10 +00:00
Stephan Bergmann
ddb4988c58 Add SAL_FALLTHROUGH, where apparently appropriate
Change-Id: I005943a7c7bc4f8bfc647b2cf44f143a66a7e997
2016-05-10 17:03:59 +02:00
Rosemary Sebastian
87cccfbf7e Replace '||' with '&&'
so that the condition doesn't always evaluate to true

Change-Id: I66ba3d4c7985e1fad60f12836e44167f19216588
Reviewed-on: https://gerrit.libreoffice.org/24548
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-01 10:34:53 +00:00
Stephan Bergmann
d3f80583ee -Werror,-Wvarargs
"passing an object that undergoes default argument promotion to 'va_start' has
undefined behavior [-Werror,-Wvarargs]"

just replace the variadic function with one taking an initializer list

Change-Id: Ied3dfe835dcebef48cf35374ec4d8835f98e6779
2016-04-27 13:47:30 +02:00
Noel Grandin
17c4f7f0bc clang-tidy modernize-loop-convert in e*
Change-Id: If56abefa81b41479e3ea9890dee1c43f006086de
Reviewed-on: https://gerrit.libreoffice.org/24384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26 07:43:58 +00:00
Stephan Bergmann
9ad66e5ae9 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I626b79e1450d78aec96c206db82bf64a47305d08
2016-04-20 17:25:39 +02:00