LibreOffice Module xmerge (master) 1
Static Public Member Functions | Static Private Member Functions | List of all members
org.openoffice.xmerge.util.TwipsConverter Class Reference

Helper class providing static methods to convert data to/from twips. More...

Static Public Member Functions

static float twips2cm (int value)
 Convert from twips to cm's. More...
 
static int convert2twips (String value, int defaultValue)
 Convert String to twips. More...
 

Static Private Member Functions

static int cm2twips (float value)
 Convert from cm's to twips. More...
 
static int inches2twips (float value)
 Convert from cm's to twips. More...
 

Detailed Description

Helper class providing static methods to convert data to/from twips.

Definition at line 24 of file TwipsConverter.java.

Member Function Documentation

◆ cm2twips()

static int org.openoffice.xmerge.util.TwipsConverter.cm2twips ( float  value)
inlinestaticprivate

Convert from cm's to twips.

Parameters
valuefloat containing the representation of the value.
Returns
int containing the converted value.

Definition at line 46 of file TwipsConverter.java.

References value.

Referenced by org.openoffice.xmerge.util.TwipsConverter.convert2twips().

◆ convert2twips()

static int org.openoffice.xmerge.util.TwipsConverter.convert2twips ( String  value,
int  defaultValue 
)
inlinestatic

Convert String to twips.

Parameters
valueString in the form "1.234cm" or "1.234inch".
defaultValuethe default value.
Returns
the converted value if value is a well-formatted
String
, defaultValue otherwise.

Definition at line 71 of file TwipsConverter.java.

References cm, org.openoffice.xmerge.util.TwipsConverter.cm2twips(), Float, org.openoffice.xmerge.util.TwipsConverter.inches2twips(), and value.

Referenced by org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.parseColWidth(), and org.openoffice.xmerge.converter.xml.sxc.RowStyle.parseRowHeight().

◆ inches2twips()

static int org.openoffice.xmerge.util.TwipsConverter.inches2twips ( float  value)
inlinestaticprivate

Convert from cm's to twips.

Parameters
valuefloat containing the representation of the value.
Returns
int containing the converted value.

Definition at line 58 of file TwipsConverter.java.

References value.

Referenced by org.openoffice.xmerge.util.TwipsConverter.convert2twips().

◆ twips2cm()

static float org.openoffice.xmerge.util.TwipsConverter.twips2cm ( int  value)
inlinestatic

Convert from twips to cm's.

Parameters
valueThe short to be converted.
Returns
float containing the converted.

Definition at line 33 of file TwipsConverter.java.

References cm, and value.

Referenced by org.openoffice.xmerge.converter.xml.sxc.ColumnStyle.writeAttributes(), and org.openoffice.xmerge.converter.xml.sxc.RowStyle.writeAttributes().


The documentation for this class was generated from the following file: