summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2023-02-21Related: tdf#153752 Use virtual method to avoid dynamic castsMike Kaganski
Change-Id: I97c09d82699621d5a43a525b5f2cf75ff5d131c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147353 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-29no need to lock SolarMutex over the whole method hereNoel Grandin
Change-Id: Ifcac67c0f4e149fe7e1d923d7efede9552b034a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-29UNO fn FormObjEventListenerImpl::documentEventOccured must lock SolarMutexStephan Bergmann
When trying to address a deadlock issue involving NotifySingleListenerIgnoreRE (sfx2/source/doc/sfxbasemodel.cxx), I hit the DBG_TESTSOLARMUTEX at > DbgTestSolarMutex > SfxBroadcaster::RemoveListener > SfxListener::EndListening > CheckParentsOnDelete > SbxObject::~SbxObject > SbUnoObject::~SbUnoObject > SvRefBase::ReleaseRef > tools::SvRef<SbxObject>::operator= > SbUserFormModule::ResetApiObj > FormObjEventListenerImpl::documentEventOccured > (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>::operator > comphelper::OInterfaceContainerHelper2::forEach<com::sun::star::document::XDocumentEventListener, (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>> > SfxBaseModel::postEvent_Impl > SfxBaseModel::Notify > ScModelObj::Notify > SfxBroadcaster::Broadcast > SfxApplication::NotifyEvent > SfxBaseController::dispose > (anonymous namespace)::XFrameImpl::setComponent > (anonymous namespace)::XFrameImpl::close > SfxFrame::DoClose > SfxViewFrame::Notify > SfxBroadcaster::Broadcast > (anonymous namespace)::SfxModelListener_Impl::notifyClosing > SfxBaseModel::close > SfxBaseModel::dispose > UnoApiTest::load > UnoApiTest::loadFromURL > VBAMacroTest::testVba during CppunitTest_sc_vba_macro_test, which this commit fixes. (I commit this independently of any commit addressing that deadlock, as that involves some SolarMutexReleaser hackery and might eventually get reverted, while this change here looks correct and worthwhile even on its own.) Change-Id: I4217098c33114653cd69f4bef61c9f8089ce8b24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146302 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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-26Simplify a bitMike Kaganski
Change-Id: I970feb9897018c69173b899392484a2818c184f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146193 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-26Simplify a bitMike Kaganski
Change-Id: Ib3507d5083116fc621def9c8168c95267a914bed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-26Delete extra whitespaces inserted by the editorAndreas Heinisch
Change-Id: I89ef4d04e27e52f5ee6168f368e23f96e112a8be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146085 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
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-19Base SfxLibrary on WeakComponentImplHelperStephan Bergmann
...rather than on the deprecated OComponentHelper. The two classes SfxDialogLibrary and SfxScriptLibrary, both deriving from SfxLibrary, had been found to implement their respective queryInterface in a way that is incompatible with the XAggregation protocol inherited via OComponentHelper. It looks like no code actually made use of the XAggregation offered by these Sfx*Library classes, so the easiest fix for those queryInterface implementations appears to switch from OComponentHelper to WeakComponentImplHelper (thereby dropping XAggregation, and thus rendering the existing queryInterface implementations OK). Ideally, SfxLibrary would derive from WeakComponentImplHelper<XInitialization, XStorageBasedLibraryContainer, XLibraryContainerPassword, ...> covering all the UNO interface classes from which it currently derives manually. But changing that manual implementation across SfxLibrary and its SfxDialogLibrary and SfxScriptLibrary derived classes looks tricky, so merely introduce an "empty" WeakComponentImplHelper<> for now and keep all the manual stuff, and leave proper clean up for later. Change-Id: I12dc5bad2c017b8d76ce28ac189e95cf2e3810e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145792 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-09tdf#152917: basic_macros: Add unittestXisco Fauli
Change-Id: I69050ae0e6607ed4a1d1da0e89b45125e2c06e3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145190 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@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
2023-01-05Revert all the recent loplugin:unocast changesStephan Bergmann
...as obsoleted by ef533553559fe09b4afab651fc692885d1acf4ed "Rudimentary support for dynamic_cast on UNO proxy objects". This reverts all of: 4cfcc9ac37b90ce64c8402a41eb4638adb185b5c "loplugin:unocast (framework::Desktop)" 03efbf72f4ddf7a84aa8aabef348331bd4b75e8a "loplugin:unocast (vclcanvas::TextLayout)" 80099fdd51a69eaa6c36ca88ef772810e4a777fa "loplugin:unocast (SalGtkXWindow)" cc147f576d8687fb79c77d47d41dc4ba1678a469 "loplugin:unocast (sdext::presenter::CachablePresenterView)" 40db42be1d8fd0f9c6c8c5ba3767ddb9ee2034c2 "loplugin:unocast (vclcanvas::CanvasFont)" 2d1e7995eae29e2826449eb5179f5fae181794a5 "loplugin:unocast (CairoColorSpace)" 4c0bbe4bd97636207cf71a6aa120c67698891da9 "loplugin:unocast (canvas::ParametricPolyPolygon)" 89803666621c07d1b1ac9d3bd883f0ca192a91a0 "loplugin:unocast (vclcanas::CanvasBitmap)" d5e0c2c8db71878d21c2a7255af08cf5f9a6dd04 "loplugin:unocast (sfx2::DigitalSignatures)" c0c4519e0d5b555f59bbc04cc616454edfd1f4ce "loplugin:unocast (VCLXAccessibleComponent)" feb8b833a6245d42400f42a0bc789dc84594ee6f "loplugin:unocast (VCLXDialog)" 1fa58cc6cc9c3849753342a5d9a6ddfa461b5e66 "loplugin:unocast (VCLXMultiPage)" f481f036deb1b1b46f3038074c4659f3a91b9c6c "loplugin:unocast (DocumentSettingsSerializer)" 73df933f5fa5932f94e5a1b338a3eda00a9ce354 "loplugin:unocast (css::embed::EmbeddedUpdate)" 420165ab0ef03c0467f9d17f504de2d2fc78f0e6 "loplugin:unocast (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)" 9abe8ee067e6c00f19d8a13346d53c4641c27166 "loplugin:unocast (MutableTreeNode)" 9f3022ceb036f23b4b0994c3e2fbd1001bff225a "loplugin:unocast (VCLXTabPage)" 1be70dda02c12a60778b7607cff2520ae1aa611e "loplugin:unocast (vcl::unotools::VclCanvasBitmap)" d6a70bb641b96e8e5616448c2378131ed62658b4 "loplugin:unocast (basegfx::unotools::UnoPolyPolygon)" 5a14f009e6782c077463c8cbb8e9cea3d7950107 "loplugin:unocast (xmlsecurity::Certificate)" 99009c9535dfa3e0d838989ccc7d84bfa2320ff4 "loplugin:unocast (sd::Annotation)" 0c7585c5fa78887e5459885ed744e8044fd76137 "loplugin:unocast (sd::TextApiObject)" 24e14afd1bfcaed6c200ab081973fba7e47267ca "loplugin:unocast (SignatureVerifierImpl)" 1a7ad0c10d286ce9ae2700ceb2fd50eed1fb43a4 "loplugin:unocast (pcr::PropertyEventTranslation)" a97e2d2702d9a6f37775ccee2c08c4f3b2479c4b "loplugin:unocast (RangePageBreaks)" 19dfdf86ad1f5b08041d8b7a9f196caf881231ab "iloplugin:unocast (pcr::OFormattedNumericControl)" f9785ea595fd8e911f6370e836fa579225b9e571 "loplugin:unocast (frm::OInterfaceContainer)" 5e5f40a4a92a31b0932c690219d002fcf18598cf "loplugin:unocast (ScVbaShapes)" 27b35b2c215b4832d4378ec3a7ecbba926552d06 "loplugin:unocast (ScVbaShapeRange)" cb3108f860065928552a86cf8acc4b3a95718ecf "cid#1517812 Dereference null return value" feba0ddb1521d1142560fe54b7d7696ee910237f "loplugin:unocast (weld::TransportAsXWindow)" 4d6c23216559eb48f9943bb49d6e475a6d64ba15 "loplugin:unocast (oox::ForumlaImExportBase)" 4844c096a8ab6a9a620c410a0949d4499f12a504 "loplugin:unocast (cairocanvas::SurfaceProvider)" 9a0b523e0a84d403b9092176ccec4b3e3efe42d0 "loplugin:unocast (cairocanvas::CanvasBitmap)" 8a5648d8e59b4b007dbbf3824777c19a21efc61e "loplugin:unocast (cairocanvas::TextLayout)" 28c27a0623bc78a0590858f97d03b620985bc84c "loplugin:unocast (cairocanvas::CanvasFont)" 53bc223cb3288e32a417696ee61c29e5f01f209d "loplugin:unocast (cairocanvas::RepaintTarget)" 5f70b0b9f6bc4ab145ddbd9155590ed4a3b1b9ec "loplugin:unocast (SvXMLImport)" 068187a898cdd2e26e9b16c348ecc1ed2dee3f29 "loplugin:unocast (VCLXWindow)" 88b4f966202717cd4ad38a30a8eda22c3e69ed35 "loplugin:unocast (sfx2::sidebar::SidebarController)" f1b7a69b280aefe2f1b3b0f32193494fd765f2bd "loplugin:unocast (SvxLineStyleToolBoxControl)" ba76f0ba7e8de4d2953739c952004b7d9af47197 "loplugin:unocast (i18npool::Calendar_gregorian)" 840154daf934d8df52ead1cb7acd798c4d30f007 "loplugin:unocast (framework::AddonsToolBarWrapper)" b0e9c4c5f063cefa9557810e3349bdb9c7493091 "loplugin:unocast (GrammarCheckingIterator)" 8ee6cfc9655ce9de4617cea1a0d9cb9d7a4fbfac "loplugin:unocast (ucb::ucp::ext::Content)" 5b8cd77c112bc8c0e92b8fec215c3c8e802bbc0a "loplugin:unocast (basic::SfxScriptLibraryContainer)" 9e73ff9fce12e102bb3c3cea8d8bb96c88f2c9ad "loplugin:unocast (sdext::presenter::PresenterNotesView)" a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d "loplugin:unocast (SelectionChangeHandler)" c0b59ad6e35b0cb0dea0821e95f95569739078c1 "Consistently use comphelper::getSomethingImpl<I>(aIdentifier, this)" 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c "loplugin:unocast (vclcanvas::RepaintTarget)" Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-25Fixed a copy paste error in a commentAndreas Heinisch
Change-Id: Ibcd4c2f0cccb233647f3b079f02d01f156d30138 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144818 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
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-12-20basic: remove tabs from test fileXisco Fauli
Introduced in c6dc676306d2e507bf57369d02dcaf2408d43eb0 "tdf#152520: basic_macros: Add unittest" Change-Id: Ieef7177b3eb1c7c4ab1aaa11cc343ace3f26601f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144581 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20basic: add missing license statement in .vb test filesXisco Fauli
Change-Id: I304615540edad3d3486bcdb17d7d6ae12fc084b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144584 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20basic: add missing license statement in test filesXisco Fauli
While at it, convert test_optional_paramter_type.bas to Unix format Change-Id: I141fa0a00d6b6784c3a84c8b3041086d51e5cdbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144540 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20tdf#152520: basic_macros: Add unittestXisco Fauli
Change-Id: I30f6badc620f3932cacff07bd37ef4da96f1bafd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144539 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-14loplugin:unocast (basic::SfxScriptLibraryContainer)Stephan Bergmann
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I962b2a11a6407a543fb8b4ad972128d59f62a8a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144142 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>