summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2022-11-25Fold OldBasicPassword into basic::SfxScriptLibraryContainerStephan Bergmann
Change-Id: Iaeaf30f63760185a2b1dd72feb980b94d9931d55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143253 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-05-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): basicStephan Bergmann
Change-Id: If70c3bf8d7d6c855baf23b02cccb3f3b5ccb9f64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142321 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-25Address a constexpr template point of instantiation issueStephan Bergmann
...that hits at least when building with Clang and --with-latest-c++ against recent libc++ or MSVC standard library (where C++20 and esp. C++23 made more and more class template member functions constexpr). My understanding is that there is some leeway at what point a compiler should instantiate such function specializations, and Clang decides to instantiate constexpr ones early (cf. <https://github.com/llvm/llvm-project/commit/242ad89a15d5466d166d47978bfff983d40ab511> "C++11 half of r147023: In C++11, additionally eagerly instantiate:" and its "Do not defer instantiations of constexpr functions" comment, and the discussion at <https://discourse.llvm.org/t/point-of-instantiation-of-constexpr-function-template/65129>). > In file included from basic/source/comp/codegen.cxx:21: > In file included from include/basic/sberrors.hxx:23: > In file included from include/vcl/errcode.hxx:23: > In file included from include/rtl/ustring.hxx:34: > In file included from ~/llvm/inst/bin/../include/c++/v1/ostream:168: > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:47:19: error: invalid application of 'sizeof' to an incomplete type 'SbiExprList' > static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); > ^~~~~~~~~~~ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:281:7: note: in instantiation of member function 'std::default_delete<SbiExprList>::operator()' requested here > __ptr_.second()(__tmp); > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:247:75: note: in instantiation of member function 'std::unique_ptr<SbiExprList>::reset' requested here > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } > ^ > basic/source/inc/expr.hxx:118:66: note: in instantiation of member function 'std::unique_ptr<SbiExprList>::~unique_ptr' requested here > SbiExprNode( const SbiSymDef&, SbxDataType, SbiExprListPtr = nullptr ); > ^ > basic/source/inc/expr.hxx:30:7: note: forward declaration of 'SbiExprList' > class SbiExprList; > ^ Change-Id: I3bde85164ae6b829b7c24d9645fd412ed3fd815d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141810 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-18basic: s/helt/held/ and some cleanup.Michael Meeks
Change-Id: Idebd2eef29230056caa605c79028e46d34891c44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141485 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@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-27use more string_view in accessibility..configmgrNoel Grandin
Change-Id: Ie16d36faac7d06e275348ed68e6c6b2518534fd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-31cid#1509223 Inefficient vector resizing with reserve.Noel Grandin
Change-Id: I12f215d60a7420676523c7cec85bfa5149683841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139083 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-22tdf#150139 - Add a concrete name to the error messageAndreas Heinisch
Add a concrete name to the "Property or method not found: $(ARG1)" error message when creating a listener. Change-Id: I76c904793a96082c49f8aa2d45c76c50a453d892 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138061 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
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-08-18cid#1500645 silence Resource leakCaolán McNamara
Change-Id: I1548017a39f5080dce0731169811fcb0a059c4d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138478 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-16cid#1509215 Using a moved objectCaolán McNamara
and cid#1509294 Using a moved object Change-Id: Ic4ef9bbc94d7b946d7d1904edf4b5b23278baafd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138348 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-10Better cast to sal_[u]IntPtr when passing pointer to O[U]String::numberStephan Bergmann
Change-Id: I5b7a0fa060c1e0ae4aa194e0c1862f303dd8a2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138062 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-25loplugin:moveitNoel Grandin
make the plugin more conservative, so we see less false+ (although we also miss some possibilities in the process) Change-Id: I91b1806271e7f802d7459834ab7bcc569047da3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137342 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-28Removed executable bits on filesAndrea Gelmini
Change-Id: I8508d26067084ff7bb15bbf2326a1ff7bc61a6ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136521 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-06-28tdf#149447: use proper UNO types for marshalling unsigned Basic typesMike Kaganski
cppu::UnoType<sal_uInt8> corresponds to UNO boolean, so its use made the unsigned values be converted to a true/false in Any; and additionally, using such a boolean Any, even having a 'true' value, as a parameter to a double argument would make operator >>=(const Any &, double &) return false, giving the resulting double equal to 0. The wrong conversion of UShorts and ULongs to cppu::UnoType<sal_uInt8> (aka TypeClass_BOOLEAN) was introduced in commit 11f9aa4fcb2ad0a5fada8561c7041e7f25a059fc Author Andreas Bregas <ab@openoffice.org> Date Thu May 10 14:22:42 2001 +0000 #79615# sbxToUnoValue(): Choose smallest possible type for numeric values Treating of unsigned Basic Byte as a signed cppu::UnoType<sal_Int8> (aka TypeClass_BYTE) was already introduced in commit c25ec0608a167bcf1d891043f02273761c351701 Author Jens-Heiner Rechtien <hr@openoffice.org> Date Mon Sep 18 15:18:56 2000 +0000 initial import Then, in commit 553cf2a834fcca17be6f7712c53e190e90e260eb Author Andreas Bregas <ab@openoffice.org> Date Fri Jun 08 14:59:57 2001 +0000 #87927# Map TypeClass_BYTE to SbxINTEGER instead of SbxBYTE because of signed/unsigned problem an attempt was made to handle obviously this same problem, changing the corresponding UNO type to TypeClass_SHORT. But it seems that it created problems when passing arrays of Byte through UNO to COM, where it needed to convert to a safearray, so this decision was reverted in commit dd6ba6b64aec20d37a402bee233e742e29285e88 Author Mikhail Voytenko <mav@openoffice.org> Date Thu Jul 08 21:33:48 2010 +0200 mib17: #162917# let basic byte use one byte, let olebridge convert sequence to safearray correctly This change tries to avoid the problem that caused the latter revert, by only treating Bytes as UNO shorts in getUnoTypeForSbxValue, where scalar Byte values are considered, keeping old handling for arrays. Change-Id: I805108743376e2fc27dd21a27c31759b76dc0d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136526 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-22crashtesting: assert seen with forum-mso-de-125088Caolán McNamara
where at restoring the SaveIndex the underlying aLine string had been replaced, so the index is for a different string. Save and restore the aLine too. Not entirely sure this is what we want, but it does seem to be what this restoring code expects. Change-Id: I25bd02fad72d9b0729b9504fe04416340d0e070a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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-20tdf#149622: also clear return value before calling method from SbxObject::CallMike Kaganski
Moves the custom cleanup logic to overridden SbxMethod::Clear, to simplify the cleanup code and make sure it restores empty Variant correctly. Change-Id: I01fa0529acd9ac787ffcda60fd6836ade4afdcb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136108 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-10new loplugin:moveitNoel Grandin
look for local variables that can be std::move'd to parameters off by default, since it doesn't do proper data flow analysis Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-06tdf#149402 - BASIC: Don't extend comment if line ends in a whitespaceAndreas Heinisch
Change-Id: I8adf530e77a0e65329fa59ac2873b99f48befac4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135336 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
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-02The elements of XInvocation::invoke aOutParamIndex are non-negativeStephan Bergmann
..so use o3tl::make_unsigned when comparing them against an expression of unsigned integer type, instead of casting that expression to a signed type Change-Id: I4fc0bd4447f55d5fd9bf893a4b22d6d2c2cfe3d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135280 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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-31Use more appropriate index variable typeStephan Bergmann
Change-Id: I0a6de93876d316a1aa094cf98dc2ee5c7eddebbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135205 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-31Use more appropriate type for SbiImage::nStringIdxStephan Bergmann
Change-Id: I1448739b373c6f7b9f5e6ee5a725fa0a129a4fb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135204 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-31tdf#149157 - Break multiline continuation in a comment after a new lineAndreas Heinisch
Change-Id: I3dd875152a6f2cfafb67f13f597c36f01a4759b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135018 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-05-30cid#1504574 Resource leakCaolán McNamara
make an owner for the PropertyMapEntries Change-Id: Ie915a8a312f2b24488566814ad67fdeef89b5941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135123 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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-25elide some OUString allocationNoel Grandin
Change-Id: Ia21421731dadc1d0e65da182471eb2b8d799782b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134918 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-24elide some OUString allocationNoel Grandin
Change-Id: Iacbf1da6cdc77466d9f9da399b5cc17f5a87f0ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134833 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24elide OUString allocationNoel Grandin
Change-Id: I92d487b657c7d67a4301a499ba05b4b285cfed3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18Extend loplugin:redundantcast to trivial reinterpret_cast from T to itselfStephan Bergmann
Change-Id: I7c0be7b435d6b5f97bdd40484023584146638d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134506 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-11in SbUnoObject constructor, only query for XTypeProviderNoel Grandin
if we're going to use the result Change-Id: I49ad11e287f58c1021e509f56d934aa3ce745b0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11in SetGlobalUNOConstant, only retrieve old value if we need itNoel Grandin
removes some unnecessary Find() work Change-Id: I6af9c4d9a043d4361fcca1a034b2025fe7c10c28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-10tdf#121740 dont bother checking for VBA librariesNoel Grandin
speeds up loading by 2% Change-Id: I63bf7ea2ab8087d6bb60b655fdf7718532050b89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-10move creation of xParser to where it is usedNoel Grandin
Change-Id: I03511a8c7b01b0abb69b276b900bf712549e5873 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134113 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>