summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07VBA test - error() functionZdeněk Crhonek
Change-Id: Ia667342f9112932c71df593f08371d3c35255b19 Reviewed-on: https://gerrit.libreoffice.org/45917 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-07loplugin:countusersofdefaultparams in basctl..basegfxNoel Grandin
Change-Id: I515acfb9de1f6dff1de94a60055c5b600e5e5241 Reviewed-on: https://gerrit.libreoffice.org/45957 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06VBA test - iserror function test repair, tdf#114232Zdeněk Crhonek
Change-Id: I924713f360a41fa5b269468fdf771df6a50df44b Reviewed-on: https://gerrit.libreoffice.org/45923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-06basic: SfxLibraryContainer: replace maMutexMichael Stahl
... with cppu::BaseMutex, because a member cannot ensure the life cycle guarantees expected by WeakComponentImplHelper. Change-Id: Iaa10c699abf69882d917487740db241ba1455e1c
2017-12-06loplugin:salcall handle virtual methodsNoel Grandin
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42 Reviewed-on: https://gerrit.libreoffice.org/45851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05Save an unnecessary duplicate GetObject() callEike Rathke
Change-Id: Ib0efc84ad2cedc1a149fa57996bc0481bd64591b
2017-12-05Simplify the IsObject()/GetObject() logic hereEike Rathke
Change-Id: I816b15b6795b4946b1bfed0d1f6d103a6a1aba4f
2017-12-05Rather call GetObject() only if IsObject(), tdf#112571 follow-upEike Rathke
Which effectively is what GetObject() internally also does to determine whether to set an error, so resetting an error here is moot (or might even hide a nested error?). Change-Id: I8736d16e386d1833126965538f96aaa1fd73dfd6
2017-12-05Resolves: tdf#114232 reset error after unsuccessful GetObject() queryEike Rathke
Probably broken already since commit 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a Date: Wed Oct 6 10:16:27 2010 +0100 initial commit for vba blob ( not including container_control stuff ) Change-Id: Iecce564851a76921b491ff101365c70883ad7475
2017-12-05Resolves: tdf#114231 do not mask ErrCode with GetRest()Eike Rathke
Regression from commit 7ca950ec744b7af1d15724ec2abc296573a641e4 Date: Wed Aug 23 19:25:02 2017 +0200 no need to use ERRCODE_RES_MASK here the relevant usage sites already call GetRest() before comparing which exactly is the reason that it didn't work anymore. Old StringArray ItemList resources stored only 16-bit values, hence ERRCODE_RES_MASK was used to mask the ErrCode values in the resource for which code had to mask ERRCODE_RES_MASK as well to compare values. Now the full ErrCode is stored, so code must not use GetRest() on a value to compare against, or use GetRest() on both values (which theoretically could lead to ambiguities, but probably doesn't in resources that are restricted to one module). Change-Id: I835e47424bb008bc680dc4f8c502c9558397db36
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-02VBA tests repair (2) - don't pass the test when all tests failZdeněk Crhonek
Change-Id: I2519fc54e2ce74ec3c6777aa002971548a21c3c6 Reviewed-on: https://gerrit.libreoffice.org/45715 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-02VBA tests - repair tests (Don't pass when all tests fail)Zdeněk Crhonek
Change-Id: I70bfb8b909f9f7033cd1eb374db0fe710fd2a0c3 Reviewed-on: https://gerrit.libreoffice.org/45260 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-11-29Find VBA-only functions when compiling first on module levelEike Rathke
This likely never worked as there is no SbiInstance in that step, but worked by chance when running a module's code that was compiled with VBA support where the VBA-only function was added as a symbol to be resolved later during runtime and then the SbiInstance exists and the symbol was magically resolved. Found when trying to correct vba_tests to actually fail if all subtests fail that then started to fail in Atn.vb because of the Round() function being VBA-only. Change-Id: I7d9f6e2640a73388a2a58c3d180820c6ef85abe3 Reviewed-on: https://gerrit.libreoffice.org/45425 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-29loplugin:unusedmethodsNoel Grandin
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1 Reviewed-on: https://gerrit.libreoffice.org/45386 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-26basic, disable scripting problemjan Iversen
When building without scripting a couple of functions were undeclared, to solve that source/runtime/runtime source/classes/sbintern were moved so they also compile in building without scripting Change-Id: I908fee3caf8376d70ed286c17085d6b8a700ae75
2017-11-24Get rid of two more temporary SvNumberFormatter instancesEike Rathke
Change-Id: Id2afd9dd9d791383a1374b5abe52b47b43a19f08 Reviewed-on: https://gerrit.libreoffice.org/45236 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Get rid of a temporary SvNumberFormatter instanceEike Rathke
For each Format call.. Change-Id: I2f9d875ca27d5a10e609df1c0168be2dad65eaab Reviewed-on: https://gerrit.libreoffice.org/45230 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Get rid of that LANGUAGE_GERMAN nonsenseEike Rathke
Change-Id: I1ca3125e893a54ac00a3d785d77ed5612fb01857 Reviewed-on: https://gerrit.libreoffice.org/45235 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Aaand another one.. SvNumberFormatter instanceEike Rathke
... just to parse with LANGUAGE_ENGLISH_US if system locale failed.. Change-Id: Id9b7cfb5b5f21c46789f30e8e8c72a7524491e95 Reviewed-on: https://gerrit.libreoffice.org/45238 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Get rid of a temporary SvNumberFormatter instanceEike Rathke
... in case we have a runtime instance already. Only used for scanning date literals in source so not frequently used, otherwise we could remember a non-runtime instance formatter somewhere. Change-Id: I1146860c4b0aa4091708c22e498a6f720d6c7a13 Reviewed-on: https://gerrit.libreoffice.org/45232 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Make the SbiInstance SvNumberFormatter shared_ptrEike Rathke
In preparation to get rid of the per call locally created SvNumberFormatter instances.. Change-Id: Ic7db3bbb655aa18e939f5722964655a20f2eadf2 Reviewed-on: https://gerrit.libreoffice.org/45227 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24Don't pass the test when all tests failEike Rathke
Due to the locale dependent date format used here in strings that neither matches en-US nor en-GB (in which the tests seem to be executed) all tests failed, and then with passCount==0 the check was If failCount <> 0 And passCount > 0 Then instead of If failCount <> 0 Or passCount = 0 Then so the end result was OK. Also fixed the one case that was commented with Rem why this fails in excel? It actually also failed for us, just that because all tests failed (see above) it never seemed to fail.. Problem seems to be the accuracy of the underlying date+time double for this specific calculation. Good to know it happens in Excel as well ;-) As a workaround, conversion to string does the necessary rounding internally. Change-Id: If0302b2feab9e1233d66da4eccff732f61542a69 Reviewed-on: https://gerrit.libreoffice.org/45196 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-23various coverity warningsCaolán McNamara
Change-Id: I27f20c51f86aeaed8e932f7ca45cce8770bc34ec Reviewed-on: https://gerrit.libreoffice.org/45140 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-23tdf#114011 limit/truncate date, not only yearEike Rathke
Change-Id: I479040f411fb8b5975c0aa1aa24f95c957cf80cf
2017-11-22replace check of eof and GetError with goodCaolán McNamara
Change-Id: I7d9f04262ab5420e9a14813fa1274bb9d01e3291 Reviewed-on: https://gerrit.libreoffice.org/45076 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-22drop duplicate methodCaolán McNamara
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12 Reviewed-on: https://gerrit.libreoffice.org/45075 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-18silence some coverity warningsCaolán McNamara
Change-Id: I5a530e37156b5cd36e8a07ac20851880a46f520d Reviewed-on: https://gerrit.libreoffice.org/44875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-17inline SbxMAXSALUINT64 and friendsNoel Grandin
which don't offer any value Change-Id: Ie8082abc80ffd0e7719f4fa9a0d5f93203628ee5 Reviewed-on: https://gerrit.libreoffice.org/44798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-15Fix typosAndrea Gelmini
Change-Id: I8bdced3fa572074aedabdcfce841adf525ae8b81 Reviewed-on: https://gerrit.libreoffice.org/44710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-13Fix typosAndrea Gelmini
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-10loplugin:finalclasses in basic,basegfxNoel Grandin
Change-Id: Iff223782fa0ded0fe46b8b7af35bfd21f331015f Reviewed-on: https://gerrit.libreoffice.org/44535 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-04loplugin:constparams in various(1)Noel Grandin
Change-Id: Ic80ca59abc3e104c7adf0c1eff1d16addf48bc8b Reviewed-on: https://gerrit.libreoffice.org/44261 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-27Another ImpGetIntntlSep() fix, tdf#81671 follow-upEike Rathke
Change-Id: I9c056a137ab873f677e374d75c4e2f06bf370f21
2017-10-27Fix build of Windows-only code, tdf#81671 follow-upEike Rathke
Change-Id: I68a468857c529e8cab80d4453832dc9f4b3657d8
2017-10-27Handle decimalSeparatorAlternative in BASIC ImpScan,..., tdf#81671Eike Rathke
Change-Id: I73ff2bf624ba7c8d88c9419a109c340806bd31f5
2017-10-26vcl: make MapMode constructor explicitMichael Stahl
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-23loplugin:includeform: basicStephan Bergmann
Change-Id: I6fbba5c4619eec7ae03fed65a18974faa0f190af
2017-10-23overload std::hash for OUString and OStringNoel Grandin
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-21loplugin:redundantcast handle dynamic_castNoel Grandin
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb Reviewed-on: https://gerrit.libreoffice.org/43621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-17Seems that testMiscOLEStuff() works only as 64-bit on a current Windows 10Tor Lillqvist
Change-Id: Ib43f8c185d2a2e9e93f34d918d6f9461586cf6a6
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-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-03Replace more reinterpret_cast with SAL_W/SAL_UMike Kaganski
Change-Id: Ia632e4083222ad9e7f17c2ad0d0825f189c700cc Reviewed-on: https://gerrit.libreoffice.org/43071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use SAL_W/SAL_U instead of reinterpret_cast btwn wchar_t* and sal_Unicode*Mike Kaganski
This is type-safe, and allows to catch cases where a source type is changed for some reason, but reinterpret_cast masks that Change-Id: Ib64b6fa2e22d94a6bba890f0ccc3e20325c6f0a1 Reviewed-on: https://gerrit.libreoffice.org/42961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use explicit function names for fooA/fooW WinAPI; prefer fooWMike Kaganski
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22Fresh run of bin/update_pch.shMike Kaganski
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>