You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Rory O'Farrell <of...@iol.ie> on 2016/04/11 09:51:51 UTC

Background colour for OO Comments

Comments applied to text in OpenOffice take different background colours depending on the author of the comment.  Presumably OO makes some analysis of the Author of the comment and modifies the background colour applied to that comment in light of that analysis.  Would someone familiar with the code kindly point me to the code for the mechanism, or better still, quote the (hopefully small) section of code responsible?  

I am working on a modification to AnnotationTool extension
http://en.ooo-info.org/documentation/annotation_tool.html
to suit my document composition and revision methods.  I regularly flag locations in a document with a Comment indicating the revision to be applied there.  All such Comments have the same colour background which means Comments for different purposes are all visually identical.  

I am modifying the above extension so I can insert Comments into a document, indicating what revision/review is required at that location (selected from a small list of predefined choices, such as Check, Revise, Source?, Date?...) and each comment in one of those predefined choices shows in a different background colour, making review of them very straightforward.  Knowledge of the mechanism for allocation of background code to Comments may be helpful.

I hope to have a first release of this later this week.


Aside: I have noticed an anomaly in subscribing to the dev ML. I have sent this message several times from my standard email account and it has not come through to the dev ML, although my replies to queries on the dev list come through immediately.  So I am hijacking an existing thread (changing subject, of course) to see if this version of my query will come through. Apologies for any duplication or odd threading.

-- 
Rory O'Farrell <of...@iol.ie>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Background colour for OO Comments

Posted by "Dennis E. Hamilton" <de...@acm.org>.

> -----Original Message-----
> From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> Sent: Monday, April 11, 2016 10:44
> To: dev@openoffice.apache.org
> Subject: Re: Background colour for OO Comments
> 
> On Mon, 11 Apr 2016 10:35:35 -0700
> "Dennis E. Hamilton" <de...@acm.org> wrote:
> 
> >
> >
> > > -----Original Message-----
> > > From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> > > Sent: Monday, April 11, 2016 10:00
> > > To: dev@openoffice.apache.org
> > > Subject: Re: Background colour for OO Comments
> > >
> > >
> > > The initial extension offers the facility to mark a selection and
> attach
> > > the annotation to that selection.  It uses a Post-it yellow as
> selection
> > > marker.  My thought was that if I could decide the colour OO would
> > > choose for the Comment (based on Category/PseudoUser), I might
> change
> > > the selection marker to match that. But without that, the extension
> is
> > > nearly functional - a little more tweaking and remove of tracing
> code
> > > needed.
> > [orcmid]
> >
> > Nice idea about changing the color of the selection itself.
> >
> > I'd still like to see a small file with enough to see what is being
> supplied in the ODF.
> >
> >  - Dennis
> >
> I've sent you privately a small sample file.  I hope to have a
> preliminary finished extension tomorrow - I've done enough for today!
[orcmid] 

1. With the file you sent me, I see the colors of the comments exactly the same as you have indicated in the cover email.

 2. When I added two comments on my own, on in front of the others, one between the original 6th and 7th, I got yellow highlighting, a new color, for my comment in both cases and the colors already assigned were not disturbed.

 3. There is no indication of this at all in the ODF for the documents.  There is no special style or application of styles in the comments or for the comment boxes.  The settings file has nothing about annotations or different users who worked on the document.

Your observation that this is all handled in the display code and it is related to the user ID (the only thing that changes beside the timestamps) seems to be confirmed.

I have no idea how to find that.  I trust others may recall where annotations are handled.

 - Dennis
> 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> > For additional commands, e-mail: dev-help@openoffice.apache.org
> >
> >
> 
> 
> --
> Rory O'Farrell <of...@iol.ie>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Background colour for OO Comments

Posted by Rory O'Farrell <of...@iol.ie>.
On Mon, 11 Apr 2016 10:35:35 -0700
"Dennis E. Hamilton" <de...@acm.org> wrote:

> 
> 
> > -----Original Message-----
> > From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> > Sent: Monday, April 11, 2016 10:00
> > To: dev@openoffice.apache.org
> > Subject: Re: Background colour for OO Comments
> > 
> > 
> > The initial extension offers the facility to mark a selection and attach
> > the annotation to that selection.  It uses a Post-it yellow as selection
> > marker.  My thought was that if I could decide the colour OO would
> > choose for the Comment (based on Category/PseudoUser), I might change
> > the selection marker to match that. But without that, the extension is
> > nearly functional - a little more tweaking and remove of tracing code
> > needed.
> [orcmid] 
> 
> Nice idea about changing the color of the selection itself.
> 
> I'd still like to see a small file with enough to see what is being supplied in the ODF.
> 
>  - Dennis
> 
I've sent you privately a small sample file.  I hope to have a preliminary finished extension tomorrow - I've done enough for today!

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
> 
> 


-- 
Rory O'Farrell <of...@iol.ie>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Background colour for OO Comments

Posted by "Dennis E. Hamilton" <de...@acm.org>.

> -----Original Message-----
> From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> Sent: Monday, April 11, 2016 10:00
> To: dev@openoffice.apache.org
> Subject: Re: Background colour for OO Comments
> 
> 
> The initial extension offers the facility to mark a selection and attach
> the annotation to that selection.  It uses a Post-it yellow as selection
> marker.  My thought was that if I could decide the colour OO would
> choose for the Comment (based on Category/PseudoUser), I might change
> the selection marker to match that. But without that, the extension is
> nearly functional - a little more tweaking and remove of tracing code
> needed.
[orcmid] 

Nice idea about changing the color of the selection itself.

I'd still like to see a small file with enough to see what is being supplied in the ODF.

 - Dennis


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Background colour for OO Comments

Posted by Rory O'Farrell <of...@iol.ie>.
On Mon, 11 Apr 2016 09:00:06 -0700
"Dennis E. Hamilton" <de...@acm.org> wrote:

> > -----Original Message-----
> > From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> > Sent: Monday, April 11, 2016 00:52
> > To: dev@openoffice.apache.org
> > Subject: Background colour for OO Comments
> > 
> > 
> > Comments applied to text in OpenOffice take different background colours
> > depending on the author of the comment.  Presumably OO makes some
> > analysis of the Author of the comment and modifies the background colour
> > applied to that comment in light of that analysis.  Would someone
> > familiar with the code kindly point me to the code for the mechanism, or
> > better still, quote the (hopefully small) section of code responsible?
> [orcmid] 
> 
> If you save the document and open it later, is the coloration preserved consistently?

Coloration seems to be consistent on all my trial examples, going back (in earlier versions) about 18 months

> 
> If you make up a brief ODT that has multiple colorations, upload it as an attachment on a bugzilla issue on the topic (feature request, I think) and we can dig into the ODT to see whether there are any clues in the ODF, whether settings or in the annotation data itself.  Oh, also include the colors you see in case other viewers see them differently.  A screen shot along with the document would be helpful.
> 
> The particular colors might not be preserved when different users view the document, or even when you view it later yourself from time to time.  The assignment of colors may be related to order of comments and you would want to rule that out.

The colorations do not seem to be related to order of comments.  They seem to be related to the name of the OO User, perhaps derived by some algorithm from that. In the case of my extension, the categories are given by substitution of a pseudo User. In testing, if I forced a category to be my OO User name, the background colour was visually identical to a standard Comment.

It might not matter if the colorations changed from one installation to another, in the event that a file was being edited on multiple machines by multiple (collaborative) users, so long as each category/PseudoUser had a unique colour on that installation, as the purpose of the colour is to allow simple recognition of a class of comments.

A quick test just now on three linux (Xubuntu 15.10/16.04) computers and one Win XP computer showed that, by visual inspection on non colour calibrated monitors, the background colour on all comments (7 different categories) was consistent from installation to installation.
 
> Also, there are provisions in ODF for quite a bit of styling on annotations (the comments), including in the paragraph text that is the body of the comment itself.  It would take some experimentation to see what of those are recognized (and preserved) by OpenOffice Writer and useful for your purposes.

As these Comments (I think I'm going to use a variation of Annotations) are using the underlying standard OO mechanism for Comments, I see no reason why they should not honour the supported styling for comments built into OO.  On my preliminary tests they do so, including the ability to insert a working hyperlink.

The initial extension offers the facility to mark a selection and attach the annotation to that selection.  It uses a Post-it yellow as selection marker.  My thought was that if I could decide the colour OO would choose for the Comment (based on Category/PseudoUser), I might change the selection marker to match that. But without that, the extension is nearly functional - a little more tweaking and remove of tracing code needed.


Rory


> 
> > 
> > I am working on a modification to AnnotationTool extension
> > http://en.ooo-info.org/documentation/annotation_tool.html
> > to suit my document composition and revision methods.  I regularly flag
> > locations in a document with a Comment indicating the revision to be
> > applied there.  All such Comments have the same colour background which
> > means Comments for different purposes are all visually identical.
> > 
> > I am modifying the above extension so I can insert Comments into a
> > document, indicating what revision/review is required at that location
> > (selected from a small list of predefined choices, such as Check,
> > Revise, Source?, Date?...) and each comment in one of those predefined
> > choices shows in a different background colour, making review of them
> > very straightforward.  Knowledge of the mechanism for allocation of
> > background code to Comments may be helpful.
> > 
> > I hope to have a first release of this later this week.
> > 
> > 
> > Aside: I have noticed an anomaly in subscribing to the dev ML. I have
> > sent this message several times from my standard email account and it
> > has not come through to the dev ML, although my replies to queries on
> > the dev list come through immediately.  So I am hijacking an existing
> > thread (changing subject, of course) to see if this version of my query
> > will come through. Apologies for any duplication or odd threading.
> [orcmid] 
> 
> You hit the list just fine with this one.
> 
> Interesting.  I haven't seen any posts from you on this topic.  Are you using one of the list readers or are you always using the list directly?
> > 
> > --
> > Rory O'Farrell <of...@iol.ie>
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> > For additional commands, e-mail: dev-help@openoffice.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
> 
> 


-- 
Rory O'Farrell <of...@iol.ie>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Background colour for OO Comments

Posted by "Dennis E. Hamilton" <de...@acm.org>.
> -----Original Message-----
> From: Rory O'Farrell [mailto:ofarrwrk@iol.ie]
> Sent: Monday, April 11, 2016 00:52
> To: dev@openoffice.apache.org
> Subject: Background colour for OO Comments
> 
> 
> Comments applied to text in OpenOffice take different background colours
> depending on the author of the comment.  Presumably OO makes some
> analysis of the Author of the comment and modifies the background colour
> applied to that comment in light of that analysis.  Would someone
> familiar with the code kindly point me to the code for the mechanism, or
> better still, quote the (hopefully small) section of code responsible?
[orcmid] 

If you save the document and open it later, is the coloration preserved consistently?

If you make up a brief ODT that has multiple colorations, upload it as an attachment on a bugzilla issue on the topic (feature request, I think) and we can dig into the ODT to see whether there are any clues in the ODF, whether settings or in the annotation data itself.  Oh, also include the colors you see in case other viewers see them differently.  A screen shot along with the document would be helpful.

The particular colors might not be preserved when different users view the document, or even when you view it later yourself from time to time.  The assignment of colors may be related to order of comments and you would want to rule that out.

Also, there are provisions in ODF for quite a bit of styling on annotations (the comments), including in the paragraph text that is the body of the comment itself.  It would take some experimentation to see what of those are recognized (and preserved) by OpenOffice Writer and useful for your purposes.

> 
> I am working on a modification to AnnotationTool extension
> http://en.ooo-info.org/documentation/annotation_tool.html
> to suit my document composition and revision methods.  I regularly flag
> locations in a document with a Comment indicating the revision to be
> applied there.  All such Comments have the same colour background which
> means Comments for different purposes are all visually identical.
> 
> I am modifying the above extension so I can insert Comments into a
> document, indicating what revision/review is required at that location
> (selected from a small list of predefined choices, such as Check,
> Revise, Source?, Date?...) and each comment in one of those predefined
> choices shows in a different background colour, making review of them
> very straightforward.  Knowledge of the mechanism for allocation of
> background code to Comments may be helpful.
> 
> I hope to have a first release of this later this week.
> 
> 
> Aside: I have noticed an anomaly in subscribing to the dev ML. I have
> sent this message several times from my standard email account and it
> has not come through to the dev ML, although my replies to queries on
> the dev list come through immediately.  So I am hijacking an existing
> thread (changing subject, of course) to see if this version of my query
> will come through. Apologies for any duplication or odd threading.
[orcmid] 

You hit the list just fine with this one.

Interesting.  I haven't seen any posts from you on this topic.  Are you using one of the list readers or are you always using the list directly?
> 
> --
> Rory O'Farrell <of...@iol.ie>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org