Commit Graph

854 Commits

Author SHA1 Message Date
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
Noel Grandin
ee094bd46f loplugin:staticmethods
Change-Id: If97f01a05294fa7efd59a8934c7b6f65cda5084a
2015-04-13 09:37:12 +02:00
Stephan Bergmann
5ba54aacd5 Remove dead INetProtocol::Vim
...which removes the need to abstract over the standard URI '%' escape prefix
vs. the silly vim '=' special case invention.

Change-Id: I54a52dd912c3aafc38275a0ac2466a6daeec328f
2015-04-07 20:21:21 +02:00
Stephan Bergmann
54e87df11f Change INetProtocol enumerators to CamelCase
...to avoid clashes with macros and poor warnings about hiding global FILE

Change-Id: I444e8b958f029201b228937e088efabc4b6d3050
2015-04-02 18:33:37 +02:00
Stephan Bergmann
44b3e56bb4 Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload

Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
2015-04-02 16:30:34 +02:00
Stephan Bergmann
4f2a236da4 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I69cac41fd3db1e99ecb55e23ac81c67046f81cb4
2015-04-01 08:35:28 +02:00
Stephan Bergmann
c3fb36ed26 Clean up C-style casts from pointers to void
Change-Id: I6dd7c7fbaf0d4b22abba0a7b1f5e37f0a46d0747
2015-03-28 19:09:17 +01:00
Tor Lillqvist
6c7291141c WaE: implicit conversion from bool to 'int'
Change-Id: I40782009fb8d73f827c82c298586a7d4542561c9
2015-03-02 09:39:55 +02:00
Noel Grandin
e9beb26470 convert SBI_ constants to enum class
Change-Id: I65e706f4e1adfe242808293d9514c9db8d22cc12
2015-03-02 08:59:18 +02:00
Noel Grandin
2f928b2d09 remove NUMBERFORMAT_ constants
.. in favour of just using the underlying constants from
css::util::NumberFormat

Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
2015-02-25 10:34:27 +02:00
Noel Grandin
9473ba2469 fix marking of free slots in array
Change-Id: I5170b9bbc4a3acab8307f7ad5ebc5e4ba9d58352
2015-02-24 10:36:51 +02:00
Stephan Bergmann
3b513aefa4 tdf#86543: reinterpret_cast -1 of appropriate width as special marker
Change-Id: Idf0d2a77a78e0e8fcbf435984b9b8f4393e4c207
2015-02-23 13:13:39 +01:00
Radu Ioan
a8e6f0bea0 tdf#39440 - cppcheck cleanliness
Fixed some cppcheck defects

Change-Id: I25fd6aba9d76df98d20b9a1bb4c9d3c1bf6f84bb
Reviewed-on: https://gerrit.libreoffice.org/14487
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-02-17 06:15:54 +00:00
Caolán McNamara
a1ceacc17e boost::foo_ptr->std::foo_ptr
Change-Id: I9219619b538b6530a89f5932ac51eb3b62eb396a
2015-02-16 12:54:44 +00:00
Stephan Bergmann
0f86834bd5 Remove redundant explicit up-casts
Change-Id: I58fd91354fe41673216674f5ae9c11c17cb3f29d
2015-02-05 12:47:23 +01:00
Juan Picca
6e1d28efb3 fdo#39440: replace C-style cast's
* Add get() method to tools::SvRef

Change-Id: I3825852176c9c37f3ee21f4fd57328b1c7451951
Reviewed-on: https://gerrit.libreoffice.org/14268
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-02-05 07:24:30 +00:00
Caolán McNamara
bf7b702814 coverity#1267698 Uninitialized scalar field
Change-Id: I79974d276a8f7f856dbf09b14b06ce3b1bb418f0
2015-01-30 20:52:52 +00:00
Eike Rathke
cd528c3099 implement css::i18n::XCalendar4 and LocaleCalendar2 service, tdf#63230
Implementation only, new local date/time routines not used yet from the
outside in this step.
2015-01-26 18:12:10 +01:00
Tor Lillqvist
b5938bf4b3 WaE: rewrite call of rtl::OUString::operator= ...
... with empty string constant argument as call of rtl::OUString::clear
[loplugin:stringconstant].

Actually, no need to clear the string here as it already is empty, surely?

Change-Id: Ib4b1a6e1b0c0f59c1c964fe58d26058b492c3821
2015-01-24 08:10:50 +02:00
Julien Nabet
b7d02d7a5a Resolves fdo#87834: strange behavior of mid()-function
See https://bugs.freedesktop.org/show_bug.cgi?id=87834
Thank you Michael Büssow for pointing these cases

Change-Id: I3a9b58360ddab529d1fb2f7eeba7f1c7ae69ba7c
Reviewed-on: https://gerrit.libreoffice.org/13707
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-23 20:32:52 +00:00
Stephan Bergmann
4130c64355 Some more loplugin:cstylecast: basic
Change-Id: Ib22bc7408d333a7080fa44c9c3ac9535ccf00752
2015-01-20 09:06:45 +01:00
Noel Grandin
c32a5a3b8e simplify Date/Time/DateTime conversion code
add constructors to Date/DateTime/Time,
that take the css::util counterparts,
to simplify code converting between these type

Change-Id: I4b03da02c63f65b6ec18cb4d6ecc3859bdef1ff7
Reviewed-on: https://gerrit.libreoffice.org/13855
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2015-01-13 15:24:04 +00:00
Tsutomu Uchino
bf964151a7 Related: #i94895# revert the part of revision 1650261
replaced string should be starting with the start postion if specified

(cherry picked from commit 68c6265584fb6cb0469098507dd287e6e1127324)

Conflicts:
	basic/source/runtime/methods.cxx

Change-Id: Ib729facfa78ffddebc258440324f05d037fae46f
2015-01-11 20:45:28 +00:00
Caolán McNamara
476f75802a Resolves: #i94895# fix illegal result of Replace runtime function"
and adjust the basic test-case, which is surely wrong

The syntax for REPLACE is:

// Replace(expression, find, replace[, start[, count[, compare]]])

surely in the case of a start of 3 the preceeding chars should
be returned unchanged in the result, not stripped off as before
this change.

This reverts commit 869402a587.

Change-Id: Ie710e4de9e7e35c84abe2770142a963532820af4
2015-01-09 12:05:37 +00:00
Tsutomu Uchino
a272f5b7b3 Resolves: #i63614# fix strange type mismatch when Iif function is used
Second or later compilation uses value type returned by previous execution of code.
Use the defined type as return value of the runtime function of Basic always.

(cherry picked from commit 7470c682e136a4a89c1e9474bbc79b2d61f31048)

Conflicts:
	basic/inc/basic/sbxmeth.hxx
	basic/inc/basic/sbxobj.hxx
	basic/source/runtime/stdobj.cxx
	basic/source/sbx/sbxobj.cxx

Change-Id: I3064e8403286a9c1401ef658bf139bedeae11f17
2015-01-09 09:24:44 +00:00
Caolán McNamara
869402a587 Revert "Resolves: #i94895# fix illegal result of Replace runtime function"
This reverts commit 340ca294d4 as CppunitTest_basic_vba
breaks, so needs revisiting to see which is right

Change-Id: I10168d454a8c67d91eee5bb8939aff74bba42954
2015-01-08 20:35:35 +00:00
Tsutomu Uchino
340ca294d4 Resolves: #i94895# fix illegal result of Replace runtime function
(cherry picked from commit a2700f75af61837033ff213607445cc1f74b36d6)

Conflicts:
	basic/source/runtime/methods.cxx

Change-Id: If9c671a612de87d8d37bfc40704a97a6062fd150
2015-01-08 16:51:10 +00:00
Noel Grandin
7f8f277b94 fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Caolán McNamara
7f476fea47 boost::unordered_map -> c++11 std::unordered_map
Change-Id: I28438000c2b0a8e6ce4f5640f861f572c0cb83c8
2014-12-27 23:00:45 +00:00
Stephan Bergmann
39ddeb53c0 basic: Use appropriate OUString functions on string constants
Change-Id: I43f99ba6759b0f8f633af784beaec583dbab0b9e
2014-12-18 14:12:23 +01:00
Stephan Bergmann
898c414700 basic: Use appropriate OUString functions on string constants
Change-Id: Ied7e5eba39672363065083493bd5e60449fda371
2014-12-12 10:21:45 +01:00
Michael Weghorn
93124f7710 reduce scope of local variables
This eliminates some of the warnings from Cppcheck report of
2014-11-29.

Change-Id: Ic4bf3bd8f5982d2ea2f25a28c0dd61084c59af11
Reviewed-on: https://gerrit.libreoffice.org/13331
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-12-06 14:12:31 +00:00
David Ostrovsky
e6e51a0a90 Add missing include header
Change-Id: I59d6f1401cdfc37c0949cc9d439cb7ff52857079
Reviewed-on: https://gerrit.libreoffice.org/13286
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-12-03 08:04:05 +00:00
Caolán McNamara
ecc56da366 busted loop condition
regression from

commit 119873328a
Date:   Thu Oct 21 15:34:02 2010 -0500
    convert vos/process.hxx and related API

Change-Id: I36527a4f0109105b9853a79773b4c92f9bc4e902
2014-11-21 11:55:11 +00:00
Caolán McNamara
ef076fa1c1 coverity#1255390 Resource leak
Change-Id: I3631d6bbcf45986deb1e911fcdb0e6606a0c6d91
2014-11-21 11:55:10 +00: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
Michael Stahl
e815987104 vcl: move the Impl class of MapMode ...uhm... out of the public header?
And remove the tools/fract.hxx include.

grep -l -r fract.hxx workdir/Dep/*Object* |wc -l
before: 4569
after:  1851

Shrinks some libraries, example from --enable-dbgutil Fedora gcc 4.8.3:
libvcllo.so by 473k (0.35%)
libswlo.so by ~1Mb (sadly that is just 0.2%)

Change-Id: I09bd025d551a5d2c5528b938a68c6aa5f8f114a0
2014-11-14 01:08:47 +01:00
Andrea Gelmini
da40cac540 Fix common typos. No automatic tools. Handmade…
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959
Reviewed-on: https://gerrit.libreoffice.org/12164
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 11:04:11 +00:00
Caolán McNamara
12bcfec04f markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05 14:58:00 +00:00
Caolán McNamara
cb0e009a9e document array_vs_singleton dismissals
Change-Id: I8d7eb4c01197e885abca717c7814c61a7641ac9d
2014-10-30 10:10:09 +00:00
Michael Stahl
51906611ab basic: move SbxAppData to a BasicDLL member
... so it is deleted by ~SfxApplication.

Change-Id: I161bd92eb9b5082d1fdeea603921d0372a4d97e6
2014-10-23 21:30:45 +02:00
Michael Stahl
a7498603d8 basic: pimplify that
Change-Id: I0abe66ded0fd69a2720ad64e1a1426aafc7dfffb
2014-10-23 21:30:45 +02:00
Jan Holesovsky
31af61ea09 Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d.

Conflicts:

	cui/source/tabpages/transfrm.cxx
	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx
	tools/source/generic/rational.cxx

Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
2014-10-23 18:34:39 +02:00
Jan Holesovsky
858c2a2977 Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"
This reverts commit 582ef22d3e.

Conflicts:

	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx

Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
2014-10-23 18:34:34 +02:00
Marcos Paulo de Souza
2e52086aa0 fdo#60689: replace SUPD variable
Change-Id: Iad63330f8762b595ba5ee94fc20bc2c64ac92f6b
Reviewed-on: https://gerrit.libreoffice.org/11937
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-10-23 14:38:27 +00:00
Tor Lillqvist
9ecac3874d Replace DISABLE_SCRIPTING with HAVE_FEATURE_SCRIPTING
Feature test macros that govern conditional compilation should be
defined in config_*.h include files, not on the compilation command
line.

Change-Id: I40575a4762fd2564f10927b6f38a112dd9f9a3d7
2014-10-22 09:30:23 +03:00
David Tardon
582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
Julien Nabet
4c12951a03 Typo: compatability->compatibility
Change-Id: If0b98a30452a9d1fcc340173deb6856755926471
2014-10-12 13:00:46 +02:00
Juan Picca
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
Caolán McNamara
8f436d3de7 use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use

coverity#1242393 Don't call rand
coverity#1242404 Don't call rand
coverity#1242410 Don't call rand and additionally allow 0xFF as a value
coverity#1242409 Don't call rand
coverity#1242399 Don't call rand
coverity#1242372 Don't call rand
coverity#1242377 Don't call rand
coverity#1242378 Don't call rand
coverity#1242379 Don't call rand
coverity#1242382 Don't call rand
coverity#1242383 Don't call rand
coverity#1242402 Don't call rand
coverity#1242397 Don't call rand
coverity#1242390 Don't call rand
coverity#1242389 Don't call rand
coverity#1242388 Don't call rand
coverity#1242386 Don't call rand
coverity#1242384 Don't call rand
coverity#1242394 Don't call rand

Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
2014-10-06 14:13:27 +01:00