summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2017-05-21make string translation loading more uniformCaolán McNamara2-8/+8
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> (cherry picked from commit 2155e04d6343638ca9815d394cbc4f78c2b17c3a) drop toString Change-Id: I0f67c8931523bbe90bfbc8cc7d9a5bd523758ee5 (cherry picked from commit 8b1101023f01b2c7478a014b5ead73ada4fd4861) pNameResId is unused Change-Id: Ic1fe6abc7066517187695266c4d1a0888b41ffe7 (cherry picked from commit c2667d7ff558a1b7bf83e694909465f00d1a16f6) Reviewed-on: https://gerrit.libreoffice.org/37843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-18basic: Fix broken unit test for Join()Takeshi Abe1-17/+15
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-17basic: Fix broken test for VBA's LCaseTakeshi Abe1-16/+14
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-16loplugin:checkunusedparams variousNoel Grandin1-2/+2
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-16basic: Test VBA's CDec() only on WindowsTakeshi Abe2-2/+4
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-15Translate German comments and debug strings (leftovers in dirs a... to c...)Johnny_M5-7/+7
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-15remove some unnecessary lockingNoel Grandin1-4/+0
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-15basic: Fix broken logic in VBA's unit testsTakeshi Abe42-42/+42
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-15basic: Fix VBA constant vbNewLine with unit testTakeshi Abe3-1/+59
... 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-12loplugin:constantparamNoel Grandin2-5/+4
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-12remove unused uno::Reference varsNoel Grandin3-8/+2
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-12basic: Remove strange ifdef-guard for SHAREDTakeshi Abe4-34/+1
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-10basic: Compare strings in a case-insensitive mannerTakeshi Abe2-2/+2
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-10basic: Compare with keywords without creating temporary stringsTakeshi Abe1-5/+2
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-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
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-09make loplugin constantparam smarter about string paramsNoel Grandin6-12/+11
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-09remove unnecessary empty OUString fields and varsNoel Grandin3-6/+4
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-09loplugin:constantparamNoel Grandin3-4/+4
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-07revert OSL_ASSERT changesChris Sherlock4-31/+31
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert basic module away from OSL_ASSERT to assertChris Sherlock4-31/+31
Change-Id: Idfd05d410ad3d76c3699492d98e1284a21f5f7d6
2017-05-05Fix typosAndrea Gelmini1-1/+1
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-03VBA tests- MONTHNAME,NPER, NPV,OCT test caseZdeněk Crhonek5-0/+273
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-03More likely month pos firstEike Rathke1-1/+1
Change-Id: I0033c176071642f8df245307af79b8505644a004
2017-05-03Add two digit year test for CDateToIso()Eike Rathke1-0/+2
Change-Id: I69f067327504023a2f2439a73cdb1fc6a703aa39
2017-05-03CDateFromIso: accept YYMMDD two digit year for compatibilityEike Rathke1-7/+15
Some may even rely on that.. Change-Id: Icdaf9b2917aa0b1ca5e76c5220022c65fc654d86
2017-05-02Replace mouth-painted "inaccurate around leap year" rollover algorithmEike Rathke4-57/+59
... 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-02SbiRuntime::isVBAEnabled() needs to be guarded with #if HAVE_FEATURE_SCRIPTINGEike Rathke1-1/+5
Change-Id: I7fab0c946c13a9779fad05f88be6ae6a9da93775
2017-05-02BASIC: handle the full tools::Date range from -32768-01-01 to 32767-12-31Eike Rathke5-51/+95
* 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-02loplugin:checkunusedparams in basctl and basicNoel Grandin2-30/+28
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-04-29CDateToIso: larger buffer for possible year rangeEike Rathke1-1/+1
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-28loplugin:salunicodeliteral: basicStephan Bergmann3-4/+4
Change-Id: I479666b439f1d6324f07253d65181983b7c2c3ea
2017-04-28Use invalid parameter error for malformed input, tdf#106956 follow-upEike Rathke1-42/+46
... instead of invalid procedure call. Change-Id: I812f4c7041db9a116e65a24afb85164b4dd498b6
2017-04-28Add unit test for CDateFromIso with YYYY-MM-DD, tdf#106956Eike Rathke1-0/+3
Change-Id: Id7867228c091bb60764225a6436087dd390f13de
2017-04-28Resolves: tdf#106956 CDateFromIso accept also YYYY-MM-DD formEike Rathke1-14/+47
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-28loplugin:cppunitassertequals: basicStephan Bergmann1-1/+1
Change-Id: Icaa3e0eace6ccff365d4ebdb007771fc8a78671a
2017-04-27explicitly defining __RSC is no longer necessaryNoel Grandin1-2/+0
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-27tools: move errcode.hxx to the vcl moduleChris Sherlock19-20/+23
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-26use strong_int for LanguageTypeNoel Grandin1-1/+1
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-25vcl: change ErrorHandlerFlags to DialogMaskChris Sherlock2-10/+10
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-25errinf.hxx moved out of tools and into vcl moduleChris Sherlock3-3/+3
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-25make __RSC a builtin define for the RSC compilerNoel Grandin1-1/+1
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-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock6-0/+6
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-24BASIC: Call OUString() instead of OUString("");Arnaud Versini2-3/+3
Change-Id: Ie68d48a5dd0fd3593054e853f179db9a4be03b24 Reviewed-on: https://gerrit.libreoffice.org/36831 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-04-23BASIC: Make TokenLabelInfo a singleton, never modified and simplify it.Arnaud Versini2-31/+20
Change-Id: Ie233aebc39f5b181087a64d3cf2053ef4ecbab91 Reviewed-on: https://gerrit.libreoffice.org/36829 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21gbuild: Remove MSVC 2013 legacy codeDavid Ostrovsky3-3/+0
Uwinapi is discontinued. Change-Id: I063b4d0d8fab2d60de168e960a63b8181158ac01 Reviewed-on: https://gerrit.libreoffice.org/23198 Reviewed-by: David Ostrovsky <david@ostrovsky.org> Tested-by: David Ostrovsky <david@ostrovsky.org>
2017-04-21remove unnecessary explicit linefeeds from end of SAL and OSL log callsNoel Grandin2-5/+5
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf Reviewed-on: https://gerrit.libreoffice.org/36727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-20loplugin:unusedmethodsNoel Grandin1-1/+0
Change-Id: Ib7a9b1b0802ca751da258065e89b412b090bb672 Reviewed-on: https://gerrit.libreoffice.org/36718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-19clang-tidy readability-simplify-boolean-expr in accessibility..cuiNoel Grandin1-3/+1
Change-Id: Iae27da322c6ede592e6b268fb2210d3525ed22cc Reviewed-on: https://gerrit.libreoffice.org/36677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-19remove freshly unused menu support from src filesCaolán McNamara1-0/+1
Change-Id: I038711a0c4d440d452d5b2ae1bfcba5c9305815b Reviewed-on: https://gerrit.libreoffice.org/36646 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-18Fix parameter types of SbiRuntime::StepSTATIC_ImplStephan Bergmann2-2/+2
...which had been like that ever since 78d40bcdf3b724954f29da348952153ed53bfa2d "INTEGRATION: CWS npower10", for no apparent reason. Change-Id: I4803d20fd81c37b55e10e4ea4ff1c5355b937161