summaryrefslogtreecommitdiff
path: root/basic
AgeCommit message (Collapse)Author
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-20loplugin:constparams in basicNoel Grandin
Change-Id: Idf55f63f2d56be4997a8cdc6afc5690eacac9a60 Reviewed-on: https://gerrit.libreoffice.org/40214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-19Change the most obvious Date+=(long)... to Date+=static_cast<sal_Int32>(...)Eike Rathke
Simple search git grep -l 'Date.*[+-].*[(<] *long *[>)]' Since commit f5b0cc2a3690ba963b3f150886e1d5ddddee9530 Date: Sat Jul 1 16:01:15 2017 +0200 Date operators +,-,+=,-= have sal_Int32 operands instead of long. Change-Id: I2387cbceadcb056831225e4111353980d50a94d4 Reviewed-on: https://gerrit.libreoffice.org/40163 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-07-17loplugin:unnecessaryparen: basic (clang-cl)Stephan Bergmann
Change-Id: Id6e339a4d1bc775826ff434bc77beb05fe353324
2017-07-14tdf#103104 Allow line-continuation followed by a dot in BASICTakeshi Abe
as in VBA-compatibility mode. Change-Id: If263183fc1fa5742235213a8617fdf412d2a245e Reviewed-on: https://gerrit.libreoffice.org/39893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-07-13loplugin:oncevar: empty strings: basicStephan Bergmann
Change-Id: I4edf130e526c4004aa8913e6aafdcd1e2f4ac1ef
2017-07-13use more OUString::operator== in a*..chart2Noel Grandin
Change-Id: Ifb5608abebffd9687ed55e8c74f9be54a749111d Reviewed-on: https://gerrit.libreoffice.org/39887 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13loplugin:oncevar for value-dependent constant expressionsStephan Bergmann
(Where the change to basic/source/comp/codegen.cxx reveals that loplugin:loopvartoosmall also needs the Clang < 3.9 workaround from 33ee8e61292af05627f5f72ea2f93ad80e715e46 "Work around bug in Clang 3.8".) Change-Id: I9f23b9648bc11ca4136a0fbdd332570ba70ee77c Reviewed-on: https://gerrit.libreoffice.org/39667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07basic: Put local stuff into unnamed namespaceTakeshi Abe
Change-Id: Ic8515d04980ee627f964821547fb25d52240e933 Reviewed-on: https://gerrit.libreoffice.org/39681 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-07-06use more begin()/end() for SequenceNoel Grandin
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
2017-07-06teach unnecessaryparen plugin about other kinds of statementsNoel Grandin
i.e. do / while / switch Change-Id: Id0985015cc425557f9984734701d56466f8a6088 Reviewed-on: https://gerrit.libreoffice.org/39601 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05loplugin:useuniqueptr in basic..cppcanvasNoel Grandin
Change-Id: Ib40241eb794607154ae52f8aa68fbf5ea5e944af Reviewed-on: https://gerrit.libreoffice.org/39551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05new loplugin unnecessaryparenNoel Grandin
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-04loplugin:casttovoid in RTLFUNCStephan Bergmann
Change-Id: I810278640936e9b3c73f56a37e8c4786fd2790e3
2017-07-02loplugin:casttovoid: basicStephan Bergmann
Change-Id: I4e70accf67d4d812b8998b0baa07cd04c27216ad
2017-06-29VBA test - add RATE, RGB functionsZdeněk Crhonek
Change-Id: I284597a54067049479c56d6e6eea6322f0e3ee2b Reviewed-on: https://gerrit.libreoffice.org/39377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-06-27No reason not to use RTLFUNC hereStephan Bergmann
Change-Id: I9f01d84b4c518c178220af5cc310a3ba06bdceaa
2017-06-24std::unordered_map can erase an element by given key, if anyTakeshi Abe
so that it is unneeded to find its position in advance. Change-Id: Iccf92f98b8683e4b2fb5252f5e05a357268b7033 Reviewed-on: https://gerrit.libreoffice.org/39156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-23loplugin:unusedfields in accessibility..comphelperNoel Grandin
Change-Id: Ifb68d65fc3e48dd80e3ff2b7a4124468fdda1695 Reviewed-on: https://gerrit.libreoffice.org/39137 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21s/ERRCODE_SBX_OK/ERRCODE_NONENoel Grandin
adds no value Change-Id: Iedf7a6a7be28fed4059b576312890be8cbb980d7 Reviewed-on: https://gerrit.libreoffice.org/39056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21convert ErrCode to strong typedefNoel Grandin
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-20loplugin:oncevar accessibility..basicNoel Grandin
Change-Id: I8fb41b658ef0f6ad1774ea897eace3dc9bb12de6 Reviewed-on: https://gerrit.libreoffice.org/38969 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-17use local statics in getTypes functionsJochen Nitschke
... instead of double checked locking patterns. Change-Id: I1b86ce723ff22dd357b3ed69a52757b085472424 Reviewed-on: https://gerrit.libreoffice.org/38906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-15replace SbxError typedef with ErrCodeNoel Grandin
part of a larger patch to convert ErrCode to strong_int Change-Id: Ia56e5d6d8c4217d6f258e2113d20ce737977892f Reviewed-on: https://gerrit.libreoffice.org/38813 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-15drop SbError typedefNoel Grandin
in favour of ErrCode. Part of a larger patch to convert ErrCode to strong_int Change-Id: Ia846bfc93c58c85c6a6cec79e9d19b9ecbd1c05f Reviewed-on: https://gerrit.libreoffice.org/38783 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-13remove MAYBEFUTURE dead codeNoel Grandin
Seems to date from: commit c631cf94e468d6f5ced5cacda3600c683c44dca2 Author: John LeMoyne Castle <jlc@mail2lee.com> Date: Tue Dec 21 15:47:53 2010 +0000 68bit currency enhancement Change-Id: I81863991ec3717ea213dffb535283e6fc8abceb7 Reviewed-on: https://gerrit.libreoffice.org/38693 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12cleanup unused css/frame/* includesJochen Nitschke
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09clang-tidy readability-non-const-parameterNoel Grandin
Change-Id: I7b2680898dbfc49185fb949349d81f4ac615a470 Reviewed-on: https://gerrit.libreoffice.org/38593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-08Cater for UNO (signed) vs. BASIC (unsigned) byte mismatchStephan Bergmann
See <https://listarchives.libreoffice.org/global/users/msg51243.html> "[libreoffice-users] type byte in Basic", where > Sub Main > dim oOutputStream as variant > oOutputStream = createUnoService("com.sun.star.io.SequenceOutputStream") > dim nA as byte > nA = 195 > oOutputStream.writeBytes(array(nA)) > oOutputStream.flush > dim back(0) as byte > back = oOutputStream.getWrittenBytes > MsgBox(back(0)) > End Sub failed with "Inadmissible value or data type. Overflow." instead of showing "-61". Change-Id: I0445476c67510d5f8669a6e711e92332c01ec06c
2017-06-07tdf#108039: check for nullptr in rtl_uString and OUStringMike Kaganski
rtl_[u]String_newConcat now checks allocation result to return early and avoid SIGSEGV. Other functions are not modified, to keep old behavior relying on allocation success and crashing early on OOM to avoid added overhead in performance-critical places. OUString operator+= now checks rtl_uString_newConcat result and throws std::bad_alloc on failure, to specifically address BASIC problem. It keeps strong exception guarantee of leaving this' state unaltered. Concatenation in BASIC now checks for bad string allocation (previously SIGSEGV was generated). Unit test included. Change-Id: I1513311d3d58eac43b2d2ec9a230e22dff0b4245 Reviewed-on: https://gerrit.libreoffice.org/37965 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-06replace SVSTREAM_OK with ERRCODE_NONENoel Grandin
since the first is #define'd to the second, and offers no extra value Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450 Reviewed-on: https://gerrit.libreoffice.org/38406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-05Improved loplugin:cstylecast to reference types: basicStephan Bergmann
Change-Id: Ib2159aef39d416905899fe91280d2234835e23e9
2017-06-05clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192 Reviewed-on: https://gerrit.libreoffice.org/38400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30teach redundantcast plugin about functional castsNoel Grandin
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30basic: Drop unused variables in test scriptsTakeshi Abe
Change-Id: I9893e8bed254dcac91fbc7abb5ab4817a28ba339 Reviewed-on: https://gerrit.libreoffice.org/38133 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-28remove unnecessary use of OString::getStrNoel Grandin
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-27add VBA tests- PMT, PPMT, PV,QBCOLOR functionsZdeněk Crhonek
Change-Id: Idcbecbdee6a6c054886d6a11ce22e525ecf23736 Reviewed-on: https://gerrit.libreoffice.org/38084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-05-24tdf#93727 Support date literals in basicGrzegorz Araminowicz
* detect #...# in SbiScanner * add vb test * made date locale-independent Change-Id: Ic269df2df8d3a7c5af7858c3655bb40a0b6033f0 Reviewed-on: https://gerrit.libreoffice.org/36002 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-24basic: Stop detecting the number of tokens at runtimeTakeshi Abe
which removes static variables and improves SbiTokenizer's thread-safety. Change-Id: Ic3eb52adfa85691af65f214c1b90c43c03f9a3dd Reviewed-on: https://gerrit.libreoffice.org/37867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-22Test _WIN32 instead of WIN32Takeshi Abe
since the former is predefined by Visual C++ [0], but the latter is not. [0] https://msdn.microsoft.com/en-us/library/b0084kay.aspx Change-Id: I9ecb84779cbaf5f0186ef0b05da61b32293f8f2b Reviewed-on: https://gerrit.libreoffice.org/37808 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-22basic: Kill unnecessary ifdef stuffTakeshi Abe
Change-Id: Id890eb2b7ff2f87005e114dd0fcea0fe3eb81eea Reviewed-on: https://gerrit.libreoffice.org/37866 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-20cleanup unused css/resource/ includesJochen Nitschke
Change-Id: I1e2c795cef64799d5e28e5fafec6cd72f621abba Reviewed-on: https://gerrit.libreoffice.org/37853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/script/ includesJochen Nitschke
but keep exception includes in headers for now Change-Id: I826828675a2d14b906e57068cbced2e790e12bce Reviewed-on: https://gerrit.libreoffice.org/37846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-19loplugin:stringcopy: basicStephan Bergmann
Change-Id: I39d8ae76be2794d5e7b5a9979d7211823c995c2c
2017-05-19make string translation loading more uniformCaolán McNamara
change various ResId classes that use conversion operator to OUString to functions that return a OUString drop various defines drop unnecessary toString calls Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92 Reviewed-on: https://gerrit.libreoffice.org/37817 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-19loplugin:comparisonwithconstant in basicNoel Grandin
Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5 Reviewed-on: https://gerrit.libreoffice.org/37809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-19basic: Fix broken unit test for IsMissing()Takeshi Abe
Change-Id: Ia6fb2622c85686a50701d4c37356e608a3df653b Reviewed-on: https://gerrit.libreoffice.org/37775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>