made getHighlightColor() public, so convertor don't need to clone CHP info
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c2c9ea3589
commit
deb0c2eb68
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -33,7 +32,7 @@ public class WordToHtmlUtils extends AbstractWordUtils
|
||||
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 ) )
|
||||
@ -58,10 +57,7 @@ public class WordToHtmlUtils extends AbstractWordUtils
|
||||
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() )
|
||||
{
|
||||
@ -70,7 +66,7 @@ public class WordToHtmlUtils extends AbstractWordUtils
|
||||
if ( characterRun.isHighlighted() )
|
||||
{
|
||||
style.append( "background-color: "
|
||||
+ getColor( clonedProperties.getIcoHighlight() ) + "; " );
|
||||
+ getColor( characterRun.getHighlightedColor() ) + "; " );
|
||||
}
|
||||
if ( characterRun.isStrikeThrough() )
|
||||
{
|
||||
|
@ -417,6 +417,11 @@ public final class CharacterRun
|
||||
return _props.isFHighlight();
|
||||
}
|
||||
|
||||
public byte getHighlightedColor()
|
||||
{
|
||||
return _props.getIcoHighlight();
|
||||
}
|
||||
|
||||
public void setHighlighted(byte color)
|
||||
{
|
||||
_props.setFHighlight(true);
|
||||
@ -533,7 +538,10 @@ public final class CharacterRun
|
||||
/**
|
||||
* 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();
|
||||
|
Loading…
Reference in New Issue
Block a user