summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
AgeCommit message (Collapse)AuthorFilesLines
2018-05-12Fix typosAndrea Gelmini1-1/+1
Change-Id: Ic1234560cf9bf646e5499f3192fb37f1d36a6010 Reviewed-on: https://gerrit.libreoffice.org/54165 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-08Refactor CommonSalLayout font handlingJan-Marek Glogowski1-1/+1
Moves all platform specific code from CommonSalLayout into the platform specific plugins. This way the vcl library won't depend on the Qt5 libraries and the Qt5Font header can be moved into the qt5 VCL plugin. While at it, switch the CommonSalLayouts font reference from the FontSelectPattern to the LogicalFontInstance and also add the harfbuzz font handling to the instance. Change-Id: Ida910b8d88837ea949a2f84394ccc0cfae153060 Reviewed-on: https://gerrit.libreoffice.org/47408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-07Move PhysicalFontFace member of FontSelectPatternJan-Marek Glogowski1-1/+1
A FontSelectPattern describes a general font request. It can be used to find the best matching LogicalFontInstance. The instance will be created based on a PhysicalFontFace, which is really a factory since commit 8b700794b2746070814e9ff416ecd7bbb1c902e7. Following this workflow, this moves the PhysicalFontFace pointer to the instance and makes it constant. Which leaves some special symbol font handling code in the hash and instance lookup code path. It used to query the font face directly from the instance. I'm not sure of the correct handling. The related commits where made to fix #i89002#, which has an attached test document. 1. commit 849f618270da313f9339dda29a9f35938434c91d 2. commit 8c9823d311fdf8092cc75873e4565325d204a658 The document is as broken as it was before the patch. The symbol substitution still works, but the 'Q's are missing when displaying a symbol font. I also don't understand all the reinterpret_casts for fake font ids. I guess this was used to prevent the crashes I see, where a PhysicalFontFace referenced in a valid LogicalFontInstance is freed and a later FontId check in the GlyphCache crashes. So this now checks for a valid cache instead. Change-Id: If8ee5a6288e66cfa4c419289fbdd5b5da128c6ea Reviewed-on: https://gerrit.libreoffice.org/47279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-04-18Related: tdf#117068 inform salframe that there's a modal dialog runningCaolán McNamara1-2/+2
Change-Id: Ie95fbc1586e11396271fb43e6117f39f4f61cb0e Reviewed-on: https://gerrit.libreoffice.org/53086 Tested-by: Jenkins <ci@libreoffice.org> 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 Bergmann1-2/+2
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-03long->sal_Int32 in tools/gen.hxxNoel Grandin1-2/+2
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-01Fix typoAndrea Gelmini1-1/+1
Change-Id: I8983e1ef73051febd796d737cba1a58558b80bbf Reviewed-on: https://gerrit.libreoffice.org/52209 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-03-30Avoid crash-reporter crash.Michael Meeks1-5/+10
http://crashreport.libreoffice.org/stats/crash_details/f5086a7d-3c67-46e4-945e-e0882a604eee Change-Id: Ic9ceed2e736a4ad1c155a31d3b2dc453e6a562aa Reviewed-on: https://gerrit.libreoffice.org/52119 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-23use boost::optional in vclNoel Grandin1-12/+3
instead of allocating small objects on the heap via std::unique_ptr Change-Id: Iba1d9ad90dc5a31908027336f85046a9de6f5bc4 Reviewed-on: https://gerrit.libreoffice.org/51769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-02drop old tools/gen methods in vclNoel Grandin1-1/+1
Change-Id: I863ce5ae46ae90f06780261fa17b087a7153c807 Reviewed-on: https://gerrit.libreoffice.org/50445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-28convert COL_ constants to be of type ColorNoel Grandin1-1/+1
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27lok: mouse pointer events on document windows onlyPranav Kant1-0/+3
Change-Id: Ie21db52b2dd0d4f55289896caba5174380316e65
2018-02-27replace Color(COL_*) with COL_*Noel Grandin1-4/+4
using git grep -lwP "Color\s*\(\s*(COL_\w+)\s*\)" | xargs perl -pi -e "s/Color\s*\(\s*(COL_\w+)\s*\)//g" and then some manual fixup where the resulting expression no longer compiled Change-Id: I0e268d78611c3be40bba9f60ecfdc087a36c0df4 Reviewed-on: https://gerrit.libreoffice.org/50372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22loplugin:changetoolsgen in vclNoel Grandin1-36/+36
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494 Reviewed-on: https://gerrit.libreoffice.org/50107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21Bin useless codePranav Kant1-2/+0
Change-Id: Id3ffa2333946a9551da9d0f9ecbd2885716b9376 Reviewed-on: https://gerrit.libreoffice.org/50102 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2018-02-20drop Color::SetColor(ColorData) in favour of operator=Noel Grandin1-1/+1
first stage of getting rid of ColorData Change-Id: I5e4e95eb958722814c43c8d1ebfef17ad18c29ec Reviewed-on: https://gerrit.libreoffice.org/49997 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-19weld: hook up help responseCaolán McNamara1-1/+6
and keep the current legacy ownership behaviour when welding the legacy backend Change-Id: I7e1f90f2d235abf0e10062b4be11ba5150bbdbfb Reviewed-on: https://gerrit.libreoffice.org/49918 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-19lok IME: underline characters which are being composedPranav Kant1-1/+1
Change-Id: Ibfc35f1668228400f37ec9b0b0350583483f484d
2018-02-16tdf#115315 Cursor not in focus with new documentTelesto1-1/+1
Partial revert of 7aae8772aa18744cb1bbd8348272be99cc882c47 ("Clear VclPtr instance reference on removed UserEvents.") Disposing of child controls should not affect focus events of the parent frame. Change-Id: I583311050560a2851cfcc372741b675b52375d06 Reviewed-on: https://gerrit.libreoffice.org/49855 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-14lok IME: support dialogs as wellPranav Kant1-1/+7
Change-Id: Ic78da45dadaa5a4e1ca78e20d04974108581121e Reviewed-on: https://gerrit.libreoffice.org/49714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2018-02-13use a11y description if offline help doesn't have an entryCaolán McNamara1-0/+3
Change-Id: I0090e10f6fa7b5e86be7ace8f1bd61f3f790fa11
2018-02-08Different approach for tdf#115227Maxim Monastirsky1-1/+1
This reverts the previous attempt of commit 250ad9311a613d9b4e1cf5cf5fdaf33d9b326220 ("tdf#115227 svtools: suppress UNO notifications for color selectors"), in favor of a different fix. The advantage of this new approach is that is doesn't affect events other than activate/deativate, and that it covers more cases: Toolbar popups even if not based on svtools::ToolbarPopup, or if closed by clicking outside them, font name/size and paragraph style toolbar controls, notebookbar, context and main menus (for the non gtk3 native case, the gtk3 native menus left for a future investigation). For now, keep this logic inside toolkit, but ideally it should be in vcl (after reviewing vcl internal listeners). One side effect that I noticed after this change, is that there is a deactivation/activation pair which suppressed when e.g. opening a new document from the start center. But I'm not sure if that's a problem, given that the focus state of the top window as a whole wasn't changed, only its contents, and there are other APIs to track activation of document components. This happens because the source and the target windows of those events are the same, and we need to suppress this case to fix the font name/size style controls, and also the color picker after 27473d1c0f8ba3006262001cbefff33f639a19ac ("tdf#114935 Move the focus back to the document"). Otherwise we'll need to find another way to move the focus to the document w/o triggering listeners. Another case that will see a change in behavior, is document event listeners in dbaccess, as the Focus/UnFocus events there are based on top window activation/deactivation. However, I think it's a good change, as currently just opening of a toolbar popup or main/context menus there triggers those document events, making them useless. I would like to also mention here, that in fact those top window activation events never really worked as tdf#115227 expects them, as the superfluous events for at least the font name/size, style and color toolbar buttons existed already in OOo. The behavior of the color buttons changed in LO for a few years, but regressed again in the work on a real focus grabbing for floating windows starting with commit dd46727b99d4bb5135451aa7e5e1bdb197373843 ("Resolves; tdf#87120 no keyboard navigation inside floating windows"). That work also introduced superfluous events when using menus. And a note about the change in menubarwindow.cxx: When a menubar popup is closed it's deleted using the lazydelete mechanism, which reparents the popup window, so it doesn't appear anymore in the hierarchy of the document window. Moreover, I suspect that at some point the lazydelete thing will be replaced by a VclPtr mechanism, which might break this even further, so the event won't appear as coming from the popup window (which might be already disposed at this stage). So instead, temporarily set the menubar window as the current focus window, so the activation will appear as if it was coming from the menu bar window itself. Change-Id: I292232adfcbd1a31d66ce394cd2f1bf42a013ecb Reviewed-on: https://gerrit.libreoffice.org/48746 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-08sw lok: IME support + unit testPranav Kant1-1/+19
Change-Id: I557493db23dfa3529606050c86161628dbd722e7 Reviewed-on: https://gerrit.libreoffice.org/49354 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2018-01-31Modernize a bit vcl (part5)Julien Nabet1-8/+6
by using for range loops Change-Id: I52d6e6c9e1c2c321dc81d8258943a1a9a611441c Reviewed-on: https://gerrit.libreoffice.org/48987 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-18lok dialog: enable MessageDialog tunnelingHenry Castro1-9/+10
Change-Id: I05b270a19e29c5ed3a2482fd8163e61e66bfdf74 Reviewed-on: https://gerrit.libreoffice.org/47772 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2018-01-17loplugin:useuniqueptr in WindowImplNoel Grandin1-2/+2
Change-Id: I6a24f9fdf574276281d4a67caec426df14b2dd8c
2018-01-17loplugin:useuniqueptr in ImplWinDataNoel Grandin1-11/+9
Change-Id: Iea0e657bed5a8008f82534494cb0965a9749f1b2
2018-01-15lokdialog: Allow closing the Format Cell dialogs in any order.Jan Holesovsky1-0/+5
Includes also lots of infrastructural changes, making the conversion of the rest of the dialogs much easier. StartExecuteAsync should be used in-place of StartExecuteModal and the latter removed from the code-base incrementally. More common code from Dialog::Execute should be moved to ImplStartExecuteModal in a next step, as this is used more widely. Change-Id: Idb2c1ec790e38f582438471a0419a56cdcf1439d Reviewed-on: https://gerrit.libreoffice.org/47722 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-01-12More loplugin:cstylecast: vclStephan Bergmann1-1/+1
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-10tdf#113874 Guard against invalid statesSamuel Mehrbrodt1-1/+2
Change-Id: I013dd4eb81f0fbef25d9f58e27fe72d800d910ba Reviewed-on: https://gerrit.libreoffice.org/47702 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-12-28Try to handle fonts orphaned from cache gracefullyMike Kaganski1-1/+1
ImplFontCache::Invalidate deletes unused entries (with zero ref count), and keeps other entries, but clears everything (including still used fonts) from its instance list. In the same time, those fonts' mpFontCache pointers kept pointing to this cache object. External clients released font instance by calling its cache's Release method; this itself allows for broken invariants that cache's mnRef0Count is equal to number of unused font instances in its list. Also, those fonts never got released, leaking because ImplFontCache only ever deletes objects in its list. What is worse, sometimes font caches get deleted after invalidation (see OutputDevice::ImplClearFontData). As the instance list of the cache is empty at the point of delete, the cache destructor doesn't delete those fonts that were orphaned at the moment of invalidation (those fonts are still used by some client objects, so deleting them is clearly wrong). But since the font instances still have cache pointer referring the already deleted cache, releasing the instances (by calling deleted cache's Release member function) must lead do some weird results. This patch moves the Acquire/Release to LogicalFontInstance, which now checks if its cache pointer is valid, and if it is, the cache is used to do the work (as before); otherwise, the font handles its lifetime itself, and deletes itself when its reference counter is zero. The cache invalidation clears the cache pointer of the still-used instances. Change-Id: I29811272dda814cbc81f14668d63e385ce772332 Reviewed-on: https://gerrit.libreoffice.org/47111 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-12-20lokdialog: Use Application::Post{Mouse,Key}Event() to post to main threadPranav Kant1-68/+0
... instead of custom machinery there to post to main thread. This also now posts window key events to the main thread instead of processing them on the lok thread. Change-Id: Ided1efb3f237a1838fa50bb8d74752be714c3032
2017-12-14Fix memleakPranav Kant1-0/+1
Change-Id: I557b2f43263fc125d0ee87b968dee1893e4ca7cf
2017-12-14lokdialog: Unblock custom window mouse key eventsPranav Kant1-12/+32
In some cases, the mouse event blocks. Eg: when the mouse event is responsible for launching a new dialog (cf. Spell dialog -> Options). We don't want any kind of blocking behavior whatsoever in LOK. Post all custom window mouse events back the main-loop thread and keep the current LOK thread free. Change-Id: I018870fadcb62dbb7b33a7d93f8af3a0000442b5
2017-12-12tdf#114408 set correct tooltip rectangleCaolán McNamara1-2/+2
The original code tried to get the position of the window relative to its parent and then ask the parent to adjust that position to a position relative to the toplevel. But the position to use in that case should have be WindowImpl::nX/WindowImpl::nY not GetPosPixel() Much easier to just directly ask the the current window for its position relative to the toplevel. Change-Id: Iff202f052bc651a8c0e3a57ff3322e5e2a3e4b9a Reviewed-on: https://gerrit.libreoffice.org/46314 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-12tdf#114407 let tooltip children of non-nwf widgets be nwf themedCaolán McNamara1-1/+2
alternative is to not use themed text color when writing text in non-nwf tooltips Change-Id: I12556d5fd9a38c4b36f77c97144898f08fa4d738 Reviewed-on: https://gerrit.libreoffice.org/46312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-09Use ImplIsFloatingWindow instead of dynamic_castPranav Kant1-3/+3
Change-Id: I09f351ae5d8d1b5c1a405d7aa8082be6014268b3
2017-12-09lokdialog: Move lok cursor invalidation callbacks to vcl::CursorPranav Kant1-11/+0
Change-Id: I5cbb845259b6802fb2a0776f8d8f19f9680115ad
2017-12-06lokdialog: Window* -> VclPtr<Window>, and a small simplification.Jan Holesovsky1-11/+6
Change-Id: I853e2d6ec2e55c78894a9942aa201763a57fe195 Reviewed-on: https://gerrit.libreoffice.org/45900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-12-05lokdialog: Make the badstatic loplugin happy.Jan Holesovsky1-10/+27
Change-Id: Ic19bbd2a3533e4e600d8856e55c4e8d06f0ad752 Reviewed-on: https://gerrit.libreoffice.org/45500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-12-04lokdialog: Merge dialog & dialog child mouse event APIs into onePranav Kant1-24/+12
Change-Id: I91aaa6a58f33dd2d817e02533de96e0c8191f2ca
2017-12-04lokdialog: Simplify; make the LOK dialog API more genericPranav Kant1-35/+12
Merge the dialog floating window callbacks and function calls into one. Unique window ids across vcl::Window is enough to distinguish between them. Floating windows don't have a LOK notifier as they are created in the vcl itself (so we can't access them from sfx2). Use the parent LOK notifier in that case (which would be a dialog). This API should also help in autopopup filter tunneling later. Change-Id: I63a2c97ffdd84695dc967e14c793089a7c50b41b
2017-12-04lokdialog: Kill some code; use already existing method to paintPranav Kant1-9/+0
This is not require now in the new approach where the dialog is already created by the time paint request call for dialog happens. Layouting is already complete by that time. Change-Id: I610b050a268e61e8d4036aa7eb5766cf0c8b37e0
2017-11-29lokdialog: Move the LOKWindowId <-> VclPtr<Window> mapping to Window.Jan Holesovsky1-3/+28
This allows registering & de-registering of non-sfx windows too, and makes the Calc autofilter popup to appear. Change-Id: I7cbbe94d208115aabcb6fa5f964646c7b7ce4c93
2017-11-29lokdialog: Move the painting down to Window, and enable Calc and Impress.Jan Holesovsky1-0/+118
Tested with .uno:FormatCellDialog in Calc, Impress not tested. Change-Id: I6d911c29616988db0625be9e2a63cf2172c69ee8
2017-11-29lokdialogs: Assign the LOK window id only when necessary.Jan Holesovsky1-1/+10
Change-Id: Id48957a8c2bde068f30bb26e66df81972fe38e0f
2017-11-29lokdialog: Move the Notifier down to vcl::Window.Jan Holesovsky1-0/+20
We need to tunnel more than just dialogs, so this is the 1st step to get the Autofilter popup rendered. Change-Id: I6523a39ddc7a6eb2a204e48ab364130a5822f548
2017-11-29loplugin:unusedmethodsNoel Grandin1-16/+0
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1 Reviewed-on: https://gerrit.libreoffice.org/45386 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-09rename AvoidConfig to FuzzingCaolán McNamara1-2/+2
cause that's what its really used for and a couple of cases are not specifically about avoiding config but avoiding uninteresting disk acccess and what not Change-Id: I4c6454f98388579fcd0bf9798321d30408ab65ee Reviewed-on: https://gerrit.libreoffice.org/44491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-23loplugin:includeform: vclStephan Bergmann1-1/+1
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea