Files
loongoffice/include/sfx2
Justin Luth bc21a85029 tdf#34804 sw: enable keyboard shortcut for CharColor and CharBackColor
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>
2024-10-17 17:33:49 +02:00
..
2024-10-16 15:51:52 +02:00
2024-06-18 01:07:42 +02:00
2024-05-22 12:22:47 +02:00
2024-02-19 09:09:06 +01:00
2024-06-18 01:07:42 +02:00
2024-07-09 18:56:13 +02:00
2024-03-08 07:06:13 +01:00
2024-02-01 12:12:10 +01:00
2023-12-19 09:42:03 +01:00
2024-05-02 14:37:56 +02:00
2023-12-21 21:13:55 +01:00
2024-04-28 22:30:17 +02:00
2024-05-10 18:42:35 +02:00
2024-06-18 01:07:42 +02:00