19package org.openoffice.xmerge.converter.xml.sxc;
21import org.w3c.dom.NodeList;
22import org.w3c.dom.Node;
23import org.w3c.dom.NamedNodeMap;
24import org.w3c.dom.Element;
51 NamedNodeMap attrNodes = node.getAttributes();
52 if (attrNodes !=
null) {
53 int len = attrNodes.getLength();
54 for (
int i = 0;
i < len;
i++) {
55 Node attr = attrNodes.item(
i);
63 if (!node.hasChildNodes()) {
66 NodeList children = node.getChildNodes();
67 int len = children.getLength();
68 for (
int i = 0;
i < len;
i++) {
69 Node child = children.item(
i);
70 String nodeName = child.getNodeName();
71 if (nodeName.equals(
"style:properties")) {
72 NamedNodeMap childAttrNodes = child.getAttributes();
73 if (childAttrNodes !=
null) {
74 int nChildAttrNodes = childAttrNodes.getLength();
75 for (
int j = 0; j < nChildAttrNodes; j++) {
76 Node attr = childAttrNodes.item(j);
117 this.rowHeight = RowHeight;
139 if (attr.equals(
"style:row-height")) {
173 if (parentStyle ==
null)
179 }
else if (!
name.equals(
"DEFAULT_STYLE")) {
180 parentStyle = (
RowStyle)
sc.lookup(
"DEFAULT_STYLE",
null,
181 null,
this.getClass());
187 if (parentStyle !=
null) {
208 Element node = parentDoc.createElement(
name);
224 if (style.getClass() !=
this.getClass())
241 node.setAttribute(
"style:row-height", height);
A StyleCatalog holds a collection of Style objects.
An object of class Style represents a style in an OpenOffice document.
String parent
Parent of the Style.
String family
Family of the Style.
String name
Name of the Style.
Represents a text Style in an OpenOffice document.
void setRowHeight(int RowHeight)
Sets the height of this row.
int parseRowHeight(String value)
Parse a rowheight in the form "1.234cm" to twips.
RowStyle(Node node, StyleCatalog sc)
Constructor for use when going from DOM to client device format.
void handleAttribute(String attr, String value)
Set an attribute.
void writeAttributes(Element node)
Write this Style object's attributes to a Node in the Document.
Style getResolved()
Return a Style object corresponding to this one, but with all of the inherited information from paren...
int getRowHeight()
Returns the height of this row.
Node createNode(org.w3c.dom.Document parentDoc, String name)
Create a new Node in the Document, and write this Style to it.
RowStyle(String name, String family, String parent, int rowHeight, StyleCatalog sc)
Constructor for use when going from client device format to DOM.
boolean isSubset(Style style)
Return true if style specifies as much or less than this Style, and nothing it specifies contradicts ...
This class is used for logging debug messages.
static final int INFO
Informational messages.
static void log(int flag, String msg)
Log message based on the flag type.
static final int ERROR
Error messages.
Helper class providing static methods to convert data to/from twips.
static int convert2twips(String value, int defaultValue)
Convert String to twips.
static float twips2cm(int value)
Convert from twips to cm's.
T * clone(T *const other)
Document and PluginFactory implementations for XML based formats.
Provides general purpose utilities.
Provides interfaces for converting between two Document formats, and supports a "merge" interface for...