summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2021-11-09rtl::Static to thread-safe staticNoel Grandin
Change-Id: I35e2a252708228bdbeaee557ef35763c64608653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-07forward decls go after #includeNoel Grandin
Change-Id: I54c33508639044092356eed5144720261b4f65db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-03loplugin:constparamsNoel Grandin
Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30tdf#145371 - Delete array variable only before ReDimAndreas Heinisch
Otherwise, global array variables don't maintain their state. Change-Id: I10dafd9e2946630c5476c9858f765d67ef2f6d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124368 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-29Prepare for removal of non-const operator[] from Sequence in basicMike Kaganski
Change-Id: If048bc301c38ac5ac5412a7d8f69231705088a50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124343 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-27tdf#57308 - Basic IDE: Watching of a variable does not workAndreas Heinisch
Watching a variable which returns a value from a function always shows "out of scope" in the watch window of the Basic IDE. In order to resolve this issue, the name of the variable being watched will be searched also in the current method instance. Change-Id: I5ff6ce22067e11d74275eeb82da814da1eebe3db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124239 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-26Revert "tdf#57308 - Basic IDE: Watching of a variable does not work"Andreas Heinisch
This reverts commit f9ce4b2d04b58843d7986acd9382864b0b30d617. Reason for revert: Cast to SbxVsriable instead of SbxMethod causes the code to start over Change-Id: I8f00f8f13faef8cb8c6db4e8c2a096a921f8714b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124187 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-25tdf#57308 - Basic IDE: Watching of a variable does not workAndreas Heinisch
Watching a variable which returns a value from a function always shows "out of scope" in the watch window of the Basic IDE. In order to resolve this issue, the name of the variable being watched will be searched also in the current method instance. Change-Id: Id383e03925956056931d199fe86d1b352cf8e4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124075 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-20tdf#125637 - Correctly hand names ending with an underscoreAndreas Heinisch
If a name is ending with an underscore at the end of the line, it won't be recognized correctly and it will be wrongly interpreted as the respective name without the underscore at the end. Instead of changing the macro source, use a flag in order to correclty identify the line end. Change-Id: I6f933d7382b510bffed3e2692d32c232b7084624 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123833 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-20loplugin:indentation check for indent inside blockNoel Grandin
look for places where the statements inside a block are not indented Change-Id: I0cbfa7e0b6fb194b2aff6fa7e070fb907d70ca2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-19Fix Windows buildStephan Bergmann
...after cf3971a9414f52b116c1c21f267128ffa67f171b "Simplify Sequence in b*" Change-Id: If8650faa7a45258729e54b3df37e9084221babfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123792 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-17basic: simplifiy class initializationArnaud Versini
Change-Id: I87fa2f606011aab8e34d9445d9e9299786f05747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123324 Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2021-10-17Simplify Sequence in b*Julien Nabet
Change-Id: I0817d9a35a9c3fc43badb6cc60727de69849b063 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123720 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-12tdf#130307 - Support for each loop for objects exposing XIndexAccessAndreas Heinisch
Change-Id: Ib94c642e6d2a52ac7c60a8f7ae3c79d611b41614 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123072 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-07tdf#144924 - Change return type of array elements of the split functionAndreas Heinisch
If VBA is not enabled, allow the assignment of variables with different data types to the individual array elements created by the split function. Change-Id: I7bdd432cdebbfded5f7fb3acc0216474eb6b6821 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123122 Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-01loplugin:constmethodNoel Grandin
Change-Id: I3ed657c5c5e6840e38e3c8505505b4b372125df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122910 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30tdf#143575, tdf#143974 - Remove custom precision format in BASICAndreas Heinisch
Change-Id: Iefe046fa223f85204b27ebabe81523aa1a97f92f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122856 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-30tdf#143575, tdf#143974 - Use rtl::math::doubleToUString to convert numbers ↵Andreas Heinisch
to strings Change-Id: I1427dbd49af680a1bf386410977c9cb2b0a3961e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122831 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-27tdf#131563 - Add vba color constantsAndreas Heinisch
Change-Id: I59bcd11b5da1450fced77671c2cf6ed44e299a06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122607 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-22Fix typosAndrea Gelmini
Change-Id: Icd2f83bddcb993a6430d328d0bc51f38d70374ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122412 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-09-19tdf#123144 - Always translate an error number to a vba error messageAndreas Heinisch
In addition, create a meaningful error message and don't create and artificial error message if there exists a custom one. Change-Id: I682e497ee3fdfe4da80fb17ab41c1b4cf90eb2cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122206 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-18cid#1486004 silence Uncaught exceptionCaolán McNamara
Change-Id: Id545530140c0f2ceeeaecfb0c03c94f296bdbb4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122297 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-15loplugin:finalclasses in basicNoel Grandin
Change-Id: I3ec4ccb58dc3823eee8b6ab8bda31b128ee24569 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122146 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-14tdf#42982: improve UNO API error reporting4k5h1t
Change-Id: I1252c89f23e70eb88744585bb2abd4fe3794e1d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121918 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-09-10Fix typosAndrea Gelmini
Change-Id: Icb9acdf67be84e3bedab53188246890b6aa82a7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120286 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-10tdf#144353 - Handling of missing optional parametersAndreas Heinisch
Don't assign a missing optional variable to a property and don't allow the computation/comparision including missing optional attributes. In the previous cases a ERRCODE_BASIC_NOT_OPTIONAL is raised. Change-Id: Iab391286fcace16c271ae511304075e2a0c5c651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121794 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-08simplify static_cast after dynamic_castNoel Grandin
Change-Id: I53ae7f18519fdd878730d1d0316ebc408271c66d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-07Fixed typos in the description of the default case for optionalsAndreas Heinisch
Change-Id: Ib80faf454fe4ef22b3ebb0b633769d4479cd84a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121793 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07Fixed a copy paste error in the test casesAndreas Heinisch
Change-Id: Ib11b6cfe385542664b28de35897caee67099d22c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121792 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07tdf#144245 - Added test file to automatic testAndreas Heinisch
Change-Id: I92b71b7e7ac8c2262d36875e4b04ed91e17bc495 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121791 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07tdf#144245 - Case-insensitive operation for non-ASCII charactersAndreas Heinisch
Support case-insensitive operation for non-ASCII characters in the Collection object (VBA). Change-Id: Ie17560cb9aac5bfb32aa041744445dd4839681d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121534 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-06clang-tidy:clang-analyzer-optin.performance.PaddingNoel Grandin
noting that XMLTokenEnum was already being treated as being limited to 32-bits, we bitmask it together with namespaces Change-Id: Ic48f2a662452d1b8e022078d31a723d2ac65aef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-29basic : remove BasicManagerImplArnaud Versini
Change-Id: Ia2b2c5fdf7d61e0853f181a38840c5ae263f5c9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-27clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: Ibeff6e5cbc20ab86b1e9cb96292acb340849ede3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121149 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-26Avoid OUString::createFromAscii on input containing NUL charactersStephan Bergmann
...as it triggers the "rtl_uString_newFromLiteral - Found embedded \0 character" SAL_WARN in rtl::str::newFromLiteral (called from OUString::createFromAscii via rtl_uString_newFromLiteral) Change-Id: I6013062b961657561d67d8dbbf5b2a45816eed4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121086 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-20New loplugin:unusedcapturedefaultStephan Bergmann
In sc/qa/unit/ucalc_formula.cxx, dropping the capture-default from the lExpectedinF lambda revealed that MSVC in C++17 mode (i.e., when building without --with-latest-c++) requires ROW_RANGE (a local const int variable from the enclosing TestFormula::testTdf97369) to be captured, even though all uses of that variable within the lambda body are constant expressions. That is still true at least for the latest Visual Studio 2019 version 16.11.1. (This is not an issue for the lExpectedinH and lExpectedinI lambdas a few lines further down, as they, in addition to using that ROW_RANGE, also use the local const double variables SHIFT1 and SHIFT2, whose uses are not constant expressions, so they are implicitly captured and loplugin:unusedcapturedefault does not suggest dropping those lambdas' capture-defaults in the first place.) Change-Id: Iee7efb485187cbe8eba6a2d470afca4993eb1816 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120693 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-17rtl::Static -> thread-safe static localNoel Grandin
Change-Id: I9f8fe250813f4f376dc46c6f3d7e25e90fdbb50e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120566 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-11There is no LANGUAGE_ENGLISH {en} locale but LANGUAGE_ENGLISH_US {en-US}Eike Rathke
The known fallback locale is en-US so this worked by chance.. Change-Id: I81ee2aff0cc35b4c8d501dfb6846f0709f1417ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120301 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-08-10No need in this functionMike Kaganski
Change-Id: I391183753e4fad800b7c69aef2e76a3780ce52a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120244 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-10Use nStringSize instead of nStringOffMike Kaganski
nStringSize is the actual size of the string block, and is the correct end position to use to calculate last string length. nStringOff is not updated during load, so using it makes no sense here. It was this way ever since 039dbbcb9688971a85b1791f60a55693ff3ba261. Change-Id: I4fad1bdd6ed4af9dd7d29b5438ec23db0b815806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120243 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-10tdf#143707 - Change strategy to support suffix type charactersAndreas Heinisch
In order to support the correct data type of numeric constants, booleans, and default values for strings, the strategy to transport the data type character to the runtime has been changed. The type character will be added after the literal and the string termination symbol in order to keep compatibility. This allows to retrieve the correct type in StepLOADNC and in StepPARAM. Any legacy written images are still possible to process, since if there is a suffix type character where the data type character was directly written after the numeric constant, it will be processed in StepLOADNC. Without this fix, an optional parameter of type Variant, would still include the suffixe type character, and will not be converted to the correct type in StepPARAM. Change-Id: I86c8192c6dc28457053fa7b23a073420e45407b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119945 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-08-06Move variable definition to usage siteMike Kaganski
Change-Id: I3d95551cb72b867e19a1a2bf75c73d1c3422a984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120132 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-06make --disable-scripting compileCaolán McNamara
Change-Id: Ie2be232e062389b74408dd9f001b1cf4db7db7d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120123 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-06drop intermediate vcl::Window from Application::GetDefDialogParentCaolán McNamara
Change-Id: I96be984cbefeb8e45bf49de4c50a225a46fbefb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120089 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>