Commit Graph

931 Commits

Author SHA1 Message Date
Stephan Bergmann
d1c9e5ee53 tdf#43157: Fix format string violations in OSL_TRACE etc.
...for a 32-bit build, similar to what ee11e221d2
"tdf#43157: Fix format string violations in OSL_TRACE etc." did for a 64-bit
build

Change-Id: I05dd79ede3e66cb9ab7a33792319eb34b34c82dd
2015-03-13 18:21:36 +01:00
Stephan Bergmann
2358dfc602 Clean up previous commit
...and add missing XServiceInfo implementations

Change-Id: I719cd10b6202d94e751805e1b838eb3f193e24d1
2015-03-12 10:48:03 +01:00
Chris Sherlock
6f7b0a1fad scripting: use constructor syntax in vbaevents.component
Change-Id: Ie27ec9ca92137e9f8666d2080fd1bc028417e337
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2015-03-12 10:48:03 +01:00
Michael Stahl
e557b160fd pyuno, scripting: remove executable bits from python, js, bsh files
Change-Id: Id108693d84fbca7764614e126ee1b3b045baec17
2015-03-02 13:26:28 +01:00
Stephan Bergmann
0e882b6513 loplugin:deletedspecial
Change-Id: I862b29974c770aea7396f2d650208b1f3e1f4e4b
2015-02-07 12:36:01 +01:00
Michael Stahl
74df327e1e scripting: remove unnecessary SAL_CALL
Change-Id: Ic1fbb36a509ec1dce63f1c7fa4a8955a4780517d
2015-01-29 21:48:11 +01:00
Stephan Bergmann
3f5ccf572a Fix types of functions called via pointer (-fsanitze=function)
Change-Id: Ife0151a04477ce30bb132e6dfae9f4d3a74bf4b0
2015-01-26 15:17:31 +01:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Julien Nabet
7da92fdcb0 cppcheck: Possible inefficient checking for <var> emptiness
Change-Id: I6ca0e477a4429e762c48c721951b9876db3a5c6c
2015-01-04 19:11:13 +01:00
Caolán McNamara
ca8787a981 boost::unordered_map->std::unordered_map
Change-Id: I5d458f43616edc395faa8c27edaddc7d515166db
2015-01-04 12:51:09 +00:00
Michael Weghorn
17fc7aa3b8 fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.

Change-Id: I390607e002e93cf7a6babc26d9be084d9f185058
2014-12-21 20:18:17 +01:00
Stephan Bergmann
b9def20cea scripting: Use appropriate OUString functions on string constants
Change-Id: Iacb434225e779de4911e9acc8431662f5eabcee3
2014-12-18 14:12:30 +01:00
Stephan Bergmann
fe17eb9448 scripting: Use appropriate OUString functions on string constants
Change-Id: I8ee8eb92ac95937893c894e67882e9df2c16a67d
2014-12-15 10:15:16 +01:00
Michael Stahl
8eb37e74ff pyuno: move "officehelper.py" from scripting to pyuno
... because at least in Fedora packages with system python it's a pain
to use officehelper.bootstrap() because unlike pyuno it is not installed
in the standard python directories but in libreoffice/program.

You might think that bootstrap() is not appropriate functionality for a
UNO langauge binding, but then why does ::cppu::bootstrap() exist?

Change-Id: I5fd4b344a811c087d32fb6304e55105ab3cb137e
Reviewed-on: https://gerrit.libreoffice.org/12968
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-12-02 13:47:26 +00:00
Michael Stahl
6a0fe37dec sal: clean up public headers with include-what-you-use
Sadly cannot forward declare "struct {...} TimeValue;".

rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h
was painful enough for now...

Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-17 11:06:53 +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
Noel Grandin
705c48d32e fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.

Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-05 08:44:19 +02:00
Caolán McNamara
5652f529b5 coverity#1237350 use our double-locking templates for this
Change-Id: I589468e9663ffd01a237a1684345985396bc4eac
2014-10-24 13:43:09 +01:00
Stephan Bergmann
ad9498f8b8 More -Werror,-Wunused-private-field
...detected with a modified trunk Clang with

> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp	(revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp	(working copy)
> @@ -1917,9 +1917,10 @@
>    const Type *T = FD.getType()->getBaseElementTypeUnsafe();
>    // FIXME: Destruction of ObjC lifetime types has side-effects.
>    if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> -    return !RD->isCompleteDefinition() ||
> -           !RD->hasTrivialDefaultConstructor() ||
> -           !RD->hasTrivialDestructor();
> +    return !RD->hasAttr<WarnUnusedAttr>() &&
> +           (!RD->isCompleteDefinition() ||
> +            !RD->hasTrivialDefaultConstructor() ||
> +            !RD->hasTrivialDestructor());
>    return false;
>  }
>
> @@ -3517,9 +3518,11 @@
>    bool addFieldInitializer(CXXCtorInitializer *Init) {
>      AllToInit.push_back(Init);
>
> +#if 0
>      // Check whether this initializer makes the field "used".
>      if (Init->getInit()->HasSideEffects(S.Context))
>        S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
>      return false;
>    }

to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html>
"-Wunused-private-field distracted by side effects").

Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
Norbert Thiebaud
39c8834d21 coverity#1209004 Unchecked return value
Change-Id: I8749a5d6f176406e181312d94a1e643974d87617
2014-10-05 13:26:10 -05:00
Stephan Bergmann
609e22b0dc scripting: std::auto_ptr -> std::unique_ptr
Change-Id: I91f4a037dfcfbea83cb1ea546ea73880f0480961
2014-10-01 12:17:17 +02:00
Michael Stahl
212f25c227 scripting: another missing SolarMutex guard
Change-Id: I762dad4d94ab4f27912b4ddac5b6a77f7d685cb8
2014-09-30 17:34:26 +02: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
Stephan Bergmann
a01ef1978c Improve logging
Change-Id: I9c879cc16de0d5353a5ab8ce4c8a8cd7f000a170
2014-09-17 11:48:20 +02:00
Stephan Bergmann
27d5b5c6dd BRAND_BIN_SUBDIR -> BRAND_INI_DIR, to cater for new Mac OS X layout
Change-Id: Ic367545895a25a4cf6e95fc1be2f5db9f36a221b
2014-09-17 11:45:14 +02:00
Noel Grandin
5bce329040 SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.

Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:47:44 -05:00
Caolán McNamara
d375986dae coverity#707084 Uncaught exception
Change-Id: I89459f7a77fcb5785cfb2e8288326fce65202d9c
2014-09-02 15:36:28 +01:00
Caolán McNamara
2f1eed4839 createNonDocMSPs->ensureNonDocMSPs
put the double-lockery into ensureNonDocMSPs and
the contents into a new createNonDocMSPs

Change-Id: Id09c933396e1a6ae1c45be79131a75729b16932b
2014-09-02 12:14:50 +01:00
Stephan Bergmann
70946992d4 Fix some *_component_getFactory function types
Change-Id: I912f9d1454c049419e9ead6f0ff8d7fa7d8cd6c5
2014-08-28 16:11:33 +02:00
Takeshi Abe
4d32244437 Avoid possible memory leaks in case of exceptions
Change-Id: Ib4a87cab2729e18b2c830cbd7e7a34d62b5f0f45
2014-08-26 19:47:14 +09:00
Noel Grandin
37b9ea92ba convert SBX flag bits to type-safe enum
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817
Reviewed-on: https://gerrit.libreoffice.org/11070
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-26 04:30:03 -05:00
Stephan Bergmann
c7d7582452 Fix *_component_getFactory function type
Change-Id: I966824af73effed95d975c09cb8a7f9ae022843f
2014-08-21 17:49:13 +02:00
Stephan Bergmann
bf640ba048 Fix *_component_getFactory function type
Change-Id: Id16c653554f5573dc862e0798747b7337ff74d44
2014-08-21 17:44:40 +02:00
Caolán McNamara
a107bdfdfc ErrorBox->MessageDialog
Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b
2014-08-18 10:57:21 +01:00
Noel Grandin
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
Norbert Thiebaud
d92aa2f445 remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b
2014-06-27 17:08:04 +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
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
Noel Grandin
db246b491c scripting: remove SAL_THROW macro
Change-Id: I535a57d043ac51926ae6f640d721d0dd1571c3fa
2014-06-05 08:17:52 +02:00
Noel Grandin
adc20c3937 compareToAscii -> equalsAscii
convert places using compareToAscii that should be using equalsAscii

Change-Id: I97b4da7f6e867c3967b2f65b70d6886f83b4a4e5
2014-06-04 11:52:31 +02:00
Jens Carl
f3e1f476e9 fdo#68849: Add header guards to all include files
Added header guards to files in directories sal/, sal/, and scripting/

Change-Id: Ieb7f224f2d27bd671618c516f47f5b7f08c1d294
Reviewed-on: https://gerrit.libreoffice.org/9582
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-06-01 16:07:41 +00:00
Noel Grandin
ebc0a15515 remove more unnecesary OUString constructor use
when throwing exceptions

Change-Id: I6edfb6b6745499f802b0e3c0e096a36fb7c32aac
2014-05-29 09:01:40 +02:00
Noel Grandin
0f2824b117 remove more unnecessary use of OUString constructor
Change-Id: Iae14cb3df65295b6894fd9e05411c5698e9c8aba
2014-05-27 08:20:12 +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
Tsutomu Uchino
a00c4c5e2f Resolves: #i113481# query script invocation from the current frame...
when the controller is not yet attached

(cherry picked from commit 03a410876fbdb5f9e1a7216d9d622557275d4896)

Change-Id: I1da3b3da258445d5187dcc75c4d151d08f9017dc
2014-05-18 08:53:07 +01:00
Chris Laplante
3c1e30b77d Correct common misspellings, and remove some ASCII art along the way.
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c
Reviewed-on: https://gerrit.libreoffice.org/9356
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-17 12:38:38 +00:00
Noel Grandin
b2096deaff various loplugin:passsequencebyref
Change-Id: Id1045a7f66b4fa10b6491587ba07246a31ceba72
2014-05-14 16:54:27 +02:00
Julien Nabet
e3d01ad336 Fix previous commit (scripting part)
Change-Id: Ib451642924909c11db4252e81d0c6db690c0e838
2014-05-11 10:37:30 +02:00
Julien Nabet
bd59628620 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part10
Change-Id: I67acda35fa127547dcea0cd18c9dc16db7c00294
2014-05-11 10:16:42 +02:00