Writer/Underline Color

From Apache OpenOffice Wiki
Jump to: navigation, search


Underline color in Writer

Underline color is not a standalone attribute in Writer. It belongs to the underline attribute, which is one of significant font effect attribute. The underline and underline color attributes can be accessed via the “Font Effects” pane in Writer, and the value range for underline color is the same as for the Color pane.

Descriptions of Main Problems

Currently, Apache OpenOffice 3.4 doesn't implement the support of underline color importing and exporting in WORD 2003/2007 filter, although it works well in ODF. Color of underlining text in documents imported from Word 2003/2007 into Writer get the wrong color, e.g. black as default color in Writer, while in Word 2003 it would be any one. Color of Underlining text in documents exported from Writer to Word 2003 will be lost, and also set the color as default value black.

underline color import status
odt work
doc lost
docx lost
underline color export status
odt2odt work
odt2doc lost
doc2odt lost
doc2doc lost
docx2odt lost
docx2doc lost

Underline color in document model

The Underline and Underline color attributes can be accessed via the UNO API. Using the properties CharUnderline, CharUnderlineColor, and CharUnderlinelineHasColor in the service com.sun.star.style.CharacterProperties. These properties are described in the following table:

underlinecolor related properties
short CharUnderline This property contains the value for the character underline.
::com::sun::star::util::Color CharUnderlineColor This property contains the color of the underline for the characters.
boolean CharUnderlinelineHasColor This property specifies if the property CharUnderlineColor is used for an underline.


There is a Value container named SvxUnderlineItem for underline font effects which specify the underline color property
20120709070557!Svxunderlineitem_inherit.png

Underline color in specification

ODF specification

The underrline color attribute is stored using the following ODF property.

style:text-underline-color The value range is either font-color or a color value

MS Binary Format specification

underline color is one of Character Properties(CHP) in Binary Format,and the color attribute is stored using the following sprm property.

Sprm ispmd operand
sprmCCvUI(0x6877) 0x77 A COLORREF value that specifies the color of the text underline.

OOXML Format specification

When it comes to Office open XML specification, element <w:u> and attribute <w:color> are used to specify the color for the underling text. e.g. <w:u … w:color="auto" />

Support underline color in WW8 filter

import design detail

1. Adding the underline color loading function SwWW8ImplReader::Read_UnderlineColor(),

2. Read sprmCCvUI property from stream in SwWW8ImplReader::GetSprmReadInfo()

export design detail

1. Adding the color export process in WW8AttributeOutput::CharUnderline() method which handle the underline property export.

2. Retrive the underline color attribute from SvxUnderlineItem::GetColor() and write them into sprmCCvUI property

Support underline color in WORD 2007 filter

TODO

Personal tools