[Dropped] Default format for comment box text

Discuss the word processor
Post Reply
mrfixiter
Posts: 11
Joined: Wed Jul 07, 2021 5:02 am

[Dropped] Default format for comment box text

Post by mrfixiter »

Hi :)

I noticed while editing a document and inserting comments, that if the text was longer than the width of the comment box, the words wrapped to the next line inside the comment box. Unfortunately, the next line in the comment box was double-spaced. I would like to have all the comment boxes, present and future, default to single spaced lines. Is this possible without upsetting the document formatting?

Thanks for your help.

mrfixiter
Last edited by MrProgrammer on Wed Aug 09, 2023 6:02 pm, edited 1 time in total.
Reason: Dropped: Decided to format each comment individually
User avatar
Zizi64
Volunteer
Posts: 11382
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can the text in a comment box have its own default formatting?

Post by Zizi64 »

What version of OpenOffice/LibreOffice are you using?
What file type are you using?

Please upload an ODF type sample file here.
And never paste preformatted text into your documents. Use the "as Unformatted text" option of the Paste special feature.
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.
mrfixiter
Posts: 11
Joined: Wed Jul 07, 2021 5:02 am

Re: Can the text in a comment box have its own default formatting?

Post by mrfixiter »

The version is:
AOO4113m1(Build:9810) - Rev. 281f0d3533
2022-07-01 10:22

File type is .odt

I do not know the version of OO on which it was created but I think it began as a .docx file. I will get the details for you tomorrow. Generally speaking though, is there a way to format the line spacing in the comment box which is separate from the formatting in the document?

Thanks for your help.

mrfixiter
OpenOffice 4.1.9 on Windows 7
User avatar
RoryOF
Moderator
Posts: 34671
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Can the text in a comment box have its own default formatting?

Post by RoryOF »

In OpenOffice there is no way I know of to set default text format for a Comment. One can however select the text in any individual Comment and change its font, size and weights by Direct Formatting. It may be necessary to wait some seconds between each item change to allow OpenOffice cope; this time depends on size of the document and the number of Comments in the document.

There are times I regret the passing of the .INI file, which allowed customisation of details of an application.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2844
Joined: Wed Mar 09, 2016 2:40 pm

Re: Can the text in a comment box have its own default formatting?

Post by JeJe »

Comments for me already default to single spacing so I'm not clear what you're asking or how the double line spacing got into the comment?

You can have a macro like this (made with the macro recorder) to insert a comment with whatever formatting you want.

Code: Select all


sub insertcomment
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertAnnotation", "", 0, Array())

rem ----------------------------------------------------------------------
dim args2(1) as new com.sun.star.beans.PropertyValue
args2(0).Name = "LineSpacing.Mode"
args2(0).Value = 0
args2(1).Name = "LineSpacing.Height"
args2(1).Value = 100

dispatcher.executeDispatch(document, ".uno:LineSpacing", "", 0, args2())


end sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
mrfixiter
Posts: 11
Joined: Wed Jul 07, 2021 5:02 am

Re: Can the text in a comment box have its own default formatting?

Post by mrfixiter »

Thank you all for sharing your knowledge. The user I am trying to help remotely only has very basic computer skills. I'll check out the macro code but trying to explain how to use it in simple terms would not be possible for this user.

Originally the document was created in Word and saved in docx formatting. The document was then sent to my friend who does not have Word. He opened it in OO Writer and then renamed it and saved it in odt format. He then forwarded the document to me asking me how to fix the comment line spacing. When I opened the file, the document and comments were double-spaced just as he had said. For comparison's sake I opened a new, blank document and typed in a few lines which were single-spaced. Then I changed the line spacing to double-spaced and inserted a comment that needed to line wrap. The comment was single spaced. So I can't figure out what the pattern with this is. I would upload the document but it contains personal information.

Thanks again. :)

mrfixiter
OpenOffice 4.1.9 on Windows 7
User avatar
RoryOF
Moderator
Posts: 34671
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Can the text in a comment box have its own default formatting?

Post by RoryOF »

The answer may be to use manual (re-) formatting: try selecting the text in a double spaced Comment (click in the Comment, Ctrl A to select) then try /Format /Paragraph / Indents and Spacing tab and select "Single" spacing.

If that works for you, the answer may be to hand edit each Comment. Globally changing all Comments would necessitate low level manipulation of the content.xml component of the file, perhaps using a macro editor; such procedure is fraught with danger, and I certainly would not attempt it if it were necessary in my case.

Each modified Comment is assigned its own unique style internally (i.e., not visible from ODT Writer when editing) and such individual internal styles would need to be identified, removed where applied, and replaced by a single style applying the desired characteristics; perhaps also it would be necessary to tidy up by removal of the now unused style definitions (I distinguish between the style definitions and the application of that style in the internal file). I have looked into this for reasons of my own; every time I decide to leave matters alone and carry on as before.
.
 Edit:  Each modified Comment, even if of the same characteristics as other Comments, is assigned a unique internal style definition and application, so there is a proliferation of internal styles, each used only once.  
.
The settings from /Format /Paragraph seem be applied in the Comment, although predefined Styles do not. The definitions for Comments in the OpenDocument standards seem to permit change of typeface, Bold, Italic, Underscore, and URLs. They do not appear to permit the application of Styles.

As an aside: in a later revision of the OpenDocument standard it would be nice in my view if Comments could have simple styles applied, also some of the Fields of OpenOffice. The use of Fields would allow a Comment to point to a relevant BookMark or other Field, or perhaps have an automatic counter field.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
mrfixiter
Posts: 11
Joined: Wed Jul 07, 2021 5:02 am

Re: Can the text in a comment box have its own default formatting?

Post by mrfixiter »

Thank you again for providing so many insights as to how all this works. :bravo: The complexity of this topic is really intriguing however I'll have to put this aside for now as my friend has decided to format each comment individually and go from there.

Best regards,

mrfixiter
OpenOffice 4.1.9 on Windows 7
Post Reply