summaryrefslogtreecommitdiff
path: root/basic/source
AgeCommit message (Collapse)Author
2022-02-22tdf#147132: Flatten Basic function implementationsRamreiso Kashung
Some SbRtl_* functions have been flattened at basic/source/runtime/methods.cxx Change-Id: Id56485ddfaa972133c9b199d22b141d93df475f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130206 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-02-21tdf#147089 - Round Integral Division (IDIV) literals to Integer valuesAndreas Heinisch
Change-Id: Ia243c6117a437d0c6efb33a4e76c5e9ee539fbdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130302 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-11tdf#147364: fix function signature to account to calling conventionMike Kaganski
First, the integer function result is returned in a 64-bit register (RAX), and truncation it to sal_Int32 breaks any pointer return value. Second, using explicit (not vararg) first function double argument would pass it through XMM0, without also copying it to RCX (which is guaranteed for varargs). Ref: https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention Change-Id: I08212c44d8690d6910068b13c16af2ce899c94f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129808 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-09tdf#147262: CallByName() argument names does not match that of VBAJulien Nabet
Change-Id: I3029b98abbe3b8facf01f0e50a7efdff545c2141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129646 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-09tdf#146672 - CDbl: skip spaces and tabs at the end of the scanned stringAndreas Heinisch
Change-Id: Ib7a4e8c7145b549a5327de23549d39d11f8590cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129648 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroVaibhavMalik4187
Change-Id: I4f5258ca5b37e9b1b4237c5d29e4a9e5362fa855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129116 Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-02-06We know the length hereMike Kaganski
Change-Id: I630b7fbda7c9ebf578e74260a0d67eea32e9e429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129549 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-03tdf#146742 - Move the initialization code of a method to SbMethod::CallAndreas Heinisch
Change-Id: I516bacdcd22ed094a0e9b6e125e941f32fe88c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129238 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-03Use default argumentMike Kaganski
Change-Id: I44e9c2e5de2c041f2839b14a057e1b88fd6ea01f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129337 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-02SbRtl_Spc is exactly the same as SbRtl_SpaceMike Kaganski
Change-Id: I0ccbffef348fc23ef5ca090ec2112abfe333e8e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129332 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-02Use OUStringBuffer in SbRtl_FormatNumberMike Kaganski
Change-Id: Ie3e187b7dd1329f8fae04042fa6375c4bde3fa57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129331 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-30tdf#132388: reimplement fix for tdf#142487Mike Kaganski
Each call to css::i18n::XTextSearch::SearchForward transliterates input string, making performance of repeated calls unacceptable. So prepare the transliterated strings once, and use the offset sequence to map search results to indices into original string. Change-Id: Ie08dd5a408aca9a950067db285a480b41a3f9a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129162 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-28tdf#145614: Convert #define to enumRamreiso Kashung
Change-Id: I1e89d233797461dc363bcd5021cc5347598ffff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128001 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-01-25tdf#90341 Clean Up Excessive const_cast'ingVaibhavMalik4187
Change-Id: Ib4cab4a4e476b469378b0b86d0819d4642f38893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128907 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-22Related tdf#146909: add missing IDIGNORE in BasicJulien Nabet
Change-Id: Idbbceb2f5375d47c942bab70ce81f7be79b17478 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128780 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-01-14make comphelper::OInterfaceContainerHelper4 more threadsafeNoel Grandin
(*) make all the methods that require an external mutex take a std::unique_lock as a parameter, so that call sites cannot forget (*) make the forEach method drop the lock when firing listener methods, to reduce the odds of deadlock Change-Id: I0a80e3b3d1c1c03b7de4a658d31fcc2847690903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-13Recheck modules [a-c]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I74a3c3a67c3639376e2251c3eb917fa4139dfbd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127808 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-08tdf#145693 - Argument name should be 'charcode' instead of 'string'Andreas Heinisch
In addition, changed argument datatype from Int to Long. Change-Id: I702e09b6b8061d7cf00dd403e4681a0ab348d4c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128100 Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-12-28tdf#145960 - Return type of boolean operators should be of type booleanAndreas Heinisch
In addition, added missing vba test to the test routine. Change-Id: I3ee837e1eab30f10e0a4169d11014f9b6574ad1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127631 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-12-27tdf#144353, tdf#146281 - Correctly copy the information about variablesAndreas Heinisch
During the assignment of a variable, copy its information only if there isn't already one present. Change-Id: I29fcfcd10406f2af0708a879d57e0a3c704f179e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127387 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-12-23Nullify passed pointer in releaseDecimalPtr unconditionallyMike Kaganski
This was an implementation error ever since it was introduced in commit 79d3bc479950127ecfd40f73978c0fc84c1e7908. The function is used to release the refcounted object, and the calling code does not always set the pointer to another value or discard it (see uses in basic/source/sbx/sbxvalue.cxx). If it resets the pointer in some cases, it must do it always. Change-Id: I17de412914935082d20f2a1a91ea6e4e289936aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127254 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-21loplugin:flatten in accessibility..basicNoel Grandin
Change-Id: If2cc282c2b135d634daf393a082c29049b10a677 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ModuleInvocationProxyNoel Grandin
Change-Id: I2ec935fb1c53338f475d5e8aec877f84824a56e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ImplRepositoryNoel Grandin
Change-Id: Ie3cd416d32214fe4a0477c50bf49749ac620d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127072 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in CurrDirPoolNoel Grandin
Change-Id: I889f643266c6f087c34f681e71f27d8ab493e04c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-10ofz#42182 oss-build failureCaolán McNamara
since... commit 47aabde053a1472dc32770da29d68c8de5bd7919 Date: Thu Dec 2 12:37:07 2021 +0200 Make the tdf#97983 changes to BASIC optional where LibreOffice6FloatingPointMode is called from code not inside !HAVE_FEATURE_SCRIPTING [LNK] Executable/pptfuzzer basic/source/sbx/sbxvalue.cxx:1343: error: undefined reference to 'LibreOffice6FloatingPointMode()' basic/source/sbx/sbxvalue.cxx:1328: error: undefined reference to 'LibreOffice6FloatingPointMode()' basic/source/sbx/sbxvar.cxx:456: error: undefined reference to 'LibreOffice6FloatingPointMode()' basic/source/sbx/sbxvar.cxx:441: error: undefined reference to 'LibreOffice6FloatingPointMode()' clang-14: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [/src/libreoffice/vcl/Executable_pptfuzzer.mk:13: instdir/program/pptfuzzer] Error 1 make: *** [Makefile:170: Executable_pptfuzzer] Error 2 Change-Id: I8e635df26f30edf8acd9c148590d034e8b13c056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126646 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-09Make the tdf#97983 changes to BASIC optionalTor Lillqvist
If you want to keep the string to floating point conversion semantics in BASIC as they were in LibreOffice 6, you can either set the LIBREOFFICE6FLOATINGPOINTMODE environment variable to some non-empty value, or set the org.openoffice.Office.Scripting/Basic/Compatibility/ UseLibreOffice6FloatingPointConversion flag in the Expert Configuration. (Or use a registry modification file with that effect.) Adapt the relevant unit test accordingly. Thanks to Mike Kaganski for showing how to access the setting in the LibreOffice registry from Basic. Change-Id: I13d6d5d834e1bb81ef8df489db2b1da79f01dfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125756 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-04Fix --disable-(avmedia|scripting)TheRock Builder
So it's not a good idea to change the patch without testing it again. I'm still hoping for a better usable MediaItem then the previous dummy. The ODF stores a preview image and it should allow to export the media. The scripting fix feels like a workaround. somehow the final class specifier triggers something that makes the linker fail with missing destructors for all std::unique_ptr objects derivated from SbxFactory. Implementing these as virtual overrides didn't help, neither as {} or = default. So this removes them in the !"#if HAVE_FEATURE_SCRIPTING" case. Change-Id: I9f6751f44e0247ed31c27be0ee816239795e9372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126330 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-03replace comphelper::OListenerContainer with OInterfaceContainerHelper3Noel Grandin
OInterfaceContainerHelper3 is in wide use and can do the same thing with less ceremony Change-Id: I5252738d6b7bda6245c66da46352944ead79bd52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-02Bin pointless commentTor Lillqvist
Change-Id: I173dbfc93fabbacacc1a68189b7a50cd993f1caa
2021-12-01Simplify ImpStrChr and ImpScanMike Kaganski
Change-Id: I8c752a7838ded7f3783982411ec937f46224d522 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126172 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-01Unify and simplify floating-point-to-integer conversionMike Kaganski
* Round the number once, to avoid doing it three times for a successful conversion. * Round to nearest before convertsToAtMost/convertsToAtLeast, to handle cases like Dim n As Integer n = 32767.4 which should succeed. * Add overflow checks to Hyper (U/Int64) types. Change-Id: Ib10837e6df3cc1e3aba7a657e882bd40e344fd3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126173 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-27use more OInterfaceContainerHelper3 in ModifiableHelperNoel Grandin
Change-Id: I8d959e365f995d48a6105fac3ed0f84c7cc1d86b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125920 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-27use more OInterfaceContainerHelper3 in NameContainerNoel Grandin
Change-Id: I75cb302156ea93fe0b545b22ca85a0c537cce760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125919 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19Use M_PI* instead of F_PI*Mike Kaganski
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-18Drop unused argument names, and (void) noiseMike Kaganski
Change-Id: I75f313924db7d6a0658f9d7cc1d571767cec3144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125364 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-18tdf#145725: document about VBASupport+RGB (no bug here)Julien Nabet
Change-Id: I1a90509b7e5481bcf811f19889688c767c32e46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125430 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-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>