summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2018-02-16ofz#6311 still problems with SdrEdgeObj listening to same obj at start as endCaolán McNamara
Change-Id: Ibd80b484788779b73943b28a5f36e51ebcacec30 Reviewed-on: https://gerrit.libreoffice.org/49824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-05Resolves: tdf#114232 call GetObject() only if IsObject()Eike Rathke
This is a combination of 2 commits. Resolves: tdf#114232 reset error after unsuccessful GetObject() query 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 (cherry picked from commit 863e269cd3d37034e634d9ad730d8e87a46ceb76) Rather call GetObject() only if IsObject(), tdf#112571 follow-up 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 (cherry picked from commit d1cd68fac3a3a521e1f7ebf033b908d67832a0c1) Reviewed-on: https://gerrit.libreoffice.org/45904 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
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 (cherry picked from commit d915cb417befeb4a2aa1913e4b91d8cc5297c3ec) Reviewed-on: https://gerrit.libreoffice.org/45882 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-11-30Find 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> (cherry picked from commit af8431d8dbc59df1e1f17742a1be002b054f3b00) Reviewed-on: https://gerrit.libreoffice.org/45476
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>
2017-09-20Bin some noise comments and ASCII graphicsTor Lillqvist
Change-Id: Ib0e786b0e8401da3e3c93bf254727411774e8f43
2017-09-19iOS, solved code never reached (sbxvalue.cxx)jan Iversen
used #ifndef to avoid "code never reached" Change-Id: I3f3d6f9aa31a263b783528e2921133ed526146c9
2017-09-19Clean up a couple of overly verbose SAL_INFOsTor Lillqvist
Change-Id: I2b17bfb95f687617967d4e43356d39aa3bb6e041
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 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-09-13Enable -Wunreachable-codeStephan Bergmann
...motivated by <https://gerrit.libreoffice.org/#/c/41565/2> adding dead code at the end of a switch statement, after the last case's "break". -Wunreachable-code appears to work well on Clang, while it appears to have no effect on GCC. Most of the affected places are apparently temporary/TODO/FIXME cases of disabling code via "if (false)", which can be written with an extra set of parentheses as "if ((false))" to silence -Wunreachable-code on Clang (which thus needed loplugin:unnecessaryparen to be adapted accordingly). In some cases, the controlling expression was more complex than just "false" and needed to be rewritten by taking it out of the if statement to silence Clang. One noteworthy case where the nature of the disabled code wasn't immediately apparent: Sep 12 16:59:58 <sberg> quikee, is that "if (false)" in ScExponentialSmoothingDialog::ApplyOutput (sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx) some work-in- progress or dead code? Sep 12 17:02:03 <quikee> sberg: WIP, but you can remove it Sep 12 17:04:47 <sberg> quikee, I'll wrap the false in an extra set of parentheses for now, to silence -Wunreachable-code (I wouldn't want to remove it, as I have no idea whether I should then also remove the "Initial value" comment preceding it) Sep 12 17:07:29 <quikee> sberg: both are different ways to calculate the "intital value"... so no Another case where the nature of the dead code, following while (true) loops without breaks, is unclear is sd/source/ui/remotecontrol/BluetoothServer.cxx, where I added TODO markers to the workarounds that silence the warnings for now. basic/source/sbx/sbxvalue.cxx had a variable of type double, of automatic storage duration, and without an initalizer at the top of a switch statement. Clang warning about it is arguably a false positive. Apart from that, this didn't find any cases of genuinely dead code in the existing code base. Change-Id: Ib00b822c8efec94278c048783d5997b8ba86a94c Reviewed-on: https://gerrit.libreoffice.org/42217 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-08clang-tidy modernize-use-emplace in b*Noel Grandin
Change-Id: I51e0369ba2e1fe0b7c934531f71d3bda95ba09ec Reviewed-on: https://gerrit.libreoffice.org/42109 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-08oovbaapi: create XOval and XLine shape typesTamas Bunth
This is needed in order to make "TypeOf myLine Is Line" or similar expressions return the expected "true" value. The implementation of the basic interpreter of TypeOf uses XTypeProvider to determine the type of an object by getting the last part of the type name. E.g. "ooo:vba::msforms::XLine" is determined as a "Line". That's why I created the XLine and XOval blank classes. TypeOf doc: https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/typeof-operator Change-Id: Ia49cc92d672e30d0126f02d61a55a956ac1425f0 Reviewed-on: https://gerrit.libreoffice.org/42083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-09-01Replace list by vector in dllmgr-x86-x64 (basic)Julien Nabet
Change-Id: I169590700474100e88f2e287f205ce7cbadedabe Reviewed-on: https://gerrit.libreoffice.org/41797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-09-01Replace list by vector in methods.cxx (basic)Julien Nabet
Change-Id: I75ad4d22dd6ff95e244fbffc1fc20ae208b2ecd1 Reviewed-on: https://gerrit.libreoffice.org/41796 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-31loplugin:constparams: basic (clang-cl)Stephan Bergmann
Change-Id: Ia84473360333cb4905692a4d9d0358c93acebff8
2017-08-29rename SBX errorcodes to BASICNoel Grandin
Change-Id: Ia6c2d2379a2f6e9b1109e2c04edd5cdd9dcf242f Reviewed-on: https://gerrit.libreoffice.org/41706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-29move all the basic errcodes to one fileNoel Grandin
Change-Id: Ic3353c80ac9fdbd17f17503b1c973c9a7cef0c7f Reviewed-on: https://gerrit.libreoffice.org/41617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>