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()) {
64 NodeList children = node.getChildNodes();
65 int len = children.getLength();
66 for (
int i = 0;
i < len;
i++) {
67 Node child = children.item(
i);
68 String nodeName = child.getNodeName();
69 if (nodeName.equals(
"style:properties")) {
70 NamedNodeMap childAttrNodes = child.getAttributes();
71 if (childAttrNodes !=
null) {
72 int nChildAttrNodes = childAttrNodes.getLength();
73 for (
int j = 0; j < nChildAttrNodes; j++) {
74 Node attr = childAttrNodes.item(j);
139 if (attr.equals(
"style:column-width")) {
173 if (parentStyle ==
null)
179 }
else if (!
name.equals(
"DEFAULT_STYLE")) {
181 null,
this.getClass());
187 if (parentStyle !=
null) {
208 Element node = parentDoc.createElement(
name);
224 if (style.getClass() !=
this.getClass())
241 node.setAttribute(
"style:column-width", width);
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 handleAttribute(String attr, String value)
Set an attribute.
Style getResolved()
Return a Style object corresponding to this one, but with all of the inherited information from paren...
ColumnStyle(String name, String family, String parent, int colWidth, StyleCatalog sc)
Constructor for use when going from client device format to DOM.
int getColWidth()
Returns the width of this column.
ColumnStyle(Node node, StyleCatalog sc)
Constructor for use when going from DOM to client device format.
void setColWidth(int colWidth)
Sets the width of this column.
Node createNode(org.w3c.dom.Document parentDoc, String name)
Create a new Node in the Document, and write this Style to it.
void writeAttributes(Element node)
Write this Style object's attributes to a Node in the Document.
boolean isSubset(Style style)
Return true if style specifies as much or less than this Style, and nothing it specifies contradicts ...
int parseColWidth(String value)
Parse a colwidth in the form "1.234cm" to twips.
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...