summaryrefslogtreecommitdiff
path: root/basic/source/sbx/sbxvar.cxx
AgeCommit message (Collapse)Author
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>
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-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-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-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-05-05loplugin:constmethodNoel Grandin
Change-Id: I7913fd8144d521b8293ac43036d0fad82e457cd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115145 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-09Drop "32" from names of SbxArray methods taking 32-bit indicesMike Kaganski
... a leftover from times when there were methods for 16-bit as well as for 32-bit indices. 16-bit indices were removed in commit 62f3f3d92aa204eaaa063b30d7ade44df501b997. Change-Id: Idf8b1160e68e8b303cf75ea79dd7dbb3bd00275d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112187 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-02BASIC : simplify SbxVariable constructors and remove impl classArnaud Versini
Change-Id: Iff37e71389594b313a3a3d12998dbbdbf0c85d05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108539 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-23Initialize method mapping table at compile timeMike Kaganski
This removes the need to calculate hashes for the table at runtime. Also this introduces a static assertion to make sure that the table has correct structure, and fixes some methods that had wrong argument counts: CreateUnoListener: 1 -> 2 MIRR: 2 -> 3 SLN: 2 -> 3 SYD: 2 -> 4 Changes in basic/source/classes/sb.cxx are related to the change of SbxVariable::MakeHashCode into constexpr function taking string view. Change-Id: I2fec4994e976f36c4b647c30b51a9e879a815775 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108220 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-05tdf#42949 Fix new IWYU warnings in directories [ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib0008b9bb095f27e5e436d6b507dc709ab7bf01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-14loplugin:simplifybool moreNoel Grandin
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-19loplugin:flatten in basicNoel Grandin
Change-Id: Icb8e3cda312b50c9a9f12f96bec1c746f41c8979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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-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-10convert WriteCharPtr..getStr to WriteOStringNoel Grandin
and improve the WriteOString method, we can avoid the strlen here, we already have the length One change in behaviour to be noted - if the string contains trailing zero bytes, which ARE INCLUDED IN THE STRING LENGTH, i.e. I'm not talking about the normal terminating zero, then this patch changes behaviour because we will now write those zeros to the stream. Change-Id: I4668b9b9eb877f820b1dc70d6cd10ba2623bc0a2 Reviewed-on: https://gerrit.libreoffice.org/80597 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-23tdf#123043 make type character detection unicode-awareTomoyuki Kubota
Change-Id: I98886a7d13a43cc3202d45f96ceb5062f76f0784 Reviewed-on: https://gerrit.libreoffice.org/71013 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-10-22pvs-studio: V794 The assignment operator should be protectedCaolán McNamara
Change-Id: Ia443a0e61a091d877c8da26bf7d45bf4261f8669 Reviewed-on: https://gerrit.libreoffice.org/62166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-08cppcheck: variableScope in basicJochen Nitschke
use a range based loop in one case Change-Id: I3d3acc35739634797e2b6e4d1cc2909b3fe33750 Reviewed-on: https://gerrit.libreoffice.org/60188 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:stringloop in basic, framework, sax, svtoolsNoel Grandin
Change-Id: I2bad74a8f103e9dc68c8e0d0e6315697068d2f6d Reviewed-on: https://gerrit.libreoffice.org/58135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-19loplugin:useuniqeptr in SbxVariableNoel Grandin
Change-Id: I788ec594589d9708e12db83a7371b5a8d9fed38c
2018-01-15More loplugin:cstylecast: basicStephan Bergmann
Change-Id: I0bb219632da384ab047a2b1fc3f2b041dacaf2cb
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-11-01loplugin:constantparam in basic,basctlNoel Grandin
Change-Id: If918c42d4b82d78c07786cfa47c74d0dfb7493d6 Reviewed-on: https://gerrit.libreoffice.org/44131 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-10basic: consistently use "" and <> in include directivesMike Kaganski
Change-Id: I147c0e9b9b1e09af593f54799e45e1348cd40716 Reviewed-on: https://gerrit.libreoffice.org/43298 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-17use more default copy ctorsJochen Nitschke
if ctor should be private or protected explicitly default them. boost::optional has copy ctors, so use them. Change-Id: If1855626b297e739afef0dc5ad57958f7ad199bc Reviewed-on: https://gerrit.libreoffice.org/42363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11new loplugin:deadclassNoel Grandin
look for classes which only have copy/move constructors, and so are effectively dead Change-Id: I0b844f301e2200c2b40031856bfdb0b0e2c8f77d Reviewed-on: https://gerrit.libreoffice.org/41039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21s/ERRCODE_SBX_OK/ERRCODE_NONENoel Grandin
adds no value Change-Id: Iedf7a6a7be28fed4059b576312890be8cbb980d7 Reviewed-on: https://gerrit.libreoffice.org/39056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-02-17convert SbxNameType to scoped enumNoel Grandin
and drop unused enumerators Change-Id: I2b47828b2146fcda335f1dc1c1f61a1139abbe19
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15teach sallogareas plugin to catch inconsistenciesNoel Grandin
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a Reviewed-on: https://gerrit.libreoffice.org/32004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08convert SFX_HINT to scoped enumNoel Grandin
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-30loplugin:constantparamNoel Grandin
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c Reviewed-on: https://gerrit.libreoffice.org/29321 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-14loplugin:constantparamNoel Grandin
clean up the plugin a little, and try to catch params which are default constructed, which doesn't seem to be working yet Change-Id: Ife45f18502a45cd26306424b7432c55fcbb0fd12 Reviewed-on: https://gerrit.libreoffice.org/28861 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-08-30loplugin:stringconstant: adapt to improved OUStringLiteral1 (basic)Stephan Bergmann
Change-Id: I7e9ceb5513b34115bb1f41e627af06bbffc6ecf1
2016-08-24tdf#96505 get rid of "long" integer literals 'L'Asela Dasanayaka
Remove L from integer literals in module basic all 0L, 1L, 2L and 3L Change-Id: Ia46ce3d206020e16fc17e95731244a557941528c Reviewed-on: https://gerrit.libreoffice.org/27816 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-06-23tdf#99589 - tolower / toupper - dangerous to Turks ...Gökhan Gurbetoğlu
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683 Reviewed-on: https://gerrit.libreoffice.org/26537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-14Resolves: tdf#59222 Crash in Basic with an array of values...Caolán McNamara
from a range address trying to make all SbxVariables reference count their parents is ludiciously hard, so just reference count this one known crashing case Change-Id: Ie1fa6624e8184146dd00d766cdbacef674153ef6 Reviewed-on: https://gerrit.libreoffice.org/26272 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-12convert more DBG_ASSERT(false to SAL_WARNNoel Grandin
Change-Id: Ie52f28f28c67a91c4d3d4517d5c6a466890c7a55 Reviewed-on: https://gerrit.libreoffice.org/26195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03tdf#89329: use unique_ptr for pImpl in sbxvarXisco Fauli
Change-Id: I74734c34e72ba5d508830dbcff88f0d3b93a0766 Reviewed-on: https://gerrit.libreoffice.org/25742 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23Convert SbxClassType to scoped enumNoel Grandin
Change-Id: I48afcdd9924d22b52a8db21aa253061e4d38c85b Reviewed-on: https://gerrit.libreoffice.org/25259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11clang-tidy performance-unnecessary-value-param in basicNoel Grandin
Change-Id: I997213ca28efc2df04d454ffaf3c81c9cbad09ac
2016-02-24simply the SbxRes stuff, inheriting from OUString is ickyNoel Grandin
Change-Id: Ie9794ea164d587ad87ee13d360cb3abc18166051
2016-02-24Removing #defines for String_XXX in sbxres.hxxbaltasarq
This is a [partial] patch for BUG #84938: https://bugs.documentfoundation.org/show_bug.cgi?id=84938 The objective is to substitute all apparitions of #defined constants for enum class. The victim here is the series of constants STRING_xxx that were located in sbres.hxx and were changed for a StringId enum class. Obviously some other files where the type is used must be changed too. Change-Id: I31fa684eb5eb3508d2025c9a319d5b245cc177af Reviewed-on: https://gerrit.libreoffice.org/22655 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-17loplugin:unnecessaryvirtualNoel Grandin
update the plugin with lessons learned from the mergeclasses plugin and re-run it Change-Id: I9d622eb3d05fceaf8fa764c533c8fa5dfb4c7711 Reviewed-on: https://gerrit.libreoffice.org/20015 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-115th step to remove tools/rtti.hxxOliver Specht
tools/rtti.hxx removed completed the interface of some Sdr.* Items and removed pseudo items Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a Reviewed-on: https://gerrit.libreoffice.org/19837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>