Age | Commit message (Collapse) | Author |
|
This is followup for commit cbe229ec219e56ce1bb5dd9598f9052a98504249
lok: jsdialog: enable font name box after save
We need to use weld:: api to inform JSDialogs about
sensitivity change. Happens in lok after shape
resize - we cannot open font size dropdown.
Change-Id: I1897502948c90e3bd1e5e3e347429fa9729d87a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177512
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179612
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: Ic6a6f9a8462a128ab8f61dfa6dbbecb8c707e57f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179595
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
|
|
Change-Id: I461471e5b2e9cd3d94896d9ba6ac315f7237bec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179510
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
|
|
and
cid#1606986 COPY_INSTEAD_OF_MOVE
cid#1557969 COPY_INSTEAD_OF_MOVE
cid#1557837 COPY_INSTEAD_OF_MOVE
cid#1557772 COPY_INSTEAD_OF_MOVE
cid#1557735 COPY_INSTEAD_OF_MOVE
cid#1557672 COPY_INSTEAD_OF_MOVE
cid#1557664 COPY_INSTEAD_OF_MOVE
cid#1557650 COPY_INSTEAD_OF_MOVE
cid#1557642 COPY_INSTEAD_OF_MOVE
cid#1557639 COPY_INSTEAD_OF_MOVE
cid#1557628 COPY_INSTEAD_OF_MOVE
cid#1557623 COPY_INSTEAD_OF_MOVE
cid#1557581 COPY_INSTEAD_OF_MOVE
cid#1557489 COPY_INSTEAD_OF_MOVE
cid#1557473 COPY_INSTEAD_OF_MOVE
cid#1557317 COPY_INSTEAD_OF_MOVE
cid#1557261 COPY_INSTEAD_OF_MOVE
cid#1557146 COPY_INSTEAD_OF_MOVE
cid#1557135 COPY_INSTEAD_OF_MOVE
cid#1557134 COPY_INSTEAD_OF_MOVE
cid#1557079 COPY_INSTEAD_OF_MOVE
cid#1557063 COPY_INSTEAD_OF_MOVE
cid#1557052 COPY_INSTEAD_OF_MOVE
cid#1556982 COPY_INSTEAD_OF_MOVE
cid#1556977 COPY_INSTEAD_OF_MOVE
cid#1556950 COPY_INSTEAD_OF_MOVE
cid#1556943 COPY_INSTEAD_OF_MOVE
cid#1556804 COPY_INSTEAD_OF_MOVE
cid#1556736 COPY_INSTEAD_OF_MOVE
cid#1556658 COPY_INSTEAD_OF_MOVE
cid#1556621 COPY_INSTEAD_OF_MOVE
cid#1556590 COPY_INSTEAD_OF_MOVE
cid#1556579 COPY_INSTEAD_OF_MOVE
cid#1556534 COPY_INSTEAD_OF_MOVE
cid#1556524 COPY_INSTEAD_OF_MOVE
cid#1556478 COPY_INSTEAD_OF_MOVE
cid#1556467 COPY_INSTEAD_OF_MOVE
cid#1556422 COPY_INSTEAD_OF_MOVE
cid#1556314 COPY_INSTEAD_OF_MOVE
cid#1556309 COPY_INSTEAD_OF_MOVE
cid#1556258 COPY_INSTEAD_OF_MOVE
cid#1556143 COPY_INSTEAD_OF_MOVE
cid#1556119 COPY_INSTEAD_OF_MOVE
cid#1556101 COPY_INSTEAD_OF_MOVE
cid#1556097 COPY_INSTEAD_OF_MOVE
cid#1556039 COPY_INSTEAD_OF_MOVE
cid#1555966 COPY_INSTEAD_OF_MOVE
cid#1555948 COPY_INSTEAD_OF_MOVE
cid#1555915 COPY_INSTEAD_OF_MOVE
cid#1555836 COPY_INSTEAD_OF_MOVE
cid#1555748 COPY_INSTEAD_OF_MOVE
cid#1555644 COPY_INSTEAD_OF_MOVE
cid#1555582 COPY_INSTEAD_OF_MOVE
cid#1555478 COPY_INSTEAD_OF_MOVE
cid#1555475 COPY_INSTEAD_OF_MOVE
cid#1555409 COPY_INSTEAD_OF_MOVE
cid#1555372 COPY_INSTEAD_OF_MOVE
cid#1555334 COPY_INSTEAD_OF_MOVE
cid#1555330 COPY_INSTEAD_OF_MOVE
cid#1555310 COPY_INSTEAD_OF_MOVE
cid#1555257 COPY_INSTEAD_OF_MOVE
cid#1555247 COPY_INSTEAD_OF_MOVE
cid#1555147 COPY_INSTEAD_OF_MOVE
cid#1555120 COPY_INSTEAD_OF_MOVE
cid#1555059 COPY_INSTEAD_OF_MOVE
cid#1555016 COPY_INSTEAD_OF_MOVE
cid#1554880 COPY_INSTEAD_OF_MOVE
cid#1554824 COPY_INSTEAD_OF_MOVE
cid#1554808 COPY_INSTEAD_OF_MOVE
cid#1546189 COPY_INSTEAD_OF_MOVE
Change-Id: I2d2f33c603f1596228c9ecb169472ba6751e7826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177593
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
When we save - we block UI. In the lok we disable that for
some cases like in commit e005690e9c648ce516c1ed60da6341c7215bf2c9
lok: avoid sending jsdialog messages during background save.
But we also use save file to generate previews of shapes what happens
on eg. resize in Online. Then we trigger disable and enable cycle
for frames - and we end with FontNameBox enabled!
That was causing the JSDialog combobox still being locked - because
frame unlock was using direct VCL API, not weld:: one in the
InterimItemWindow. Let's fix that with proper StateChanged handling.
So now it is functional. But still I think there is some error in the
logic - as after save we should beg the "before save" state of control
not "always enabled". But it's different problem.
Change-Id: Ia8e5c8c864156271b5f68d482234e83eb57b0deb
(cherry picked from commit cbe229ec219e56ce1bb5dd9598f9052a98504249)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177489
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
|
|
Change-Id: Ic92f640f79c8d1185be422eefaa61601eae9ae8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176555
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
|
|
Change-Id: Ie5f9a7f0e6903476bd02391a71c1f3d75afaf09f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176483
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Yikes - especially when delete is involved.
Previously it was deleting the in-use background,
regardless of where the mouse right-click happened.
You might wonder why not just query GetHighlightedItemId?
That is because (at least for GTK)
the highlightedItem is zero'd out as soon as the pop-up starts,
i.e. when the mouse is moved over top of the context menu.
Change-Id: Ib88cb0edb8c2c8f854c35821d8125a1991d12a55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176447
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Change-Id: I80bdcae1db64f7693600178d86c122c5875369b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
we can just take a "const &".
(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)
Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
Change-Id: Ic5fd72cb64208c278ffc129591cd3d1131efdc08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176137
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
we already declare the same thing in various places,
and I intend to be using this some more, so it makes
sense to only declare it in one place
Change-Id: Ifea6b589e992dd9f6cd8f2301f837e71397481c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Inserts now up to 12 default styles and adds only user styles
that are not among the default
Change-Id: I60ea3e46092681a932cf3fe470c2ce9fb3553917
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176011
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
|
|
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I645fd2a6fafb2607d94607599366d9442b4423fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175199
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
|
|
The result of this patch is that a keyboard shortcut can now
set the font fore-/back-ground color using the
color shown in the toolbar/sidebar.
This is now possible thanks to Maxim's work in 7.6.2
tdf#154270 Sync toolbar button recent colors
and Andreas Heinisch's 24.8 commit 8c822b764b35a0116a0865e991a87c8315e0
tdf#72991 - Remember last used color depending in cui
This patch does 3 things:
1. SetRecentColor when the app initializes
2. Uses SID_ATTR_CHAR_COLOR's recentColor for .uno:FontColor
if no pItem was provided (i.e. a keyboard shortcut called it)
3. Uses SID_ATTR_CHAR_BACK_COLOR's recentColor for .uno:CharBackColor
if no pItem was provided
(Note that without a selection,
CharBackColor isn't so useful for a keyboard shortcut,
since it turns the drag-and-drop template on.)
Setting the recent color right away is critical for user acceptance.
Otherwise, it would only function after they first modified the color
in the toolbar/sidebar.
make CppunitTest_sw_uiwriter9 CPPUNIT_TEST_NAME=testTdf34804
Unfortunately, I can't reliably know if this request
came from an awt::KeyEvent or not, because in that case
we could just avoid CharBackColor's template altogether.
[While there is rReq.GetModifiers() as a good hint,
it is not a guarantee (in case assigned to a function key,
or CTRL held while clicking the toolbar, etc.)]
Change-Id: I7377f087dcdf7011205af005cd0d172100bade2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174804
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
|
|
Change-Id: Ie8e504491d350d582620a5c421d6243239d437d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174976
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I24c947c20afeffffebe5ac794108c4ccecb680f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172828
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ib376a1bcb75e72d6e5754818a353b0d9c7dbd26d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171851
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
I took example on colorConversions.js from avisek, see
https://gist.github.com/avisek/eadfbe7a7a169b1001a2d3affc21052e
2 steps: convert Lab to XYZ, then XYZ to RGB
credit Avisek Das and István Ujj-Mészáros
Change-Id: I3a80259b6de1aca7fe3c308d9024e9b9f2a5a425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171729
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
|
|
Add new overloads to OUString methods that have a
"OUString* rest" style parameter.
Instead return a view, which does not require allocation.
To avoid overload ambiguity, split the methods into
different variants that do not use default parameters.
Change-Id: I1aa366115750f1f7ea4fe665804195f59f7c4b69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167632
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
Commit [1] introduced localization of color palette names. However, the name defined in Common.xcs is not localized, so we need to make sure that the standard palette gets selected on a clear profile.
[1] 5e45351c52584fb116d2cc54da969734e5effab9
Change-Id: I2f03b3ab4bdbb77327388a754e1fc6f9d7413ba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170732
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
|
|
Change-Id: Ifd062cf25c6e930da56571e01c21bd9d2ddf6ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170394
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
|
|
and
cid#1554706 COPY_INSTEAD_OF_MOVE
cid#1554733 COPY_INSTEAD_OF_MOVE
cid#1554736 COPY_INSTEAD_OF_MOVE
cid#1554738 COPY_INSTEAD_OF_MOVE
cid#1554740 COPY_INSTEAD_OF_MOVE
Change-Id: I766cff4ef8eb4256d26f51d7d9dc64442c4bc728
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170453
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
|
|
As band-aid for the lack of proper toolbar resizing,
feedback is given via entry message type
Change-Id: Ic2b2a2aff93040f558775d63c18c21370fabcb39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170167
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
|
|
- rename action: rendered_combobox_entry -> rendered_entry
- change generic get json property callback to more specialized
image getter as it wasn't used anywhere apart of that and we need
image enceded as base64 only not JSON
- add to the full update of icon view "ondemand" property to the entries
with images so LOK client will know it has to download the render
- it will be possible to support HiDPI renders in the future: added TODO
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I83a6e91133f8f9cb03e0bc794b51e1947435fa90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169622
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170160
Tested-by: Jenkins
|
|
Change-Id: I5989905a2efeff23cf803832a5d65857c64b036e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169854
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Change-Id: I073ac7358c1bcb82992ec7746f4b3986d6d35633
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169755
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
the CTRL+F search
Change-Id: I51ccd2186c47a91958c262efac9a1514b9c3b138
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169606
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Tested-by: Jenkins
|
|
Update the border tooltips within Calc's toolbar and sidebar so that they
have matching descriptions.
Also update tooltips in Writer toolbar so that descriptions match across
both apps.
Change-Id: Ib7c682ed5035fe61d991209c4f2cf7f0a1a08a5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169052
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org>
|
|
Change-Id: I7aa8ed716998a185996482dc561219b398a1c919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169080
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
In order to reduce number of calls to GetMarkedObjectList() later on
Change-Id: I2a2c87c2552cfc9002a9afc7d8eefb16a601b784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168216
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I40cfc39501006146f7c6c04a1f3c7cf877c6f1c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167186
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
|
|
Change-Id: Ica3c79facee725effcfb160738305c599c5de1ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167575
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
Change-Id: Ibdf5f7b0100cafbecc263a038b2234012da10fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167543
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ia765a03e033acb82e367873380d289587ea87d6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167449
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
Change-Id: I9bb7884048f3cc7ef795f7a79dc566fc8fe77e7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167063
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
Change-Id: I8edb1fefe1b2b8a3db3ee8f3a0eed59c7f08a36e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166863
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: Ic8b925a3ec55166a9d5da05827d2cb335943b665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165542
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
|
|
I checked if this is used, but it can be replaced
using Clear() -> all. This prevents that the whole
array of Items in an ItemSet gets set to
INVALID_POOL_ITEM.
I also checked if INVALID_POOL_ITEM/IsInvalidItem
is needed at all representing SfxItemState::DONTCARE
but it is and still will need to be set for individual
Items.
At last checked if SfxItemState::UNKNOWN and
::DISABLED really need to be separate states, but
indeed there are some rare cases that need that.
To make things more consistent I also renamed
SfxItemState::DONTCARE to SfxItemState::INVALID
to better match Set/IsInvalid calls at ItemSet.
The build showed a missing UT and led to a problem
due to the hand-made ItemSet-like SearchAttrItemList.
The state 'invalid' seems to be used as 'unused'
marker. It should be changed to use SfxPoolItemHolder
and not need that. For now, set by using an own loop
to set to that state.
Change-Id: Ifc51aad60570569a1e37d3084a5e307eed47d06c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165035
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
same is true for "Theme Colors", a problem since:
commit 4ccc2f0e3f45c9d78f74b1848851bedf71f7382d
Date: Fri Mar 1 22:11:14 2024 +0200
cool#8327 use tools::JsonWriter for theme colors
Change-Id: Ibaab5df197bd8005037e066181e8a50bdda5ceda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164658
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164669
Tested-by: Jenkins
|
|
This patch makes the Draw/Impress Navigator display the name retrieved
by SdrCustomShapeGeometryItem::GetPropertyValueByName("Type") for
custom shape objects when the custom shape is unnamed and the Navigator
is set to show all objects. For Writer and Calc, this patch makes
inserted fontwork custom shape objects be automatically named 'Fontwork
N'.
Change-Id: Ice34461fe7a4b26d01b2d93e871a956dc55392f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152568
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org>
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
|
|
shaves 2% off the load time
Change-Id: I579825bd6101b57a44b0f3118ede17ec2393d9d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164477
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Iebca3781910f9e28100258da8266d51f673f31d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164232
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
1) Open a spreadsheet
2) Format a cell with a currency. Example USD $ English (USA)
3) Open the sidebar if it's not opened already
4) Click in the currency dropdown
5) Observe: there is $ (Default)
Expected result: USD $ English (USA) Default
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: Idf7f4174557e59cb6f5ffd65c25572322a5794ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164123
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Change-Id: If9e22982f4f7c276d19167ff365e1b4e290e3de7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163748
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
|
|
Change-Id: I51585f1c15984a066262023184f668662853d20f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163556
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
Driving forward the Item reworks I now take the
ItemPool in focus: It now does not hold any items
anymore and should be renamed to something like
ItemInfoProvider/ItemHelper, since it's main purpose
is to provide the Defaults for the Item functionality.
There is that SfxItemInfo, only a struct and bundling
SlotID and ItemFlags. There are also the DefaultItems,
just handled as ptrs in an array. It is/was always
error-prone to keep these in sync. Remember that it's
also necessary for the order to not only being sorted
but being increments of one with no gaps allowed in
the WhichIDs to which the Items are bound.
I now bundled that to a new class ItemInfo that joins
WhichID, SlotID, ItemFlags and the default Item. This
is a pure virtual base class, it comes in three
derivations:
(1) ItemInfoStatic:
This is supposed to be global static and hosts the
Item in a std::unique_ptr to ensure cleanup. It is
designed to be constructed once during runtime and
being shared globally. It allows the ItemPtr to be
nullptr to mark as non-static (if initial static is
not possible for some reason) but still offers the
needed data. Most cases (95%+) are of that case.
The contained Item is owned by that instance. The
flag isStaticDefault() is set at the Item.
(2) ItemInfoDynamic:
This is supposed to be used for cases where the Item
cannot be static: Mainly for SfxSetItem (that needs
a Pool itself in the contained SfxItemSet, so lifetime
is bound to that Pool), but other cases showed up in
the transition. These instances live while the Pool
lives and get destructed when the Pool goes down.
Also uses std::unique_ptr for the Item instance for
as much automated cleanup as possible, the contained
Item is owned by that instance, the instance by the
Pool. The flag isDynamicDefault() is set at the Item.
(3) ItemInfoUser:
This is used for UserDefaults that can be set for
every ItemInfo entry to 'overshadow' the default
from the 'outside'. It uses a regular Item and
the central access methods implCreateItemEntry/
implCleanupItemEntry to manage the Item instance,
thus works like a SfxPoolItemHolder. The Item
instance can be globally shared and re-used even
when the Pool goes down. Instances belong to the
Pool and are cleaned up when the Pool goes down.
This Item does not need any further flag to be
set.
The ItemInfos are organized using a class
called ItemInfoPackage:
This bundles groups of ItemInfoStatic to
functional instances. There are derivations/
implementations of this e.g. for Writer ItemPool
bundling all the needed defaults for Writer,
similar for draw/impress, Calc and other usages.
These ItemInfoPackage can be 'registered' at an
ItemPool using it's method registerItemInfoPackage.
This does all the needed stuff to setup that
group of ItemInfos at the Pool (It even sets
internal vars First/LastWhich, that info can just
be derived from the buildup ItemInfo Ptrs).
The ItemInfoPackage has methods 'size()' and
'getItemInfo(index) to allow looping over it
and deliver the infos the Pool needs. The
(forced, pure virtual) overloads of getItemInfo
in the specific implementations check for the
ItemPtr being nullptr and create a exclusive
incarnation of ItemInfoDynamic for the Pool if
needed, returning that. The Pool owns the
ItemInfoDynamic incarnations and uses the
ItemInfoStatic directly. On shutdown it cleans
up the ItemInfoDynamic as needed.
The ItemInfoUser is used by the Pool when a
UserDefault is set/used: for SetUserDefaultItem,
GetUserDefaultItem, ResetUserDefaultItem. It
is not held in a 2nd list, but directly in the
list of ItemInfo'ptrs: To keep track of this
an unordered_map is used that helds the original
ItemInfo associated with the WhichID. That way
no two lookups (as before) are needed to get the
current Pool's default for any WhichID.
The derivations of ItemInfoPackage are
encapsulated and just allow access to an
ItemInfoPackage& with a single method as
return value. All use a static local instance
of a std::array<ItemInfoStatic, FIXED_SIZE>
which constructs all ItemInfoStatic and the
static Item instances - if already possible.
Sometimes it is necessary to overload the
constructor to set some static instances
for Items later than the lib init. These are
also just marked with nullptr as Item instance.
Some need to overload getItemInfo to complete
instances of ItemInfoStatic, if needed, or
create and deliver instances of ItemInfoDynamic.
The registerItemInfoPackage also offers a
optional lambda callback: there were two cases
where local data from the Pool was needed to
incarnate the item - just add that to the
call to registerItemInfoPackage if needed,
see examples in the adapted code.
For the re-use of Items this means that now
in SfxItemSet/SfxPoolItemHolder *true* static
Items can and will be used without RefCount
directly and globally. This is also the case
for dynamic Items, with the exception of
differing Pools for SfxSetItems which cannot
be done.
Future:
That design is already prepared to allow
solving that Pool-chaining problem: currently
there are master/sub-pools and all accesses
have to traverse that structure before even
doing anything.
For the future the idea is more to 'compose'
a Pool by registering ItemInfoPackages, e.g.
for Writer pool you may start with SfxItemPool,
register the writer-specific ItemInfoPackage,
then the one for DrawingLayer (if needed) and
the one for EditEngine.
It should also be possible to get to smaller
granularities of that packages. Ideas for
new ones will emerge. We might also think
about composing Pools which can e.g. run Writer
and Chart, so allowing to use Chart *without*
OLE stuff in Writer - just ideas...
More changes:
- Adapted all stuff, cleaned up old stuff/
definitions
- Removed FreezeIdRanges, that can be done
once per Pool on-demand (and cannot be
forgotten to be called)
- Merged XOutdevItemPool with SdrItemPool
and offered a ItemInfoPackage which joins
both needed sets of Items
- All the cleanup hassle with Pools and
defaults cleaned up
- Adapted all access methods of the pool
to use that new stuff. Pool chaining
currently stays, but I use a central
method 'getTargetPool' instead of
recursive calling to get the correct
Pool for the action
Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
This patch makes the selected text in the code editor be
automatically inserted in the search bar.
Change-Id: Ibbe64aa3375a5a47dedb762001ed4b99f4b22e46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162548
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
|