summaryrefslogtreecommitdiff
path: root/basic/source
AgeCommit message (Collapse)Author
2019-10-01loplugin:data (clang-cl)Stephan Bergmann
Change-Id: Ib8b2bc1c5f7b27a646036ce23cae2b6a06edd038 Reviewed-on: https://gerrit.libreoffice.org/79922 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01Avoid loplugin:data (clang-cl)Stephan Bergmann
Change-Id: If10e70b30313509988861ee5200f08f2b83a647b Reviewed-on: https://gerrit.libreoffice.org/79918 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringadd in basctl..cuiNoel Grandin
Change-Id: I2fdeb7eb3ead3512ad6d3fe793305038ab3aa7ae Reviewed-on: https://gerrit.libreoffice.org/79886 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:duplicate-defines in basicNoel Grandin
Change-Id: I0e400bdd9cfc5fd123c574e05c4aca55b782395f Reviewed-on: https://gerrit.libreoffice.org/79831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27tdf#62326 - Macros: Converting Hex strings of negative valueAndreas Heinisch
If the value of the hex string lies within the range of 0x8000 (SbxMAXINT + 1) and 0xFFFF (SbxMAXUINT) inclusive, cast the value to 16 bit in order to get signed integers, e.g., SbxMININT through SbxMAXINT. Moved unit test to test_scanner.cxx in order to test basic hex convertations. Removed old vba unit tests. Change-Id: I247b41c40197afc5328ef5685c758c1dd1cefae5 Reviewed-on: https://gerrit.libreoffice.org/79583 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-18Removed executable permission on filesAndrea Gelmini
Change-Id: Iea2a937559ac8393c0fb5bf9482115ba162c2a6c Reviewed-on: https://gerrit.libreoffice.org/79079 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-17tdf#118544 set correct type for optional parameterTomoyuki Kubota
Change-Id: Id8840431b9dc1f1e97882c675ebfc6456e33d953 Reviewed-on: https://gerrit.libreoffice.org/77684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-17Remove redundant clearsMike Kaganski
Change-Id: Id95a33bd7f2a89791e140bf0cb51b59c06a2c65e Reviewed-on: https://gerrit.libreoffice.org/79054 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-17move GetStandardText to stdtext.hxxCaolán McNamara
Change-Id: Iaf9b5107cf88390f62d5ca94bf985c77bcb8b7ad Reviewed-on: https://gerrit.libreoffice.org/79048 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-06Fixing "...."Andrea Gelmini
Change-Id: Id005a7531d546dd43de13b49bcb3e93081c5ad8d Reviewed-on: https://gerrit.libreoffice.org/78679 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-03loplugin:constmethod in basicNoel Grandin
Change-Id: Ib2056ab8437e163c7ae42e3ab7a4a3f8b6cb80a2 Reviewed-on: https://gerrit.libreoffice.org/78547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-01Fix '..'Andrea Gelmini
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for ".." instead of "..." between words. It passed "make check" on Linux. Change-Id: I144d8061fca9f545c762941551e59dffdd3650e8 Reviewed-on: https://gerrit.libreoffice.org/78357 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-09-01Fix '..'Andrea Gelmini
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for lines ending with ".." instead of "..." It passed "make check" on Linux. Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe Reviewed-on: https://gerrit.libreoffice.org/78356 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16use more TOOLS_WARN_EXCEPTIONNoel Grandin
Change-Id: Ic21ea11ff106e0732bb8fa600ef39a549d7bda86 Reviewed-on: https://gerrit.libreoffice.org/77569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15loplugin:sequenceloop in basic..cuiNoel Grandin
Change-Id: I15d825de3201808d188b461415f78a4d81b64127 Reviewed-on: https://gerrit.libreoffice.org/77494 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-14Fix Clang 10 -Werror,-Wimplicit-int-float-conversionStephan Bergmann
> basic/source/sbx/sbxint.cxx:342:13: error: implicit conversion from 'sal_Int64' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] > if( d > SAL_MAX_INT64 ) > ~ ^~~~~~~~~~~~~ > basic/source/sbx/sbxint.cxx:358:13: error: implicit conversion from 'sal_uInt64' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] > if( d > SAL_MAX_UINT64 ) > ~ ^~~~~~~~~~~~~~ > basic/source/sbx/sbxint.cxx:706:34: error: implicit conversion from 'sal_uInt64' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] > else if( d > SAL_MAX_UINT64 ) > ~ ^~~~~~~~~~~~~~ > basic/source/sbx/sbxlng.cxx:60:30: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] > if( p->nSingle > SbxMAXLNG ) > ~ ^~~~~~~~~ > basic/source/sbx/sbxsng.cxx:280:21: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] > if( n > SbxMAXLNG ) > ~ ^~~~~~~~~ > basic/source/sbx/sbxsng.cxx:297:21: error: implicit conversion from 'sal_uInt32' (aka 'unsigned int') to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-int-float-conversion] > if( n > SbxMAXULNG ) > ~ ^~~~~~~~~~ > basic/source/sbx/sbxulng.cxx:66:30: error: implicit conversion from 'sal_uInt32' (aka 'unsigned int') to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-int-float-conversion] > if( p->nSingle > SbxMAXULNG ) > ~ ^~~~~~~~~~ Consistently use o3tl::convertsToAtLeast/Most(o3tl::roundAway(...), ...) for all those conversion cases that check that a floating-point value falls into an integer range, even those that don't cause a warning. even those that don't con Change-Id: I008f615e9b4ad7533390aa1822cc932bf4a4b351 Reviewed-on: https://gerrit.libreoffice.org/77452 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-14Fix Clang 10 -Werror,-Wimplicit-int-float-conversionStephan Bergmann
> basic/source/sbx/sbxvalue.cxx:1038:58: error: implicit conversion from 'sal_Int64' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] > if( dTest < SAL_MIN_INT64 || SAL_MAX_INT64 < dTest) > ^~~~~~~~~~~~~ ~ > basic/source/sbx/sbxvalue.cxx:1065:58: error: implicit conversion from 'sal_Int64' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] > if( dTest < SAL_MIN_INT64 || SAL_MAX_INT64 < dTest) > ^~~~~~~~~~~~~ ~ Change-Id: Ic1e88ae0e0cbc58bec0742d73fa40bfa0ff88858 Reviewed-on: https://gerrit.libreoffice.org/77453 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): basicStephan Bergmann
Change-Id: I174b057e29e5c0d56534fb1d2b6240880c7ddf2b Reviewed-on: https://gerrit.libreoffice.org/76695 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-28loplugin:collapseifNoel Grandin
Change-Id: I69bfafa97c66ef944cc6ae35c7e2f66d0430d6a4 Reviewed-on: https://gerrit.libreoffice.org/76496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-24Fix typosAndrea Gelmini
Change-Id: Ib778a6598f3797fe871a25b56b7b4b7761889296 Reviewed-on: https://gerrit.libreoffice.org/76269 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-22cid#1448485 silence Copy-paste errorCaolán McNamara
Change-Id: I6c82f9d87203d90099e39880bfd3feb2c2ff8354 Reviewed-on: https://gerrit.libreoffice.org/76097 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19loplugin:referencecasting in avmedia..basicNoel Grandin
Change-Id: I6790b2e3902d64fb6f714f031affa221dbaba014 Reviewed-on: https://gerrit.libreoffice.org/75934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19cid#1448547 Unchecked return valueCaolán McNamara
Change-Id: If0b19a53bba10064a81a22856cd3796dcefd1f68 Reviewed-on: https://gerrit.libreoffice.org/75903 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19cid#1448256 Unchecked return valueCaolán McNamara
Change-Id: I13c95bdbfc3161cca3b136266c5fd2e57b34a093 Reviewed-on: https://gerrit.libreoffice.org/75870 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19cid#1448438 Uncaught exceptionCaolán McNamara
Change-Id: I444e8c8833db6bb0af9cfc7c3b18b45178faa663 Reviewed-on: https://gerrit.libreoffice.org/75892 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18cid#1448372 Unchecked return valueCaolán McNamara
Change-Id: I63d8c9d145cd938fde289d680bdc0ed3f7357bd7 Reviewed-on: https://gerrit.libreoffice.org/75883 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18cid#1448326 Unchecked return valueCaolán McNamara
Change-Id: I21dd0363ff8cad8737a25b3b79f960d44d03bdd4 Reviewed-on: https://gerrit.libreoffice.org/75877 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-06-29tdf#125564: WatchWindow should report correct type for global constantsTomoyuki Kubota
Change-Id: Ibe078e61385e78aab3933d70af14f4b38806fcf6 Reviewed-on: https://gerrit.libreoffice.org/73142 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-14loplugin:logexceptionnicely in accessibility..basicNoel Grandin
Change-Id: I6e0b95b40e3d62db36352f3ea916f79f3dbc9084 Reviewed-on: https://gerrit.libreoffice.org/74018 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-11Use hasElements to check Sequence emptiness in accessibility..canvasArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I24c3f04b4eed3c1cd973166885660f113a26844f Reviewed-on: https://gerrit.libreoffice.org/71805 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-11loplugin:virtualdown in SbxValueNoel Grandin
Change-Id: I746b6b7e18265366903825ccf6c94f672dc92db9 Reviewed-on: https://gerrit.libreoffice.org/73770 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-27-fsanitize=nullabilityStephan Bergmann
Change-Id: I27336c512ed0b46b32344a05611e6ba17e45adef Reviewed-on: https://gerrit.libreoffice.org/73023 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-15Fix typoAndrea Gelmini
Change-Id: I715da280563c7c3f03eb9b521478db4481ae4b2f Reviewed-on: https://gerrit.libreoffice.org/72322 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-10an uno -> a unoCaolán McNamara
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-07downgrade warning to infoCaolán McNamara
Change-Id: Id337f26471f54d7d52c293629b9d19901b188c63 Reviewed-on: https://gerrit.libreoffice.org/71897 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-03tdf#68339 Other: BASIC Syntax errorJens Carl
Allow expressions (operands) of comparison operators prefixed with the Logical Operator "Not". Change-Id: I1b070e2288dac26b1f1186d38cf5d2f4ad99a406 Reviewed-on: https://gerrit.libreoffice.org/71332 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-02Resolves: tdf#124605 ditch "if operand 1 is Empty, result is operand 2"Eike Rathke
It has been like that since the initial import but is utter nonsense. It might had (doubtfully) served some early StarBasic compatibility quirk, but is wrong and was implementation defined buggy behaviour. The Option VBASupport 1 even explicitly disabled it. In future we may want to implement the VBA Nothing value for an SbxEMPTY at least for boolean operators, but this for Calc user defined macro functions might even need a distinguished SbxEMPTYCELL or such. Or an explicit SbxNOTHING. Change-Id: I28919d982d0e60b9b840a12271dc717effa59662 Reviewed-on: https://gerrit.libreoffice.org/71701 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 Date: Thu Dec 21 20:08:33 2017 +0900 chart2: suspend/resume setting rects dirty for 3D shapes comphelper::OInterfaceCompare is no longer necessary Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975 Reviewed-on: https://gerrit.libreoffice.org/71537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-25Fix typoAndrea Gelmini
Change-Id: I7db23f84a3de4772b38c9538704f501a9169ce09 Reviewed-on: https://gerrit.libreoffice.org/71267 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-23tdf#123043 make type character detection unicode-awareTomoyuki Kubota
Change-Id: I98886a7d13a43cc3202d45f96ceb5062f76f0784 Reviewed-on: https://gerrit.libreoffice.org/71013 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-17Fix uses of variables before their lifetimes beginStephan Bergmann
All of those have been broken with recent loplugin:sequentialassign changes (and have been found with a new plugin to be commited). The code in SbUnoClass::Find (basic/source/classes/sbunoobj.cxx) looks suspicious, but has been effectively like that ever since at least c25ec0608a167bcf1d891043f02273761c351701 "initial import", so just marked it with a TODO comment for now. Change-Id: I0d691cb55ef317cf2b16b0490169de7ec97375cf Reviewed-on: https://gerrit.libreoffice.org/70874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-12loplugin:sequentialassign in accessiblity..canvasNoel Grandin
Change-Id: I984717138ac85c1af5fc363fda06f5c2b5497965 Reviewed-on: https://gerrit.libreoffice.org/70641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08Fix typoAndrea Gelmini
Change-Id: I1413e1872b1f2cd29256b33cdc7ac7ae09faf46c Reviewed-on: https://gerrit.libreoffice.org/70394 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-08Fix typoAndrea Gelmini
Change-Id: Ia5b4b50e919964b0746a68b008c9f7a86240c3a6 Reviewed-on: https://gerrit.libreoffice.org/70398 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-08Fix typoAndrea Gelmini
Change-Id: I7b9802f224b497004df8cce7abd2bb8e52c79128 Reviewed-on: https://gerrit.libreoffice.org/70395 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-07tdf#120703 PVS: Silence V522 warningsMike Kaganski
V522 There might be dereferencing of a potential null pointer. Change-Id: I680f1628133216de6336ac5ffa846447ffd55a41 Reviewed-on: https://gerrit.libreoffice.org/70352 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>