summaryrefslogtreecommitdiff
path: root/basic/qa
AgeCommit message (Collapse)Author
2020-07-21tdf#134576: basic_macros: Add unittestXisco Fauli
Change-Id: I6078e0712f7983159ea3b3f2060a1c4b69e9d5c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99114 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-06-30Upcoming improved loplugin:staticanonymous -> redundantstatic: basicStephan Bergmann
Change-Id: I1046ee1ea28e19afa51b0e20ee573105ced77535 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97522 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-16tdf#133913 - create variable with Variant/Type in StepLOADNCAndreas Heinisch
During the loading of numeric constants in StepLOADNC, create variables of type Variant and convert them to the requested type, i.e. Variant/Type in order to prevent type conversion errors, when they are passed to a method with variant parameter types. Change-Id: I2ab0111b5b53dd2de9523ba7cf12bd2519d050b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96402 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-06-11tdf#132563 - Convert parameters of type SbxEMPTYAndreas Heinisch
During the construction of the parameter list of a method, convert parameters of type SbxEMPTY to their requested type, since missing parameters are handled differently in StepEMPTY, where separate parameter information (SbxMISSING) is added. Change-Id: Ie1e027cfdd652404ec29bd3d05e7daf533468936 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96088 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2020-06-03loplugin:simplifypointertobool improveNoel Grandin
to look for the x.get() != null pattern, which can be simplified to x I'll do the x.get() == nullptr pattern in a separate patch, to reduce the chances of a mistake Change-Id: I45e0d178e75359857cdf50d712039cb526016555 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-02Upcoming loplugin:elidestringvar: basicStephan Bergmann
Change-Id: Ie723d07afcc6e0d5e52bec77617fec326a739415 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95374 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-21tdf#132389 - case-insensitive operation for non-ASCII charactersAndreas Heinisch
Support case-insensitive operation for non-ASCII characters in the Replace function in Basic. Change-Id: I48069ad7be1ae0f012c52f595cc44e6b50580b94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94580 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-02tdf#79426, tdf#125180 - Don't convert missing parameters to requested typeAndreas Heinisch
If a particular parameter type is requested during the construction of a parameter list, don't convert missing parameters to avoid implicit casting to the specified data type and value of the method. Missing parameters are handled in StepEMPTY, where additional information about missing parameters is added. Change-Id: Ia413b2996d7d1feecedc1dfefaf6baf0fd9d917e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90215 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-30Cleanup for tdf#130476, tdf#62323 and tdf#62326Andreas Heinisch
Change-Id: I21b934415a8fd39e0dfd6a4c3cc8d589c84084f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91222 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-27tdf#130476 - take into account trailing data type charactersAndreas Heinisch
For hex/octal literals take into account trailing suffix types from GetSuffixType in basic/source/comp/scanner.cxx. The suffix type $ (String) is not allowed for numeric values or hex/octal literals and leads to a syntax error (ERRCODE_BASIC_SYNTAX) during compile time. Change-Id: Id6c4bbf1296361879f7dec461a48bbdc5c683338 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90978 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-24VBA Err object raise method TestCasesLibreOfficiant
Err.Raise(#) enables 'User-Defined Exceptions' Std Basic alternative is: Error # 'without parentheses which throws pre-defined error codes. Change-Id: I76229b237066e33229d4d13e6742c660887fda2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-02tdf#36737 - Initialize default values of optionalsAndreas Heinisch
Initialize default values of optionals in function headers. In LO Basic, optional parameters are allowed, but without any default values. Missing parameters will not be initialized to their respective default values of its datatype, either. With option Compatible, optional parameters are allowed with default values. Missing optional parameters that don't have explicit default values will not be initialized to their default values of its datatype. With option VBASupport, optional parameters are allowed with default values. Missing optional parameters that don't have explicit default values will be initialized to their default values of its datatype. Change-Id: I57aabae5f70d1cf6c4e8feb95ce0db6af753383c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87550 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-22LibO Basic Property Get/SetLibreOfficiant
Change-Id: I1ef323560ffaacf9e44c8ba9332b825ffc38d59e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/83943 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-20tdf#130426 Support Basic Chr(&H8000), ..., Chr(&HFFFF) againStephan Bergmann
...after it had been broken by d5b7627a0e738c0866b819910153b96b611813f8 "tdf#62326 - Macros: Converting Hex strings of negative value". The corresponding help update is <https://gerrit.libreoffice.org/c/help/+/89100> "tdf#130426 Update documentation for Basic Chr and ChrW functions". Change-Id: I5f08b1ef907d840b491315a1f445f729b4999d0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89090 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-05tdf#129596 Distinguish between integer and long while loading immediate valuesU-DESKTOP-8OSNV7R\DrRobotto
During the generation of CONST_ expressions, distinguish between integer and long and load the correct value in the immediate load step. Change-Id: Ib4eb65d7fae3163043899ad8234816b1ebd7316b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85779 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-18sal_Char->char in avmedia..basicNoel Grandin
Change-Id: Ied1331d979539ef1183da64c55351b57d24f4a4f Reviewed-on: https://gerrit.libreoffice.org/85371 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-14VBA Enum statement TestCasesLibreOfficiant
Change-Id: Ib8f730d22bc7de00736c9fb1bb9c1af1784eb5df Reviewed-on: https://gerrit.libreoffice.org/85074 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-11Fix typoAndrea Gelmini
Change-Id: Ia35bd38c40ec65025ab4f43bea71745f15a548c8 Reviewed-on: https://gerrit.libreoffice.org/84915 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-09SbxArray: drop 16-bit indicesMike Kaganski
Change-Id: I43b478187636b9bb53fdf7ab938436ae364bd7a7 Reviewed-on: https://gerrit.libreoffice.org/84733 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-08Fix typo in namefileAndrea Gelmini
Change-Id: I03dd69ae32b2d619300cdfac3581bebc142437be Reviewed-on: https://gerrit.libreoffice.org/84708 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-12-07tdf#59327: two arguments with the same name is an errorMike Kaganski
Change-Id: I8d10487d6d6729de749a373feb0a8a349f2986e9 Reviewed-on: https://gerrit.libreoffice.org/84686 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-07tdf#59327: DIM should fail in procedures when same-name argument is presentMike Kaganski
Change-Id: I0a6828bd0b0c27018dc02c36ee207b8666f88ec0 Reviewed-on: https://gerrit.libreoffice.org/84682 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-28tdf#97983 - Added localization for numeric typesAndreas Heinisch
For numeric types, take into consideration different locales Change-Id: I815c195e7ef53a7b958f85932415a16c9a8a1e35 Reviewed-on: https://gerrit.libreoffice.org/83683 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-23Property Get/Let Basic StatementLibreOfficiant
My very first Basic TestCase: Assistance/mentoring is welcome Change-Id: I6399fdb603051792d698695fe659e5a12a0c8396 Reviewed-on: https://gerrit.libreoffice.org/83553 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2019-11-13fix windows builds after commit 7ddedd2594ddcaeed21f46709fdb44601ff641bflbenes
Change-Id: I2990da77a91f6c8fdb6fd9e4112d0451bc3342da Reviewed-on: https://gerrit.libreoffice.org/82547 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-12tdf#42949 Fix IWYU warnings in basic/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I325149be2ea7697b5b4a2ce4a662edd2f8be6e50 Reviewed-on: https://gerrit.libreoffice.org/82312 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27tdf#62326 - Macros: Converting Hex strings of negative valueAndreas Heinisch
If the value of the hex string lies within the range of 0x8000 (SbxMAXINT + 1) and 0xFFFF (SbxMAXUINT) inclusive, cast the value to 16 bit in order to get signed integers, e.g., SbxMININT through SbxMAXINT. Moved unit test to test_scanner.cxx in order to test basic hex convertations. Removed old vba unit tests. Change-Id: I247b41c40197afc5328ef5685c758c1dd1cefae5 Reviewed-on: https://gerrit.libreoffice.org/79583 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-18Removed executable permission on filesAndrea Gelmini
Change-Id: Iea2a937559ac8393c0fb5bf9482115ba162c2a6c Reviewed-on: https://gerrit.libreoffice.org/79079 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-17tdf#118544 set correct type for optional parameterTomoyuki Kubota
Change-Id: Id8840431b9dc1f1e97882c675ebfc6456e33d953 Reviewed-on: https://gerrit.libreoffice.org/77684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-03loplugin:constmethod in basicNoel Grandin
Change-Id: Ib2056ab8437e163c7ae42e3ab7a4a3f8b6cb80a2 Reviewed-on: https://gerrit.libreoffice.org/78547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-31Fix typos in codeAndrea Gelmini
"modifiedTimout" doesn't exist Change-Id: If0576c2f286124f8afa39cd70ab563cee1919237 Reviewed-on: https://gerrit.libreoffice.org/78265 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-11Use hasElements to check Sequence emptiness in accessibility..canvasArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I24c3f04b4eed3c1cd973166885660f113a26844f Reviewed-on: https://gerrit.libreoffice.org/71805 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-03tdf#68339 Other: BASIC Syntax errorJens Carl
Allow expressions (operands) of comparison operators prefixed with the Logical Operator "Not". Change-Id: I1b070e2288dac26b1f1186d38cf5d2f4ad99a406 Reviewed-on: https://gerrit.libreoffice.org/71332 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-03-01Some more WIN32 -> _WIN32Stephan Bergmann
...at least some of which have presumably been missing from ce43d0ae9279edbf1ad108fe0d8325327a038d49 "use consistent #define checks for the Windows platform" by accident (and some just clean up comments) Change-Id: I5532685c7df96ae3c8a25b73d8064d7433964a9b Reviewed-on: https://gerrit.libreoffice.org/68580 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-03add test for bug tdf#121337Zdeněk Crhonek
Change-Id: I26d1d426e6a856b09a48efe8e411b8c54e0f35cf Reviewed-on: https://gerrit.libreoffice.org/64275 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2018-11-13Add reference to test codeStephan Bergmann
...that had inadvertently been missing from the file's inital commit, a6a48eeef16e473be14642469cd922f177f54998 "tdf#121325: Replace all of given length, even if replacement is shorter" Change-Id: I2a09e1d1ee94480d5615106a4e28958218d9b4c7 Reviewed-on: https://gerrit.libreoffice.org/63334 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-13tdf#121325: Replace all of given length, even if replacement is shorterStephan Bergmann
Both LO and MS Basic restrict the amount of replacement text ("If the Length parameter in the <emph>Mid statement</emph> is less than the length of the text that you want to replace, the text is reduced to the specified length." in helpcontent2/source/text/sbasic/shared/03120306.xhp, resp. "The number of characters replaced is always less than or equal to the number of characters in Target." at <https://docs.microsoft.com/en-us/dotnet/visual-basic/ language-reference/statements/mid-statement>). But cc20344010e94eda22fee662aab966d395a0796a "tdf#111313: Honor bWriteNoLenParam in !bCompatibility, too" had introduced a regression (in the non--compatibility- mode case), restricting the amount of replaced text to be no more than the amount of replacement text, even if the given length argument was larger. (Which had already regressed in the past, see <https://bugs.documentfoundation.org/show_bug.cgi?id=62090> "Mid statement doesn't work as expected".) Added test cases now. Change-Id: I21d4409f49a2437eb0e1a1e200561d803c42a24c Reviewed-on: https://gerrit.libreoffice.org/63328 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-09-05loplugin:simplifyconstruct in accessibility..bridgesNoel Grandin
Change-Id: I08f6a64b50f03d1b08027a2ac9e51442255d64bc Reviewed-on: https://gerrit.libreoffice.org/59976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02Small cleanup and simplificationMike Kaganski
Change-Id: I1e8a750832f365f080f6f60c81560dc942003049 Reviewed-on: https://gerrit.libreoffice.org/56788 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-30Small cleanupMike Kaganski
Change-Id: I0d3cea810b9148859d1c0704e06381f22d7b24c9 Reviewed-on: https://gerrit.libreoffice.org/56762 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-29tdf#118218: Implement FormatNumber VBA functionMike Kaganski
The existing unit test (previously non-functional because of defunct success condition) is fixed and extended. Change-Id: I2544f865144b25f51a5f0941e5d961f246f41c4b Reviewed-on: https://gerrit.libreoffice.org/56610 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-29tdf#118442: Fix incorrect index calculationMike Kaganski
If a number string has leading spaces and/or minus, then calculating index into the aBuf as the difference between p and pStart gives wrong (too big) number. This asserts in debug builds, when e.g. an assignment is made in a BASIC macro: Dim f As Double f = " -12.20" "include/rtl/ustrbuf.hxx:490: sal_Unicode &rtl::OUStringBuffer::operator[](sal_Int32): Assertion `index >= 0 && index < pData->length' failed." This affects, e.g., https://gerrit.libreoffice.org/56610 (see https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/9527/consoleFull#1820989527d893063f-7f3d-4b7e-b56f-4e0f225817cd) Change-Id: I14654166be721907e2a26ea6f4091f203a9437d7 Reviewed-on: https://gerrit.libreoffice.org/56611 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2018-05-04Removed executable permission on data filesAndrea Gelmini
chmod -x for .patch, .pptm, and .vb Change-Id: I98e1221e48df22e8b58aaf305898cbe301f187ce Reviewed-on: https://gerrit.libreoffice.org/52568 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-02-24Use for range loops in basegfx and basicJulien Nabet
Change-Id: I5b2086c245695aeb30630150b3c5ccf61fbd6a56 Reviewed-on: https://gerrit.libreoffice.org/50280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-19new loplugin:emptyifNoel Grandin
Change-Id: I1092115a0ceb3a5e6680a4b724b129f98a892c42 Reviewed-on: https://gerrit.libreoffice.org/48128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: basicStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I20b38196ee1b6a34384dc46d9de1b6e1b44947ae
2017-12-23VBA tests (4) - don't pass when all tests failZdeněk Crhonek
Change-Id: Ib4f9b5df1cffe104ba27be95183d075f24f28bb3 Reviewed-on: https://gerrit.libreoffice.org/45774 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-22VB tests (3)-don't pass whe all tests failZdeněk Crhonek
Change-Id: I7dd99a43a3d41c8ca31a070028a19bd032d06435 Reviewed-on: https://gerrit.libreoffice.org/45739 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>