Commit Graph

224 Commits

Author SHA1 Message Date
Arkadiy Illarionov
966f40eecf Use hasElements to check Sequence emptiness in [e-i]*
Similar to clang-tidy readability-container-size-empty

Change-Id: I79e31919db8f4132216f09a7868d18835eeb154b
Reviewed-on: https://gerrit.libreoffice.org/71795
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-31 16:10:17 +02:00
Mike Kaganski
5a824268df Don't use resettable/clearable guard where plain guard is enough
Also use scope where possible. This allows to limit guard scope at
language level; visualises the scope clearly; and helps avoiding
errors like fixed in commit 61e4437c85.

Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41
Reviewed-on: https://gerrit.libreoffice.org/70376
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-07 17:53:04 +02:00
Matteo Casalin
cca2e42926 Use getTokenCount and indexed getToken
Change-Id: Id57a1771c897c69b05d02a359f22e5fb2b1f5a31
Reviewed-on: https://gerrit.libreoffice.org/69239
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-04-06 23:41:12 +02:00
Gabor Kelemen
80aec8ef2a tdf#42949 Fix IWYU warnings in include/connectivity/*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I02f75be483529ba1f7a6e460e34c4752b4265221
Reviewed-on: https://gerrit.libreoffice.org/68893
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-12 10:14:54 +01:00
Noel Grandin
8b5e23eac3 log nice exception messages whereever possible
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1
Reviewed-on: https://gerrit.libreoffice.org/68579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-07 07:12:39 +01:00
Mike Kaganski
e3560f4770 Replace deprecated boost::optional::reset(val) with operator =
Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b
Reviewed-on: https://gerrit.libreoffice.org/63221
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-10 09:16:53 +01:00
Gabor Kelemen
2a962cb122 tdf#42949 Fix IWYU warnings in include/comphelper/[m-z]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I04c5ba277d5b3398c07de6ae66713d977636088d
Reviewed-on: https://gerrit.libreoffice.org/61347
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-08 12:16:44 +02:00
Arkadiy Illarionov
97b6fd8e9e Replace find_if with proper quantifier algorithms
Missed in 085269d25a

Change-Id: I3cfab57232908b48d090658e0fbc948d62b3fc6f
Reviewed-on: https://gerrit.libreoffice.org/60180
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-08 14:46:08 +02:00
Arkadiy Illarionov
085269d25a Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11
Reviewed-on: https://gerrit.libreoffice.org/59744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29 11:40:29 +02:00
Gabor Kelemen
bdb0775a26 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from filter to jvmfwk

Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5
Reviewed-on: https://gerrit.libreoffice.org/58204
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 09:28:40 +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
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
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
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
Stephan Bergmann
c6a62b3694 More loplugin:cstylecast: forms
Change-Id: Ide91ff51ef5c048272d742547597d6c66fc3abea
2018-01-15 09:05:33 +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
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
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
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
Stephan Bergmann
7340b6a951 loplugin:includeform: forms
Change-Id: I770fe656a390045e850e967074545bf5dac7f335
2017-10-23 22:46:08 +02:00
Noel Grandin
9c5c905680 clang-tidy modernize-use-emplace in editeng..framework
Change-Id: I7739c4f77c856d34f8484754244df13d8fef840e
Reviewed-on: https://gerrit.libreoffice.org/42151
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-11 09:42:55 +02:00
Caolán McNamara
182a74d937 de-hrc various things
e.g.  helpid[s].hrc -> helpids.h
and insert include guards where missing

move "ordinary" defines into .hxx files

remove .hrc entries that are used as arguments to dialog factory
when a dedicated method can be added instead

Change-Id: I792fb8eb0adfaa63cf354e6e57401fc943e9196e
2017-07-21 08:20:51 +01:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
Noel Grandin
20571c4725 use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759
Reviewed-on: https://gerrit.libreoffice.org/39763
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-11 12:50:55 +02:00
Noel Grandin
ab9b38a406 use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
2017-07-06 08:35:23 +02:00
Jochen Nitschke
c4ddf6cd6d C++11 remove std::unary_function bases from functors
std::unary_function is deprecated since C++11 and removed in C++17

90% done with regexp magic.
removed obsolete <functional> includes.

The std::unary_function base class was used in 3 places:
* chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole
   is used in a std::not1 function helper who uses the members
   return_type and argument_type.
   - replace deprecated std::not1 with a lambda
* chart2/source/tools/ModifyListenerHelper.cxx:
   lcl_weakReferenceToSame used the argument_type member in the
   operator() parameter.
   - inline the parameter type.
* xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement
   used result_type and argument_type in operator().
   - inline the types

Also fix compile error with gcc about finding std::for_each.

Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f
Reviewed-on: https://gerrit.libreoffice.org/39358
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-03 12:21:03 +02:00
Stephan Bergmann
ef7d2da6aa loplugin:casttovoid: forms
Change-Id: Ib3f4eaa68566665b9d6eec324cef593411b1aa7b
2017-07-02 22:32:12 +02:00
Lionel Elie Mamane
ecdcf38a32 tdf#108732 ListBox: in absence of a field, treat data as string
so that one meaningfully compare it; default is DataType::OTHER,
which is not comparable

Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880
2017-06-24 15:22:17 +02:00
Eike Rathke
96ef5d50da Handle TypedItemList property in models, tdf#108413 follow-up
Now that the TypedItemList property is somewhat exposed at OListBoxModel and
OComboBoxModel also handle that something could want to set it, even if it was
meant to be used with external sources.

Change-Id: Iae8ce2a50dbbb2166d9a67dbf55900beeb9192d2
2017-06-14 13:34:01 +02:00
Eike Rathke
a1ace08b5b Fix subsequentcheck, TYPEDITEMLIST has to be OPTIONAL, tdf#108413 follow-up
Change-Id: Idb74536b9fa3837e36ae4fbb529d09b6218c80d8
2017-06-13 03:14:47 +02:00
Eike Rathke
0f8670eceb Resolves: tdf#108413 yet some more TYPEDITEMLIST property entries
... which apparently need to be present to be able to override them. You
also can have never enough macro names to obfuscate things for grep..

Change-Id: Ic0bdcb71682136a537b3ce1c564f02f686f1ee9e
2017-06-12 17:28:01 +02:00
Stephan Bergmann
420a8de648 Improved loplugin:cstylecast to reference types: forms
Change-Id: Ide68579e892594875a5c38b3f62872d4eeae06cf
2017-06-05 21:18:09 +02:00
Lionel Elie Mamane
4f4b06ce32 tdf#106462 old value and new value were swapped
in

commit 66ccfcd290
Author: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Date:   Fri Oct 21 09:36:10 2016 +0200

    remove use of tryPropertyValue Any specialisation

    Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3
    Reviewed-by: Stephan Bergmann <sbergman@redhat.com>

Change-Id: I90dd3f6dba799eec9210dbb7560be105cb50e6d1
Reviewed-on: https://gerrit.libreoffice.org/35023
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
2017-03-09 18:54:15 +00:00
Eike Rathke
838fab822c Resolves: tdf#79250 add typed list to form control listbox
... so numeric and text data can be distinguished input.

Change-Id: I63280a93c272ccc6f5e7ca06a1a1fcbfb3db8455
2017-02-14 11:49:35 +01:00
Eike Rathke
d3293c7173 Revert "Resolves: tdf#79250 add typed list to form control listbox"
This reverts commit e387b69967.

It breaks toolkit.subsequentcheck with
propertyChangeListener wasn´t called for ´TypedItemList´

Back to the drawing board for the twisted property logic of forms and
toolkit uno control models.
2017-02-11 01:19:37 +01:00
Eike Rathke
e387b69967 Resolves: tdf#79250 add typed list to form control listbox
... so numeric and text data can be distinguished input.

Change-Id: I63280a93c272ccc6f5e7ca06a1a1fcbfb3db8455
2017-02-10 20:58:52 +01: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
Jan-Marek Glogowski
bf110d40ef Change all Idle* LINKs to be Timer*
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles
Link in the Timer class. Now there are two possible solution:

  1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or
  2. split the inheritance of Idle from Timer again to maintain
     different Link<>s and move all common code into a TimerBase.

While the 1st is more correct, the 2nd has a better indicator for
Idles. This implements the first solution.

And while at it, this also converts all call sites of SetTimeoutHdl
and SetIdleHdl to SetInvokeHandler and gets rid of some local Link
objects, which are just passed to the SetInvokeHandler call.

It also introduces ClearInvokeHandler() and replaces the respective
call sites of SetInvokeHandler( Link<Timer *, void>() ).

Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
2017-01-23 20:49:05 +01:00
Jan-Marek Glogowski
fdc612619c Refactor Scheduler to add Task class
Moves all the "task-specific" stuff into a Task class and just
keeps the "real" static Scheduler functions in the original
Scheduler class.

Change-Id: I9eb02d46e2bcf1abb06af5bab1fa0ee734d1984c
2017-01-17 16:08:47 +01:00
Jochen Nitschke
66ccfcd290 remove use of tryPropertyValue Any specialisation
change return value of getCurrentMultiValue from Any<Sequence<Any> >
to Sequence<Any>.
return value of getCurrentSingleValue (Any of connectivity::ORowSetValue)
can't be changed to use tryPropertyValue.
inline functionality

Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3
Reviewed-on: https://gerrit.libreoffice.org/30091
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-21 14:36:11 +00:00
Noel Grandin
389999abdb make comphelper::containerToSequence a little smarter
So we don't have to specify the source and destination type as often.

Change-Id: Id9e286417a1cb246d163cbc3c536b231a4a92624
Reviewed-on: https://gerrit.libreoffice.org/30700
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-09 07:48:18 +00:00
Noel Grandin
bbf6c51717 loplugin:expandablemethods in forms..formula
Change-Id: Idc948ad06913def28cb642c3a4e5ea9322b9fb3b
Reviewed-on: https://gerrit.libreoffice.org/30688
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 09:49:48 +00:00
Caolán McNamara
db337150cd coverity#1374315 Uncaught exception
Change-Id: Id7a01c652d1d11675b87ee732ff40ddd76de6236
2016-10-27 21:37:42 +01:00
Jochen Nitschke
d1ea6ecda6 replace <<= with assign for <<= with rhs Any
found by deleting specialization of '<<=' template

Change-Id: I253f15177ab20fd3ef9baf4158da8c662cb47e6c
Reviewed-on: https://gerrit.libreoffice.org/29956
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-10-18 19:16:44 +00:00
Stephan Bergmann
106ea87205 Remove _TYPED suffix from tools/link.hxx macros
...which was introduced with 3ead3ad52f "Gradually
typed Link" to distinguish the new, typed versions from the old, untyped ones,
but is no longer necessary since 382eb1a23c
"remove untyped Link<>" removed the old versions.

Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-10-05 07:56:12 +02:00
Caolán McNamara
a6bc2ace5f coverity#1372386 Uncaught exception
Change-Id: Ic1fd5486e6b26718086d2f062459f11c00f244d2
2016-09-01 10:40:14 +01:00
Stephan Bergmann
9741e7a437 Clean up uses of Any::getValue() in forms
Change-Id: I335aabc92ecb5de107dad3ecdfa6e025ec0d1b0f
2016-06-10 18:55:13 +02:00
Stephan Bergmann
0f3ac23d73 Insert explicit "break" when falling through to empty next case
...which itself only contains a "break" (or nothing at all at the end of the
"switch"), as otherwise Clang -Wimplicit-fallthrough would warn about these.

Change-Id: I25c1cf2ca74dfeba7ca0385ca8f1c1bf30bbf91b
2016-05-10 14:57:26 +02:00