summaryrefslogtreecommitdiff
path: root/vbahelper/source/msforms/vbacontrol.cxx
AgeCommit message (Collapse)Author
2024-05-14loplugin:ostr in vbahelperNoel Grandin
Change-Id: I7763dd628ba3d4288e52b51e08a5af301f916c1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167621 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-01use more XVclWindowPeerNoel Grandin
Rather than using it's superclass XWindowPeer and implicitly relying on it being XVclWindowPeer and casting it everywhere. Change-Id: Icfb46f3b920d00f4a167a31803a71bbb0368d05c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149894 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-28clang-tidy modernize-pass-by-value in vbahelperNoel Grandin
Change-Id: I7f2a7dd3e8f0a791496f5e021bd802dba89d7643 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-31Use a range-based for loopStephan Bergmann
Change-Id: Id3c358e0a7f11a4a203b1acbd42b9b09c7f7a2fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135193 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03Just use Any ctor instead of makeAny in vbahelperStephan Bergmann
Change-Id: Ie985584ad55f69817294e45b11b7c832d39c9bf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133737 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-01Prepare for removal of non-const operator[] from Sequence in vbahelperMike Kaganski
Change-Id: I2450faf4b3e093b2046034e2a5e5657ff5144d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124410 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-04-08move set/get Pointer to VCLUnoHelperCaolán McNamara
Change-Id: I7dadc7bc881e0b892720b3eb89fdc60c8d87c541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113776 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
(*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-11vbahelper: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I190d58fe45aa0b724b7239f5417bd0293d6dca80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98234 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-16Revert "loplugin:constfields in vbahelper"Noel Grandin
This reverts commit cc34b5a4c2d231de3882508654f15765d29f44c9. Change-Id: I891826d88dd4e8bc8e6896889f4c1880c798080f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-17tdf#42949 Fix IWYU warnings in vbahelper/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I6bf00dd94a397f00b4aa8c58ce7a5963e0eadc89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88629 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-26Rephrase cast from sal_Int32 to sal_uInt32Stephan Bergmann
...to avoid false positives with upcoming loplugin:unsignedcompare: > vbahelper/source/msforms/vbacontrol.cxx:730:12: error: explicit cast from 'sal_Int32' (aka 'int') to 'sal_uInt32' (aka 'unsigned int') (of equal rank) in comparison against 'sal_uInt32': if the cast value is known to be non-negative, use o3tl::make_unsigned instead of the cast [loplugin:unsignedcompare] > if ( ( static_cast<sal_uInt32>(nBackColor) >= sal_uInt32(0x80000000) ) && > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > vbahelper/source/msforms/vbacontrol.cxx:731:12: error: explicit cast from 'sal_Int32' (aka 'int') to 'sal_uInt32' (aka 'unsigned int') (of equal rank) in comparison against 'unsigned long': if the cast value is known to be non-negative, use o3tl::make_unsigned instead of the cast [loplugin:unsignedcompare] > ( static_cast<sal_uInt32>(nBackColor) <= sal_uInt32(0x80000000) + SAL_N_ELEMENTS(nSysCols) ) ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (This is the only case I found where the plugin's heuristics failed.) Change-Id: I36d12caa0f837b8ba860eaf33b3e166a4f1001fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87454 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-09-26loplugin:constmethod in vbahelperNoel Grandin
Change-Id: I40a59224286cb1eaece58f5f52b26f9191171be8 Reviewed-on: https://gerrit.libreoffice.org/79581 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): vbahelperStephan Bergmann
Change-Id: I10c543744f22a9f4db4e99c97629bb0e0b7f37db Reviewed-on: https://gerrit.libreoffice.org/76628 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-29Fix typosAndrea Gelmini
Change-Id: Iec31617554fae0f6c5a3d795a917ce9096d84405 Reviewed-on: https://gerrit.libreoffice.org/76521 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-21loplugin:referencecasting in vbahelper..vclNoel Grandin
Change-Id: I2bd9e2c4e8a3d56a7b2168bd2ccff389051e5b4c Reviewed-on: https://gerrit.libreoffice.org/76032 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-02Use hasElements to check Sequence emptiness in [v-x]*Arkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c Reviewed-on: https://gerrit.libreoffice.org/71603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13Pointer is pointlessNoel Grandin
since it is just a wrapper around PointerStyle Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267 Reviewed-on: https://gerrit.libreoffice.org/67711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11loplugin:indentation in unotools..vbahelperNoel Grandin
Change-Id: I76de5678dd21f207e9e9c2a0c446f2c0b9be974e Reviewed-on: https://gerrit.libreoffice.org/67609 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22improve function-local statics in vbahelperNoel Grandin
Change-Id: Id54660390baa337d8bd54a19924e138c2ccb0bc7 Reviewed-on: https://gerrit.libreoffice.org/63790 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-04pass AbstractGeometryAttributes around by std::unique_ptrNoel Grandin
Change-Id: I6e06c89b5e4b77c8fc5e3e1a6bf7d76d8ebd7810 Reviewed-on: https://gerrit.libreoffice.org/61349 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18loplugin:constfields in vbahelperNoel Grandin
Change-Id: I6121e2b41a5e6116be8027fe5197ce53d8f6797f Reviewed-on: https://gerrit.libreoffice.org/60562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-06use more Color in vbahelperNoel Grandin
Change-Id: I9d153b184a394ac21d504cb503731f8c5c8ec1de Reviewed-on: https://gerrit.libreoffice.org/50797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: vbahelperStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I4ab5ca8cc7c3e26b43937ec9edae3d106f11cf56
2017-08-01loplugin:checkunusedparamsNoel Grandin
the "check for taking address of function" part was generating false+ Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f Reviewed-on: https://gerrit.libreoffice.org/40613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28loplugin:oncevar in ucb..vbahelperNoel Grandin
Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae Reviewed-on: https://gerrit.libreoffice.org/39327 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16loplugin:unusedfields in tools..vbahelperNoel Grandin
Change-Id: Ief7d4c8e1866604eda6308ea2a5c1ce4b1c093bc Reviewed-on: https://gerrit.libreoffice.org/38836 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-02-28new loplugin unoanyNoel Grandin
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-09New loplugin:externvar: vbahelperStephan Bergmann
Change-Id: Ic66aa797251b6de1d964dcd66ca1bd952c8c17d3
2016-11-24loplugin:unnecessaryoverride (dtors) in vbahelperStephan Bergmann
Change-Id: I809869a438b710b2c4722027cc78d39a81b0a092
2016-11-11update vclwidget loplugin to find ref-dropping assigmentNoel Grandin
Look for places where we are accidentally assigning a returned-by-value VclPtr<T> to a T*, which generally ends up in a use-after-free. Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9 Reviewed-on: https://gerrit.libreoffice.org/30749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-06-13tdf#42949: clean up includes in include/vbahelper with iwyuJorenz Paragas
Change-Id: Iaf93ff58229e9362b03b3e810611e969ef8baf38 Reviewed-on: https://gerrit.libreoffice.org/26206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-18com::sun::star->css in vbahelper/Noel Grandin
Change-Id: I7ab89b01cf6817b365a02e73d4635dfdb5b40440 Reviewed-on: https://gerrit.libreoffice.org/20022 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I6eb8949e3e14d82b52af9a2ba26d67bf1bd8e1a5
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-09-10vbahelper: tdf#88206 replace cppu::WeakImplHelper* etc.Takeshi Abe
with the variadic variants. Change-Id: I8a7f7c81a876b5f1ac987375f8c43bbef89dc087 Reviewed-on: https://gerrit.libreoffice.org/18461 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-08-27Clean up sEmptyStephan Bergmann
Change-Id: If1b2bfe308caa2bce92e73d2c5c86ee273faed93
2015-08-03inline some use-once typedefsNoel Grandin
Change-Id: I02cbbba56a2ad83e0ac3d806265a7e0d6a29594d Reviewed-on: https://gerrit.libreoffice.org/17495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-21loplugin:unusedmethods vbahelperNoel Grandin
Change-Id: Ia04e2682e3bd05591b67b9fe15557ce8c0e7939e Reviewed-on: https://gerrit.libreoffice.org/17234 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-05-25cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: Ic323f07196d8a0d106d9ddf73a06db377c23fb98
2015-05-22convert POINTER constants to scoped enumNoel Grandin
Change-Id: Iea29ce5fd6c620535197d3ca8538335078430e19 Reviewed-on: https://gerrit.libreoffice.org/15825 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-19Fix typo code Resouce->ResourceAndrea Gelmini
Change-Id: I6e68c13e4513c2f8cc38e237646db7dffc88fe3b Reviewed-on: https://gerrit.libreoffice.org/13986 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-29vbahelper: std::auto_ptr -> std::unique_ptrStephan Bergmann
Change-Id: Ic1b28e7f79cc7dad6a045eb64e5191991533990d
2014-09-23fdo#82577: Handle WindowNoel Grandin
Put the VCL Window class in the vcl namespace. Avoids clash with the X11 Window typedef. Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a