summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)AuthorFilesLines
2019-01-17tdf#122250 Crash when running extensionNoel Grandin1-1/+5
as a consequence of commit 4e07987ce8134312920682e3481c3f8e3d7b66c3 Date: Thu Aug 25 15:08:55 2016 +0200 cid#1371154 Missing move assignment operator this extensions appears to pass bogus data into VCLXWindow::setProperty, so I had to workaround that when debugging Change-Id: Ib6728c0a990bd7cfbfed43d79b7560bd2f7f5a67 Reviewed-on: https://gerrit.libreoffice.org/66297 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit b2fa854e81d329c9ed49bd10944cea1a430ecf7e)
2018-10-30Fix warning in !HAVE_FEATURE_SCRIPTING caseTor Lillqvist1-1/+1
Change-Id: Ibc2a9d4426e9ef09eb874e7a9fef0ea31cad56d5 (cherry picked from commit 57ba456786614348e309ad1860219ace2f2a2e0b) Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2018-10-30basic, solve link problemsjan Iversen3-0/+16
When not using scripting, there were a number of unresolved symbols. First aproach did not work, so this commit is the more extensive. Change-Id: Iaf78bde10d9a43862d58d1aa8f46b14aa075eddb Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2018-10-20tdf#120706: nullptr dereferenceMike Kaganski1-1/+1
Change-Id: I55814a6b4cdfda93a51621b5b31c166507a7e7a6 Reviewed-on: https://gerrit.libreoffice.org/62005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 49d304c4f6635381a27b60a8944744cc81ff1e91) Reviewed-on: https://gerrit.libreoffice.org/62028 Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 7951138541caabcd25fccaa8f9ebb0226ce2ce12)
2018-06-30tdf#118442: Fix incorrect index calculationMike Kaganski2-2/+67
If a number string has leading spaces and/or minus, then calculating index into the aBuf as the difference between p and pStart gives wrong (too big) number. This asserts in debug builds, when e.g. an assignment is made in a BASIC macro: Dim f As Double f = " -12.20" "include/rtl/ustrbuf.hxx:490: sal_Unicode &rtl::OUStringBuffer::operator[](sal_Int32): Assertion `index >= 0 && index < pData->length' failed." This affects, e.g., https://gerrit.libreoffice.org/56610 (see https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/9527/consoleFull#1820989527d893063f-7f3d-4b7e-b56f-4e0f225817cd) Change-Id: I14654166be721907e2a26ea6f4091f203a9437d7 Reviewed-on: https://gerrit.libreoffice.org/56611 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins (cherry picked from commit b24b0b9856b42eb6598c053703a11f86b6a6346c) Reviewed-on: https://gerrit.libreoffice.org/56734 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2018-06-30tdf#118218: Implement FormatNumber VBA functionMike Kaganski4-9/+170
The existing unit test (previously non-functional because of defunct success condition) is fixed and extended. Also includes backport of commit 7283125c563a2759f278c1caa6a7b71ade4f0101 Change-Id: I2544f865144b25f51a5f0941e5d961f246f41c4b Reviewed-on: https://gerrit.libreoffice.org/56610 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 0f7a7c8e719dab6b79e24285b907b5be17f39fc8) Reviewed-on: https://gerrit.libreoffice.org/56731 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2018-06-01forcepoint#42 check available str lengthCaolán McNamara1-1/+1
Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975 Reviewed-on: https://gerrit.libreoffice.org/54978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 15ea1cda0b3c37ff944ad9a239b7ed453e8b0591)
2018-05-31Factor out AsyncQuitHandler to be usable elsewhere, tooTor Lillqvist1-26/+1
Or do we already have the corresponding functionality somewhere, and SbModule::Run() could be changed to use that instead? Change-Id: I6f45d4a023f9f9d9a24ab6934117a712ccbe75e2 Reviewed-on: https://gerrit.libreoffice.org/55048 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit cac718bfe606c363fa4538db8c6d21f28f139f58)
2018-05-23Resolves: tdf#117612 truncate DateAdd("m",...) to last day of monthEike Rathke4-29/+41
... instead of resulting in error because of roll-over not being set. Fallout from commit 6d424f07701bf26d8fb173563b567d5f097c33e2 CommitDate: Tue May 2 23:12:34 2017 +0200 Replace mouth-painted "inaccurate around leap year" rollover algorithm that does stricter checking but DateAdd() needs a lax checking with truncate to last day of month. (cherry picked from commit 40c9a129e5a53e6eadfe8ca80c98ccf7eda957f9) Conflicts: basic/source/runtime/methods.cxx Backported. Change-Id: I9d6f95ad3ac38257d492019bd621070491e98e76 Reviewed-on: https://gerrit.libreoffice.org/54421 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 07a0748243fed290771b8805398b0ca7a52369f7)
2018-03-25Decrease fragility in odd use cases with no current documentTor Lillqvist1-1/+4
Change-Id: I9966166561d4c6e577f3f7e8e04572f97a0b295e Reviewed-on: https://gerrit.libreoffice.org/49450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 73256b918119e378c762f6a3d79d04f311a075cc)
2018-03-20lokdialog: Allow switching language of some of the ResMgr's.Jan Holesovsky1-3/+2
This way, it is possible to have all the strings translated in dialogs even when different users use different languages. [It was already possible to have different languages previously, but not everything in the dialog has switched - like the buttons at the bottom of the dialogs etc.] Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9 Reviewed-on: https://gerrit.libreoffice.org/46417 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/46979 Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 101a79cc4d13a1f566c1b97c1329813eb7c61bcf)
2018-03-19Get rid of loop counter variableMike Kaganski1-4/+1
Change-Id: Ia4f4e24819525287e720a9c016b3666bc006b545 Reviewed-on: https://gerrit.libreoffice.org/46531 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 8de8e0ce218dbb9e74d2a41517d5f6b1d36f478f)
2018-02-16ofz#6311 still problems with SdrEdgeObj listening to same obj at start as endCaolán McNamara4-11/+11
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 Rathke1-1/+1
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 Rathke1-1/+1
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 Rathke1-2/+14
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 Rathke1-3/+22
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 Rathke1-14/+26
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 Rathke1-9/+9
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 Rathke1-10/+8
... 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 Rathke1-4/+14
... 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 Rathke4-50/+21
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 Rathke1-29/+38
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 McNamara1-1/+2
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 Rathke1-8/+19
Change-Id: I479040f411fb8b5975c0aa1aa24f95c957cf80cf
2017-11-22replace check of eof and GetError with goodCaolán McNamara1-1/+1
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 McNamara5-9/+9
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 McNamara2-2/+2
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 Grandin2-21/+21
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 Gelmini1-1/+1
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 Gelmini1-1/+1
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 Grandin3-12/+7
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 Grandin5-6/+6
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 Grandin16-38/+32
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 Rathke2-2/+3
Change-Id: I9c056a137ab873f677e374d75c4e2f06bf370f21
2017-10-27Fix build of Windows-only code, tdf#81671 follow-upEike Rathke1-1/+2
Change-Id: I68a468857c529e8cab80d4453832dc9f4b3657d8
2017-10-27Handle decimalSeparatorAlternative in BASIC ImpScan,..., tdf#81671Eike Rathke1-12/+22
Change-Id: I73ff2bf624ba7c8d88c9419a109c340806bd31f5
2017-10-26vcl: make MapMode constructor explicitMichael Stahl1-1/+1
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-23loplugin:includeform: basicStephan Bergmann10-15/+15
Change-Id: I6fbba5c4619eec7ae03fed65a18974faa0f190af
2017-10-23overload std::hash for OUString and OStringNoel Grandin5-7/+6
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 Grandin3-5/+5
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 Lillqvist2-29/+5
Change-Id: Ib43f8c185d2a2e9e93f34d918d6f9461586cf6a6
2017-10-10basic: consistently use "" and <> in include directivesMike Kaganski57-151/+151
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 Kaganski5-43/+40
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 Grandin3-8/+9
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 Kaganski2-2/+2
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 Kaganski3-11/+5
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 Kaganski1-2/+1
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 Kaganski1-9/+9
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 Lillqvist7-92/+2
Change-Id: Ib0e786b0e8401da3e3c93bf254727411774e8f43