writer2latex.latex
Class ParConverter

java.lang.Object
  extended by writer2latex.latex.ConverterHelper
      extended by writer2latex.latex.StyleConverter
          extended by writer2latex.latex.ParConverter

public class ParConverter
extends StyleConverter


Field Summary
private  boolean bNeedArrayBslash
           
 
Fields inherited from class writer2latex.latex.StyleConverter
declarations, styleMap, styleNames
 
Fields inherited from class writer2latex.latex.ConverterHelper
config, ofr, palette
 
Constructor Summary
ParConverter(OfficeReader ofr, Config config, ConverterPalette palette)
          Constructs a new ParConverter.
 
Method Summary
 void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
           
 void applyAlignment(StyleWithProperties style, boolean bIsSimple, boolean bInherit, BeforeAfter ba)
           
private  void applyCellParStyle(java.lang.String sName, BeforeAfter ba, Context context, boolean bNoTextPar, boolean bLastInBlock)
           
private  void applyLineSpacing(StyleWithProperties style, BeforeAfter ba)
          Apply line spacing from a style.
private  void applyMargins(StyleWithProperties style, BeforeAfter ba)
          Apply margin+alignment properties from a style.
private  void applyParProperties(StyleWithProperties style, BeforeAfter ba)
          Apply all paragraph properties.
private  void applyParStyle(java.lang.String sName, BeforeAfter ba, Context context, boolean bNoTextPar)
          Use a paragraph style in LaTeX.
private  void applyParStyle(java.lang.String sName, BeforeAfter ba, Context context, boolean bNoTextPar, boolean bBreakInside)
           
private  void createAutomaticParStyle(StyleWithProperties style, Context context)
           
private  java.lang.String createBorder(java.lang.String sLeft, java.lang.String sRight, java.lang.String sTop, java.lang.String sHeight, java.lang.String sColor)
          Helper: Create a horizontal border.
private  void createParStyle(java.lang.String sName)
          Convert a paragraph style to LaTeX.
private  void createSimpleParStyle(StyleWithProperties style, Context context)
           
private  void createSoftParStyle(StyleWithProperties style, Context context)
           
 void handleParagraph(org.w3c.dom.Element node, LaTeXDocumentPortion ldp, Context oc, boolean bLastInBlock)
           Process a text:p tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bNeedArrayBslash

private boolean bNeedArrayBslash
Constructor Detail

ParConverter

public ParConverter(OfficeReader ofr,
                    Config config,
                    ConverterPalette palette)

Constructs a new ParConverter.

Method Detail

appendDeclarations

public void appendDeclarations(LaTeXDocumentPortion pack,
                               LaTeXDocumentPortion decl)
Overrides:
appendDeclarations in class StyleConverter

handleParagraph

public void handleParagraph(org.w3c.dom.Element node,
                            LaTeXDocumentPortion ldp,
                            Context oc,
                            boolean bLastInBlock)

Process a text:p tag

Parameters:
node - The text:h element node containing the heading
ldp - The LaTeXDocumentPortion to add LaTeX code to
oc - The current context
bLastInBlock - If this is true, the paragraph is the last one in a block, and we need no trailing blank line (eg. right before \end{enumerate}).

applyCellParStyle

private void applyCellParStyle(java.lang.String sName,
                               BeforeAfter ba,
                               Context context,
                               boolean bNoTextPar,
                               boolean bLastInBlock)

applyParStyle

private void applyParStyle(java.lang.String sName,
                           BeforeAfter ba,
                           Context context,
                           boolean bNoTextPar)

Use a paragraph style in LaTeX.

Parameters:
sName - the name of the text style
ba - a BeforeAfter to put code into
context - the current context. This method will use and update the formatting context
bNoTextPar - true if this paragraph has no text content (hence character formatting is not needed)

applyParStyle

private void applyParStyle(java.lang.String sName,
                           BeforeAfter ba,
                           Context context,
                           boolean bNoTextPar,
                           boolean bBreakInside)

createParStyle

private void createParStyle(java.lang.String sName)

Convert a paragraph style to LaTeX.

A soft style is declared in styleDeclarations as \newenvironment...

A hard style is used by applying LaTeX code directly

Parameters:
sName - the OOo name of the style

createAutomaticParStyle

private void createAutomaticParStyle(StyleWithProperties style,
                                     Context context)

createSimpleParStyle

private void createSimpleParStyle(StyleWithProperties style,
                                  Context context)

createSoftParStyle

private void createSoftParStyle(StyleWithProperties style,
                                Context context)

applyLineSpacing

private void applyLineSpacing(StyleWithProperties style,
                              BeforeAfter ba)

Apply line spacing from a style.

Parameters:
style - the paragraph style to use
ba - a BeforeAfter to put code into

createBorder

private java.lang.String createBorder(java.lang.String sLeft,
                                      java.lang.String sRight,
                                      java.lang.String sTop,
                                      java.lang.String sHeight,
                                      java.lang.String sColor)

Helper: Create a horizontal border. Currently unused


applyMargins

private void applyMargins(StyleWithProperties style,
                          BeforeAfter ba)

Apply margin+alignment properties from a style.

Parameters:
style - the paragraph style to use
ba - a BeforeAfter to put code into

applyAlignment

public void applyAlignment(StyleWithProperties style,
                           boolean bIsSimple,
                           boolean bInherit,
                           BeforeAfter ba)

applyParProperties

private void applyParProperties(StyleWithProperties style,
                                BeforeAfter ba)

Apply all paragraph properties.

Parameters:
style - the paragraph style to use
ba - a BeforeAfter to put code into