Commit Graph

96 Commits

Author SHA1 Message Date
Norbert Thiebaud
39c8834d21 coverity#1209004 Unchecked return value
Change-Id: I8749a5d6f176406e181312d94a1e643974d87617
2014-10-05 13:26:10 -05:00
Daniel Sikeler
32d6415617 fdo#83512 Make use of OUStringHash and OStringHash
Change-Id: I33cafe68c798e3d54943ea1790fa4e73f85e525d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-18 13:12:48 +02:00
Caolán McNamara
d375986dae coverity#707084 Uncaught exception
Change-Id: I89459f7a77fcb5785cfb2e8288326fce65202d9c
2014-09-02 15:36:28 +01:00
Stephan Bergmann
70946992d4 Fix some *_component_getFactory function types
Change-Id: I912f9d1454c049419e9ead6f0ff8d7fa7d8cd6c5
2014-08-28 16:11:33 +02:00
Noel Grandin
533c6cb6ba fixes for up-casting to Reference<XInterface>
Fix regressions introduced with
6a043e9c0a "Use the new type-checking
Reference constructor to reduce code noise"

Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-06-25 17:10:43 +02:00
Julien Nabet
d59da701c6 Related fdo#58774 Alternative dialog Find & Replace for Writer
After having installed the extension from http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer/releases/1.4
I had a crash, extract of bt:
5  0x00002aaad3ee13df in rtl::OUString::copy (this=0x7fffffff2510, beginIndex=147, count=-15) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:1481
6  0x00002aaad3edc10e in stringresource::StringResourcePersistenceImpl::implScanLocaleNames (this=0x8e2bba0, aContentSeq=uno::Sequence of length 24 = {...})
    at /home/julien/compile-libreoffice/libreoffice/scripting/source/stringresource/stringresource.cxx:1728

So add a quick check to be sure iDot > iSlash

Change-Id: I944a852d6cc9a35c451985ac96032f0d848136e8
2014-06-21 22:33:17 +02:00
Noel Grandin
db246b491c scripting: remove SAL_THROW macro
Change-Id: I535a57d043ac51926ae6f640d721d0dd1571c3fa
2014-06-05 08:17:52 +02:00
Noel Grandin
e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Noel Grandin
b2096deaff various loplugin:passsequencebyref
Change-Id: Id1045a7f66b4fa10b6491587ba07246a31ceba72
2014-05-14 16:54:27 +02:00
Noel Grandin
2ff8ae7c9e scripting: sal_Bool->bool
Change-Id: I1550c49cce2ad64f9d62b06ec20512a750f83b84
2014-04-24 10:53:16 +02:00
Thomas Arnhold
8bb2ce61c0 fixincludeguards.sh: some smaller dirs
Change-Id: Ic25bd678dc299627299b22145efd7bebcf2b39d0
2014-04-19 11:10:13 +02:00
Noel Grandin
5babf1b903 remove unnecessary scope qualifier from sal_Bool uses
i.e. convert "::sal_Bool" to "sal_Bool"

Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
2014-04-03 13:54:02 +02:00
Caolán McNamara
e57401aeb0 coverity#704287 Logically dead code
Change-Id: Iab22d2d12319bc01f9aebc1dcf40f47881d40446
2014-03-29 18:12:06 +00:00
Stephan Bergmann
70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Noel Grandin
86a32589e9 Find places where OUString and OString are passed by value.
It's not very efficient, because we generally end up copying it twice -
once into the parameter and again into the destination OUString.

So I create a clang plugin that finds such places and generates a
warning so that we can convert them to pass-by-reference.

Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
2014-03-18 08:32:26 +02:00
Donizete Waterkemper
c4cff5a645 fdo#54938: Convert some places to use cppu::supportsService
Change-Id: Ib941c6ec82d81b1da815561eee87ee91dc8de200
Reviewed-on: https://gerrit.libreoffice.org/8443
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2014-03-03 15:53:46 -06:00
Stephan Bergmann
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
Alexander Wilms
b0308236d2 Remove visual noise from scripting
Change-Id: Id9f177a20d911ce1e041407aa556c9cf13f0efc8
Reviewed-on: https://gerrit.libreoffice.org/8305
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-26 08:37:40 -06:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Stephan Bergmann
dbac5ccaf8 bool improvements
Change-Id: I0ef2adc0bd4a4764c38094b2b7d27c3453ecc117
2014-01-28 20:26:23 +01:00
Noel Grandin
82625bb98e remove unnecessary sal_Unicode casts in OUStringBuffer::append calls
Convert code like:
    buf.append( static_cast<sal_Unicode>('!') );
to:
    buf.append( '!' );

Change-Id: Iacb03a61de65a895540940953b49620677b3d051
2014-01-07 09:43:37 +02:00
Stephan Bergmann
9ed364774c Adapt all (non-extension, SharedLibrary) .components to environment="..."
Change-Id: I56f38bd786f3a026cb2908f28540dc9c4003af83
2013-12-17 11:06:00 +01:00
Noel Grandin
2ac50736e4 remove unnecessary use of OUString constructor in SCRIPTING module
Change-Id: I87dd775949d1d3cc2c191e84e57b49cd66ecc750
2013-11-11 08:36:06 +02:00
Noel Grandin
aeb41c9b9b remove redundant calls to OUString constructor
Change code like this:
  aStr = OUString("xxxx");
into this:
  aStr = "xxxx";

Change-Id: I31cb92e21658d57bb9e14b65c179536eae8096f6
2013-11-04 10:11:07 +02:00
Noel Grandin
0e6a2601b3 Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.

Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
2013-11-04 08:06:10 +02:00
Noel Grandin
e2451bd729 Convert indexOf->startsWith and lastIndexOf->endsWith
This is both an optimisation and a cleanup.

This converts code like
   aStr.indexOf("XX") == 0
to
  aStr.startsWith("XX")
and converts code like
  aStr.lastIndexOf("XXX") == aStr.getLength() - 3
to
  aStr.endsWith("XXX")

Note that in general
  aStr.lastIndexOf("X") == aStr.getLength() - 1
converts to
  aStr.isEmpty() || aStr.endsWith("X")
so I used the surrounding context to determine if aStr could be empty
when modifying the code.

Change-Id: I22cb8ca7c2a4d0288b001f72adb27fd63af87669
2013-10-31 08:34:21 +02:00
Marcos Paulo de Souza
ee5661ecd3 fdo#54938: Adapt supportsService implementations..
to cppu::supportsService

Change-Id: I0b03d3910f094f2183bf9859db9d5bcaf35d1f14
Reviewed-on: https://gerrit.libreoffice.org/6370
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2013-10-22 10:28:10 +00:00
Takeshi Abe
f4004429d3 Mark as const
Change-Id: Ic81dd60fadecf72f25792903985f2b387df7a7a0
2013-08-19 07:47:34 +09:00
Eike Rathke
6b2aaa7d23 resolved fdo#67444 don't push_back() with already reserved size
Change-Id: I5660bdf07ad0adae053508bed1805369850c1134
2013-08-07 12:02:58 +02:00
Eike Rathke
38522416bd use LanguageTag::getMatchingFallback()
Change-Id: Ib6fd9581728bdd7c32ccec9ce538d9b4c5658b04
2013-07-11 17:48:14 +02:00
Eike Rathke
3f1a58884e added FIXME-BCP47 comments
Change-Id: I9e47a22f8a061461bfb0f21e74ae001e719f04b6
2013-07-10 21:48:15 +02:00
Noel Grandin
6a043e9c0a Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases.

Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752
Reviewed-on: https://gerrit.libreoffice.org/4001
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2013-05-22 10:44:29 +00:00
Stephan Bergmann
617e7c6231 Missing include
Change-Id: I1be082b7db5592ad5090cf3ffaafe708bb1d9be4
2013-04-16 19:07:36 +02:00
Luboš Luňák
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Thomas Arnhold
39d45390f4 removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings declarations
s/(OUString\s+[a-zA-Z_][A-Za-z0-9_]*\s*)\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/$1\($2\)/gms

Change-Id: Iad20f242c80c4bdc69df17e2d7a69d58ea53654b
Reviewed-on: https://gerrit.libreoffice.org/2835
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-03-19 10:48:30 +00:00
Thomas Arnhold
8b27d78b4a automated removal of RTL_CONSTASCII_USTRINGPARAM for quoted OUStrings
Done with a perl regex:

s/OUString\s*\(\s*RTL_CONSTASCII_USTRINGPARAM\s*\((\s*"[^")]*?"\s*)\)\s*\)/OUString\($1\)/gms

Change-Id: Idf28320817cdcbea6d0f7ec06a9bf51bd2c3b3ec
Reviewed-on: https://gerrit.libreoffice.org/2832
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-03-19 09:00:26 +00:00
Caolán McNamara
df37f7d8e8 move loop variables into least scope pos
Change-Id: I8e69e92bbfee2bf20918d041ecc6b7a3f7729fbd
2013-02-24 23:24:26 +00:00
Julien Nabet
3901964b6d coverity#704434 Non-array delete for scalars
Change-Id: Ie92de56ead7988d951fe44cf63b4e72214b1e22f
Reviewed-on: https://gerrit.libreoffice.org/2358
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-02-24 23:22:55 +00:00
Thomas Arnhold
d5caf6898b loplugin: unused variables
Change-Id: I7fc203900256839e679bf73b717d121fedc42087
2013-02-24 17:44:31 +01:00
Noel Grandin
fbd4588afd fdo#46808, convert io::TextOutputStream service to new-style
Change-Id: I12af47afc21c2b646197893a77698f4e0818f94f
2013-02-11 08:02:15 +02:00
Noel Grandin
ff85e8319a fdo#46808, convert io::TextInputStream service to new style
Change-Id: Ida4abdd6587399aa8ade88af672bcb23ab7ea0f1
2013-02-11 08:02:15 +02:00
Stephan Bergmann
a9916dabb4 Remove xml2cmp leftovers
Change-Id: I7c0ba8b653b8e0534ae17bd879b93b75c6554893
2012-12-12 10:27:41 +01:00
Tor Lillqvist
60e7472b9d OUString::concat() does not modify in-place
Change-Id: I298f33a23e44146d7ce5fbf72d176020804e03d6
2012-11-28 21:49:24 +02:00
Noel Grandin
5837402fb1 fdo#46808, use service constructor for ucb::SimpleFileAccess
I upgraded the service to return XSimpleFileAccess3, since it
already implemented that interface, and it's backwards
compatible.

Change-Id: I40001a46048bd21a23b6a2f58a95376f06fc634b
2012-11-15 08:28:44 +01:00
Tor Lillqvist
1b075ea2cb Use prefix
Change-Id: I0323e3eb9446c4f2b18f84f5ed33909a877163c8
2012-10-02 11:46:16 +03:00
Noel Grandin
206c70eef3 fdo#46808, Adapt TempFile UNO service to new style
Change-Id: Ia448d6d74201e2be487c6d8317f94be3745808aa
2012-08-27 15:40:08 +02:00
Julien Nabet
350de508cf Prefer prefix ++/-- operators for non-primitive types
Change-Id: Iedb58cade2bc7cdbce2e8d40b0e3502bf3df4fa9
2012-07-15 15:21:38 +02:00
Bjoern Michaelsen
d24b518261 Revert "Some cppcheck cleaning"
This reverts commit b21661ce42.

this breaks with ../framework/source/lomenubar/MenuItemInfo.hxx:49:12: error: expected ‘;’ at end of member declaration
2012-07-14 16:07:39 +02:00
Michael Meeks
3f281b6f0a re-base on ALv2 code. Includes:
remove onlineregistration with dependencies
Patch contributed by Juergen Schmidt
http://svn.apache.org/viewvc?view=revision&revision=1249245
2012-07-06 20:29:14 +01:00
Takeshi Abe
d221d4e5a7 removed unnecessary forward declarations of class
this also moved necessary ones to right headers

Change-Id: Idda93aeaa1fdfeda602b14e3b233ffd1cf27c0cf
2012-07-02 22:07:55 +09:00