febbad7263
cleanup unused css/frame/* includes
...
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65
Reviewed-on: https://gerrit.libreoffice.org/38633
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-06-12 13:05:38 +02:00
1dd5e226bd
clang-tidy readability-non-const-parameter
...
Change-Id: I7b2680898dbfc49185fb949349d81f4ac615a470
Reviewed-on: https://gerrit.libreoffice.org/38593
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-06-09 15:05:54 +02:00
b5594f06c4
Cater for UNO (signed) vs. BASIC (unsigned) byte mismatch
...
See <https://listarchives.libreoffice.org/global/users/msg51243.html >
"[libreoffice-users] type byte in Basic", where
> Sub Main
> dim oOutputStream as variant
> oOutputStream = createUnoService("com.sun.star.io.SequenceOutputStream")
> dim nA as byte
> nA = 195
> oOutputStream.writeBytes(array(nA))
> oOutputStream.flush
> dim back(0) as byte
> back = oOutputStream.getWrittenBytes
> MsgBox(back(0))
> End Sub
failed with "Inadmissible value or data type. Overflow." instead of showing
"-61".
Change-Id: I0445476c67510d5f8669a6e711e92332c01ec06c
2017-06-08 14:48:25 +02:00
ef117cad3a
tdf#108039: check for nullptr in rtl_uString and OUString
...
rtl_[u]String_newConcat now checks allocation result to return
early and avoid SIGSEGV. Other functions are not modified, to
keep old behavior relying on allocation success and crashing
early on OOM to avoid added overhead in performance-critical
places.
OUString operator+= now checks rtl_uString_newConcat result and
throws std::bad_alloc on failure, to specifically address BASIC
problem. It keeps strong exception guarantee of leaving this'
state unaltered.
Concatenation in BASIC now checks for bad string allocation
(previously SIGSEGV was generated).
Unit test included.
Change-Id: I1513311d3d58eac43b2d2ec9a230e22dff0b4245
Reviewed-on: https://gerrit.libreoffice.org/37965
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
Tested-by: Jenkins <ci@libreoffice.org >
2017-06-07 11:48:57 +02:00
de8caac6be
replace SVSTREAM_OK with ERRCODE_NONE
...
since the first is #define'd to the second, and offers no extra value
Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450
Reviewed-on: https://gerrit.libreoffice.org/38406
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-06-06 08:15:57 +02:00
3fdfbe68ba
Improved loplugin:cstylecast to reference types: basic
...
Change-Id: Ib2159aef39d416905899fe91280d2234835e23e9
2017-06-05 21:18:14 +02:00
17a2c9e8e2
clang-tidy performance-unnecessary-value-param
...
Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192
Reviewed-on: https://gerrit.libreoffice.org/38400
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-06-05 09:22:51 +02:00
2ccde70d60
teach redundantcast plugin about functional casts
...
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-30 08:50:31 +02:00
ef513fd4b0
remove unnecessary use of OString::getStr
...
Change-Id: I0490efedf459190521f4339854b3394d57765fdb
Reviewed-on: https://gerrit.libreoffice.org/38058
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-28 19:44:08 +02:00
f45463d8e2
tdf#93727 Support date literals in basic
...
* detect #...# in SbiScanner
* add vb test
* made date locale-independent
Change-Id: Ic269df2df8d3a7c5af7858c3655bb40a0b6033f0
Reviewed-on: https://gerrit.libreoffice.org/36002
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Eike Rathke <erack@redhat.com >
2017-05-24 18:55:45 +02:00
7948e84091
basic: Stop detecting the number of tokens at runtime
...
which removes static variables and improves SbiTokenizer's
thread-safety.
Change-Id: Ic3eb52adfa85691af65f214c1b90c43c03f9a3dd
Reviewed-on: https://gerrit.libreoffice.org/37867
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-24 04:15:32 +02:00
514fd7073c
basic: Kill unnecessary ifdef stuff
...
Change-Id: Id890eb2b7ff2f87005e114dd0fcea0fe3eb81eea
Reviewed-on: https://gerrit.libreoffice.org/37866
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-22 05:01:57 +02:00
cae3e20571
cleanup unused css/resource/ includes
...
Change-Id: I1e2c795cef64799d5e28e5fafec6cd72f621abba
Reviewed-on: https://gerrit.libreoffice.org/37853
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-20 18:00:42 +02:00
a0b93fe081
cleanup unused css/script/ includes
...
but keep exception includes in headers for now
Change-Id: I826828675a2d14b906e57068cbced2e790e12bce
Reviewed-on: https://gerrit.libreoffice.org/37846
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-20 10:23:38 +02:00
f0fddb1d2d
loplugin:stringcopy: basic
...
Change-Id: I39d8ae76be2794d5e7b5a9979d7211823c995c2c
2017-05-19 17:19:14 +02:00
2155e04d63
make string translation loading more uniform
...
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
Tested-by: Caolán McNamara <caolanm@redhat.com >
2017-05-19 15:40:40 +02:00
2e51afc77c
loplugin:comparisonwithconstant in basic
...
Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5
Reviewed-on: https://gerrit.libreoffice.org/37809
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-19 12:53:34 +02:00
6df22f0ec5
loplugin:checkunusedparams various
...
Change-Id: I5d1cc807134230d86e0226a12fada204004312d3
Reviewed-on: https://gerrit.libreoffice.org/37675
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-16 14:20:27 +02:00
2c3f58eff2
Translate German comments and debug strings (leftovers in dirs a... to c...)
...
Translates all (leftovers) found using a custom regex, in directories not
shown by /bin/find-german-comments and beginning with "a" to "c".
Change-Id: I3b0152ee78ad80a29d714cbd98bf888f31be4763
Reviewed-on: https://gerrit.libreoffice.org/37573
Reviewed-by: Eike Rathke <erack@redhat.com >
Tested-by: Eike Rathke <erack@redhat.com >
2017-05-15 15:27:52 +02:00
4582acb3ee
remove some unnecessary locking
...
Change-Id: I7da9e82930d3fe8f927c495aeca270b8bb5cf65c
Reviewed-on: https://gerrit.libreoffice.org/37602
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-15 08:40:46 +02:00
f99c95c80d
basic: Fix VBA constant vbNewLine with unit test
...
... making its value CRLF on Windows and LF on others.
A winding road of regressions passed through it;
first b680e352546dc614f3b30bbe212e6b415a6a6bf4,
then 7beeced463648fc67defea2ad48d58dd42f0ca1e.
Change-Id: I9e4da4a17436949b4fea35481b8355b4321cb268
Reviewed-on: https://gerrit.libreoffice.org/37500
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-15 04:57:59 +02:00
dd6d7992d6
loplugin:constantparam
...
Change-Id: I67d74072c776c32a1f91df94c621efe180baf5dc
Reviewed-on: https://gerrit.libreoffice.org/37481
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-12 12:30:53 +02:00
389da66dfc
remove unused uno::Reference vars
...
found by temporarily marking Reference as SAL_WARN_UNUSED.
Change-Id: I18809b62654467f890016adcc92576980ced393b
Reviewed-on: https://gerrit.libreoffice.org/37511
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-12 09:56:01 +02:00
9425245a87
basic: Remove strange ifdef-guard for SHARED
...
Was there any platform predefining it?
Change-Id: I4c155c00272b426c0d2b1b1ec0184cc223f9e38c
Reviewed-on: https://gerrit.libreoffice.org/37461
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-12 03:57:08 +02:00
e93cf20603
basic: Compare strings in a case-insensitive manner
...
without creating temporary strings.
Change-Id: I8d0e8286089cb78fa9d8612bff6c51f6901637f1
Reviewed-on: https://gerrit.libreoffice.org/37249
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-10 05:54:25 +02:00
e5a4858e1a
basic: Compare with keywords without creating temporary strings
...
Change-Id: Ie284bbe4759a31c48cde415a4e673efd4c789741
Reviewed-on: https://gerrit.libreoffice.org/37252
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-10 05:49:19 +02:00
959496794c
cleanup osl/diagnose.h includes
...
with command
> git grep -l osl/diagnose.h *.cxx |
xargs grep -L -w 'OSL_\w*' |
xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d'
headers need more work
Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab
Reviewed-on: https://gerrit.libreoffice.org/37350
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de >
Reviewed-by: Michael Stahl <mstahl@redhat.com >
2017-05-09 15:41:46 +02:00
12191a4f30
make loplugin constantparam smarter about string params
...
Change-Id: Id3df69b38fd35f46735246a6d307a89aa10d4294
Reviewed-on: https://gerrit.libreoffice.org/37426
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-09 13:52:30 +02:00
719a2adfbd
remove unnecessary empty OUString fields and vars
...
Change-Id: I940120087a0bc6b1b0abc30a3e7727ce22b7d9a7
Reviewed-on: https://gerrit.libreoffice.org/37394
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-09 08:28:56 +02:00
4763091bbe
loplugin:constantparam
...
Change-Id: Ia9500b25602c14aadf49fe373682ae9d87a0a1a2
Reviewed-on: https://gerrit.libreoffice.org/37390
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-09 08:28:04 +02:00
97eb00c75e
revert OSL_ASSERT changes
...
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
6b3b0b85f9
tdf#43157: convert basic module away from OSL_ASSERT to assert
...
Change-Id: Idfd05d410ad3d76c3699492d98e1284a21f5f7d6
2017-05-07 09:29:23 +10:00
a940826162
Fix typos
...
To complete commit 0ef94e2b559547bc4e906e7f24e57ff5d642e108
and f12096272e684ddcd8ffa4e34dcb0a680cc594c2
Change-Id: Ie86bbfbd58dd728a013bef221e4d5c8fbcaf8e03
Reviewed-on: https://gerrit.libreoffice.org/37199
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Julien Nabet <serval2412@yahoo.fr >
2017-05-05 23:35:06 +02:00
cc0ea8bb25
More likely month pos first
...
Change-Id: I0033c176071642f8df245307af79b8505644a004
2017-05-03 16:37:50 +02:00
e0eb3f5edd
CDateFromIso: accept YYMMDD two digit year for compatibility
...
Some may even rely on that..
Change-Id: Icdaf9b2917aa0b1ca5e76c5220022c65fc654d86
2017-05-03 16:13:21 +02:00
6d424f0770
Replace mouth-painted "inaccurate around leap year" rollover algorithm
...
... with proper tools::Date methods Normalize() and AddMonths().
Also prepare functionality to easily switch on rollover for StarBASIC as well,
i.e. when called by DateSerial() runtime function.
For StarBASIC, invalid date for day > daysinmonthofyear is now (or better since
a previous commit 94bb96ada421b423e9ed30526fe5a6aac95f00b9 from today) properly
detected, not just dumb 1<=day<=31.
Change-Id: Ibb44f7247726f1e1168f0e66c5ae18e073d19f08
2017-05-02 23:12:34 +02:00
b5483b46f6
SbiRuntime::isVBAEnabled() needs to be guarded with #if HAVE_FEATURE_SCRIPTING
...
Change-Id: I7fab0c946c13a9779fad05f88be6ae6a9da93775
2017-05-02 16:06:51 +02:00
1b13548f33
BASIC: handle the full tools::Date range from -32768-01-01 to 32767-12-31
...
* Input of two-digit years only possible through CDateFromIso() though to
maintain compatibility with previous behavior and also VBA mode.
* VBA mode restricted to years 1..9999
Change-Id: Ia9574c3bf136619b4831b349d263c96b162d1ed4
2017-05-02 15:56:20 +02:00
769d383b06
loplugin:checkunusedparams in basctl and basic
...
Change-Id: I077ce96aed3c79045d5e8438109a8b1690ff1218
Reviewed-on: https://gerrit.libreoffice.org/37062
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-05-02 11:55:03 +02:00
38d9919432
CDateToIso: larger buffer for possible year range
...
Theoretically tools::Date can hold five digits years and even negative,
though Basic internally accepts only 100<=year<=9999. Might be that some
date calculations may result in years out of those margins, so at least
don't truncate those.
Change-Id: I3c217cc42476ce1cf8f9046111a1281288dc5bb6
2017-04-29 00:23:14 +02:00
f06e696723
loplugin:salunicodeliteral: basic
...
Change-Id: I479666b439f1d6324f07253d65181983b7c2c3ea
2017-04-28 18:27:01 +02:00
d6fd4252bf
Use invalid parameter error for malformed input, tdf#106956 follow-up
...
... instead of invalid procedure call.
Change-Id: I812f4c7041db9a116e65a24afb85164b4dd498b6
2017-04-28 16:13:36 +02:00
cdcbdf88b7
Resolves: tdf#106956 CDateFromIso accept also YYYY-MM-DD form
...
Previous implementation was over-simplified and accepted all sort of malformed
input to yield some arbitrary date, including longer and shorter and not
strictly numeric strings.
Change-Id: I2158429aeff7431f5ec5a1c9125018a5455a4730
2017-04-28 15:46:33 +02:00
2762ee5fe3
explicitly defining __RSC is no longer necessary
...
since commit 6b448d3634f26224e480c0f30c617eacd7b4e3ab
"make __RSC a builtin define for the RSC compiler"
Change-Id: I99af239993c3217bf528f5595def0c2de337f01b
Reviewed-on: https://gerrit.libreoffice.org/37025
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-04-27 16:13:06 +02:00
f9f045e783
tools: move errcode.hxx to the vcl module
...
Change-Id: I17e5a033de5f0aeb0a726744f7b464cdab6e2ee3
Reviewed-on: https://gerrit.libreoffice.org/36854
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com >
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com >
2017-04-27 10:38:35 +02:00
c70d49c7c8
use strong_int for LanguageType
...
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448
Reviewed-on: https://gerrit.libreoffice.org/36629
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-04-26 08:50:54 +02:00
41f5c11c3b
vcl: change ErrorHandlerFlags to DialogMask
...
Change-Id: I1959ac97f679d8d719f851f9869962b39a20ded9
Reviewed-on: https://gerrit.libreoffice.org/36841
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com >
2017-04-25 23:27:56 +02:00
3b85b72d64
errinf.hxx moved out of tools and into vcl module
...
ErrorInfo has a hard depency on VCL, yet is in the tools package. It is more
appropriate to have it reside in the VCL module.
Change-Id: Ica54a46c3a7f86cf0331ed7245234bea69c05650
Reviewed-on: https://gerrit.libreoffice.org/36839
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com >
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com >
2017-04-25 10:55:17 +02:00
6b448d3634
make __RSC a builtin define for the RSC compiler
...
instead of randomly defining it in only some of .src files
Change-Id: Ifec3920740723d248400f451d717b5288c421b8d
Reviewed-on: https://gerrit.libreoffice.org/36832
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2017-04-25 10:04:53 +02:00
da64d198ec
tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
...
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com >
2017-04-25 09:31:31 +02:00