Bug 131688 - RemoveDirectCharFormats <Ctrl>+<Shift>+X usage tip
Summary: RemoveDirectCharFormats <Ctrl>+<Shift>+X usage tip
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low trivial
Assignee: Jakub Kościelak
URL:
Whiteboard: target:7.5.0
Keywords: difficultyBeginner, easyHack, skillDesign, topicUI
Depends on:
Blocks: Tip-Of-The-Day
  Show dependency treegraph
 
Reported: 2020-03-30 00:21 UTC by TorrAB
Modified: 2024-05-14 08:28 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
file with altered (bold, big) chars (13.82 KB, application/vnd.oasis.opendocument.text)
2020-03-30 00:21 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-03-30 00:21:51 UTC
Created attachment 159133 [details]
file with altered (bold, big) chars

In boldNor.odt,
	0. cursor after 'a', hit h: 'h' Bold & big, as expected.
	1. cursor after 'b', hit ^m (or Format>Clear Direct Formatting), then y: 'y' Normal (not Bold, size 12) —OK.
	2. cursor after 'c', hit ^X (ctrl_shift_x; RemoveDirectCharFormats; Tip № 65), then v: 'v' Bold & big (like 'c'), unexpected; ^X did not work.
	3. cursor after 'd', hit ^X (as in step2), then p: 'p' Normal (not Bold) —OK.
	4. cursor after 'e', hit ^m (as in step2), then q: 'q' Normal (not Bold) —OK.
	5. cursor after 'f', hit ^X: nothing happens; hit 'g': g Bold. Word is now 'fgh'.
	6. cursor after 'f', hit ^m: 'fgh' becomes Normal, because cursor is inside a word; OK.
	Conclusion: ^X works only at the end of a parag —steps 2, 3, 5. ^m (Clear Direct Formatting) apparently does the same thing, but better —steps 1, 4, 6. Function RemoveDirectCharFormats can be eliminated.
Comment 1 Heiko Tietze 2020-04-03 09:50:55 UTC
Stuart, what do you think?
Comment 2 V Stuart Foote 2020-04-03 16:20:48 UTC
The function remains valid as implemented for OOo (see also i13592), just being misapplied by OP.

Review of the control [1] shows it is intended to be applied when positioned at the end of a Paragraph--to prevent the continuation of the Direct Formatting from that point should additional text be added.

See no reason to remove, and its writer shell action DontExpandFormat() might be another tool to solve other paste with/without formatting issues. 

The tip-of-the-day string for it [2] probably needs a tweak--"Typing new paragraph text in..."

=-ref-=

[1] https://opengrok.libreoffice.org/xref/core/sw/source/uibase/shells/txtattr.cxx?r=a01a5bd9#192
[2] https://opengrok.libreoffice.org/xref/core/cui/inc/tipoftheday.hrc?r=a504ed78#112

 { NC_("RID_CUI_TIPOFTHEDAY", "Typing in bold, italics, or underlined in Writer you can continue with the default attributes using just the shortcut %MOD1+Shift+X (remove direct character formats)."), "", "tipoftheday_w.png"},
Comment 3 Heiko Tietze 2020-04-06 09:40:42 UTC
(In reply to V Stuart Foote from comment #2)
> The tip-of-the-day string for it [2] probably needs a tweak...

Let's do this. Seth, a job for you?
Comment 4 Heiko Tietze 2021-06-17 05:28:06 UTC
Customization of .uno:RemoveDirectCharFormats into the toolbar (menu probably too) is possible but not effective. We should block it in sw/sdi/swriter SfxVoidItem RemoveDirectCharFormats FN_REMOVE_DIRECT_CHAR_FORMATS > MenuConfig, ToolBoxConfig

And the TotD needs improvement, search cui/inc/tipoftheday.hrc for "Typing in bold, italics, or underlined in Writer".
Comment 5 Commit Notification 2022-11-08 09:37:17 UTC
Bogdan B committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3c4ee1f180aed4bc09cf8dab2a1101feb0d95fa6

tdf#131688 Improve one tip of the day

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 BogdanB 2022-11-08 09:49:40 UTC
Second part of comment 4 is solved. Remains the first part.

Heiko, if this is just a half solved job how I should mark the bug?
Comment 7 Jakub Kościelak 2024-05-05 17:38:47 UTC
     { NC_("RID_CUI_TIPOFTHEDAY", "You can continue writing with the default formatting attributes after manually applying bold, italic or underline by pressing %MOD1+Shift+X."), "", "", swriter},

We should probably change it to %MOD1+M here?
Comment 8 Jakub Kościelak 2024-05-05 17:51:52 UTC
We remove this completely:
SfxVoidItem RemoveDirectCharFormats FN_REMOVE_DIRECT_CHAR_FORMATS
or do we set:
AccelConfig
     MenuConfig
     ToolBoxConfig
just false?
Comment 9 Heiko Tietze 2024-05-06 08:17:52 UTC
I see X_SHIFT_MOD1 assigned to .uno:RemoveDirectCharFormats in officecfg/registry/data/org/openoffice/Office/Accelerators.xcu. Why do you think it needs to be changed?
Comment 10 Jakub Kościelak 2024-05-06 09:38:05 UTC
I think I misunderstood, I thought we wanted to remove this function and suggest using MOD1 + M instead. So what is left to do?
Comment 11 Heiko Tietze 2024-05-06 10:14:55 UTC
According comment 4 only your comment 8 is missing. How do you bring ctrl+M into play here?
Comment 12 Jakub Kościelak 2024-05-06 12:15:48 UTC
As I wrote, I thought that we wanted to use Ctrl + M and remove Ctrl + Shift + X, as it was written in comment no. 1, that it works the same but better, so change it also as a tip of the day for the user.

We only change MenuConfig and ToolBoxConfig to false?



https://gerrit.libreoffice.org/c/core/+/167164
Comment 13 Heiko Tietze 2024-05-06 12:35:33 UTC
(In reply to Jakub Kościelak from comment #12)
> ...as it was written in comment no. 1

(In reply to TorrAB from comment #0)
> Conclusion: ^X works only at the end of a parag —steps 2, 3, 5. ^m (Clear
> Direct Formatting) apparently does the same thing, but better...

FN_REMOVE_DIRECT_CHAR_FORMATS runs SwTextNode::DontExpandFormat() while FN_FORMAT_RESET boils down to ImpEditEngine::RemoveCharAttribs(). It's a whole chain of processing with the only obvious difference that one keeps the language. I'm afraid of removing one.

The ultimate question is whether ctrl+M is easier to use than shift+ctrl+X (I agree) and if we should advertise ctrl+M in the TotD and probably hide the other command from users.

If so, you should set all *CONFIG flags to false (see bug 147411) and remove the assignmemt of .uno:RemoveDirectCharFormats to X_SHIFT_MOD1 in officecfg/registry/data/org/openoffice/Office/Accelerators.xcu (but first check if the command in other modules work differently).

Is it worth all the effort?
(But thanks for taking care anyway, Jakub!)
Comment 14 Jakub Kościelak 2024-05-10 11:26:22 UTC
I think Ctrl + M is easier to use and we should advertise it in TotD. Some people probably use this second, longer command, so I guess we can't remove it. Can we calmly? Hiding is not an option due to the bug, right? The command is either everywhere or nowhere, did I understand correctly?
Comment 15 Heiko Tietze 2024-05-14 08:28:34 UTC
(In reply to Jakub Kościelak from comment #14)
> I think Ctrl + M is easier to use and we should advertise it in TotD. Some
> people probably use this second, longer command, so I guess we can't remove
> it. Can we calmly? Hiding is not an option due to the bug, right? The
> command is either everywhere or nowhere, did I understand correctly?
Don't know what happens if a command is assigned to a shortcut and the customization is removed later. Guess it still works. Easy to test :-)