writer2latex.latex

Class TableFormatter

public class TableFormatter extends ConverterHelper

This class converts OOo table styles to LaTeX.

In OOo the table style is distributed on table, column and cell styles.

In LaTeX we have to rearrange this information slightly, so this class takes care of that.

Constructor Summary
TableFormatter(OfficeReader ofr, Config config, ConverterPalette palette, TableReader table, boolean bAllowPageBreak, boolean bIsInTable)

Constructor: Create from a TableReader.

Method Summary
voidapplyCellStyle(int nRow, int nCol, BeforeAfter ba, Context context)

Get material to put before and after a table cell.

voidapplyRowStyle(int nRow, BeforeAfter ba, Context context)

Get material to put before a table row (background color)

voidapplyTableStyle(BeforeAfter ba, BeforeAfter baAlign)

Create table environment based on table style.

Returns eg.

StringgetInterrowMaterial(int nRow)

Create interrow material

booleanisColortbl()
is this a colortbl?
booleanisLongtable()
is this a longtable?
booleanisSimple()
is this a simple table (lcr columns rather than p{})?
booleanisSupertabular()
is this a supertabular?
booleanisTabulary()
is this a tabulary?

Constructor Detail

TableFormatter

public TableFormatter(OfficeReader ofr, Config config, ConverterPalette palette, TableReader table, boolean bAllowPageBreak, boolean bIsInTable)

Constructor: Create from a TableReader.

Method Detail

applyCellStyle

public void applyCellStyle(int nRow, int nCol, BeforeAfter ba, Context context)

Get material to put before and after a table cell. In case of columnspan or different borders this will contain a \multicolumn command. If bApplyCellFormat is true, there will be a minipage environment

applyRowStyle

public void applyRowStyle(int nRow, BeforeAfter ba, Context context)

Get material to put before a table row (background color)

applyTableStyle

public void applyTableStyle(BeforeAfter ba, BeforeAfter baAlign)

Create table environment based on table style.

Returns eg. "\begin{longtable}{m{2cm}|m{4cm}}", "\end{longtable}".

getInterrowMaterial

public String getInterrowMaterial(int nRow)

Create interrow material

isColortbl

public boolean isColortbl()
is this a colortbl?

isLongtable

public boolean isLongtable()
is this a longtable?

isSimple

public boolean isSimple()
is this a simple table (lcr columns rather than p{})?

isSupertabular

public boolean isSupertabular()
is this a supertabular?

isTabulary

public boolean isTabulary()
is this a tabulary?