summaryrefslogtreecommitdiff
path: root/toolkit
AgeCommit message (Collapse)Author
2020-05-20move ComboBox to toolkit-only headersCaolán McNamara
Change-Id: If5f0ab1fba8fa7302b7c0e8d2b25761ab64c97e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94143 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-20fix -Werror=maybe-uninitializedNoel Grandin
Change-Id: I718016b5f9120c18868ed798785af1f8108be25b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-18tdf#133142 UnoControlTabPageContainer: Handle tab property changesMichael Weghorn
In the model, changing a tab page's title or enabled/disabled status is done via methods 'XTabPageModel.setTitle' and 'XTabPageModel.setEnabled'. Changes to the title and enabled/disabled status are propagated to the tab page container containing the tab page (s.a. 25c692c2a94ab83c2c859ac5ab334b62ac8b825e ("ControlModelContainerBase: Use property for enabled status", 2020-05-15)). Make 'VCLXTabPageContainer' derive from 'XPropertiesChangeListener' and implement the 'propertiesChange' method defined in that interface to handle property changes for the tab pages and have 'UnoControlTabPageContainer' forward 'PropertyChangeEvent's to its peer so they can be handled there. This way, changes for those tab page properties via UNO are now properly updated in the UI as well. Change-Id: I6fa1fadf781575c4ad1d066aed9c3a651b10869d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94402 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-15ControlModelContainerBase: Use property for enabled statusMichael Weghorn
Use the property BASEPROPERTY_ENABLED for getting and setting the status instead of handling it in a custom bool member variable. This way, property changes are also automatically propagated and can be handled by the corresponding listeners. Change-Id: I3a36ac8738a7caae987894ac9dd271d2713c1e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94310 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-15Forward 'removeTabPageContainerListener' as suchMichael Weghorn
Calling 'addTabPageContainerListener' for the peer instead looks like it was probably a copy paste mistake when adding this forwarding in both, 'UnoControlTabPageContainer::addTabPageContainerListener', and 'UnoControlTabPageContainer::removeTabPageContainerListener' in commit 559f957fc3e4295b049866efe3582b2aaa17c414 ("tabcontrol: notify tab listener", 2010-09-06). Change-Id: I98f20b9cb3e658143b362118189adfbed85f3b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94262 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-14UnoEditControl: Don't initialize members twiceMichael Weghorn
'mnMaxTextLen' and 'mbSetMaxTextLenInPeer' are already assigned the same values in the member initializer list. Change-Id: I498ff981c25f6b5395400c75ad8c7e0f20ff3a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94180 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-14Rename ContainerControl_IBase -> ControlContainer_IBaseMichael Weghorn
The only class inheriting from it is ControlContainerBase, so make the naming more consistent, also to match the naming pattern used elsewhere. Change-Id: I91739fb105f97605a3c279100b8c4e666aa3b010 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94139 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-13fix ScriptEventContainer::isEmptyNoel Grandin
which was relying on the nElementCount field, which was not being updated. Just delete it and check the map. Change-Id: If543abcc7c1778a27675a1df69a54325024234b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-11tdf#132832 calcAdjustedSize: Take max width into accountMichael Weghorn
Actually take into account the preferred width when calculating the size of radio button, checkbox and hyperlink controls. This e.g. makes word wrap work properly when the multiline property is set for a checkbox, radio or hyperlink control and the single line text exceeds the preferred width, rather than keeping the whole text in one line that exceeds the preferred width. Change-Id: Id04668e4e1afe7c10a28468eff05cf04c10ae3c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93947 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-11Fix 32bit linux buildSamuel Mehrbrodt
Change-Id: I4faf3fb20c632163f98264d162bbf85f80b3603d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93797 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-05-10compact namespace in testtools..toolkitNoel Grandin
Change-Id: Iae1a7d3e2f14ee98ad486b4423208d2c29039346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93905 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-09Just use initializer list for Sequence<OUString>Michael Weghorn
Change-Id: I4732e238053b8c9e6813f1bbecd6f613922cb521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93748 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-09toolkit: Use lambda instead of FindControlModel functorMichael Weghorn
Change-Id: I04cbd84196b5bf31caa4da3140dc65b1dfa20127 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93746 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-05-08remove TriStateBox classCaolán McNamara
Change-Id: Ia6c76a9f0fc0be7790d0c801cbca4a7b8d478976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93680 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-08split button.hxx into toolkit-only pieceCaolán McNamara
Change-Id: I792efb417504a3b55043ff4fc3fd3597a9b953f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93678 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-07Add comment about insertion orderSamuel Mehrbrodt
Change-Id: I650316c0c4bc31a861b3d96586a6a0aae57bd054 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93537 Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-05-07Test keeping element order in EventContainerSamuel Mehrbrodt
Change-Id: Ic33d8a83305f70bb3eb60f44da0d9ac0d2b47e16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93570 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-05-07Revert "remove some "optimisation" insanity in ScriptEventContainer"Samuel Mehrbrodt
This broke the event order in basic dialog xml, which in turn broke macro signatures. This reverts commit 85f08e3e34bea01456eaf8989ac4f77d3900d5c5. Change-Id: I49ef2eb200571a0fd862770abc4331b6ea053e2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93564 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-05-06Resolves: tdf#132581 allow disabling the auto-group RadioButton featureCaolán McNamara
the older way of doing things is to dig around contiguous radiobuttons to see what is part of the group, while the contemporary one is to explicitly use group() to set the members. A problem of the legacy way of doing it is that the results during setup and teardown of a collection of radiobuttons can be misleading. Change-Id: I6c590d0fb6fc6db3f5e5ba4397a62930a5c8f3f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93567 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-06Move all public Java classes to libreoffice.jarSamuel Mehrbrodt
This moves the classes from juh.jar and ridl.jar to libreoffice.jar The goal is to have one single jar (and Java module, will be added later) which developers can include to work with LO. juh.jar and ridl.jar are kept as basically empty jars with libreoffice.jar on its classpath to keep backwards compatibility. This is a continuation of ae855bf48163ff64d94cfc34aff8e37abdb5518d and a preparation to have Java 9 module support. Change-Id: Ifbbfb97f60373d14256e62ae3122913bd17d5bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-23Fix typoAndrea Gelmini
Change-Id: Id2b8dd8c1d465a438ce6dfc859b007c5bfd98c51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92080 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-11rename vcl::Window::Update to PaintImmediatelyNoel Grandin
To make the code easier to read. Change-Id: Iebc648150391939fba5d1cd815c72dbcf02ceec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-10Make BitmapPrimitive2D vcl-independentArmin Le Grand
as preparation to have drawinglayer module independent from vcl in the future Change-Id: Iaa01370f27b51cba5114a54f37d1ec73d0719918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92048 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-29Fix is_typed_flags for MessBoxStyle (toolkit/msgbox)Julien Nabet
Change-Id: I40a2c8b2ad562a6378b5337f53af59577cd5ce0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91322 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-25Remove unused using declarations in oox...xmlsecurityGabor Kelemen
Found by: run-clang-tidy-10 -checks=-*,misc-unused-using-decls Change-Id: I3e95791e223ef01e140a6217e29a9efae428a784 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90876 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-21simplify codeNoel Grandin
These methods are virtual, so the check does nothing useful. Possibly back when this code was introduced, the methods were not. This was introduced in commit 411f66186e228 Date: Mon Jan 31 07:58:15 2005 +0000 INTEGRATION: CWS vcl34 (1.49.26); FILE MERGED 2005/01/06 14:13:03 ssa 1.49.26.1: #i37461# get/setOutputsize has to check for DockingWindow to call proper method to solve https://bz.apache.org/ooo/show_bug.cgi?id=37461 I have checked, and the bug does not come back. Change-Id: I540b85eccbf7107ee640f09b41340dc906995557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90795 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-20Dispose dialog created during testStephan Bergmann
I experienced crashes during shutdown of CppunitTest_toolkit at least with --enable-lto, [...] > OK (2) > warn:vcl:109889:109889:vcl/source/app/svmain.cxx:460: DeInitVCL: some top Windows are still alive > text = "" type = "N7toolkit16ScrollableDialogE", ptr = 0x216b740 > > warn:fwk.desktop:109889:109889:framework/source/services/desktop.cxx:1065: Desktop disposed before terminating it > warn:fwk.desktop:109889:109889:framework/source/services/desktop.cxx:179: Desktop not terminated before being destructed > warn:unotools.config:109889:109889:unotools/source/config/configmgr.cxx:140: ConfigManager not empty > cppunittester: /home/sbergman/lo2/core/include/vcl/vclptr.hxx:106: VclPtr<reference_type>::~VclPtr() [with reference_type = vcl::Window]: Assertion `m_rInnerRef.get() == nullptr || vclmain::isAlive()' failed. Change-Id: I419b7ef8e23c94a906e3de6b3a55b63e13650abe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90790 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-15Revert "loplugin:constfields in toolkit"Noel Grandin
This reverts commit 175834ce6a3ba707a6d34aa8de7351574381f481. Change-Id: I4b524ca1aa9aed2273b5d891a02fc0b360abc94c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-13Revert "loplugin:constfields in svtools"Noel Grandin
This reverts commit 07c4aa4298f062cee1894b80ef82e76d5ffcf4c7. Change-Id: Ic3f639581b9aca373f82c011f15be60d117b1943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-07clang-format toolkit, tools, uui with under 5-percent lines of changeMuhammet Kara
Files which could become clang-format conformant with under 5-percent lines of change relative to the total count of lines in the file are found by using bin/find-clang-format.py, and fixed with /opt/lo/bin/clang-format -i <path-of-the-file> There will be follow-up patches to fix all 'under-5-percent' files. Change-Id: I4952f350f4d22913ea94689b902ffa26c223ff96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90152 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-03-03inline some use-once constantsNoel Grandin
Change-Id: I201b195438ef3df067cfa6db97c3b37b23061142 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89887 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-20tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorEda Nur Var
Change-Id: I9c9a9af78bab721f112c33e485c431aac11bece6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87523 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-18move SVTXFormattedField, SVTXCurrencyField, SVTXNumericField to toolkitCaolán McNamara
Change-Id: If22200a4f342d4d779c612dbace61a4cf99471ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88866 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-16move TreeControlPeer to toolkitCaolán McNamara
Change-Id: Id5298615f0f3dad6e61955e23367c0345b33f2b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88813 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-14move dialog.hxx to vcl/include/toolkitCaolán McNamara
Change-Id: Ia3877f58b6e5ccc4fb1621e6b928638e0c850e7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88602 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-14move VCLXFileControl to toolkitCaolán McNamara
Change-Id: I39bb417fe7e033a8f368fa04d4a30b2388bcddfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88615 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-08replace some more copy/clear with swapNoel Grandin
Change-Id: I6501dd59682d2605e9b9856c2deaa02a873ce641 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-05move some toolkit/ headers inside the moduleNoel Grandin
Change-Id: I88badb1eb586db00a350afbcd6f4903a5623c724 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04tdf#117331 Merge jurt and unoil into ridlSamuel Mehrbrodt
jurt.jar and unoil.jar are kept as effectively empty jars, each with a Class-Path: ridl.jar in their meta-inf/manifest.mf, so that 3rd-party code loading them (with or without also loading ridl.jar) will still have access to their content. Conceptually, the UNOIDL entities in unoil.jar (corresponding to module offapi) are not part of the URE, but are now made available by URE's ridl.jar. This should probably not cause problems in practice. At least for now, we seal exactly those packages in ridl.jar that were originally sealed in jurt.jar. Ideally, all of ridl.jar could be sealed now, but that would be mildly incompatible, as it would prevent 3rd-party code from introducing additional UNOIDL entities in the relevant namespaces (even if that is something we do not want 3rd-party code to do anyway). However, some JunitTest_jurt_* define classes in those sealed packages. In the past they got away with that by using gb_JunitTest_use_jar_classset,*,jurt. Instead they now need to gb_JunitTest_use_jar_classset,*,ridl and drop the gb_JunitTest_use_jar,*,ridl. But the former only makes available the classes that are specified in ridljar/Jar_ridl.mk with gb_Jar_add_sourcefiles, not the UNOIDL entities specified via gb_Jar_add_packagedirs. But the tests need the udkapi UNOIDL entities, so introduce gb_JunitTest_add_classpath to let the tests get them explicitly. (Curiously, JunitTest_jurt_uno and JnitTest_jurt_util use gb_JunitTest_use_jar_classset,*,jurt but don't seem to acutally need it; lets leave that for a follow-up clean up.) As a follow-up clean up, relevant files could be moved from jurt/ to ridljar/. Change-Id: I836f4e7bb47fb41f1306e3f223da90dba988eb9a Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctorHakan Bakacak
Change-Id: Ifda9d3a4f05ffa9f611512d5d203e40d67d1c542 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87522 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-28tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctorMehmet Emin Başoğlu
Change-Id: I13e5c59aa673100655f38328b4b6515a1946fb76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87524 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-28move private TimeBox to toolkit-only headersCaolán McNamara
move private DateBox to toolkit-only headers move private CurrencyBox to toolkit-only headers move private PatternBox to toolkit-only headers move private CurrencyField to toolkit-only headers move private CurrencyFormatter to toolkit-only headers Change-Id: If5ba9e07b20cdc69ca554af388ec9d9e362cbf9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87555 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-27Split independent loop vars, giving them appropriate typesStephan Bergmann
...and thus avoiding an unnecessary explicit cast from sal_Int32 to sal_uInt32 Change-Id: I536fc52960259509a3b722fed9268dc6ec9e76a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87482 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-26rename some local variablesNoel Grandin
mostly to make the job of my very aggressive unused local vars plugin easier Change-Id: Ifc21a920841f8589f8b7e10de39dba6622a5d501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87399 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>