package org.apache.poi.hwpf.converter;
import org.apache.poi.hwpf.usermodel.BorderCode;
-import org.apache.poi.hwpf.usermodel.CharacterProperties;
import org.apache.poi.hwpf.usermodel.CharacterRun;
import org.apache.poi.hwpf.usermodel.Paragraph;
import org.apache.poi.hwpf.usermodel.TableCell;
public static void addBorder( BorderCode borderCode, String where,
StringBuilder style )
{
- if ( borderCode == null || borderCode.getBorderType() == 0 )
+ if ( borderCode == null || borderCode.isEmpty() )
return;
if ( isEmpty( where ) )
public static void addCharactersProperties(
final CharacterRun characterRun, StringBuilder style )
{
- final CharacterProperties clonedProperties = characterRun
- .cloneProperties();
-
- addBorder( clonedProperties.getBrc(), EMPTY, style );
+ addBorder( characterRun.getBorder(), EMPTY, style );
if ( characterRun.isCapitalized() )
{
if ( characterRun.isHighlighted() )
{
style.append( "background-color: "
- + getColor( clonedProperties.getIcoHighlight() ) + "; " );
+ + getColor( characterRun.getHighlightedColor() ) + "; " );
}
if ( characterRun.isStrikeThrough() )
{
return _props.isFHighlight();
}
+ public byte getHighlightedColor()
+ {
+ return _props.getIcoHighlight();
+ }
+
public void setHighlighted(byte color)
{
_props.setFHighlight(true);
/**
* clone the CharacterProperties object associated with this
* characterRun so that you can apply it to another CharacterRun
+ *
+ * @deprecated This method shall not be public and should not be called from high-level code
*/
+ @Deprecated
public CharacterProperties cloneProperties() {
try {
return (CharacterProperties)_props.clone();