summaryrefslogtreecommitdiff
path: root/basic/source/runtime
AgeCommit message (Collapse)Author
2023-08-09tdf#147132 Flatten Basic function implementationssahil
Change-Id: I0ba6e7c1e128f3216eb3b77246c659a728df1324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155011 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-03-23rtl::Static to thread-safe-staticNoel Grandin
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-22tdf#147132: Simplify usage of StarBASIC::Error()adityasingh22
Change-Id: Iedb499fa58798d40e7193c80c31dc9337a3a356b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148519 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-03-22Refactor and fix VBA StrConvMike Kaganski
This properly handles null bytes that are expected when converting between byte strings and Unicode. It properly handles TransliterationFlags, which are not a bitset. In vbProperCase, it uses the correct method to lowercase the string, working not only with ASCII. Change-Id: I04e8cdca66ef9863a6516b15205a2a543ed97680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149224 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-17tdf#152690: Refactor fixBaole Fang
Change-Id: I170eba4968743afbab3cc6aa943706612b3e1a57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149035 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-16tdf#152690: Fix "!" behavior when it is not the first in a groupBaole Fang
Fix "!" behavior when it is not the first in a group. Add testcases for "!" and Like. Change-Id: Ia76fa26722b6546d08dd8842d83f55bb0c0ea5ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148720 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-14elide some temporary OStringsNoel Grandin
where we can pass a string_view into OStringToOUString Change-Id: If7803ba49aa15f6e9c7bd386d32fb84003155390 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-07no need to allocate these separatelyNoel Grandin
they are all one or two words in size Change-Id: I86611e14a32dda3ae2226bbfa775ad0234513888 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148425 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-03lok: macro: VBA message dialogs was causing assertion failureMarco Cecchetti
Get VBA MsgBox and VBA Runtime Script Error dialogs to be displayed correctly without causing an assertion failure. Provided a solution that allows VBA MsgBox to be executed in a not-async way so that the VBA script is paused until the message box is closed. Change-Id: Ica7d0d343a0ea4b6a163c1c43572f18a5779a0ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147243 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147321 Tested-by: Jenkins
2023-03-02flatten some classes in basicNoel Grandin
no need to allocate separately where the contained class is only one pointer big Change-Id: If5fac0b0e20f80bffebc8611791d07888cbec1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-26tdf#141474 tdf#151901 BASIC functions argument names do not match that of VBAAlain Romedenne
Basic function argument names can be used either by position either by name, keyword arguments ae called 'named arguments' in VBA - VBA doc: https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/understanding-named-arguments-and-optional-arguments - libO Basic function signatures: https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03090401.html?DbPAR=BASIC#bm_id3154422 This patch attempts to correct - all in one - malformed keyword names in BASIC function signatures. It reflects keyword arguments usage inside QA BASIC unit tests. In the end Online help pages may incorporate such practice. Change-Id: Iab0c92b2c152d2564662e51e68f1f736b8deefd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145720 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-02-21tdf#153752: SbxObject::Execute: extra characters in Option Compatible modeMike Kaganski
Change-Id: Ib3e4bd9eb9a249123a686f2434ded7b529fb050f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147345 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-19tdf#153724: make sure to retrieve the variable value before checking the typeMike Kaganski
Commit 5760c94b8847164f9a7a181f031c7c86643944af tried to avoid all cases which could set an error in SbiRuntime::PushForEach. To do that, it checked the type of xObjVar before trying to get an object from it, which otherwise could set an error. But the type of the contained value can be not known until it is retrieved (which can happen inside SbxValue::Get in a call to SbxValue::Broadcast with SfxHintId::BasicDataWanted). This happens e.g. when the container passed to 'for each' is a call to some special function, like VBA's 'Selection'. Then SbxValue::GetFullType would return SbxEMPTY prior to SbxValue::Get. Let's make sure to call SbxValue::Get first (asking for a Variant, to avoid errors on type mismatch), and only then, check the actual result data type. Change-Id: Iaa697f38285505e50504ae09f9307fbd29e09a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147273 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-27tdf#153235: Optimize Application::Reschedule calls in SbiRuntime::StepMike Kaganski
Setup the "last reschedule time" counter at the first pass, to avoid useless immediate reschedule. Update the counter when running "when blocked" reschedules. This seems to avoid the problem with the bugdoc. Change-Id: Ib5958a1a2b048f5ec654c69ee9e977e8a26de6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146215 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-26Simplify SbiRuntime ctorMike Kaganski
Change-Id: I18309ed4ed8ebb31b3bf9ffc676a2d501e2593b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146214 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-20tdf#147132 Flatten Basic function implementationsRadhey Parekh
Change-Id: Icd7610a3b7415838f632579deb2cd2cc505b44a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139001 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-01-07Resolves: tdf#152917 Add ConvertFromUrl() put result back, tdf#147132 follow-upEike Rathke
Regression from commit 6b3e66cd7a355061bf1dec76bbc4f389b6b60f2d CommitDate: Mon Sep 5 16:04:25 2022 +0200 tdf147132 basic : flaten some functions Change-Id: I20e6b00ed613b98a5e58623a010d894b1bcb4c6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145172 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-12-25Simplify a bitMike Kaganski
Change-Id: I2c4df04cc7c57649077f61bfd0bc9fb0e9b42a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144795 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-18basic: correct reference to method that doesn't exist.Michael Meeks
Apparently not there in basic from prior to its open-sourcing. Change-Id: I9b2da35abfc9971ee380c68f33e239fe63b381c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141483 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-10-14tdf#151503 - Do not evaluate a missing optional variable to a booleanAndreas Heinisch
Change-Id: I671f857344f91de63612eabcbbdb2cab9b94cc0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141296 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-09-25tdf#151012 - Initialize optional parameters with their default valuesAndreas Heinisch
Change-Id: I3ed3eb904b50892e5946abe684e801819ba296e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140128 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-09-15This comment is obsoleteMike Kaganski
A leftover from commit f6e0527033be682dbf6b60bd9b060fdd853ffe33 Date Mon Mar 21 12:55:40 2011 +0100 Remove most of dead code inlibs-core (basic) which dropped the related commented out code for "not implemented" stub, being there since c25ec0608a167bcf1d891043f02273761c351701 "initial import". Change-Id: Ic09a0c63921f1c5daa277fe7bb6dfc194895b673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139978 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-14move ErrCode to comphelper and improve debug output stringNoel Grandin
need to move it, because modules "below" vcl want to use the debug output method Change-Id: Ibcaf4089a1e0b3fcc0b5189c7ebf1aae90f50b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-05tdf147132 basic : flaten some functionsArnaud VERSINI
Change-Id: I462cbac4183f304e9f4b296a6361a05a4615c7eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-05BASIC : missing parameter check in SbRtl_CreateObjectArnaud VERSINI
Change-Id: I44e8c17274e20eb080494b2eaf25f74d33a35b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137394 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-20move wintypes.hxx from tools to vclChris Sherlock
Change-Id: Ief9949fd4252de9e33df172af07aa7ed097b5520 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136560 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-13tdf#147132 Flatten a Basic functionRoman Kuznetsov
Change-Id: I85eef5ca499197cfd96fecc4d05a82f7d11089cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136856 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-24tdf#147529 - BASIC MsgBox: Check for missing optional parametersAndreas Heinisch
Change-Id: Iecb47e0005c609ee1117d6fb141e810c0166806a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136339 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-06-21elide some makeStringAndClear() callsNoel Grandin
Change-Id: Ie8c04a8c414f32cc0e68fbab1d24a9707f179011 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-03tdf#147132 Flatten Basic functionRoman Kuznetsov
Change-Id: I1e445a565dc9c45810e85b045e68db08a56207f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135271 Tested-by: Jenkins Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
2022-06-03tdf#147132 Flatten Basic functionRoman Kuznetsov
Change-Id: Ib2646bfbebdfb6d8e8a3cd1355db75b0405ccfe6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135268 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-01Use more appropriate type for SbiImage::GetString nId paramStephan Bergmann
Change-Id: I4207830e3923ce9b4f7c0f59cf5880dfcf89979b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135243 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-31clang-tidy modernize-pass-by-value in basicNoel Grandin
Change-Id: I9034ab95a4ccb58e36e77d911dd33cc50857c03a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135176 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-30tdf#147132 Flatten Basic function implementationRoman Kuznetsov
Change-Id: Ife73d08e57bb1c896a27f8cbbd6b1f4b106587a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135062 Tested-by: Jenkins Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
2022-05-10fix --disable-scripting buildCaolán McNamara
Change-Id: I41e0da3d379d54ec59f9eba46978cfe7f9e09d33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134105 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-10More usual 1899-12-30 base Date in BasicMike Kaganski
Omissions from commit 8189d815641c583b5506d482f0b4f1ab47924f6a Change-Id: I6b205f7bcc9ff9c30e55b03d39d02b9be15a01c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134064 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-09Unify and simplify SbRtl_Hex and SbRtl_OctMike Kaganski
OUStringNumber::toAsciiUpperCase is cheaper than OUString::toAsciiUpperCase. Let SbRtl_Oct use OUString::number as well. Change-Id: I3a97ec5d3a7b0005fc300310198bae47c62dfbc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134061 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-09Use usual 1899-12-30 base Date in BasicMike Kaganski
It matches VBA, has an optimization in the code, and doesn't need any additional "-2" hackery. Change-Id: I4b90674ae643788eda5ce618b4c42e2cc045ec04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134060 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-09sal_Int32 cast to tools::Long to pass to a function taking sal_Int32Mike Kaganski
Change-Id: I81bb794e6a154dd3d022b34ce1348f32c854f52b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134059 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-05Just use Any ctor instead of makeAny in basicStephan Bergmann
Change-Id: I21d9679064c4e68a1492d3550f083c3c91b5b43b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133848 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-21tdf#148651: implement VBA.FormatPercentJulien Nabet
I started from a copy/paste of FormatNumber. Then I deduplicated the code (it saved about 99% of it). Change-Id: Ibcb9ffbf8cebf45d5ffac4713e3d220b8499ba11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133133 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-15loplugin:stringviewparamStephan Bergmann
Change-Id: Id3bd8576b134728140dc68b00eebf78a8f3fd4ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133056 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08Fix buildMike Kaganski
... after commit 36e0e88b28e818faf25b8e32cc8c4dc444b8a0be Change-Id: I540d19f7146651035cd5fafe077c0ccdfcee11ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132733 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-08use more subView when converting to Int32Noel Grandin
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-03tdf#147132 Flatten Basic function implementationsofftkp
Change-Id: I21b0ec23de99aaf9b4398d59a5cc56d7d386ad58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132444 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>