summaryrefslogtreecommitdiff
path: root/framework/source/uielement/toolbarmanager.cxx
AgeCommit message (Collapse)Author
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin
Change-Id: I0567d103db8db401c737fed98483912a39352929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30Prepare for removal of non-const operator[] from Sequence in frameworkMike Kaganski
Change-Id: Ied2683a0b8a1bab1a7594da1e9bdbd3cb753552c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124370 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-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-08-23loplugin:referencecasting look through more clang TypesNoel Grandin
Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-26use officecfg for menu optionsNoel Grandin
Change-Id: I94c9cf310ed6975f158548913439445faf6d178f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-23use officecfg to retrieve DisableUICustomizationNoel Grandin
Change-Id: I87b3019c8e10eb2453746340beea4c4623dc65e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20framework: fix multiple-free in VclToolBarManager::Destroy()Michael Stahl
Multiple ImplToolItem with mnId 1000 are inserted in the same ToolBox and the problem is that only the first one gets its mpUserData set, because setting and getting that is based on the assumption that mnId is unique per container. So in Destroy() for every item with mnId 1000 the same AddonsParams object is deleted. The problem is that in ToolBarManager::FillToolbar() the local nItemId is copied, so its value never changes when iterating the loop because only its copy is incremented. (regression from ac1aefd5174258d9bcb41465ce566ed1a0819f3d) Change-Id: Ica47051f9447c2b9d1981f8373d754874f0f31b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119228 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-07-08make SetParentToDefaultWindow available from vcl onlyCaolán McNamara
rechecked tdf#119390. If I tear off the color popdown in writer, click in the combobox and shift-tab to put focus in the button (where focus is more visible) and close the torn off window then focus continues to return to the main document as wanted. Change-Id: I1e909cdf31e9a1309475d933d0ede289a84884b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118645 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-25tdf#143047: When no properties for command, use those from item containerMike Kaganski
This allows to use the "Label" property defined by user for macro items, that indeed have no built-in command properties. Thus the resulting tooltip will be a concatenation of the label and mnemonic instead of only mnemonic as happened before. Change-Id: I79d933fecd09ca7d64b7a3e7db0ef194e42c1c55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117787 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-08Resolves tdf#131817 - Option to globally switch toolbar locking on/offHeiko Tietze
Reverts 6993d5d0f1079fe720a7da004b70b57361c99fc6 and sets Locked in GlobalSettings to true New UNO command ToolbarLock to toggle the state added to the toolbars menu Change-Id: I246280b2b7930f2bf686e6fc26383da4799b5028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115797 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2021-04-22Call forgotten Init in toolbarmanagerSzymon Kłos
This call was missing in ac1aefd5174258d9bcb41465ce566ed1a0819f3d Extend ToolBarManager to build weld::Toolbar Change-Id: I734861616020e29b88310edf1ff5621c8cab2b8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114472 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2021-04-06Extend ToolBarManager to build weld::ToolbarSzymon Kłos
- used for SubToolBarController eg. framework shape toolbar popup present in the sidebar fontwork panel - add separate implementation for vcl and weld based ToolBarManager - provide basic functionality for weld based (just inserting standard items with icons and controllers) - not implemented: addons items merging etc. Change-Id: I8e460f34abd512d70e95a1d484d728b7d809ce9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113387 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-11use strong_int for item ids in vcl::ToolBoxNoel
(*) fix bug in SfxToolBoxControl::StateChanged where it was using the slot id instead of the toolbox item id (*) I left the logic in SbaTableQueryBrowser alone, but it looks suspicious, casting slot ids to toolbox ids Change-Id: Ied229164c27fb4456b0515c6fdcbd1682766a1a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-01loplugin:refcounting in sfx2Noel
Change-Id: Iba7b1be688f1a7c1b0947c2423cc1965362386b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111682 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-25allow use of FloatWinPopupFlags without including complete floatwin.hxxCaolán McNamara
Change-Id: Ica412938ead6f213668b3aa876bff81d8f512f1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111526 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-25dockwin.hxx doesn't need to include floatwin.hxxCaolán McNamara
Change-Id: Ib0408f715c9a12f32ce2f8049d2c9c7272201d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111504 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-21loplugin:refcounting in frameworkNoel
Change-Id: I2d7d14fe0335689e4a338c70587bf33137ed1ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111279 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-08lock/unlock toolbar doesn't show an unticked checkboxCaolán McNamara
when in the off state Change-Id: I1a3c2a1281029ef7d80836db8431f306aeb76db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107428 Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins
2020-11-25tdf#131441 Disable "UNDOCKTOOLBAR" when toolbar is lockeddiwanshu885
Change-Id: I3a7fdf2fbde55a8ac4083f1fa8cd76e55718b2e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106476 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2020-11-02toolbox always has flat styleNoel Grandin
ever since commit c1cd6af623e86b5b1b45f9d09dc17d6fbb907f02 Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Mon May 10 14:51:02 2004 +0000 INTEGRATION: CWS nwf (1.64.66); FILE MERGED 2004/03/31 09:28:33 ssa 1.64.66.1: #i25130# force flat toolbox buttons except for a completely and utterly undocumented hack of a registry key, introduced in commit 736dc0956a50315ec72ad126406556657a750d37 Author: Rüdiger Timm <rt@openoffice.org> Date: Thu Apr 17 14:19:46 2003 +0000 INTEGRATION: CWS vcl08 (1.57.2.4.18); FILE MERGED 2003/04/14 17:46:27 ssa 1.57.2.4.18.1: #108699# disabled flat toolbox buttons not exported anymore which only seems to apply to Windows. So just remove this. Change-Id: Idf315b8c89c3119883a5e6880d003d379fe6faec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105155 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-01use officecfg for Experimental flagNoel Grandin
move IsShowOutlineContentVisibilityButton out of header to avoid having to add extra include paths to all the unit test makefiles. Change-Id: I2763390e07cd85b8f09b6f2ad7702039daecb22f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105100 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-02loplugin:reducevarscope in frameworkNoel
Change-Id: I79237d68d815f9b46277a496a05b596f58b4028b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103813 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-31Remove remains of private:image/ via ImageIdentifier addon propertyMaxim Monastirsky
This is broken since commit 5c39b28a87060f80404079ab77604f664addb063 ("tdf#96059 Replaced imageproducer with CommandInfoProvider") but so far no one complained (maybe because the usefulness of such internal images from extensions is questionable at least). Given also that the whole ImageIdentifier feature (even its still working part) is obsolete since OOo 2.0.3 (according to the OOo dev guide), and that the availability of a particular image from an internal hardcoded image list by a particular numerical id is more an implementation detail, let's just remove the broken code instead of fixing it. In the meantime, the code was also copied into the newly introduced notebookbar addon code, so I handled it there too. There are also the registry schema and a sdk example that mention this feature, and need to be adjusted. Interesting that the particular example used there - private:image/3216 is actually broken since 2011 with commit 2559cab126f81375197051fb5b07ba6abb9efc77 ("FDO#42454 - EasyHack: remove code associated with unused icons"). Change-Id: I968b4fb8c5b207654476dd92c57d8db0815520ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101529 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-29loplugin:unusedfieldsNoel Grandin
Change-Id: I3f14647eed72898b641fbd583d18f914c7461628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101630 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-28Use ToolBarMerger::IsCorrectContextMaxim Monastirsky
Change-Id: I1256dcacd364b332232872f48a4eb3ec979fb0a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101512 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-20Base addon toolbars on the regular ToolBarManagerMaxim Monastirsky
ToolBarManager already supported addon buttons because of the toolbar merging feature. Besides the cleanup, this gives access to addon devs to all toolbar features like aliases or style buttons. Change-Id: I7adf830ac71c7f5354a924d60a531d8001e37571 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101071 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-19Use ToolBox::GetImageSizeMaxim Monastirsky
Change-Id: Ie7ae46001589584482bf5efe698b3774edace325 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100968 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-14One toolbar generic controller is enoughMaxim Monastirsky
The one from framework is more feature complete, so use that one. Change-Id: I499f0ae1d20c588cfc04beebc643819559325882 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100726 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-08-14Replace MenuToolbarController with the usual approach for menu buttonsMaxim Monastirsky
i.e. ResourceMenuController + GenericPopupToolbarController. (Decl. of both isn't available in a header file, so they are instantiated via the service manager for now. This is a bit weird for something from the same module, but should not make any difference in practice.) Change-Id: Ia3fc7ba82b0f6e1a43aa7b5e56e2cff7e039d877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100725 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: frameworkStephan Bergmann
Change-Id: I71eaaa7cbc1c38e541291d48eb5f05157fd4c8c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97563 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-26use underlying BitmapExCaolán McNamara
Change-Id: I1ddc5a50a54bb230af1c76a8098c68fdb0495df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97234 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-21use for-range on Sequence in f*Noel Grandin
Change-Id: I820255001c1b96d1f4b76a203f3c0f76fa09fe66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94567 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-08loplugin:flatten in frameworkNoel Grandin
Change-Id: I2a74a7543b5edd853396efa31a3e2568e6607778 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-24tdf#130163 Show undock or dock menu item in toolbar menuJim Raykowski
This patch removes toolbar menu item 'Dock Toolbar' enable state and shows 'Undock Toolbar' menu item when toolbar is docked and 'Dock Toolbar' menu item when toolbar is undocked. It also sets the accelerator key displayed for these items to Shift+Ctrl+F10 Change-Id: I0e4673529438c42452026602785857066ea7874a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85673 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>
2020-01-06Display menu item keyboard shortcuts in toolbar menuJim Raykowski
Change-Id: I288d4850f9a8e9ac51dfefddff7a2a7d359178c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85832 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-11-26tdf#126043 fetch the command properties just onceCaolán McNamara
Change-Id: Iaf343e9858be36ca8772d9c12eee772d93b4c394 Reviewed-on: https://gerrit.libreoffice.org/83668 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-20tdf#42949 Fix IWYU warnings in framework/*/*cxxGabor Kelemen
Also drop the now unused framework/inc/general.h Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8e19036a507dbdcd178835b6ac4182719d27a654 Reviewed-on: https://gerrit.libreoffice.org/82744 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-11tdf#42949 Fix IWYU warnings in framework/*/*hxxGabor Kelemen
Also drop unused framework/inc/fwkdllapi.h Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e79266f273b778f4a8bd3330b1b0353a2e01a61 Reviewed-on: https://gerrit.libreoffice.org/81927 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-20loplugin:referencecasting in frameworkNoel Grandin
Change-Id: I49aee4023fdb3173d842c19a53f9170ca1e725e4 Reviewed-on: https://gerrit.libreoffice.org/75972 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-23Fix typoAndrea Gelmini
Change-Id: Ie4a0e69b78f671f9990f9c750e5ecb63447efe2b Reviewed-on: https://gerrit.libreoffice.org/74599 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-31Use hasElements to check Sequence emptiness in [e-i]*Arkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I79e31919db8f4132216f09a7868d18835eeb154b Reviewed-on: https://gerrit.libreoffice.org/71795 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-04tdf#105881 Toolbar keyboard navigation fixesJim Raykowski
This patch makes toolbar keyboard navigation wrap to the begining or end toolbar item and enables access to the overflow menu using the keyboard. Change-Id: I5975b0f731beb00cf26f8e8a33e6ea4fa9322881 Reviewed-on: https://gerrit.libreoffice.org/71718 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-04-23tdf#124886 Toolbar button icons are off by oneNoel Grandin
regression from commit 1a5b12aa5da2c718848d3cc5d9bce7bfcdeacf54 Date: Thu Apr 18 15:13:19 2019 +0200 optimise find/insert pattern Change-Id: I24edd5a89beed392c86058cd60155caf94bcf9ca Reviewed-on: https://gerrit.libreoffice.org/71137 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19optimise find/insert patternNoel Grandin
if we're doing a find/insert on a set or a map, it is better to just do a conditional insert/emplace operation than triggering two lookups. Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d Reviewed-on: https://gerrit.libreoffice.org/70937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-07tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4 Reviewed-on: https://gerrit.libreoffice.org/65614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-08reduce the amount of senseless exceptions during document loadMarkus Mohrhard
Change-Id: If9d0a0539002c013f077b8fb692de4c29ca032b7 Reviewed-on: https://gerrit.libreoffice.org/64791 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-10-16drop LazyDeletorCaolán McNamara
Change-Id: I7d2e00466f321994a46b0529d645e342f229c929 Reviewed-on: https://gerrit.libreoffice.org/61718 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-31tdf#119390 Don't focus the toolbar when closing a floating windowMaxim Monastirsky
Toolbar popup windows have the toolbar as their direct parent. This causes problems when such window is teared-off and later closed, as Window::dispose will attempt to move the focus to its parent which is the toolbar, instead of what users expect to have the focus back in the document area, or in whatever was the last focused control. As a solution reparent the window before dispose, similar to what happens with floating toolbars. Also return the focus to the main window when popup mode ends, so we can keep track of the last focused control. This is also a good thing by itself, as WB_OWNERDRAWDECORATION windows don't get the focus by default, which results in neither the floating window nor the document have focus after tear-off. Change-Id: I060b8c45a64db9c612da58b7c35478bab41a4558 Reviewed-on: https://gerrit.libreoffice.org/59811 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>