summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2017-02-10Remove MinGW supportStephan Bergmann3-58/+4
In OOo times, there'd originally been efforts to allow building on Windows with MinGW. Later, in LO times, this has been shifted to an attempt of cross- compiling for Windows on Linux. That attempt can be considered abandoned, and the relevant code rotting. Due to this heritage, there are now three kinds of MinGW-specific code in LO: * Code from the original OOo native Windows effort that is no longer relevant for the LO cross-compilation effort, but has never been removed properly. * Code from the original OOo native Windows effort that is re-purposed for the LO cross-compilation effort. * Code that has been added specifially for the LO cross-compilation effort. All three kinds of code are removed. (An unrelated, remaining use of MinGW is for --enable-build-unowinreg, utilizing --with-mingw-cross-compiler, MINGWCXX, and MINGWSTRIP.) Change-Id: I49daad8669b4cbe49fa923050c4a4a6ff7dda568 Reviewed-on: https://gerrit.libreoffice.org/34127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-09loplugin:staticmethodsTor Lillqvist1-4/+4
Change-Id: I46d24d74e48806368f1726688747f0872100c438
2017-02-09split getApplicationBasicManager into get and getOrCreateCaolán McNamara1-16/+14
Change-Id: I8e35594104ba85470eda387bc227e88bf77ccffd
2017-02-09Reapply "create ErrorHandlerFlags scoped enum for error handling flags""Noel Grandin2-10/+10
This effectively reverts commit 32cae6a2eaa41568888df9c8fc5605debd8d704a. Change-Id: I15bb0a5c4acaeee6d47dd93a71601d9687d701bc Reviewed-on: https://gerrit.libreoffice.org/34028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08replace localresource of strings and keys with StringArrayCaolán McNamara2-536/+140
Change-Id: I402f5485af0c1e60677b8291c879bc7ca14633d3
2017-02-08basic: another SOLARIS check here converted to __sunMichael Stahl1-1/+1
Change-Id: Iec76b096cfcab4bd45b77bdb1438776bf5de69ca
2017-02-07Revert "remove ugly operator* in DynamicErrorInfo"Michael Stahl2-13/+13
This reverts commit b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc. The problem is this: ==24217== Conditional jump or move depends on uninitialised value(s) ==24217== at 0x29A25FCE: SfxObjectShell::SetError(unsigned int, rtl::OUString const&) (objmisc.cxx:220) ==24217== by 0x29A35E6E: SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (objstor.cxx:2300) ==24217== by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765) ==24217== by 0x29A6BC48: SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (sfxbasemodel.cxx:1802) The commit is bogus because it introduces a DynamicErrorInfo::GetErrorCode(), which overloads ErrorInfo::GetErrorCode(), which is used at least in DynamicErrorInfo_Impl::RegisterEDcr() and used to return a constructor argument of DynamicErrorInfo but now returns pImpl->lErrId, which is what this statement is trying to initialize. Ultimately this causes my clang+ASAN build to fail because the uninitialized error code happens to be detected as a mere Warning: Test name: testMathMalformedXml::Import assertion failed - Expression: !xComponent.is() - loading succeeded: sw/qa/extras/ooxmlimport/data/math-malformed_xml.docx Change-Id: I9141144e0bc356ee54279948f2fce036d1831a86
2017-02-07Revert "create ErrorHandlerFlags scoped enum for error handling flags"Michael Stahl2-10/+10
This reverts commit 05e78bde26d8b8b257ed22a0ce20c5b386a629d1. Depends on the other commit that needs reverting
2017-02-07create ErrorHandlerFlags scoped enum for error handling flagsNoel Grandin2-10/+10
Change-Id: I30c80979c87bad7bc98f36a158c31c88d80d1caf Reviewed-on: https://gerrit.libreoffice.org/33991 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07Our GetSystemTicks can now again return negative 32-bit values on WindowsTor Lillqvist1-15/+0
See 93bde3156284df4419c49447cbf455de9d74f00a . Change-Id: Ib41c2d525faab2bedab10f91c3a4f62f94870e10
2017-02-07remove ugly operator* in DynamicErrorInfoNoel Grandin2-13/+13
I can see why you'd want to hide this horrible tunnelling of information with objects registering themselves in a global list. Urrgh. Change-Id: Ib151a0d2d5a4508dc456e52883e488ce56d9a095 Reviewed-on: https://gerrit.libreoffice.org/33984 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07Revert "[API CHANGE] return sal_uInt64 from GetSystemTicks in basic"Noel Grandin2-2/+2
This reverts commit fce604c8ae11b462113305aba080d77f8193cfea, and fixes tdf#105735 - xray ThisComponent no longer works in the process. It turns out Basic doesn't support sal_uInt64 very well, so lets rather have a small possibility of bad timestamps instead of broken scripts. Change-Id: Ic00485bd517a4fc61e05632001c9a5f92e05ddd6 Reviewed-on: https://gerrit.libreoffice.org/33972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06Add missing #includesStephan Bergmann3-0/+4
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-05Related tdf#105473: Crash in: ScRangeList::operator[]Julien Nabet1-1/+1
fixes this bt: 3 0x00002aaaab314ef2 in __GI___assert_fail (assertion=assertion@entry=0x2aaaaf8dc448 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=file@entry=0x2aaaaf8ac488 "/home/julien/lo/libreoffice/include/rtl/ustring.hxx", line=line@entry=678, function=function@entry=0x2aaaaf8dc800 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101 4 0x00002aaaaf810383 in rtl::OUString::operator[] (this=this@entry=0x55555d39c9f8, index=index@entry=0) at /home/julien/lo/libreoffice/include/rtl/ustring.hxx:678 5 0x00002aaaaf822f4e in SbiScanner::NextSym (this=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/scanner.cxx:572 6 0x00002aaaaf82771e in SbiTokenizer::Next (this=this@entry=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/token.cxx:339 7 0x00002aaaaf827d23 in SbiTokenizer::Peek (this=0x55555d39c9d0) at /home/julien/lo/libreoffice/basic/source/comp/token.cxx:266 8 0x00002aaaaf8175d0 in SbiExpression::Unary (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:581 9 0x00002aaaaf8178a4 in SbiExpression::Exp (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:633 10 0x00002aaaaf81792c in SbiExpression::MulDiv (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:647 11 0x00002aaaaf8179b6 in SbiExpression::IntDiv (this=this@entry=0x55555d43cea0) at /home/julien/lo/libreoffice/basic/source/comp/exprtree.cxx:666 Change-Id: Ib56063b3106bd077cda215e34ab763bae1f33c33 Reviewed-on: https://gerrit.libreoffice.org/33933 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-03makeAny->Any in basctl..chart2Noel Grandin10-34/+34
Change-Id: Ief1cdffbfc59ab4e35ac945d020772ff84c50d61 Reviewed-on: https://gerrit.libreoffice.org/33867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02loplugin:useuniqueptrStephan Bergmann1-2/+1
Change-Id: I3a246a22baaac8195dc1b94c42994de7d80e8336
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin16-129/+129
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>
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin5-14/+14
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27Just pass in OUString directlyStephan Bergmann2-7/+0
Change-Id: Idf7d63672e8b330499e53c1395dedb92d25bb76a
2017-01-27Just pass in OUString directlyStephan Bergmann1-7/+2
Change-Id: Id9bd288080fdd5ed4dfaee77b697954ad7bc2458
2017-01-26Remove dynamic exception specificationsStephan Bergmann18-615/+265
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-24loplugin: unnecessary destructor: basctl..codemakerNoel Grandin1-6/+0
Change-Id: Iadcfa9bc4fe9efb8d24d6d6afaf2b9b3def0bc3c Reviewed-on: https://gerrit.libreoffice.org/33452 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, basicStephan Bergmann5-0/+16
Change-Id: Ic3e265e05c69942c5c1c7d1b83f65f2cbe35ca1f
2017-01-19clear ARRAY_VS_SINGLETON coverity warningsCaolán McNamara4-24/+24
experiment to see if this clears them Change-Id: I91a74e06f621d3012b564cad87586ba74b0367ca
2017-01-16new loplugin: useuniqueptr: basicNoel Grandin6-25/+19
Change-Id: I5a9806e8dd79431f14d6861c8f4d65f828398f07 Reviewed-on: https://gerrit.libreoffice.org/33145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09Revert "Remove test_getsystemticks_method.vb for now"Stephan Bergmann1-0/+15
This reverts commit 93a8ebac2d6eb124bf57223069765af08fcd5c85, now that fce604c8ae11b462113305aba080d77f8193cfea "[API CHANGE] return unsigned 64-bit value from GetSystemTicks in basic code" is in.
2017-01-09[API CHANGE] return unsigned 64-bit value from GetSystemTicks in basic codeNoel Grandin2-2/+2
instead of 32-bit value. looks like this has been incorrect since commit 9f2104e1f3a1ef8a37406b39188234df309241bc Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon Jun 19 16:46:13 2006 +0000 INTEGRATION: CWS warnings01 (1.23.26); FILE MERGED but nobody cared, since the values would previously fit into a 32-bit number. Change-Id: I4c121085977b5e7ff3e33c8ad57749b925ad31b9 Reviewed-on: https://gerrit.libreoffice.org/32879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09Remove test_getsystemticks_method.vb for nowStephan Bergmann1-15/+0
Introduced with 060c2b9b1b0d3c9cf27f1b289a620cfa82b5b060 "QA Basic: split tests of methods in different files", but GetSystemTicks appears to routinely return negative values. Change-Id: Ibccdf753aea581e05e9d4e1bf551ae72dc70c959
2017-01-06QA Basic: split tests of methods in different filesLaurent Balland-Poirier111-348/+1683
Following resolution of "Missing TAN method" [1] as discussed on dev list [2] a large majority of methods are now tested with (almost) one method per file Missing methods: - colors failed: RED, GREEN, BLUE - file methods: DIR, CHDRIVE, EOF,... - financial methods calling Calc functions: IPmt, IRR,... - not totaly implemented methods (?): ROUND, WAITUNTIL... [1] https://bugs.documentfoundation.org/show_bug.cgi?id=102872 [2] http://nabble.documentfoundation.org/QA-test-for-BASIC-functions-tt4202257.html Change-Id: I2b2824b5b18a2cfbbee2bbc5369e9e2b9e5c930b Reviewed-on: https://gerrit.libreoffice.org/32519 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-24basic: cleanup test_*_methodsLaurent Balland-Poirier7-146/+84
cleanup remove duplicate test with other tests Change-Id: I4c82ad9f226f25080199ac0dc3815492fc4c265a Reviewed-on: https://gerrit.libreoffice.org/31860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-12-19no need to wrap calls to SAL_INFO in #ifdef DBG_UTILNoel Grandin1-4/+1
Change-Id: Ic373a8f145f3f78c3f109e36a9c1dd9156f0dd75 Reviewed-on: https://gerrit.libreoffice.org/32034 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15teach sallogareas plugin to catch inconsistenciesNoel Grandin3-7/+7
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-14Partially fix VBATest::testMiscOLEStuff for Win64Mike Kaganski4-15/+20
On Windows x64 there are two ODBCs - one for each bitness. A 64-bit build gets 64-bit ODBC, and there is no provider named "Microsoft Excel Driver (*.xls)", no normally the test is simply skipped. But if MS Excel is installed, then it installs provider "Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)", that was detected by previous code, but not used inside the VBAs. So, VBAs tried to use "Microsoft Excel Driver (*.xls)" unavailable to them. This patch allows using Excel's provider as well, thus allowing developer to test against 64-bit-specific regressions. However, the last test uses Microsoft.Jet.OLEDB.4.0 provider, that is unavailable on Win64. There are substitutions - Microsoft.ACE.OLEDB.12.0 and Microsoft.ACE.OLEDB.15.0, but there is no easy way to test if they are installed. Thus, that test is disabled on Win64 for now. Also, possible buffer overflow fixed, when byte count was passed to SQLGetInstalledDriversW instead of char count. Change-Id: Ib5c55251f0e92b3078a46aee173b5061439445ae Reviewed-on: https://gerrit.libreoffice.org/32019 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-13OSL_TRACE->SAL in avmedia..canvasNoel Grandin11-20/+5
Change-Id: Id9077ea29e7028c12f40abfd4c57756c863e3cd9
2016-12-08convert SFX_HINT to scoped enumNoel Grandin14-78/+78
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-12-08loplugin:staticmethodsTor Lillqvist1-0/+2
Change-Id: Ic65f024fd88915544539dedf3aa1c68a945cddd3
2016-12-07basic: small lcl_eraseImpl refactoringArnaud Versini1-4/+2
Change-Id: I72dc8bbbd554aec9a8481cc1d9330d2a866a3ba9 Reviewed-on: https://gerrit.libreoffice.org/31597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-12-06cleanup unused includes (related to tdf#88206)Jochen Nitschke1-1/+0
cppuhelper/compbase*.hxx and cppuhelper/implbase*.hxx compbase*.hxx includes implbase*.hxx replace compbase*.hxx if only implbase*.hxx stuff is used. Change-Id: I631a20aee411c6a32ffcf470f6e392621755f995 Reviewed-on: https://gerrit.libreoffice.org/31686 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-05convert DecodeMechanism to scoped enumNoel Grandin5-52/+52
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05convert INetURLObject::EncodeMechanism to scoped enumNoel Grandin2-26/+26
Change-Id: I50ea17c7779c7b5cacddf548f1773fd7d6c8bade
2016-12-05basic : Make NeedEsc easier to readArnaud Versini1-2/+2
Change-Id: Ie2ee404a51262cd08673268169a41255abf012bd Reviewed-on: https://gerrit.libreoffice.org/31600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-04basic: cleanup test_math_methodsArnaud Versini1-27/+13
Change-Id: I11b3ca4c55151de7403ff9980ada9958d8ef12dc Reviewed-on: https://gerrit.libreoffice.org/31592 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
2016-12-02oops, wasn't supposed to commit thatNoel Grandin1-5/+5
snuck in with commit 4d2c210c74567d9af6bededf3fae6bfd62406f14 "use early return to simplify flow" Change-Id: I2a5cbff01c5f40d879d320fd3934bc0856756d37
2016-12-02use early return to simplify flowNoel Grandin1-5/+5
Change-Id: I98201eac2e038c152422bbc6380cfa321ba266df Reviewed-on: https://gerrit.libreoffice.org/31534 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-02tdf#93592 Make it possible to add default language resource to dialogeditorNiklas Johansson1-1/+5
During the conversion of uno services a few lines where removed that probably should not have been removed. This caused the dialog editor to crash if you tried to add a new language resource to a document fdo#93077. The fix for that bug fixed the crash but also made it imposible to add a language resource to a dialog that isn't previously translated. With this patch the functionality should be back on track, adding/removing language resources without problems at least as far as my testing goes. Change-Id: Ie6e083837894a219bf8e9c75dec6bf7652d51615 Reviewed-on: https://gerrit.libreoffice.org/30462 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-11-30tdf#80731 Closing parenthesis is now detected (Mid statement and functions).Pierre Lepage1-0/+5
Change-Id: I5efdb6c3ce71148672a8b76d3f1cc87b0fe04994 Reviewed-on: https://gerrit.libreoffice.org/30593 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-28-Werror,-Wunused-private-fieldStephan Bergmann1-2/+1
Change-Id: Id85b4709e295453dfd351978096596aef09ce9a9
2016-11-28BASIC: useless override DocObjectWrapper::acquire and releaseArnaud Versini1-16/+0
Change-Id: Ia8fcb1c5935374376b727075c9bdcbd6a96b3c70 Reviewed-on: https://gerrit.libreoffice.org/31264 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-24convert SbDEBUG constants to o3tl::typed_flagsNoel Grandin5-69/+63
Change-Id: Ifcada5684bacae46ec90c5ce3e58980860fee29f
2016-11-23loplugin:unnecessaryoverride (dtors) in basicStephan Bergmann4-21/+1
Change-Id: I5756b96bcc7563b82e35d3cdfdda3b80692767e5