summaryrefslogtreecommitdiff
path: root/vcl/source/control/field2.cxx
AgeCommit message (Collapse)Author
2021-07-07DateFormatter: use Date::AddDays(), AddMonths(), AddYears()Eike Rathke
... that do all the checks and normalize. Change-Id: Id3ffcf5146b25020ec808aa70240953d39328a82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118540 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-07-06Related: tdf#125035 Introduce LongDateOrder and handle YDM in DateFormatterEike Rathke
This fixes also unotools/source/i18n/localedatawrapper.cxx:1473: LocaleDataWrapper::scanDateOrder: no magic applicable lv-LV requested lv-LV loaded that is the only locale with a YDM long date order. Change-Id: I776b8706bf5bd3ec11cc46d38fd3613c8df7519f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118482 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-07-05DateFormatter: make TextToDate() long date calendar aware, tdf#125035Eike Rathke
Using number formatter to display long date now can generate any arbitrary date string in any calendar known to the locale. Cope with non-default non-Gregorian calendars when parsing such string back to a date and convert to Gregorian for the calendar widget. This currently relies on month names being different between calendars, which isn't fail-proof but at least works for the ar_DZ Hijri->Gregorian case. A better approach would be to remember the calendar used in the number formatter output, but that's not available (yet?). Change-Id: I829655275de4d1983b7e453624efca967b16a3bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118449 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-07-05Pass Formatter::StaticFormatter also from weld:DateFormatter, tdf#125035Eike Rathke
Change-Id: I8e6b0e581b9522fb04225fc945e579406a4be208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118438 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-07-04Resolves: tdf#125035 Use number formatter for long date in DateFormatter fieldsEike Rathke
Change-Id: Ib0cd55d9ad4e3abb4839d70c0086063a3f1a90f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118344 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-05-02tdf#79049 speed up OOXML workbook load (4)Noel Grandin
Optimise LocaleDataWrapper for reads by initialising the data we in the constructor, so we don't need any kind of locking Reduces load time from 34s to 28s. Change-Id: I4bd3bddb30b70ba015fe5b1372534f9507762b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28simplify code, use more subView()Noel
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-06Drop comphelper::string::equals; compare OUString to OUStringCharMike Kaganski
In cui/source/tabpages/autocdlg.cxx, use code point-based methods for comparison with sal_UCS4 values in SvxSwAutoFormatFlags. Change-Id: If34c981393774d1b8db649f0c29870e1ca6bdfe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108847 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-12New loplugin:stringviewparamStephan Bergmann
...to "Find functions that take rtl::O[U]String parameters that can be generalized to take std::[u16]string_view instead." (Which in turn can avoid costly O[U]String constructions, see e.g. loplugin:stringview and subView.) Some of those functions' call sites, passing plain char string literals, needed to be adapted when converting them. Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-26Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: I5bc56a0dea4a157b276a59bd1050b08120b948ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103455 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-04loplugin:flatten in vclNoel Grandin
Change-Id: I271cc67ecf34acbf0edbda960e33315fb6a1f9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-29replace and drop MiscCfgCaolán McNamara
Change-Id: I5ea9e3663fc5d30d725cf18757badb9b9802da18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99675 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-22weld PatternControlCaolán McNamara
Change-Id: Ie84778c2f127a6b393edbfa08e61b135ec3bcbc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99174 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-21weld DateControlCaolán McNamara
replace SpinButton when WB_SPINBUTTON is set on a date field to always use a popover with a calendar in it to make it possible to integrate this with native widgets Change-Id: I36a26599a154bddf9aec9b50b6570e13477a1f63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98858 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-15weld TimeControlCaolán McNamara
Change-Id: Idb19639eb39bc83fb8bdc7c2181bf63e9c522d18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98670 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-29loplugin:simplifybool in ucb..vclNoel Grandin
Change-Id: Ib63623f5ca3f6559e02a0013c3cbd6174f7aec14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-29tdf#130515 Time field in Base form will not display correct formatNoel Grandin
regression from commit 65b7b6322b662785bf032e66c76abc36c9a2bb0e Date: Wed Feb 8 10:40:28 2017 +0200 loplugin:unusedenumconstants read-only constants in vcl Change-Id: Icf2e385763c8ece34521895331d148a5baacf2d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>
2019-12-24sal_Char->char in vclNoel Grandin
Change-Id: I4359b7042f98586e2c9f5529d83d769cdf3d033c Reviewed-on: https://gerrit.libreoffice.org/85775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-05turn TimeFormatter::ImplInit into initializer listCaolán McNamara
Change-Id: I2f21241f753b1fe1300a284cc80a29911cd223ae Reviewed-on: https://gerrit.libreoffice.org/84465 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-05turn DateFormatter::ImplInit into initializer listCaolán McNamara
Change-Id: If58b8f5c65f7d920dd3a186cf648db605799b790 Reviewed-on: https://gerrit.libreoffice.org/84464 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-03loplugin:stringaddNoel Grandin
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-17avoid some copyingNoel Grandin
Change-Id: I2e8da57f0fe048c3cf7288bf688f9411e62a1ffc Reviewed-on: https://gerrit.libreoffice.org/79035 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): vclStephan Bergmann
Change-Id: I0bd1d26f6fc4052b812fde33ebd1d63111426942 Reviewed-on: https://gerrit.libreoffice.org/76627 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-30Fix typosAndrea Gelmini
Change-Id: Ib737ff364f627b9e4d0dc2a9903a07a0af36a8ae Reviewed-on: https://gerrit.libreoffice.org/76551 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-02tdf#42949 Fix IWYU warnings in vcl/source/[a-e]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I386e913f9002eed164c26137a0e184993d010b86 Reviewed-on: https://gerrit.libreoffice.org/74090 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-22loplugin:unusedfields in vclNoel Grandin
maStatusText in HelpTextWindow is dead since commit bd3ea40ed49074c4fa4439de7b5dea4fc3161880 Date: Fri Jan 21 14:48:58 2011 +0200 Remove ShowHelpStatusText and HideHelpStatusText and associated cruft Change-Id: I7a74e2a1b909a479f9338bd4da5fad06ccc25283 Reviewed-on: https://gerrit.libreoffice.org/68153 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>
2018-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: If173f42302553b164267909a0a3156bb25a6d558 Reviewed-on: https://gerrit.libreoffice.org/63957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-08clarify that edit doesn't change during FormatterBase lifetimeCaolán McNamara
Change-Id: I416eee47eaae49a629fb0199e6b086215d315a94 Reviewed-on: https://gerrit.libreoffice.org/63048 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-08mbDefaultLocale is always trueCaolán McNamara
Change-Id: I92bcb381330a129ca42a2407a3e4db0ed044ed51 Reviewed-on: https://gerrit.libreoffice.org/63041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-27loplugin:methodcycles more graph theory for the winNoel Grandin
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:returnconstant in vclNoel Grandin
Change-Id: I597ef6d75d1c21cdc15a91bf7f549bc14c851506 Reviewed-on: https://gerrit.libreoffice.org/58086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-06Translate German comments and debug stringsJohnny_M
And correct a few comments (translation and grammar) Change-Id: Ifafa521c683e9ca65aeba8031cd4cbfc1fadc137 Reviewed-on: https://gerrit.libreoffice.org/54888 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-16coverity#1435605 silence Unchecked return valueCaolán McNamara
Change-Id: I1617ff8157ad69b467a0feaad5680e90e2c08a47 Reviewed-on: https://gerrit.libreoffice.org/54382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-05-10weld SdStartPresentationDlgCaolán McNamara
to get duration spinbutton working need to know where the cursor is in the spinbutton and to change the adjustment factor depending on that, and need to additionally disable the vcl round to nearest base unit on up/down Change-Id: I6dd09e1639454cb4820d3aeb0c0c698fcebd417e Reviewed-on: https://gerrit.libreoffice.org/54065 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03new loplugin:dbgunhandledexceptionNoel Grandin
enforce that DBG_UNHANDLED_EXCEPTION is called first in a catch block, otherwise it cannot do it's job properly Change-Id: I906436c6861212c44f8f21552ccbceb54f15c6e1 Reviewed-on: https://gerrit.libreoffice.org/52303 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03long->sal_Int32 in tools/gen.hxxNoel Grandin
which triggered a lot of changes in sw/ Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6 Reviewed-on: https://gerrit.libreoffice.org/48806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: vclStephan 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: I363c01a1ae9e863fca4fb4589829492d7280d711
2018-01-11loplugin:redundantcast: vclStephan Bergmann
(after a to-be-committed improved loplugin:cstylecast would have rewritten the C-style casts into static_casts) Change-Id: I5e515738a29c6d79154560d69c8b86885800ba88
2017-10-30loplugin:constantparam in vclNoel Grandin
Change-Id: Ic32e4098dcdae5ca5d7fe2749badedabda86a90d Reviewed-on: https://gerrit.libreoffice.org/44043 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: vclStephan Bergmann
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-09-22vcl: [loplugin:badstatics] xCharClassMichael Stahl
There's even 2 of these; move them to struct ImplSVData which is deleted on shutdown. Change-Id: I8040cd6f9f31c0a1ab48987a490395f316d52220 Reviewed-on: https://gerrit.libreoffice.org/42630 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-03Assertion when editing pattern fieldTamás Zolnai
Change-Id: Ia515382556329feeec359254d3be3f90d2fd17ad Reviewed-on: https://gerrit.libreoffice.org/41870 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>