writer2latex.xhtml

Class TextStyleConverter

public class TextStyleConverter extends StyleWithPropertiesConverterHelper

This class converts OpenDocument text styles to CSS2 styles. This includes conversion of text properties in other styles (paragraph, cell, graphic and presentation styles).
Constructor Summary
TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType)
Create a new TextStyleConverter
Method Summary
voidapplyAnchorStyle(String sStyleName, String sVisitedStyleName, StyleInfo info)
Apply a link style, using a combination of two text styles
voidapplyProperties(StyleWithProperties style, CSVList props, boolean bInherit)
Convert formatting properties for a specific text style.
voidcssText(StyleWithProperties style, CSVList props, boolean bInherit)
voidcssTextBackground(StyleWithProperties style, CSVList props, boolean bInherit)
voidcssTextCommon(StyleWithProperties style, CSVList props, boolean bInherit)
StringgetDefaultTagName(StyleWithProperties style)
Create default tag name to represent a text
StringgetStyleDeclarations(String sIndent)

Convert style information for used styles

OfficeStyleFamilygetStyles()
Get the family of text (character) styles
booleanisBold(StyleWithProperties style)
booleanisFixed(StyleWithProperties style)
booleanisItalics(StyleWithProperties style)
booleanisSubscript(StyleWithProperties style)
booleanisSuperscript(StyleWithProperties style)

Constructor Detail

TextStyleConverter

public TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType)
Create a new TextStyleConverter

Parameters: ofr an OfficeReader to read style information from config the configuration to use converter the main Converter class nType the type of xhtml to use

Method Detail

applyAnchorStyle

public void applyAnchorStyle(String sStyleName, String sVisitedStyleName, StyleInfo info)
Apply a link style, using a combination of two text styles

Parameters: sStyleName name of the OpenDocument style sVisitedStyleName name of the OpenDocument style for visited links info the StyleInfo object to add information to

applyProperties

public void applyProperties(StyleWithProperties style, CSVList props, boolean bInherit)
Convert formatting properties for a specific text style.

Parameters: style the style to convert props the CSVList object to add information to bInherit true if properties should be inherited from parent style(s)

cssText

public void cssText(StyleWithProperties style, CSVList props, boolean bInherit)

cssTextBackground

public void cssTextBackground(StyleWithProperties style, CSVList props, boolean bInherit)

cssTextCommon

public void cssTextCommon(StyleWithProperties style, CSVList props, boolean bInherit)

getDefaultTagName

public String getDefaultTagName(StyleWithProperties style)
Create default tag name to represent a text

Parameters: style to use

Returns: the tag name.

getStyleDeclarations

public String getStyleDeclarations(String sIndent)

Convert style information for used styles

Parameters: sIndent a String of spaces to add before each line

getStyles

public OfficeStyleFamily getStyles()
Get the family of text (character) styles

Returns: the style family

isBold

public boolean isBold(StyleWithProperties style)

isFixed

public boolean isFixed(StyleWithProperties style)

isItalics

public boolean isItalics(StyleWithProperties style)

isSubscript

public boolean isSubscript(StyleWithProperties style)

isSuperscript

public boolean isSuperscript(StyleWithProperties style)