office-gobmx/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 8c822b764b
    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
..
classification
doc
inc
qa Use good old string literals in assertXPath and friends 2024-10-05 10:06:44 +02:00
sdi tdf#163291 Fix AdditionsDialog in start center 2024-10-04 13:04:38 +02:00
source tdf#34804 sw: enable keyboard shortcut for CharColor and CharBackColor 2024-10-17 17:33:49 +02:00
uiconfig/ui
util
AllLangMoTarget_sfx2.mk
CppunitTest_sfx2_classification.mk
CppunitTest_sfx2_controlleritem.mk
CppunitTest_sfx2_dialogs_test.mk
CppunitTest_sfx2_doc.mk
CppunitTest_sfx2_metadatable.mk
CppunitTest_sfx2_misc.mk
CppunitTest_sfx2_view.mk
CustomTarget_classification.mk
IwyuFilter_sfx2.yaml
JunitTest_sfx2_complex.mk sfx2: move DocumentProperties from Java to CppUnittest 2024-09-24 08:43:56 +02:00
JunitTest_sfx2_unoapi.mk
Library_sfx.mk
Makefile
Module_sfx2.mk
Package_classification.mk
PythonTest_sfx2_python.mk
README.md
UIConfig_sfx.mk
UITest_sfx2_doc.mk

Legacy Framework

SFX is the "old" framework, used for historical reasons.

An attempt of documentation of this module is located in [git:sfx2/doc].

It contains base classes for document model, view and controller, used by "old" applications like sw, sc, sd (while "new" applications are based on the "new" UNO based framework in "framework").

The SFX framework is based on dispatching slots identified by integers (SlotIDs) to SfxShells, and there is a dedicated IDL compiler (svidl) involved that generates C++ slot headers from SDI files in modules' sdi/ subdirectory.

Documentation about SFX dispatch, SDI etc.: https://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2

Document load/save code is maintained in [git:sfx2/source/doc/docfile.cxx] SfxMedium class, which handles all the twisty load and save corner cases.

[git:sfx2/source/appl/sfxhelp.cxx] Start procedure for the online help viewer top level window; handling of help URL creation and dispatch.

There are also some UNO services here that could really be implemented anywhere, e.g. the DocumentProperties or DocumentMetadataAccess.

Notable files: sfx2/source/dialog/backingwindow.cxx Startcenter buttons and the corresponding event handler.