summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2021-11-26-Werror,-Wreorder-ctorStephan Bergmann
Change-Id: Ie0a1036f57bc1449dda324b99fd83170969958a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125856 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-25Resolves: tdf#145786 get the correct bounds with window scaling enabledCaolán McNamara
the per-window/app scaling as opposed to the global desktop one which wasn't affected. the menubutton thought it saw the mouse release happen outside the window it popped up when the combobox inside it was clicked, so popped down the popup from underneath the combobox. Change-Id: Iace9538073bb2380443d87600a872e88885934d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125807 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-25vcl: pInputElement is never nullptr in PDFObjectCopier::copyRecursively()Miklos Vajna
Change it to a reference to make that more obvious. Change-Id: Ie1da9982ee2d54a5d68d393a04643d1684521ef5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125786 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-24gtk3: I don't think it makes sense to claim a crossing event is consumedCaolán McNamara
if it does, then we should use the return of m_aMouseMotionHdl.Call() Change-Id: I9f04fcba1ef1d9768c3ce3b042884110a63f26a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125781 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-24Resolves: tdf#145864 we should only return true if we consume the motion eventCaolán McNamara
and false if we want it to continue to be passed on to other handlers Change-Id: Ie237f890e3d065949dcfedb08b9f6c804643b4b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125780 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-24gtk[3|4] don't need the ifdefs if only using the dlsymed functionsCaolán McNamara
Change-Id: I2c3b7a19f047d341467f9c66ef93e3185330854d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125744 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-24Rename o3tl::underlyingEnumValue to o3tl::to_underlying to match C++23Mike Kaganski
Change-Id: I1597a8e77199445bf377dbe54adc3134bb04fd51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-24tdf#84283: vcl_pdfexport: Add unittestXisco Fauli
Change-Id: I56f50dcd93ef196d2261be924e004b9981d405dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125741 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-23CppunitTest_vcl_pdfexport: factor out common codeXisco Fauli
Change-Id: I4e25906f2b63b36d31e08282ec72921fe10f08b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125738 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-23tdf#62812 WIN use a compatible DC for font funcsJan-Marek Glogowski
All these function work on a temporary font. It's not clear, if the CreateCompatibleDC is actually needed and if the ScopedFontDC could actually just use the SalGraphics DC and restore its HFONT, but this at least now works as expected. A later patch can just drop the CreateCompatibleDC and DeleteDC calls. Change-Id: I6e86d660e69a58fa2eab89ece80c61e2635fc792 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125652 Tested-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-23Crash around help-windows.Michael Meeks
Seems a popular way to crash: vcl::Window::ImplCallMove() vcl/source/window/event.cxx:555 vcl::Window::Show(bool, ShowFlags) [clone .localalias] /usr/include/c++/10/bits/unique_ptr.h:173 vcl::Window::Show(bool, ShowFlags) vcl/source/window/window.cxx:2345 HelpTextWindow::ImplShow() vcl/source/app/help.cxx:371 Scheduler::ProcessTaskScheduling() vcl/source/app/scheduler.cxx:495 Change-Id: I33ca0059844395c41f4d76619cca22aec81df207 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125710 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-11-23tdf#139460 improve autofilter sub-menu interaction under gtkCaolán McNamara
so the submenu pops down when the mouse moves back into its parent. This removes layer of InterimItemWindow and for gtk (under wayland) the autofilter and its submenu can use native GtkPopovers Change-Id: I4c8c3d2087566f508d75eda72e272d9f7fba2f00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125428 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-23only call signal_closed from Popdown dtor if it is still openCaolán McNamara
Change-Id: I251239a6ebbd3f55b68a0c2cb15b4bd6728e19c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125703 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-23avoid only painting to windows in LOK mode, not invalidationsLuboš Luňák
9b73d3e8926d5f9b10464d19b539eef3eb088f50 disabled painting to windows in LOK mode, because it doesn't make sense as those windows are not even visible, but it tried to do it by avoiding even invalidations. That can trigger problems because some dialogs actually are forwarded to clients in LOK mode, and apparently they need the invalidations to proceed normally (the Format->Cell dialog in Online didn't repaint scrolling of the Date listbox, I don't know what exactly the actual problem was, but mnPaintFlags were different than when not avoiding invalidations). So revert most of the relevant commits and keep only avoiding actual drawing, which is what 057968bbce406efe6564347329df45b7e did. Change-Id: I4e212966830f4c690e6143b9d5fedbc24619e1ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125674 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
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-23tdf#129638 print preview: use new paper size after switching pageJustin Luth
This is a partial revert of LO 6.3 commit 2c23a96f7b6888c0e05fdc2aba57f03cd797b647. Change-Id: I17525d06d96779671caaa84e1e48629289453ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125685 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2021-11-23gtk3: reuse popover replacement as mouse event widgetCaolán McNamara
Change-Id: I99aa1f1843c5ff6e4c76716178e721a96ae284fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-22Use less DegreeN::get()Mike Kaganski
Change-Id: I97b8d6282c72307cc29a913af221d283523f2fae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125653 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-22handle filling and stroking at the same time if possibleLuboš Luňák
All tests still pass, so the end result should be the same, but this way it's done in one call. Change-Id: If5da34837a45ad600ae30568e4ba7651ac5838bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125644 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-22move code to helper functionsLuboš Luňák
I'll want some common extra functionality there later. Change-Id: I249f9ca4662fc8e8d52c58b1bd33293f363464d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125643 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-22tdf#133835 speedup calc autofilter (7)Noel Grandin
vcl::Font avoid allocating a new instance if the setter doesn't change anything, saves 5% Change-Id: I461a2a8e3709b3f3f20e431cb3b976ad47bed0ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125625 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22Related: tdf#145786 cooperate between our own grabsCaolán McNamara
don't try to workaround a grab if the grab is done by another of our own popups, and on tearing down one of our popups, restore the grab of its parent if that parent was one of our own popups. This typically matters on X where we don't use GtkPopovers (unlike wayland, where Popovers can escape the parent window). Things to test are: writer's watermark dialog: click the color button to get the 1st level popup, then click the combobox to get the 2nd level one, select an entry to return to the 1st level. a) Clicking a valueset element should select that color, not dismiss the popup without selecting a color. b) Clicking the combobox to get the popup again should result in a popup where the focus still follows the mouse (i.e. the 1st level popup doesn't try and steal away the 2nd level grab) sidebar: same scenario as above, except a color popover parented to a sidebar pane and not a dialog. Change-Id: Ib5d765b22b8a9b6b1a7806676c8fe3cfb7709734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125638 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-22gtk3: popover replacement for GtkMenuButton has to be modalCaolán McNamara
Change-Id: If1b18c4b39fbe82fd613ff0f62f0ff60fdaeeed8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125637 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-21gtk3: consider replacement for popovers visibility when queryed for itCaolán McNamara
Change-Id: I4ca71f8544720e99514abe78717dcd07617c00cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125475 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-20gtk3: don't double close popover replacementCaolán McNamara
Change-Id: Ibdd7de56ab1cadd76748422c08e21904f912532a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125567 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-20Use C++17 hexadecimal exponent floating point literalsHossein
Using new syntax for the power of 2 exponent instead of using shift left (<<) operator Change-Id: Iaa627800fb35af37a6b0efcd939f1d5f78f70e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125458 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19add placement to Popover popup_at_rectCaolán McNamara
Change-Id: Iaa12a48f62037dd985d526993a07762b10bd0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19fix gtk4 buildRene Engelhard
res is only defined if NDEBUG is *not* defined. So it doesn't exist in a "standard" build using -DNDEBUG and shouldn't be used. Change-Id: Iebae9898d50030f994a7289e2bc3fe3052172dee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125582 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Use more basegfx::deg2rad<N> and basegfx::rad2deg<N>Mike Kaganski
Change-Id: I9dc57628b98f67994d546f6887e96389be1efe62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125568 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19gtk3: treat standalone GtkPopover similarly to the GtkMenuButton managed oneCaolán McNamara
so do the same replacement with GtkWindow under X11 for gtk3 that we do in MenuButtons for the popover with direct popovers when the constraint is GTK_POPOVER_CONSTRAINT_NONE Change-Id: Ia903b24c54e6d3acc18df1ab912600e07b7f844d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125543 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversionsMike Kaganski
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-11-19remove unused definesNoel Grandin
Change-Id: I1140d7dc2f40dafcba6a314c7a641c3b2d886af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19gtk4: GtkPopover parent must be set before its shownCaolán McNamara
Change-Id: I6184422b92d3629f31141215bed588400b30289c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125542 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Qt set QPainter AntiAlias hint from SalGraphicsArmin Le Grand (Allotropia)
Change-Id: I1a9e6014ead24b6edff1dbb41b70c809204d01cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125549 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-19loplugin:stringliteraldefine in vclNoel Grandin
Change-Id: Id14cc8613fdfb67790efd6c33ee243f6bdb522f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125546 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19gtk3: take default modality from the popover it replacesCaolán McNamara
Change-Id: I0404dc17bd816a7dd403c50692f4f5325aacaf31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125503 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Upgrade to un-deprecated API and fix a crash in the pasteboard.mm helper toolTor Lillqvist
Change-Id: Ic0b839df686fb93c64ef844848028ded39225ced
2021-11-19gtk4: remove constrain-to propertyCaolán McNamara
Change-Id: I18f0b72fff31f555873a0808f171e4c1746a4411 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125539 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19rtl::Static->thread-safe static in vclNoel Grandin
Change-Id: I748c3b5608b76b4b847273856f6b1c66b53aced1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-19refactor for potential reuse outside MenuButtonCaolán McNamara
Change-Id: I36729364550dc7c505fdc396442f51809fc58073 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125489 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Drop F_2PIMike Kaganski
Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19Use M_PI* instead of F_PI*Mike Kaganski
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19tdf#137924 qt (>=5.14): Use proper DPI without requiring window handleMichael Weghorn
For Qt >= 5.14, don't require a window handle to retrieve the screen and then the associated DPI value from that one, but directly use 'QWidget::screen' (introduced in QT 5.14) to retrieve the screen. Previously, no DPI values would be set in case there was no window handle. This makes UI scaling work without having to manually set 'SAL_FORCEDPI' on Wayland. While various UI elements (like e.g. the "Help" -> "About LibreOffice" still look quite broken with the qt5 and kf5 VCL plugins in a Plasma Wayland session (at least on my Debian testing with Qt 5.15.2 and Plasma 5.23), they look OK when using the qt6 VCL plugin with a custom build of qtbase and qtwayland from Qt's "dev" git branches. Change-Id: I5feae46ed86a8b7d3cf92d4a973f7a0f9a9f95de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125507 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-11-18Qt implement QtFont::GetGlyphOutlineArmin Le Grand (Allotropia)
Fixes FontWork with QFont based rendering. Change-Id: I294fe89d2753b6e82a559ff847b44126f9ea3bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125500 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-18Drop F_PI180Mike Kaganski
Change-Id: I36783d6fd6f439a71bc46959cd859b48d65ee30f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125449 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-18draw symbols using polygons instead of raster of linesLuboš Luňák
On HiDPI those lines become obvious. Change-Id: I2b0cce3950abb4d06a56ba022100bc74026b5de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125481 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18add an extra margin to native control drawing on Skia/MacLuboš Luňák
Some controls draw outside of their given area, which would get cropped when first drawing to a temporary context limited to just that size. I haven't managed to find a way to calculate the proper marging, so just add something that's hopefully enough but not too big. Change-Id: I1a15a3ab8cbd26cbe4fb52628b300ee70c8d51ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125469 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18fix background color of some native controls with Skia/Mac (tdf#145748)Luboš Luňák
Some of the control drawing calls use CGContextFillRect() to draw background for controls, so since we use a temporary context, set up colors for such drawing. Change-Id: I41cfa29e29fcf86598d49fbbed0b159c48c63d6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125468 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18draw Mac widget controls at proper size when HiDPILuboš Luňák
This code was drawing them at non-HiDPI size and then scaling up. Change-Id: I90abfd36adaff4e7c4929cd28d0aa50d919449a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125467 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-18Fix typosAndrea Gelmini
Change-Id: Idd21ee0026d8a36653f0fb25b350dae37315f603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125336 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>