summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-02Small cleanup and simplificationMike Kaganski
Change-Id: I1e8a750832f365f080f6f60c81560dc942003049 Reviewed-on: https://gerrit.libreoffice.org/56788 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-30Small cleanupMike Kaganski
Change-Id: I0d3cea810b9148859d1c0704e06381f22d7b24c9 Reviewed-on: https://gerrit.libreoffice.org/56762 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-30tdf#118218: Make FormatNumber VBA-onlyMike Kaganski
0f7a7c8e719dab6b79e24285b907b5be17f39fc8 follow-up Change-Id: I79ed02770a4321401f250b85b04ef66d476a67df Reviewed-on: https://gerrit.libreoffice.org/56742 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-29tdf#118218: Implement FormatNumber VBA functionMike Kaganski
The existing unit test (previously non-functional because of defunct success condition) is fixed and extended. Change-Id: I2544f865144b25f51a5f0941e5d961f246f41c4b Reviewed-on: https://gerrit.libreoffice.org/56610 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-29Improved loplugin:redundantcast (const-qualified typedefs): basicStephan Bergmann
Change-Id: Ie22fe58dc2c2cc3867bd800f757433b68e0f2448 Reviewed-on: https://gerrit.libreoffice.org/56693 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-29tdf#118442: Fix incorrect index calculationMike Kaganski
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
2018-06-18Related: tdf#118073 SbiScanner::NextSym: no symbol is no symbolEike Rathke
Whatever may or may not advance or put back nLineIdx, if there's no progress at the end return false so we don't end up in an endless loop with the next NextSym() starting at the same position. Change-Id: I7084fea073490c15b8ff5abb3781ac82cdccd6d6 Reviewed-on: https://gerrit.libreoffice.org/56029 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-06-17crashtesting: check nLineIdxCaolán McNamara
Change-Id: If499712955702e760524478711160194ecea47c0 Reviewed-on: https://gerrit.libreoffice.org/55954 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-13valgrind: use OUString::operator to access into stringCaolán McNamara
address some out of bounds oddness seen with rtl_ustr_getlength_heap_buffer_overflow.sample Change-Id: I5a9772de9607644f43e74174f73053d292ca7cc0 Reviewed-on: https://gerrit.libreoffice.org/55722 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-06Translate German comments and debug stringsJohnny_M
And correct a few comments (translation and grammar) Change-Id: Ifafa521c683e9ca65aeba8031cd4cbfc1fadc137 Reviewed-on: https://gerrit.libreoffice.org/54888 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-06-01loplugin:includeform (clang-cl)Stephan Bergmann
Change-Id: Ia15fc0ea8d46cd4eab6ca690e1dac3a530512ab6 Reviewed-on: https://gerrit.libreoffice.org/55170 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-30Factor out AsyncQuitHandler to be usable elsewhere, tooTor Lillqvist
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>
2018-05-29forcepoint#42 check available str lengthCaolán McNamara
Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975 Reviewed-on: https://gerrit.libreoffice.org/54976 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-28Add missing includeSamuel Mehrbrodt
Change-Id: I645e25d6dcff1d395760f3a9980858a4c4ac1378 Reviewed-on: https://gerrit.libreoffice.org/54923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-05-28basic: Avoid looking up system clock twice to get current datetimeTakeshi Abe
Change-Id: I3de322a420bdbbd7906160b97dca531dfe3092a4 Reviewed-on: https://gerrit.libreoffice.org/53929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2018-05-28tdf#96099 Remove some trivial typedef std::vectorArkadiy Illarionov
Change-Id: I41fff78c10d46bde50063536d8cf1a3942dbf6af Reviewed-on: https://gerrit.libreoffice.org/54834 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2018-05-25loplugin:passstuffbyrefNoel Grandin
Change-Id: I785e96599bbda029adf4698d11d7f981750dec07 Reviewed-on: https://gerrit.libreoffice.org/54802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-23rename config_extension_update.h.in to config_extensions.h.inRene Engelhard
... and move HAVE_FEATURE_EXTENSIONS there, too Change-Id: I37fe52071e1db32cf5cc1e51dbd89bb4f32a39c1 Reviewed-on: https://gerrit.libreoffice.org/54072 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Rene Engelhard <rene@debian.org>
2018-05-22tdf#97231: basic: do not use extra wrapping for string marshalingVasily Melenchuk
previous approach did wrap string reference once again, making practically "a pointer to pointer to string" so this code was not working correctly for RegQueryValueExA WinAPI call. String is already provided as a reference (see marshalString(), so no reason to wrap its reference. This approach was just copied from from dllmgr-x86.cxx plus some minor changes to make both versions similar. Change-Id: I85065112407de3f078265d2c76437814402eb1b3 Reviewed-on: https://gerrit.libreoffice.org/54645 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-05-21tdf#97231: potential crash fixedVasily Melenchuk
blob2 pointer can be invalidated during marshalString() call, because it also adds new element in data vector and thus later access to blob2 can cause crash. Change-Id: I2de519c363193f34b249e7250a016397b7420882 Reviewed-on: https://gerrit.libreoffice.org/54613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-05-17New o3tl::temporary to simplify calls of std::modfStephan Bergmann
...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-17loplugin:redundantcast improvements for floating-integer conversionsStephan Bergmann
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016 Reviewed-on: https://gerrit.libreoffice.org/54416 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-16Resolves: tdf#117612 truncate DateAdd("m",...) to last day of monthEike Rathke
... 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. Change-Id: I9d6f95ad3ac38257d492019bd621070491e98e76
2018-05-10loplugin:unnecessaryvirtual improvementsNoel Grandin
look for virtual methods where all of the overrides of the method are empty Change-Id: I87d99a0b647700a8d53498e0ab5f0437d3508553 Reviewed-on: https://gerrit.libreoffice.org/54060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-04Removed executable permission on data filesAndrea Gelmini
chmod -x for .patch, .pptm, and .vb Change-Id: I98e1221e48df22e8b58aaf305898cbe301f187ce Reviewed-on: https://gerrit.libreoffice.org/52568 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-05-04Related: tdf#116579 tell SvNumberFormatter the proper NfEvalDateFormatEike Rathke
So far Basic relied on the side effect of date acceptance patterns selected according to the passed format's locale, which changed with the (temporarily reverted) commit dfb9138b8b5a239b46f189a717999bcaff19aa79. Explicitly tell the formatter the behavior to use. Change-Id: I9819399df69bdfa36d79bc9db116dec37a85cbeb Reviewed-on: https://gerrit.libreoffice.org/53787 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-05-02loplugin:useuniqueptr in SbiImageNoel Grandin
Change-Id: I24ee5de3628d6436dc045cb543d35b16074ef189 Reviewed-on: https://gerrit.libreoffice.org/53700 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-29Avoid comphelper::string::getTokenCount()Matteo Casalin
Change-Id: I2aae4f106f783969ede076ce7af14e5946a554ae
2018-04-29loplugin:useuniqueptr pStringOff in SbiImageNoel Grandin
Change-Id: I05de3e910bf857e095c99cade6fec22ccb2dd99d Reviewed-on: https://gerrit.libreoffice.org/53606 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-26[API CHANGE] deprecate XGraphicObjectResolverTomaž Vajngerl
XGraphicObjectResolver was used to get the GraphicObject URL from an storage (package) URL. This isn't possible anymore in LO 6.1 since creating GraphicObject from uniqueID was removed for its lifecycle issues. XGraphicObjectResolver is now deprecated and when the "resolveGraphicObjectURL" is called, it throws a RuntimeExeption. In places where XGraphicObjectResolver was used, we now use the XGraphicStorageHandler as the alternative. Both share a common implementation so previously we could cast one to the other at any time. Now only XGraphicStorageHandler is used. GraphicObjectResolver was removed and replaced by the alternative GraphicStorageHandler for instance creation - where needed. Change-Id: I5d3f759c6f95b7dbe2d93688d99c8aa4899ffa84 Reviewed-on: https://gerrit.libreoffice.org/53279 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-04-23loplugin:singlevalfields improve unaryoperatorNoel Grandin
when we see a unaryoperator, unless it's one of a small set, we can know (mostly) that the field will not be written. there is still a small risk of false+ with code taking references via conditional expressions. Change-Id: I96fa808067576a50e5eaf425338e225b4e0bdd4e Reviewed-on: https://gerrit.libreoffice.org/53263 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-21cppcheck: identicalInnerConditionJochen Nitschke
renamed temporary list in EnhancedCustomShape2d.cxx to avoid shadow of a local variable Change-Id: I17a2261dafd2067480fcc5314af4f48765d6b690 Reviewed-on: https://gerrit.libreoffice.org/53244 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-20loplugin:expressionalwayszero (clang-cl)Stephan Bergmann
Change-Id: If47b5bb3436ebdf799b74f7c0070f674ab52804e
2018-04-15remove some unused comphelper includesJochen Nitschke
and fix the fallout Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359 Reviewed-on: https://gerrit.libreoffice.org/52894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-12weld SbiInputDialogCaolán McNamara
this is basically the same as SvRTLInputBox Change-Id: Idbf0f58cf51ea706928e18b81ce80088015dccc4 Reviewed-on: https://gerrit.libreoffice.org/52763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-12weld SvRTLInputBoxCaolán McNamara
This (forgotten) dialog is the statbasic "InputBox" dialog Change-Id: Ifb65fb382be7bd6b5a2ba904e0cb64ddce2485a8 Reviewed-on: https://gerrit.libreoffice.org/52749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-06tdf#111313: Honor bWriteNoLenParam in !bCompatibility, tooStephan Bergmann
e8deba22e887a972f60ff05551e93c334ac1e7b6 "INTEGRATION: CWS ab26" had added the bCompatibility case with all the argument checking ("2006/05/04 08:33:46 ab 1.66.10.3: #111951# Changed Mid runtime behaviour only for CompatibilityMode(true)"), and it was probably an oversight that, for !bCompatibility, it left the bWriteNoLenParam case (triggered by Basic code like s = "abc" Mid(s,1) = "d" ) calling OUStringBuffer::remove with an illegal argument of len=-1. Change that so that only setting ERRCODE_BASIC_BAD_ARGUMENT is controlled by bCompatibility, while all the other checks (that are probably all necessary to not call rtl string functions with illegal arguments) are done in both modes. Also, the check nStartPos + 1 > nArgLen should probably be nStartPos > nArgLen instead, as nStartPos has already been decremented from the one-based Basic index to the zero-baesd rtl string index. Change-Id: I75deec0acf75b8677aa89f91897c06c1caa5614d Reviewed-on: https://gerrit.libreoffice.org/52500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-29loplugin:unusedmethodsNoel Grandin
Change-Id: I7805ac9bc6f8c0aa5ba4804777e7d7c2c29a78f3 Reviewed-on: https://gerrit.libreoffice.org/52066 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29loplugin:virtualdown in basctl,basicNoel Grandin
Change-Id: If0d729ee84263a5afb2c7acb2d62b08602aa59f4 Reviewed-on: https://gerrit.libreoffice.org/52046 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-20drop unnecessary includesCaolán McNamara
Change-Id: I1a817d5575bbd57ecaa874a27158b9218e4210cc Reviewed-on: https://gerrit.libreoffice.org/51603 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-17Typos: definied->definedJulien Nabet
Change-Id: I052d6a4815372c79b6d62c1c85d303c6272af3df Reviewed-on: https://gerrit.libreoffice.org/51466 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-03-15change recursive ImageURL prop. search to use XGraphicTomaž Vajngerl
In two cases we need to traverse and gather all ImageURL properties and get the URL string and store the graphic content to a storage (like we do in xmloff filter). ImageURL property can now only store external URL and Graphic stores the embedded XGraphic, so this was changed to look into Graphic property first and then ImageURL. We also don't gather URL sting anymore so they need to be loaded to XGraphic when gathering them. Change-Id: I5f3f4be2b403b9589d72b8733df0c97109f2b65d Reviewed-on: https://gerrit.libreoffice.org/51308 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-03-11Move (and rename) graphic stuff from svtools to vclTomaž Vajngerl
This is preparing to change how GraphicManager works where it won't base itself around GraphicObject anymore but Graphic. No functional or cosmetic change was made to the classes, only changes that were needed because of the move and rename. The only thing that wasn't moved is the GraphicRenderer as it is not needed in vcl for now (but makes sense to move it in the future to keep graphic stuff together). grfmgr was renamed to GraphicObject as the GraphicManager will be changed a lot and most likely moved out, so the name grfmgr won't make any sense anymore. All the UNO implementations were renamed with a prefix Uno and used the same name as the class name. This is made to be more specific which are the Uno objects (for example graphic.cxx contained the implementation of XGraphic, which is similar to graph.cxx contains Graphic). Change-Id: I54a2fa6c7e997469aaa7770db05244adb9f64137 Reviewed-on: https://gerrit.libreoffice.org/51068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-27convert Redline warning dialog to .ui to get helpidsCaolán McNamara
etc. Change-Id: Ic5e6031fe99347f19002d5d8527b5632333fefb0 Reviewed-on: https://gerrit.libreoffice.org/50431 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-27convert remaining WarningBox to weld::MessageDialogCaolán McNamara
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
2018-02-26loplugin:oncevar extend to tools/gen.hxx typesNoel Grandin
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2 Reviewed-on: https://gerrit.libreoffice.org/50283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-25convert remaining InfoBox to weld::MessageDialogCaolán McNamara
Change-Id: I91d828e38d96264cf4a76f30940942556b8f78d8 Reviewed-on: https://gerrit.libreoffice.org/50205 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>