summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2019-02-20o3tl::make_unique -> std::make_unique in include/ & o3tl/Gabor Kelemen
Also the last few remaining occurrences of the header Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I18f435270057f2d09e21d6ea262532cbcc974598 Reviewed-on: https://gerrit.libreoffice.org/67843 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-19pretty up logging of exceptionsNoel Grandin
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-18fix comparison of std::lower_bound resultNoel Grandin
turns out using a compare operator that takes something other than the element type as a parameter is really hard to get right. The changes in: basic/source/classes/propacc.cxx comphelper/source/property/propagg.cxx vcl/source/font/font.cxx are a regression from commit 35e80e9726b5fee6a00caa58349a4b5d924dad7c Date: Fri Oct 19 16:01:19 2018 +0200 when calling std::lower_bound The change in toolkit/source/awt/vclxtoolkit.cxx is a regression from commit 76dd28afc9c0eb632a5dd20eb51704ee0bbc4b58 Date: Tue Oct 9 16:27:11 2018 +0200 loplugin:staticvar in various Change-Id: Icf6db22e1fc091517a53dd3624913c8c2071c106 Reviewed-on: https://gerrit.libreoffice.org/67954 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11tdf#112689: Replace chained O(U)StringBuffer::append() with operator+Yusuf Sonmez
Change-Id: I84fcc109087fe72cf68cf6cc1b8cf4045488ff46 Reviewed-on: https://gerrit.libreoffice.org/67601 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-02-11new loplugin writeonlyvarsNoel Grandin
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11tdf#112689: Replace chained O(U)StringBuffer::append() with operator+Muzaffer Kadir YILMAZ
Change-Id: Iba19864313dc5039f5ca27be3d0c68785612346a Reviewed-on: https://gerrit.libreoffice.org/67602 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-02-08loplugin:indentation in basctl..bridgesNoel Grandin
Change-Id: Ie4e27466c4258c6f774a3ebb82ec3a88c28fd753 Reviewed-on: https://gerrit.libreoffice.org/67525 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-07Fix typoAndrea Gelmini
Change-Id: I9b57e73303cb12e818cd761878d0c11c38f4cc3e Reviewed-on: https://gerrit.libreoffice.org/67481 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-01-27Fix typoAndrea Gelmini
Change-Id: Iccc171ce433e38c4eea4e73dcdba76720aa78056 Reviewed-on: https://gerrit.libreoffice.org/66969 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-01-24Clean up dead uses of DISABLE_ATLStephan Bergmann
...after e597ef0489d9d5504721d21eefa15c65da0fb240 "No need for --disable-activex and --disable-atl any longer" Change-Id: I6ea0026fd18e0097aaaf0c1b05618e2a9ddf1a94 Reviewed-on: https://gerrit.libreoffice.org/66871 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Minimum Supported Version is VS2017himajin100000
Change-Id: Id771f1fe0d8c6702a52836f6229a944d259fed4c Reviewed-on: https://gerrit.libreoffice.org/66424 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-16o3tl::make_unique -> std::make_unique in basctl...bridgesGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I9a20a58c68d12656359dcaa060d8ab41f621af32 Reviewed-on: https://gerrit.libreoffice.org/66262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-14tdf#122250 Crash when running extensionNoel Grandin
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/66293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-10tdf#112689: Replace chained O(U)StringBuffer::append() with operator+Doğa Deniz Arıcı
Change-Id: Ieb5c1e13ae647b49fd563f1759d744bd5f008ce1 Reviewed-on: https://gerrit.libreoffice.org/65758 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-08convert "*xxx.get()" to "*xxx"Noel Grandin
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9 Reviewed-on: https://gerrit.libreoffice.org/65951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-28Remove unneeded cast, constify OUStringMatteo Casalin
Change-Id: I4a92779f86104cdad420069620eec50cea85b29c Reviewed-on: https://gerrit.libreoffice.org/65662 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2018-12-26basic: Spare temporary variableTakeshi Abe
Change-Id: I6c39061e04537c01c87f6cb2f40a35dd0a551a08 Reviewed-on: https://gerrit.libreoffice.org/65597 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21use unique_ptr in SbiExpressionNoel Grandin
Change-Id: I8b44215c438b749afce4ad056cab2c2ac66d4bda Reviewed-on: https://gerrit.libreoffice.org/65534 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-12loplugin:useuniqueptr in basic and frameworkNoel Grandin
Change-Id: I409c9c572eb8f3d68c8a387844b43988b4ab5c32 Reviewed-on: https://gerrit.libreoffice.org/64949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-09Fix typoAndrea Gelmini
Change-Id: I9de253ee55e662b0356f1fe305cd0acb050474da Reviewed-on: https://gerrit.libreoffice.org/64826 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-07loplugin:singlevalfields extend to all static varsNoel Grandin
Change-Id: Ic238bb5291539fd1b7e98cb4afc9b25f37e7d528 Reviewed-on: https://gerrit.libreoffice.org/64710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05Fix typoAndrea Gelmini
Change-Id: I0345811912003e308054df426e533ac7c3866284 Reviewed-on: https://gerrit.libreoffice.org/64416 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-03add test for bug tdf#121337Zdeněk Crhonek
Change-Id: I26d1d426e6a856b09a48efe8e411b8c54e0f35cf Reviewed-on: https://gerrit.libreoffice.org/64275 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2018-12-02tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: Ia9c496ec93bedb13764969bf21c3f21d84caacef Reviewed-on: https://gerrit.libreoffice.org/64413 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-01Fix typosAndrea Gelmini
Change-Id: Ie85b3a61ded8c6fd7a1f8c463912062669b3719b Reviewed-on: https://gerrit.libreoffice.org/64357 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-11-30Fix typoAndrea Gelmini
Change-Id: I028e5462e9785bac77a98d09f0bf91b4da67e477 Reviewed-on: https://gerrit.libreoffice.org/64263 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Fix typoAndrea Gelmini
Change-Id: I8e340cc5bbf5131939446291177c3532911237ab Reviewed-on: https://gerrit.libreoffice.org/64183 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-11-21improve function-local statics in basic..cuiNoel Grandin
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee Reviewed-on: https://gerrit.libreoffice.org/63701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-20Fix a copypaste errorMike Kaganski
Has been like this since commit 2d1ef8aa2493f044fa543c72b40bd8c8394d8d71 Change-Id: Idf0e05246f625befb4872e743b490a5594d24f8f Reviewed-on: https://gerrit.libreoffice.org/63548 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-17Adapt to C++2a char_tStephan Bergmann
u8 literals incompatibly change their type (as implemented by recent Clang trunk) Change-Id: Ia4f7b91f5d86656a056303d2754981ab2093a739 Reviewed-on: https://gerrit.libreoffice.org/63494 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-16loplugin:buriedassign in avmedia..cuiNoel Grandin
Change-Id: Id44f1e98a3aac2c417f8030de603175bf68f0dfe Reviewed-on: https://gerrit.libreoffice.org/63467 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-13Set error also in non-UNO/UCB case file date failures, tdf#121337 follow-upEike Rathke
And do not attempt to format an odd date in case of failure. Change-Id: I82e93f9e473f42735b6a7e7b634b14ee7f09941d Reviewed-on: https://gerrit.libreoffice.org/63331 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-11-13Add reference to test codeStephan Bergmann
...that had inadvertently been missing from the file's inital commit, a6a48eeef16e473be14642469cd922f177f54998 "tdf#121325: Replace all of given length, even if replacement is shorter" Change-Id: I2a09e1d1ee94480d5615106a4e28958218d9b4c7 Reviewed-on: https://gerrit.libreoffice.org/63334 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-13tdf#121325: Replace all of given length, even if replacement is shorterStephan Bergmann
Both LO and MS Basic restrict the amount of replacement text ("If the Length parameter in the <emph>Mid statement</emph> is less than the length of the text that you want to replace, the text is reduced to the specified length." in helpcontent2/source/text/sbasic/shared/03120306.xhp, resp. "The number of characters replaced is always less than or equal to the number of characters in Target." at <https://docs.microsoft.com/en-us/dotnet/visual-basic/ language-reference/statements/mid-statement>). But cc20344010e94eda22fee662aab966d395a0796a "tdf#111313: Honor bWriteNoLenParam in !bCompatibility, too" had introduced a regression (in the non--compatibility- mode case), restricting the amount of replaced text to be no more than the amount of replacement text, even if the given length argument was larger. (Which had already regressed in the past, see <https://bugs.documentfoundation.org/show_bug.cgi?id=62090> "Mid statement doesn't work as expected".) Added test cases now. Change-Id: I21d4409f49a2437eb0e1a1e200561d803c42a24c Reviewed-on: https://gerrit.libreoffice.org/63328 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-13Don't call Date's ImpYearToDays with zero year argumentStephan Bergmann
...on which it asserts since 6d4f2dcc7cbba771e9d9b00de50368db4a88ef1b "Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendar". The assert fired when executing the Basic code from attachment 146529 to <https://bugs.documentfoundation.org/show_bug.cgi?id=121337> "FileDateTime("\\nonexistent\smb\path") returns bogus result rather than throwing error": > #4 0x00007ffff1d1c830 in (anonymous namespace)::ImpYearToDays(short) (nYear=0) at tools/source/datetime/tdate.cxx:55 > #5 0x00007ffff1d1c449 in Date::DateToDays(unsigned short, unsigned short, short) (nDay=0, nMonth=0, nYear=0) at tools/source/datetime/tdate.cxx:149 > #6 0x00007ffff1d1c3e5 in Date::GetAsNormalizedDays() const (this=0x7fffffff7268) at tools/source/datetime/tdate.cxx:142 > #7 0x00007ffff1d1dae5 in operator-(Date const&, Date const&) (rDate1=1900-1-1, rDate2=0-0-0) at tools/source/datetime/tdate.cxx:581 > #8 0x00007ffff5f87347 in GetDayDiff(Date const&) (rDate=0-0-0) at basic/source/runtime/methods.cxx:4653 > #9 0x00007ffff5f8aebb in SbRtl_FileDateTime(StarBASIC*, SbxArray&, bool) (rPar=...) at basic/source/runtime/methods.cxx:3054 Change-Id: I6468eeafc3daf325d3da3dfeacd08c7df1d1a8f4 Reviewed-on: https://gerrit.libreoffice.org/63318 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-11-10Remove unneeded castMatteo Casalin
Change-Id: I04279faaf11bd1249bcea0d07d60facefb5186d8
2018-11-10tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: I0b3c407331bfa1fa0c5003250d327d4f26de3643 Reviewed-on: https://gerrit.libreoffice.org/63235 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-10Replace deprecated boost::optional::reset(val) with operator =Mike Kaganski
Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b Reviewed-on: https://gerrit.libreoffice.org/63221 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-07move SvTreeListBox to vclCaolán McNamara
Change-Id: I04a146d3d8a428ac1678827dc883525c40240a44 Reviewed-on: https://gerrit.libreoffice.org/62787 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-06loplugin:collapseif in accessibility..cuiNoel Grandin
Change-Id: I1437b493f3289b4ac97d061bd71973580571e792 Reviewed-on: https://gerrit.libreoffice.org/62933 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-06remove with_sprintf_ defineNoel Grandin
it has been this way since commit f333ee4564f7786f5f4ca501d71e660b5c366b93 Date: Wed Apr 11 11:54:30 2007 +0000 INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED Change-Id: I317efd9538436480a9fc3d37e748b0a51052ef80 Reviewed-on: https://gerrit.libreoffice.org/62932 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-05tdf#120703 PVS: V547 Expression '!pRTLData' is always falseMike Kaganski
Let SbiInstance::GetRTLData() return reference Change-Id: Iafe7e64f6f296b478003ce66ea66936a65ba9edc Reviewed-on: https://gerrit.libreoffice.org/62855 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-30Make SbiProcDef::Match more readableJan-Marek Glogowski
This reverts commit 02caaef29d60 ("loplugin:useuniqueptr in SbiProcDef") and is hopefully easier to follow. Change-Id: I46be2b3c7a933743795d89fe17a2c499c6983382 Reviewed-on: https://gerrit.libreoffice.org/62548 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>