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
Noel Grandin
58eab57648
java: final fields that can be static
...
found by PMD
Change-Id: I2b48f35d252d6e914c2a18a2c175b075a9d3ac0f
Reviewed-on: https://gerrit.libreoffice.org/13099
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-11-25 06:06:48 +00:00
Noel Grandin
0063cf2856
java: make fields final where possible
...
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
2014-11-18 12:44:28 +02: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
bb437029c1
java: convert fields to local variables where possible
...
found by PMD
Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542
Reviewed-on: https://gerrit.libreoffice.org/12376
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org >
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
2014-11-12 11:03:29 +00:00
Noel Grandin
36ff1527c9
java: reduce excessive code indentation levels
...
by using early return in some methods
Change-Id: I3611c8c89b3a94ef7e1772d178acf065fd7fcdc7
Reviewed-on: https://gerrit.libreoffice.org/12374
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-11-12 08:01:55 +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
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
Robert Antoni Buj i Gelonch
2a0569b53d
scripting: redundant cast to String
...
Change-Id: I5e048964cc7885a32c59ff8a9eb1fc5b9523e843
Reviewed-on: https://gerrit.libreoffice.org/11859
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-10-19 10:12:55 +00:00
Noel Grandin
93056481e8
java: when rethrowing exceptions, store the original
...
Change-Id: I8a2a264597d0b1ae06b08136fea36003682380b5
2014-10-17 08:26:22 +02:00
Noel Grandin
03c7c26cbe
java: final fields that can be static
...
Change-Id: I8c06be7bc0b8a38c662209f0de72a00550e25447
2014-10-17 08:26:21 +02:00
Noel Grandin
12b01b920f
java: no need to call String.valueOf to append to a String
...
Change-Id: I5ef45b971d24dde814ab8cbb2e9503d9da4f0d73
2014-10-17 08:26:19 +02:00
Noel Grandin
b2f69f6264
java: when rethrowing, store the original exception
...
Change-Id: I14666493e72da177fcfff1895ef3206f0e13cc01
2014-10-16 12:27:14 +02:00
Noel Grandin
fa22664be2
java: always use braces for while loops
...
Change-Id: Iff896b0cace8b8305528b3b0140004ea856169ce
2014-10-16 08:15:52 +02: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
Noel Grandin
3f43627ac6
fix import location of XScriptContext
...
Change-Id: I3b0ec540ed37e40f59210b7fb563196aee63d1ea
2014-10-14 14:44:48 +02:00
Robert Antoni Buj i Gelonch
0fdba36ab6
scripting: replace '.size() == 0' with '.isEmpty()' (collections)
...
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Map.html#isEmpty()
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html#isEmpty()
Change-Id: I76d8d8be2794655cb27ab121759494d7084b4744
Reviewed-on: https://gerrit.libreoffice.org/11967
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-10-14 12:29:02 +00:00
Robert Antoni Buj i Gelonch
791ed2c654
scripting: use new exception constructors
...
Change-Id: I7eeece85d4e462bf2df010ee29c062941a677759
Reviewed-on: https://gerrit.libreoffice.org/11966
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-10-14 12:28:37 +00:00
Robert Antoni Buj i Gelonch
b862f6e923
scripting: Null pointer dereference
...
Change-Id: I0d72ef34945065f68e9af8b0957dc440a74c14ce
Reviewed-on: https://gerrit.libreoffice.org/11923
Reviewed-by: Matthew Francis <mjay.francis@gmail.com >
Tested-by: Matthew Francis <mjay.francis@gmail.com >
2014-10-13 17:18:54 +00:00
David Ostrovsky
a1552a0ec3
Scripting: Remove org package
...
Change-Id: If0b6ac87b5d53da43557dee5824e9413a260ba7c
Signed-off-by: Stephan Bergmann <sbergman@redhat.com >
2014-10-10 09:41:29 +02:00
Andras Timar
05f1a88e19
typo: Lable -> Label
...
Change-Id: I8b9e9f75dd22ee5bff678c5bc0e1fa9381a103de
2014-10-09 13:02:50 +02:00
Robert Antoni Buj i Gelonch
1df9d5767b
scripting: as of release 5, 'enum' is a keyword
...
Change-Id: Ia45890892f3a0fa89b4c1f97a4c169de5e25c593
Reviewed-on: https://gerrit.libreoffice.org/11860
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
2014-10-08 16:28:14 +00:00
Noel Grandin
e189c61376
LocalOffice should be an abstract class
...
Change-Id: I9531b64dc8cb2545dfc41ae4d69007eced8f2d26
2014-10-07 13:20:04 +02:00
Noel Grandin
68fa141097
java: use isEmpty() instead of "size() == 0"
...
Change-Id: I23e1038246999b0744d8e9ae83b66fa1f7dafa99
2014-10-07 13:20:03 +02:00
Noel Grandin
81968336ea
java: use equalsIgnoreCase() instead of toLowerCase().equals()
...
Change-Id: I8f4afc7e15a9d85d99ea80edbbbd2b507b254ddc
2014-10-07 13:20:03 +02:00
Noel Grandin
dc53e3027b
java: simplify conditions involving logical negation
...
Change-Id: Ib45e58273e650ef9a31dbdb5f71e995a5976f50e
2014-10-07 13:20:02 +02:00
Noel Grandin
02ace92aba
java: optimise calls to toArray
...
passing in a correctly sized array requires one less allocation
Change-Id: I6198d226d9b630c99c4e8b6e3d0fdf890c495b44
2014-10-07 13:20:01 +02:00
Noel Grandin
831051f55e
java: remove useless overriding methods
...
that only call their superclass method
Change-Id: I9be2f69be132eec7918964f504c50df0ae8401a2
2014-10-07 13:20:00 +02:00
Robert Antoni Buj i Gelonch
e41597eade
scripting: line break (code formatting)
...
Change-Id: Ib1a8d7e4bdaad2f4eae822d9af280fd5b6f9dd7b
Reviewed-on: https://gerrit.libreoffice.org/11794
Reviewed-by: David Tardon <dtardon@redhat.com >
Tested-by: David Tardon <dtardon@redhat.com >
2014-10-06 14:10:27 +00:00
Norbert Thiebaud
39c8834d21
coverity#1209004 Unchecked return value
...
Change-Id: I8749a5d6f176406e181312d94a1e643974d87617
2014-10-05 13:26:10 -05:00
Robert Antoni Buj i Gelonch
4a0fc2fb02
scripting: organize imports
...
Change-Id: I26a1164d44f464a44ed7deb93ac39465feb0541c
Reviewed-on: https://gerrit.libreoffice.org/11768
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-10-03 05:25:06 +00:00
Robert Antoni Buj i Gelonch
4959ff5fef
scripting: The if statement is redundant
...
Change-Id: Ia6186be4ed48fd75d1063eed233a88e09b675bf1
Reviewed-on: https://gerrit.libreoffice.org/11774
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
2014-10-02 19:54:59 +00:00
Robert Antoni Buj i Gelonch
6f42a71439
scripting: Format_java_code.sh initial run
...
Conflicts:
scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
Change-Id: I09b94d8c96dfbaf498bd93a0088feb80a9e4afb6
2014-10-02 15:25:29 +02: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
Noel Grandin
77650bcc64
fix more Java1.5 incompatibility
...
Change-Id: I9d750f525fe73d59c150b322401418dfbd0822dd
2014-09-29 12:01:11 +02:00
Robert Antoni Buj i Gelonch
a0f3b9f954
scripting: modify astyle.options
...
Change-Id: I0e5fb63e2c632890e774b59e6808907067c87ce6
Reviewed-on: https://gerrit.libreoffice.org/11643
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
Tested-by: Caolán McNamara <caolanm@redhat.com >
2014-09-26 08:14:08 +00:00
Robert Antoni Buj i Gelonch
09b13e1e4c
scripting: astyle-java.conf -> astyle.options
...
Reviewed on:
https://gerrit.libreoffice.org/11639
Change-Id: I0852f9766495379b0208e236b3cbeafde5bf07b3
2014-09-25 16:06:23 +02:00
rbuj
feea4b250b
scripting: Format java code by using astyle tool
...
Change-Id: Ifcd90612f22282c16efdbf4d300b8164bf68f760
Reviewed-on: https://gerrit.libreoffice.org/11304
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
Tested-by: Caolán McNamara <caolanm@redhat.com >
2014-09-25 12:43:23 +00:00
Noel Grandin
83636d2c09
java: when rethrowing exceptions, store the original cause
...
so that we get a nice complete stacktrace when it hits the final
handler
Change-Id: Iec4fcc15a2a25c55f591b5e069dce3d010197a90
2014-09-25 13:47:25 +02:00
Jennifer Liebel
e16c8534f4
fdo#47302: Added insert->fields->page title button
...
Change-Id: Iebc8298a7e6a7d423d2667eec8a46a936cc4d2cd
Reviewed-on: https://gerrit.libreoffice.org/11599
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com >
2014-09-24 19:30:05 +00: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
Stephan Bergmann
31c379041c
ScriptProvider implementations need to be accessible
...
...from com.sun.star.comp.loader.FactoryHelper. Regression introduced with
70f56bc22f
"java: reduce scope, make member
classes private."
Change-Id: Iabf41a5eca2df25408e90428c60736b4a73db4c3
2014-09-16 12:57:50 +02:00
rbuj
f93ce4f7eb
scripting: decode(String) in URLDecoder has been deprecated
...
http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLDecoder.html#decode(java.lang.String)
Change-Id: I71ecb498c93d5e8d6959bdc3ab263a5ff48c1c21
Reviewed-on: https://gerrit.libreoffice.org/11453
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-09-16 06:16:49 +00:00
rbuj
1ebbb8bceb
scripting: Uncaught Exception
...
Change-Id: I949aa58416dbd80d87c9455009258f7bd2fd8520
Reviewed-on: https://gerrit.libreoffice.org/11439
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-09-14 06:45:26 +00:00
rbuj
44304a8147
scripting: replace StringBuffer with StringBuilder method
...
In JDK 1.3, StringBuffer makes the String concatenations faster.
public String concat(String s1, String s2) {
StringBuffer sb = new StringBuffer();
sb.append(s1);
sb.append(s2);
return sb.toString();
}
JDK 1.5 comes with StringBuilder (which is faster than StringBuffer) and the method:
public String concat(String s1, String s2) {
return s1 + s2;
}
is translated to:
public String concat(String s1, String s2) {
return new StringBuilder().append(s1).append(s2).toString();
}
Change-Id: I2924fcdf23d7ffbb567d9e924d02edcab4d21be6
NOTE: StringBuffer is synchronized, StringBuilder is not.
Reviewed-on: https://gerrit.libreoffice.org/11436
Reviewed-by: Noel Grandin <noelgrandin@gmail.com >
Tested-by: Noel Grandin <noelgrandin@gmail.com >
2014-09-14 06:33:05 +00:00