[ooo-build] [PATCH] sw: preserve character style on 'reset format'

Octavio Alvarez alvarezp at alvarezp.ods.org
Sun Feb 28 09:21:34 PST 2010


On Fri, 26 Feb 2010 03:02:10 -0800, Thorsten Behrens <thb at openoffice.org>
wrote:

> Octavio Alvarez wrote:
>> It changes the behavior of "Default formatting" option to
>> NOT remove the attribute for character style. It will only
>> remove directly applied format.
>>
>> For those that would need to set all the marked text to
>> "Default" style, they can still do it through F11 > Default.
>>
>> See discussion in i#47893 and i#85464 and the corresponding
>> duplicates.
>>
> wow, the spec linked from i85464 is an abomination - tried to make
> some sense from it, then gave up & reverted to just playing with
> Format->Default & "Clear Formatting".

And to make it worse, there is also a "Remove Direct Character
Formats", not shown in the Format menu by default. This command
does not do anything, as far as I could tell.

>> +--- sw/source/ui/shells/textsh1.cxx
>> ++++ sw/source/ui/shells/textsh1.cxx
>> +@@ -489,7 +489,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
>> +                 RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1,
>> +                 RES_PARATR_BEGIN, RES_PARATR_END-1,
>> +                 RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
>> +-                RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
>> +                 RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
>> +                 RES_TXTATR_UNKNOWN_CONTAINER,  
>> RES_TXTATR_UNKNOWN_CONTAINER,
>> +                 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
>>
> Skip the RES_TXTATR_INETFMT - RES_TXTATR_INETFMT range here, too?
> Likely you don't want to clear hyperlink format as well.

That _would_ be the best to do, as Hyperlink is not a format,
but an attribute (or a property) with a format (from the user
POV).

The problem is that it would leave users with no way
of removing all hyperlinks from a document, other than
removing them individually.

I don't know yet how to create a patch that fixes OO.o
 from not showing the "Remove hyperlink" option in the context
menu when more text than a single hyperlink is selected.

I'd rather leave that for another patch.

> Given the fact that there are two distinct ways to trigger
> FN_FORMAT_RESET from the UI, would you consider it an acceptable
> compromise to redirect _one_ of them to a different slot, with the
> then-updated behaviour of yours?

As far as I see now, FN_FORMAT_RESET should be the one to get
fixed (urgently), and other more specific slots should be created
later.

I'd rather see it as a severe clean up that is needed in this area.

"Clear formatting" should be an equivalent of "Clear directly
applied PARAGRAPH formatting" only, because it appears on a list
that only allows you to choose paragraph styles. I don't know
if this command exists, though.

It would imply creating a "Remove Direct X Formats", where X
is {"Paragraph", "Frame", "Page", "List"}.



More information about the ooo-build mailing list