summaryrefslogtreecommitdiff
path: root/idl/source
AgeCommit message (Collapse)Author
2024-05-02make the slot data constinitNoel Grandin
because it takes a surprising amount of time to initialise it at runtime during startup (*) have to convert the std::function in SfxType to a function pointer, because the std::function constructor is not constinit compatible. (*) the SfxType0..SfxTypeN types need some reinterpret_cast to work around the lack of zero-sized trailing arrays in c++ (*) Sadly MSVC does not support taking the address of symbols in constinit structures, so we cannot make the SfxSlot array constinit. Change-Id: I300ee770cc115d30bc25c819f2ad34b29633876c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166963 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-01use more OUString in sfx slotsNoel Grandin
Change-Id: I900d9f1d35bc1e620822eedd5722a502704d6de0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-01WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: I6eb8e490e878349f2063910e0cbc901aa7a6d524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166942 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-03-12Revert "add sm to --enable-mergelibs=more"Noel Grandin
This reverts commit 87d3f768f3ecded1e1392442181edb287aed9e2e. The unit test at starmath/CppunitTest_starmath_qa_cppunit.mk is doing $(eval $(call gb_CppunitTest_use_library_objects,starmath_qa_cppunit,\ sm \ )) which it is using to access to all the internal functions of starmath. Unfortunately that linking trick is just not compatible with the mergelib linking. Change-Id: Ie3c81a0eeea5bed192de18981463497f251531a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-07add sm to --enable-mergelibs=moreNoel Grandin
Which means (1) We need to extend the weak linkage magic for the sfx2 SFX_TYPEMAP stuff. Just make it unconditional, since it makes no difference for the individual items. (2) The initialisation of global const Sequence data in starmath stops working, because it runs too early. Use function-local static to initialise it on-demand Change-Id: Idc397515cd1d9621a06d237606c19acee600081a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-04cid#1545810 Using invalid iteratorJulien Nabet
and : cid#1545802 Using invalid iterator cid#1545745 Using invalid iterator cid#1545717 Using invalid iterator cid#1545675 Using invalid iterator cid#1545668 Using invalid iterator cid#1545639 Using invalid iterator cid#1545634 Using invalid iterator cid#1545629 Using invalid iterator cid#1545620 Using invalid iterator cid#1545608 Using invalid iterator cid#1545607 Using invalid iterator cid#1545601 Using invalid iterator Change-Id: I403842175f64a570d7e52fba7c3e03bf21b7d05b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160320 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-20Extended loplugin:ostr: idlStephan Bergmann
Change-Id: I22adb7f3750f1e1b9910f37046c5da98ac7ab5be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159697 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-17Manual extended loplugin:ostr changeStephan Bergmann
Change-Id: Ic0418ba78851183deba2555943cf26934b982378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159521 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-03tdf#145538 Use range based for loops in idl:objectYli875
Change-Id: I7c9935254be5bea050a09859cebbc4112894999b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156858 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-04-10Drop SvStream::WriteCharPtrMike Kaganski
WriteOString is a better replacement Change-Id: Ic431b9aeb98d19fe61cff71360eee555105cc2bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-30loplugin:stringadd in variousNoel Grandin
when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I8cf6a47ad357ddc73e2c430d966be72d5efd1485 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149767 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-17tdf#145538 Use range based for loopsanfanite396
Change-Id: I546bbcd6de02f9a31db6dcb34b4493bd165c0661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148527 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-02-24tdf#114441 Convert sal_uLong to a better typeAdoche Onaji
In slot.cxx, GetAttrCount() return a size_t type and same type can be assigned directly to nSCount. In hash.hxx, sal_uLong was declared in SvStringHashEntry, the only default parameter it the class takes is aName (type OString) while nValue was directly initialized as 0 in the constructor. The interface to change nValue is through a method setValue of same type.Also In idl/inc/hash.hxx SetValue() and GetValue functionsb are used in idl/source/prj/database.cxx with sal_uInt32 parameter and return type and thus, sal_uInt32 is suitable here.The instances of sal_uLong in source/objects/object.cxx are replaced with sal_uInt32. In object.cxx an iterator was declared using std::find to find nId in rSuperList (originally declared as std::vector<sal_uLong>), therefore if nId is sal_uInt32, the parent vector, rSuperList should be sal_uInt32. This change is now applicable to the void method InsertSlot's parameter rSuperList in object.hxx and also variables n, nId, iter, rSuperList in InsertSlot definition block in the file object.cxx. Variable aSuperList in obect.cxx is also changed to sal_uInt32 because its an argument for rSuperList parameter. nC1 and nC2 in idl/source/prj/svidl.cxx are chnaged from sal_uLong to size_t as this is suitable here. Change-Id: Ie075875229a676ea32dbf9e3049881a479773703 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147220 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Hossein <hossein@libreoffice.org>
2023-02-08Fix bogus uses of OUString::createFromAsciiStephan Bergmann
We got a report on IRC of builds failing with > svidl: /home/dolezvo1/Downloads/libreoffice/sal/rtl/ustring.cxx:278: void rtl_uString_newFromAscii(rtl_uString**, const char*): Assertion `static_cast<unsigned char>(*pCharStr) < 0x80' failed. when the "l" in "Downloads" was some non-ASCII character (whose exact identity was apparently obscured by the used pastebin service, though). Change-Id: Ib460793b0f8aa5e8f8822fa224d67e5a622a234d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146664 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-13add SvStream::ReadLine(OStringBuffer... to reduce OString allocationNoel Grandin
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-17loplugin:stringviewparam convert methods using copy()Noel Grandin
which converts to std::string_view::substr() Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11use more string_viewNoel Grandin
found by tweaking the loplugin:stringview and making it whitelist getLength Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-27Recheck modules [i-l]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I758bb27e93779e3df21c463714e49354748f446f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128715 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-27add some more TypeWhichId annotationsNoel Grandin
and update the idl compiler to cope with namespaced class names Change-Id: I7b5242f872e358bc3c5584f543767719172aac83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129026 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-02idl : no need to use rtl::StaticArnaud VERSINI
Change-Id: I8b53ab93010f500a61aa4930817c25d09cb2552d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-01idl : use delegating constructorArnaud VERSINI
Change-Id: Ic3a23dfc1278a9f34d0b7a441d604903eadc2a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127818 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-12-25idl : remove useless define and copy the code directly !Arnaud VERSINI
Change-Id: I92d53beb110a44624b72f7ec76ab8d1089f9caf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127438 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-24mergelibs: fix duplicate aSfxInt16Item_ImplJan-Marek Glogowski
The callgrind / mergelibs build fails with: /svx/source/form/typemap.o: in function `aSvxColorItem_Impl´: \ multiple definition of `aSfxInt16Item_Impl´; \ /sfx2/source/appl/appbas.o: first defined here Regression from commit 60d7796624f1c56eb036d3e73d7f8a8216cce2a4 ("sd theme: allow setting color effects in the sidebar"). Change-Id: Ibe382e2e12d3359caa3e853e264de0ede6a5e601 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127429 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-22loplugin:flatten in filter..includeNoel Grandin
Change-Id: I74c1ea8b9b490eaa9508a885758224063e39051b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127235 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13tdf#114441:Convert use of sal_uLong to better integer typesEmircan Agac
Change-Id: I14cfc4113e9aff0fcff3b2d3c2b0444aad8934ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120332 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-05WASM: add initial support for Emscripten cross buildJan-Marek Glogowski
- configure with: - --host=wasm64-local-emscripten - had to make a few externals optional, so adding: - --disable-nss - --disable-cmis - --disable-curl Change-Id: I48d1c73d2675ad2e2beaf2c341578199efbd24ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111130 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-04-29loplugin:stringadd simplify some *StringBuffer operationsNoel Grandin
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27use more string_view in tools/streamNoel Grandin
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-19use more string_view in OString APINoel Grandin
some parts of the OString seem to have fallen behind its more popular sibling OUString. Change-Id: Ie6d64c3005b2df5da49ba79d0c38282dd5057a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114252 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-16tdf#114441: Convert use of sal_uLong to better integer typesAhmet Hakan Çelik
Change-Id: I173d57105429e2bdf2288678fa7911b8541a402b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112154 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-11tdf#114441: Convert use of sal_uLong to better integer typesBayram Çiçek
Change-Id: Ibb432c3db6d99343514c412c4c1b968808b733c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110886 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-14-Werror,-Wformat in idl with Raspberry pi 4bJulien Nabet
[CXX] sax/source/expatwrap/sax_expat.cxx /home/pi/lo/libreoffice/idl/source/prj/database.cxx:437:23: error: format specifies type 'unsigned long' but the argument has type 'sal_uInt64' (aka 'unsigned long long') [-Werror,-Wformat] "error", nRow, nColumn ); ^~~~ /home/pi/lo/libreoffice/idl/source/prj/database.cxx:437:29: error: format specifies type 'unsigned long' but the argument has type 'sal_uInt64' (aka 'unsigned long long') [-Werror,-Wformat] "error", nRow, nColumn ); ^~~~~~~ 2 errors generated. Following https://cgit.freedesktop.org/libreoffice/core/commit/?id=5419b894a2e791de24d10f0c4433a807e175e7a0 author siddheshpatil777 <[hidden email]> 2021-01-06 14:14:33 +0400 committer Michael Stahl <[hidden email]> 2021-01-21 16:36:00 +0100 commit 5419b894a2e791de24d10f0c4433a807e175e7a0 (patch) tree 72cdf2b9648a18d711c53bb0d36ffb550ec0850d parent 21138573fcc6e300a446ffba8cfde00198fb249e (diff) tdf#114441: Convert use of sal_uLong to better integer types Change-Id: I0d961e8b1e0a6a9709fabb50b5e209c7ac5e7250 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110844 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-21tdf#114441: Convert use of sal_uLong to better integer typessiddheshpatil777
Change-Id: I14742675541a315e72191df4ee38c35373b39d52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108842 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2020-12-20No longer need to worry about ambiguous operator== in loplugin:stringviewparamStephan Bergmann
...after 46c5de832868d2812448b2caace3eeaa9237b9f6 "make *String(string_view) constructors explicit" Change-Id: I6e884c762a2fc91f5dd6fbb197a596fd60f17cae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108043 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-10Avoid calling OString ctor with null pointerStephan Bergmann
...in preparation of potential future changes from using OString to using std::string_view, where OString has an undocumented feature of allowing construction from a null pointer. This is mostly the result of a manual audit of potentially problematic getenv calls across the code base. But there can be other problematic places too, like the xmlGetProp call in tools/source/xml/XmlWalker.cxx. To identify those, rtl_{string,uString}_newFromStr aborts now in non-production debug builds when a null pointer is passed(and all places that hit with a full `make check screenshot` have been addressed here). Once we are confident that all problematic places have been identified, we should drop support for the undocumented feature (see the TODO in sal/rtl/strtmpl.cxx). Change-Id: I595cc6d4f1cda74add2a3db171323f817d362b08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-13tdf#123936 Formatting files in module idl with clang-formatPhilipp Hofer
Change-Id: I0a2681218773288c14b6faf98dd0bb8a7dbac56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105679 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-09-10svidl: Don't mention removed propertiesMaxim Monastirsky
Get/Set were removed in ccbed01b40c9bc4421943ebe1fe818d43aadcc7d ("remove unused GET/SET/STATUSBARCONFIG in .SDI files"). Nested methods were removed in 20f33eb7c5ebf2611008f6173da870bd0d1693fc ("svidl: Remove nested method support"). Change-Id: Ice03e63dc5f54365099bcaff3ba379cf691709bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102346 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-10Remove the useless Export sdi propertyMaxim Monastirsky
Maybe I'm missing something, but its usage - "if ( !GetExport() && !GetHidden() )" seems like expects it to be true and false at the same time. Anyway, there's no diff in workdir/SdiTarget after this change, so should be safe to remove. Change-Id: I6db508ff40c05dc828ffa91bb41a37c17b697503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102345 Tested-by: Jenkins Tested-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-04-07loplugin:flatten in idlNoel Grandin
Change-Id: I7e8fe338a366d146c7951fe54f74cc5e42bde039 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91833 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-20The idl __attribute__((__weak__)) hack doesn't seem necessary for --enable-ltoStephan Bergmann
dbfc495a9ace0865d764dad7404633a12cda2873 "Add config option used when we try to link one huge object file" had added it for the --enable-lto case, but without documenting exactly what it should help with. And at least my local Linux --enable-lto --enable-dbgutil etc. build successfully does `make check && make screenshot` without it. This removes the only use of STATIC_LINKING, so remove it completely. (And basctl/source/basicide/basidesh.cxx still needs to include config_options.h for ENABLE_MERGELIBS.) Change-Id: I3820e1cacccc92f5ac0c9c7fcc539c29a6864694 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90804 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-11tdf#114441: Convert use of sal_uLong to better integer typesBugra
Change-Id: I6b6f59a73aeda6af78fecaf4344826a943072033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90191 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-24Introduce OStringCharStephan Bergmann
...similar to OUStringChar, to be used in string concatenation expressions. And enable the corresponding loplugin:stringadd check, and fix its findings. Change-Id: I35ebb2253ba82bda6c98ae6ebd2ad4f27cf9abf9 Reviewed-on: https://gerrit.libreoffice.org/81456 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-21size some stringbuffer to prevent re-allocNoel Grandin
found by the simple expidient of putting asserts in the resize routine. Where an explicit const size is used, I started with 32 and kept doubling until that site did not need resizing anymore. Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4 Reviewed-on: https://gerrit.libreoffice.org/81138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>