[Solved] Ctrl+M removes Character Style in AOO but not in LO
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
[Solved] Ctrl+M removes Character Style in AOO but not in LO
Can someone please explain this to me? If I write a sentence in OpenOffice Writer and apply a character style to some of the words then do CTRL+A then apply CTRL+M then the character styled words go back to be being 'plain text' Text Body style.
If I do the same procedure in LibreOffice then the character styled words do not get reverted to Text Body style (which is what I would really expect to happen in OpenOffice too).
So, what is going on with this and OpenOffice Writer and the difference when compared to LibreOffice?
If I do the same procedure in LibreOffice then the character styled words do not get reverted to Text Body style (which is what I would really expect to happen in OpenOffice too).
So, what is going on with this and OpenOffice Writer and the difference when compared to LibreOffice?
Last edited by Hagar Delest on Sun Dec 05, 2021 8:19 pm, edited 1 time in total.
Reason: Tagged [Solved].
Reason: Tagged [Solved].
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
Re: Character Style Removed on CTRL+M
Different choices by the software designers. You pays your money and makes your choice.
OpenOffice and LibreOffice are not "work-alike" clones; their commonality is the OpenDocument format, and that is starting to show differences between LibreOffice's use of ODF1.3, and OpenOffice's use of ODF 1.2.
OpenOffice and LibreOffice are not "work-alike" clones; their commonality is the OpenDocument format, and that is starting to show differences between LibreOffice's use of ODF1.3, and OpenOffice's use of ODF 1.2.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Character Style Removed on CTRL+M
Okay, thank you Rory.
One question arises for me. Is there an equivalent keyboard shortcut routine for OpenOffice that allows removal of all direct formatting from a document but leaves character style formats untouched?
One question arises for me. Is there an equivalent keyboard shortcut routine for OpenOffice that allows removal of all direct formatting from a document but leaves character style formats untouched?
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
- Hagar Delest
- Moderator
- Posts: 32628
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Character Style Removed on CTRL+M
That's the kind of inconsistencies that drove me to LibreOffice too.
It is clearly bug in AOO IMHO. Considering a character style as direct formatting (removed with Ctrl+M) defeats the point of [character] styles...
Never heard of such a shortcut that would keep the character style format. A macro may be able to do that. But why the hassle if LO does it right?
It is clearly bug in AOO IMHO. Considering a character style as direct formatting (removed with Ctrl+M) defeats the point of [character] styles...
Never heard of such a shortcut that would keep the character style format. A macro may be able to do that. But why the hassle if LO does it right?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Character Style Removed on CTRL+M
Yes, this is what I am considering myself. I haven't used LibreOffice much but am working my way through the LibreOffice Writer manual and learning what I need to know for my own limited use of Writer -- no more need to write student essays. I have, I think, a reasonable handle on styles and templates now, enough to cover my needs until I hit a bump in the road. That said I have to note that I find the Writer manual somewhat schizophrenic in places: users are extorted to use styles, fine, but in places in the manual there are examples given (by implication, direction given) to, in effect, use direct formatting.Hagar Delest wrote:That's the kind of inconsistencies that drove me to LibreOffice too... [Why] the hassle if LO does it right?
My next challenge is Page Styles. If I can nail that down then I will have all I need for my use.
In any case I think LibreOffice is going to win the contest for me now. More up to date, ODF 1.3, and I do find the visual preview of styles in the Styles Deck very helpful, and also I have occasional use for opening .docx files and LibreOffice manages that better than OpenOffice.
Thanks for the responses.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
Re: Character Style Removed on CTRL+M
My preference is that Ctrl M should take one back to plain text.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Character Style Removed on CTRL+M
There is not "plain text" in the AOO/LO. A text has at least a Default (Paragraph and Character) style.My preference is that Ctrl M should take one back to plain text.
Maybe it sould better to have two separated options in the office suites:
- one for reset all of the direct formatting properties as in the LibreOffice.
- and an another one to reset the styles (charecter and/or paragraph styles) to the Default one: similarly to the function of the Apache OpenOffice.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Character Style Removed on CTRL+M
Default was what I meant. It has merely the Default formatting.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Ctrl+M removes Character Style in OO but not in LO
The macro would be something like this (there may be a slicker way)
Edit: yes there is, slightly improved
Edit: yes there is, slightly improved
Code: Select all
sub RemoveFormattingLeaveCharstyleUntouched()
dim vc,tc,charattributes
vc = thiscomponent.currentcontroller.viewcursor
charattributes="CharAutoEscapement CharAutoKerning CharBackColor CharBackTransparent CharCaseMap CharColor CharCombineIsOn CharCombinePrefix CharCombineSuffix CharContoured CharCrossedOut CharEmphasis CharEscapement CharEscapementHeight CharFlash CharFontCharSet CharFontCharSetAsian CharFontCharSetComplex CharFontFamily CharFontFamilyAsian CharFontFamilyComplex CharFontName CharFontNameAsian CharFontNameComplex CharFontPitch CharFontPitchAsian CharFontPitchComplex CharFontStyleName CharFontStyleNameAsian CharFontStyleNameComplex CharHeight CharHeightAsian CharHeightComplex CharHidden CharKerning CharLocale CharLocaleAsian CharLocaleComplex CharNoHyphenation CharOverline CharOverlineColor CharOverlineHasColor CharPosture CharPostureAsian CharPostureComplex CharRelief CharRotation CharRotationIsFitToLine CharScaleWidth CharShadowed CharStrikeout CharUnderline CharUnderlineColor CharUnderlineHasColor CharWeight CharWeightAsian CharWeightComplex CharWordMode"
'CharStyleName CharStyleNames CharAutoStyleName
tc= vc.text.createtextcursorbyrange(vc)
tc.setPropertiesToDefault(split(charattributes," "))
end sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Thanks very much for the macro JeJe. Never having used a macro before in OpenOffice it took me a couple of hours to get the thing into it but it seems to work fine. So now I'm thinking that I'll just incorporate it into my own default template and it will be available for all new documents.
Thanks again.
Thanks again.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
Re: Ctrl+M removes Character Style in OO but not in LO
You can paste the macro to MyMacros where it will be available to all documents and then set a shortcut or menu or toolbar item to it.
Go to:
Tools menu/macros/organize macros/Openoffice basic
From the dialog that pops up select MyMacros/Standard from the left hand box
If there's a Module1 below Standard click that and then "Edit"
If not click "New" and create it first
Paste the macro in that module and then use tools menu customize to set a menu item or whatever to it.
Similar instructions on this page
viewtopic.php?t=5519
Go to:
Tools menu/macros/organize macros/Openoffice basic
From the dialog that pops up select MyMacros/Standard from the left hand box
If there's a Module1 below Standard click that and then "Edit"
If not click "New" and create it first
Paste the macro in that module and then use tools menu customize to set a menu item or whatever to it.
Similar instructions on this page
viewtopic.php?t=5519
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Thanks again, JeJe. Your instructions, and Hagar's, are much easier to step through than the Manual way I was using yesterday. I followed your instructions, works with all documents now and have the macro assigned to a keyboard shortcut.
Above said, I'll work my way through the Manual stuff again sometime and see if I understand it better second-time around.
Above said, I'll work my way through the Manual stuff again sometime and see if I understand it better second-time around.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Character Style Removed on CTRL+M
After toying around with the macro supplied by JeJe it kind of occurs to me that there might be some occasion when the user does want to remove in LibreOffice all direct formatting from text and would also like to remove all character styles. As Zizi says in his comment:
So can someone give macro code to manage this in LibreOffice -- to remove all character styles from a selection, as Zizi suggests. (I did read JeJe's code for OpenOffice but I don't understand it and hence can't alter the code for use in LibreOffice to achieve the above -- above my pay-grade.)Zizi64 wrote:Maybe it sould better to have two separated options in the office suites:
- one for reset all of the direct formatting properties as in the LibreOffice.
- and an another one to reset the styles (charecter and/or paragraph styles) to the Default one: similarly to the function of the Apache OpenOffice.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
Re: Ctrl+M removes Character Style in OO but not in LO
Select all of the text in a paragraph, and just apply the applied Paragraph Style again. This method will reset all of the applied different Character Styles from a selected paragraph.So can someone give macro code to manage this in LibreOffice -- toremove all character styles from a selection, as Zizi suggests.
Yes, I know it: you can not do this with a selection what has various Paragraph Styles.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Ctrl+M removes Character Style in OO but not in LO
An another tip:
Right click on the selection, what has various Paragraph Styles and some Character Styles inside the text of the paragraphs. Then click on the the item in the appeared context menu:
Styles - Default character
Tested in my LO 6.1.6
I suppose it: you can assign this feature to a free hotkey.
Right click on the selection, what has various Paragraph Styles and some Character Styles inside the text of the paragraphs. Then click on the the item in the appeared context menu:
Styles - Default character
Tested in my LO 6.1.6
I suppose it: you can assign this feature to a free hotkey.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Zizi I tried this several times and it doesn't work -- or I'm doing something in my attempts that makes it not work. Can you post step-by-step instructions on how to get this to work?Zizi64 wrote:Select all of the text in a paragraph, and just apply the applied Paragraph Style again. This method will reset all of the applied different Character Styles from a selected paragraph.
What does work is making a selection of a paragraph (or more) and applying "No Character Style" to the paragraph.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
- Hagar Delest
- Moderator
- Posts: 32628
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Ctrl+M removes Character Style in OO but not in LO
No such option in my context menu with LO 7.2.2.2.Zizi64 wrote:Then click on the the item in the appeared context menu:
Styles - Default character
An option to reset all would be good, not found any so far.
But a macro that set the para style to default then the char style to default and then clear formatting would do the job.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Re: Ctrl+M removes Character Style in OO but not in LO
The menu item is named asNo such option in my context menu with LO 7.2.2.2.
Character - Default character
in my LO 7.2.1 portable version.
Last edited by Zizi64 on Sun Dec 05, 2021 1:29 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
- Hagar Delest
- Moderator
- Posts: 32628
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Ctrl+M removes Character Style in OO but not in LO
OK, I see it indeed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Re: Ctrl+M removes Character Style in OO but not in LO
Please upload an ODF type, prepared file here (with your formatting examples). Or: are you using other file type documents?Zizi I tried this several times and it doesn't work -- or I'm doing something in my attempts that makes it not work. Can you post step-by-step instructions on how to get this to work?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Try this Zizi.
Was created in LibreOffice and only saved as .odt (I'm not trying to do anything with a .doc imported file).Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
Re: Ctrl+M removes Character Style in OO but not in LO
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Well, yes Zizi thanks for testing. You managed to do it by the route that I found worked. However, when you said:
Thanks anyway. At least I have some method that works.
That doesn't work and wasn't what you actually did on the Test.odt.Zizi64 wrote:Select all of the text in a paragraph, and just apply the applied Paragraph Style again. This method will reset all of the applied different Character Styles from a selected paragraph.
Thanks anyway. At least I have some method that works.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
- Hagar Delest
- Moderator
- Posts: 32628
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Ctrl+M removes Character Style in OO but not in LO
Here is my code proposal (select the text and then run it), assign it to a shortcut (Ctrl+M for example):
Code: Select all
Sub Reset_formatting
Dim oVC as object
oVC = ThisComponent.getCurrentController().getViewCursor()
oVC.ParaStyleName = "Standard"
oVC.CharStyleName = "Standard"
subDispatch("ResetAttributes")
end sub
sub subDispatch(sCommand as string)
dim oFrame as object, oDispatcher as object
oFrame = ThisComponent.CurrentController.Frame
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oDispatcher.executeDispatch(oFrame, ".uno:" & sCommand, "", 0, array())
end sub
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
- LastUnicorn
- Posts: 542
- Joined: Sat Mar 29, 2008 2:41 am
- Location: Scotland
Re: Ctrl+M removes Character Style in OO but not in LO
Thanks very much Hagar. Assigned to CTRL+Shift+M works a treat, best of both worlds now.
Windows 10 Pro. x64
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]
LibreOffice (Still) 7.6.5.2 (x64) Fully installed to system
LibreOffice (Still) Portable 7.6.5.2 (x86) [PortableApps]
Apache OpenOffice Portable 4.1.15 [PortableApps]