summaryrefslogtreecommitdiff
path: root/vcl/source/control
AgeCommit message (Collapse)Author
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-16Resolves: tdf#143511 SysObj is clipped out if the widget is out of viewCaolán McNamara
so the sizes and relative positions are invalid under gtk, unclip the SysObj when using get_extents_relative_to Change-Id: Ibdaff20531a2a40b3b9b7dc9ac880d014db07d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125272 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-31add o3tl::span ctor from std::vectorLuboš Luňák
Makes code simpler, and std::span can be constructed from std::vector too. Change-Id: Iae26b53c52148c19d9068a63126a7393d098d654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124507 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-10-30tools::Long->sal_Int32 in GetCaretPositionsNoel Grandin
Change-Id: Id3f037e132a4d07cb2b68dbb93dd24f7f6b33ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30tools::Long->sal_Int32 in the DX arraysNoel Grandin
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-29pass DX array around using o3tl::span instead of pointerNoel Grandin
so we get bounds checking in debug mode Note that I cannot just pass around the std::vectors involved because there is a place in editeng which calls with a subset of a vector. Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22return weld::Builder by unique_ptrNoel Grandin
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-21loplugin:flattenNoel Grandin
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-17Simplify vector initialization in vclJulien Nabet
Change-Id: I881627313221081f72f8421c91417e4c111cfd97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123708 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-10Revert "Initialize nDXBuffer array (vcl/edit)"Julien Nabet
This reverts commit 00ee02ea26a070d630160ef5c51f36ab093a9b53. as suggested implicitely Change-Id: I48aed1f48dca493c486f738dca895b1c00027066 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123171 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-10Initialize nDXBuffer array (vcl/edit)Julien Nabet
Change-Id: I2ed4e43e8bf52d980e850e61769343c6a685e74d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123355 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-08loplugin:moveparam in vclNoel Grandin
Change-Id: I6dea009e1031174ecb3d4371e91c9c6d26c6e514 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123245 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constmethod handle more casesNoel Grandin
remove some of the naming limitations, and handle pointer parameters better. I only let the plugin run up till vcl/ Change-Id: Ice916e0157031ab531c47f10778f406b07966251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30Related: tdf#141633 drawing buttons to outputdevice affects later drawingCaolán McNamara
since... commit 0b76e106b8054c91a7b7d793d9219f6ee9ae7d2c Author: Oliver Bolte <obo@openoffice.org> Date: Thu Sep 4 06:42:10 2003 +0000 INTEGRATION: CWS mt801 (1.21.132); FILE MERGED 2003/08/29 14:35:52 mt 1.21.132.1: #80064# Print button with color... In the "sample db" example (Mockup.odb) there are two buttons with a yellow background, when printed part of the table control is also incorrectly painted with a yellow background. Change-Id: I481b721801b5e1d1c78dc7a01cb20745702f5c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122895 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-29Resolves: tdf#144783 shift+RETURN not searching backwardsCaolán McNamara
In gtk nothing is happening, in gen its searching forwards. Align backends so that Activate is emitted only on a bare return in both and then handle shift+RETURN explicitly for the search widget Change-Id: I142002bbaf6b3aca83800a442096a4b1024fe097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122814 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák
Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-09-15loplugin:constvarsNoel Grandin
Change-Id: I9b35d6333afa6b305bf73fc55a7e60c8365674e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-06clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I51f4e8affac41023110042b534a915f096ccd0c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121692 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-30tdf#74702 vcl: introduce GetSystemTextColor()Chris Sherlock
Also rename DrawFlags to SystemDrawColorFlags, added a unit test. Change-Id: I3cb74b278e43561d1055b3b55b9730cdbdea51aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113559 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-26use max of avg digit or 'average char' width to measure Edit spaceCaolán McNamara
instead of the x-width this is similar to what gtk does Change-Id: I2806939a09b275a3060ddf693e2763238a4e075f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121118 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-19jsdialog: dump id for imagesSzymon Kłos
Change-Id: Ia25dde027f79bc9c3c22cbaccdb41c2ff1ae4214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119504 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120661 Tested-by: Jenkins
2021-08-18loplugin:constparamsNoel Grandin
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-18jsdialog: dump FixedImageSzymon Kłos
Change-Id: I9803558fa19ef5e508817d5db0bdeb54827f63d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118969 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120629 Tested-by: Jenkins
2021-08-17jsdialog: image for radiobuttonsSzymon Kłos
Change-Id: Ic6027223c5771ffb659a4503cfd305d0decc2433 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118465 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119244 Tested-by: Jenkins
2021-08-16Rename setX/setY to SetPosX/SetPosY, to align with SetPosMike Kaganski
Change-Id: I856194f26fefad993f416d7b92b57a9417a3c0a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120546 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-08no need to allocate ControlLayoutData separatelyNoel Grandin
Change-Id: I239befdaa05beea5200c81f23d0af861c9fc3baa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-30flatten vcl::ImplControlDataNoel Grandin
the struct is already visible in the headers, so it's not a pimpl pattern, and it's only two pointers, so no point in allocating separately. The tdf#91081 bug comment I removed is no longer relevant, this general class of problem was solved with the introduction of VclPtr. Change-Id: Ie5d896baf0167273f8936930dd65891919c5bf7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119679 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-30use less GetOutDev()Noel Grandin
Change-Id: If6a528a5ff18e23226d5ec371a040cd994f1d384 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119678 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29rtl::Static -> static localNoel Grandin
in a handful cases, like a map or a vector, we don't need init on demand at all, the default constructor can be laid out at compile time Change-Id: I2d404584b5aa23db7b1f779e160e04e72dd2aa74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119656 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29Revert "cid#1486241 'Constant' variable guards dead code"Samuel Mehrbrodt
This led to an exception when activating a page via UNO (seen in WollMux): warn:svtools.uno:211417:211417:svtools/source/uno/wizard/wizardshell.cxx:120: DBG_UNHANDLED_EXCEPTION in enterState exception: com.sun.star.uno.RuntimeException message: [jni_uno bridge error] UNO calling Java method onActivatePage: non-UNO exception occurred: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 1 java stack trace: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 1 at de.muenchen.allg.itd51.wollmux.dialog.mailmerge.MailmergeWizardController.onActivatePage(MailmergeWizardController.java:170) at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method) at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:185) at com.sun.proxy.$Proxy118.execute(Unknown Source) at de.muenchen.allg.itd51.wollmux.dialog.mailmerge.MailmergeWizardController.startWizard(MailmergeWizardController.java:199) at de.muenchen.allg.itd51.wollmux.sidebar.SeriendruckSidebarContent.lambda$new$5(SeriendruckSidebarContent.java:468) This reverts commit 23c2c3433dc6bbfff2e1b590b1a89ee7f9c155c0. Change-Id: I6344a83eaa37b58c46a8b576c65bb15b11855c9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119655 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-07-29jsdialog: toolbox popupsSzymon Kłos
unify menubutton popups and toolbox dropdowns Change-Id: I61c0c33a17d96f03d6513507bda6d5c8edbc55dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117786 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119608 Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2021-07-28jsdialog: dump and activate popup windowsSzymon Kłos
Change-Id: I4eb49a81d12ac37f50c6595eeec6d472fdbe6d82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117251 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119581 Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2021-07-28jsdialog: dump internal image for buttonsSzymon Kłos
Change-Id: I53687f67042490c19d1056c74619d43566bf1289 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117132 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119562 Tested-by: Jenkins
2021-07-21flatten ImplListBoxWindowNoel Grandin
no need to allocate ImplEntryList separately Change-Id: I276e92895a00ebccff60f5067567a0ed066d4e66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119328 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-07-01loplugin:unusedmethodsNoel Grandin
Change-Id: I3ff5333c1e73ca61b0a7339e4b7dcfce211b88e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-30Purge out rtl::math::setNanBaiXiaochun
Change-Id: If8794c105e279afd4437517d3e61f2f900eb6490 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118123 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-06-24Delete copy ctors/assignments for DLLEXPORT classMike Kaganski
... instead of including <vcl/window.hxx> where it is not directly used. For details, see commit ee405fb2ef36337851801f1bd34411c606d55988. This reverts commits 6aa6b6c814b0353768fa7276d1f11d69a0ebedba and beeb19b361213d22247e5cb776dc522cbf190ca8. Change-Id: Ia91f3c303e1df0a698d06cdef1d8e64e99d781ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117751 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-22cid#1486241 'Constant' variable guards dead codeCaolán McNamara
Change-Id: Ia90e8ad537fccdf38ed0bf0e9f963033c69ec202 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117612 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-21cid#1486243 'Constant' variable guards dead codeCaolán McNamara
Change-Id: I1bc2a7555f6d129526cabbebb8b88190e3ec3a4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117545 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>