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
f060adefba
Test _WIN32 instead of WIN32
...
since the former is predefined by Visual C++ [0], but the latter
is not.
[0] https://msdn.microsoft.com/en-us/library/b0084kay.aspx
Change-Id: I9ecb84779cbaf5f0186ef0b05da61b32293f8f2b
Reviewed-on: https://gerrit.libreoffice.org/37808
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Michael Stahl <mstahl@redhat.com >
2017-05-22 22:00:47 +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
2acc4dc6a9
basic: Fix broken unit test for IsMissing()
...
Change-Id: Ia6fb2622c85686a50701d4c37356e608a3df653b
Reviewed-on: https://gerrit.libreoffice.org/37775
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-19 10:32:36 +02:00
9fb691adb4
basic: Fix broken unit test for Join()
...
Change-Id: Ib9768097d73fe664e24da4c3989141e87342a34e
Reviewed-on: https://gerrit.libreoffice.org/37711
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-18 12:13:34 +02:00
6c2a10e1d0
basic: Fix broken test for VBA's LCase
...
Change-Id: Icdbe62d4faa04b59a5cc11ea8f72f5e88f664a6d
Reviewed-on: https://gerrit.libreoffice.org/37682
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Julien Nabet <serval2412@yahoo.fr >
2017-05-17 10:30:19 +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
666901bc82
basic: Test VBA's CDec() only on Windows
...
since it is not implemented on others.
Change-Id: If058207eb441caa65f93bbb554fe77cf469b1682
Reviewed-on: https://gerrit.libreoffice.org/37631
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-16 05:19:17 +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
b9d75dea30
basic: Fix broken logic in VBA's unit tests
...
It should not be "OK" when no assertion passes.
Change-Id: Ib6bab2d597a138468e96b4acf8c3be7abd112cca
Reviewed-on: https://gerrit.libreoffice.org/37540
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp >
2017-05-15 04:59:04 +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
3cb581adde
VBA tests- MONTHNAME,NPER, NPV,OCT test case
...
Change-Id: Ia6c732d4c205ba2461007feacce1403b83e6043b
Reviewed-on: https://gerrit.libreoffice.org/37109
Tested-by: Jenkins <ci@libreoffice.org >
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com >
2017-05-03 20:14:27 +02:00
cc0ea8bb25
More likely month pos first
...
Change-Id: I0033c176071642f8df245307af79b8505644a004
2017-05-03 16:37:50 +02:00
c52f2780b5
Add two digit year test for CDateToIso()
...
Change-Id: I69f067327504023a2f2439a73cdb1fc6a703aa39
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
af754ef9d6
Add unit test for CDateFromIso with YYYY-MM-DD, tdf#106956
...
Change-Id: Id7867228c091bb60764225a6436087dd390f13de
2017-04-28 15:46:33 +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
38f70cd770
loplugin:cppunitassertequals: basic
...
Change-Id: Icaa3e0eace6ccff365d4ebdb007771fc8a78671a
2017-04-28 14:21:30 +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