Hi,
My first try at this. I'm still trying to get my head around git, so I
hope I've made the patches correctly.
After looking at the easy hacks page, I thought going for cleaning up
compiler warnings might be a good place to start contributing. Then I
noticed warnings that could be fixed by only touching comments.
Nigel.
From 87a0470cbb7d47c78eedad90a5fad279b488a66f Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 10:55:49 +0100
Subject: [PATCH 1/9] Fix javadoc comments in BookSettings.java
---
.../xmerge/converter/xml/sxc/BookSettings.java | 63 ++++++++++---------
1 files changed, 33 insertions(+), 30 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java
index 12c16d1..f8e5ea8 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/BookSettings.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,7 +40,7 @@ import org.openoffice.xmerge.util.XmlUtil;
/**
* This is a class representing the different attributes for a worksheet
- * contained in settings.xml.
+ * contained in settings.xml.
*
* @author Martin Maher
*/
@@ -48,39 +48,43 @@ public class BookSettings implements OfficeConstants {
/** A w3c <code>Document</code>. */
private org.w3c.dom.Document settings = null;
-
+
private boolean hasColumnRowHeaders = true;
private String activeSheet = new String();
private Vector worksheetSettings = new Vector();
-
+
/**
- * Default Constructor for a <code>BookSettings</code>
+ * Constructor for a <code>BookSettings</code>. Reads document settings
+ * from xml and inits SheetSettings variables.
*
- * @param dimension if it's a row the height, a column the width
- * @param repeated
+ * @param root The root XML node to read from.
*/
public BookSettings(Node root) {
readNode(root);
}
/**
- * Default Constructor for a <code>BookSettings</code>
+ * Constructor for a <code>BookSettings</code>
*
- * @param worksheetSettings if it's a row the height, a column the width
+ * @param worksheetSettings If it's a row the height, a column the width
*/
public BookSettings(Vector worksheetSettings) {
this.worksheetSettings = worksheetSettings;
}
/**
+ * Set the flag indicating whether we have row/column headers.
*
+ * @param hasColumnRowHeaders Flag to enable or disable headers.
*/
public void setColumnRowHeaders(boolean hasColumnRowHeaders) {
this.hasColumnRowHeaders = hasColumnRowHeaders;
}
-
+
/**
+ * Get the flag indicating whether we have row/column headers.
*
+ * @return Flag indicating whether we have row/column headers.
*/
public boolean hasColumnRowHeaders() {
return hasColumnRowHeaders;
@@ -96,25 +100,24 @@ public class BookSettings implements OfficeConstants {
}
/**
- * Gets the active sheet name
+ * Gets the active sheet name
*
- * @return the active sheet name
+ * @return the active sheet name
*/
public String getActiveSheet() {
return activeSheet;
}
-
+
/**
- * Sets the active sheet name
+ * Sets the active sheet name
*
- * @param activeSheet the active sheet name
+ * @param activeSheet the active sheet name
*/
public void setActiveSheet(String activeSheet) {
this.activeSheet = activeSheet;
}
-
/**
* Adds an XML entry for a particular setting
@@ -129,20 +132,20 @@ public class BookSettings implements OfficeConstants {
Element configItem = settings.createElement(TAG_CONFIG_ITEM);
configItem.setAttribute(ATTRIBUTE_CONFIG_NAME, attribute);
configItem.setAttribute(ATTRIBUTE_CONFIG_TYPE, type);
-
+
configItem.appendChild(settings.createTextNode(value));
root.appendChild(configItem);
}
/**
- * Writes out a settings.xml entry for this BookSettings object
+ * Writes out a settings.xml entry for this BookSettings object
*
- * @param settings a <code>Document</code> object representing the settings.xml
+ * @param settings a <code>Document</code> object representing the settings.xml
* @param root the root xml node to add to
*/
public void writeNode(org.w3c.dom.Document settings, Node root) {
-
+
this.settings = settings;
Element configItemMapNamed = (Element)
settings.createElement(TAG_CONFIG_ITEM_MAP_NAMED);
configItemMapNamed.setAttribute(ATTRIBUTE_CONFIG_NAME, "Tables");
@@ -157,10 +160,10 @@ public class BookSettings implements OfficeConstants {
}
/**
- * Sets a variable based on a String value read from XML
+ * Sets a variable based on a String value read from XML
*
- * @param name xml name of the attribute to set
- * @param value String value fo the attribute
+ * @param name xml name of the attribute to set
+ * @param value String value fo the attribute
*/
public void addAttribute(String name, String value) {
@@ -175,12 +178,12 @@ public class BookSettings implements OfficeConstants {
/**
* Reads document settings from xml and inits SheetSettings variables
*
- * @param root XML Node to read from
+ * @param root XML Node to read from
*/
public void readNode(Node root) {
if (root.hasChildNodes()) {
-
+
NodeList nodeList = root.getChildNodes();
int len = nodeList.getLength();
for (int i = 0; i < len; i++) {
@@ -195,11 +198,11 @@ public class BookSettings implements OfficeConstants {
Node configNameNode =
cellAtt.getNamedItem(ATTRIBUTE_CONFIG_NAME);
-
+
String name = configNameNode.getNodeValue();
NodeList nodeList2 = child.getChildNodes();
int len2 = nodeList2.getLength();
- String s = "";
+ String s = "";
for (int j = 0; j < len2; j++) {
Node child2 = nodeList2.item(j);
if (child2.getNodeType() == Node.TEXT_NODE) {
@@ -207,11 +210,11 @@ public class BookSettings implements OfficeConstants {
}
}
addAttribute(name, s);
-
+
} else if (nodeName.equals(TAG_CONFIG_ITEM_MAP_NAMED)) {
readNode(child);
-
+
} else if (nodeName.equals(TAG_CONFIG_ITEM_MAP_ENTRY)) {
SheetSettings s = new SheetSettings(child);
@@ -222,7 +225,7 @@ public class BookSettings implements OfficeConstants {
Debug.log(Debug.TRACE, "<OTHERS " + XmlUtil.getNodeInfo(child) + " />");
}
}
- }
+ }
}
}
}
--
1.7.0.4
From 496b835ecac426cdbd33accc5227e45118c83b5b Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 08:56:02 +0100
Subject: [PATCH 2/9] Fix javadoc comments in CellStyle.java
---
.../xmerge/converter/xml/sxc/CellStyle.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
index 7f02d89..09557b1 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/CellStyle.java
@@ -50,7 +50,7 @@ public class CellStyle extends Style implements Cloneable {
/**
* Constructor for use when going from DOM to client device format.
*
- * @param Node The <i>style:style</i> <code>Node</code> containing
+ * @param node The <i>style:style</i> <code>Node</code> containing
* the <code>Style</code>. (This <code>Node</code> is
* assumed have a <i>family</i> attribute of <i>text</i>).
* @param sc The <code>StyleCatalog</code>, which is used for
--
1.7.0.4
From 8c825804c56baf8d6596abeca7de946c486373a9 Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 09:08:10 +0100
Subject: [PATCH 3/9] Fix javadoc comments in ColumnRowInfo.java
---
.../xmerge/converter/xml/sxc/ColumnRowInfo.java | 84 ++++++++++---------
1 files changed, 44 insertions(+), 40 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnRowInfo.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnRowInfo.java
index 444420a..8f9bf4d 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnRowInfo.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnRowInfo.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,20 +50,19 @@ public class ColumnRowInfo {
/**
* Constructor for a <code>ColumnRowInfo</code>
*
- * @param dimension if it's a row the height, a column the width
- * @param repeated
+ * @param type whether ROW or COLUMN record .
*/
public ColumnRowInfo(int type) {
this.type = type;
}
-
+
/**
* Constructor for a <code>ColumnRowInfo</code>
*
- * @param dimension if it's a row the height, a column the width
- * @param repeated how many times it is repeated
- * @param type whether Row or column record
+ * @param dimension if it's a row the height, a column the width.
+ * @param repeated how many times it is repeated.
+ * @param type whether ROW or COLUMN record.
*/
public ColumnRowInfo(int dimension, int repeated, int type) {
@@ -73,20 +72,24 @@ public class ColumnRowInfo {
}
/**
- * Constructor that includes userDefined field
+ * Constructor for a <code>ColumnRowInfo</code> that includes userDefined
+ * field.
*
- * @param userDefined whether the record is manually set
+ * @param dimension if it's a row the height, a column the width.
+ * @param repeated how many times it is repeated.
+ * @param type whether ROW or COLUMN record.
+ * @param userDefined whether the record is manually set.
*/
public ColumnRowInfo(int dimension, int repeated, int type, boolean userDefined) {
-
+
this(dimension, repeated, type);
this.userDefined = userDefined;
}
-
+
/**
- * sets the definition
+ * Sets the format.
*
- * @param newDefinition sets the definition
+ * @param fmt The new format to use.
*/
public void setFormat(Format fmt) {
@@ -94,9 +97,9 @@ public class ColumnRowInfo {
}
/**
- * returns Name of the definition
- *
- * @return the name which identifies the definition
+ * Get the current format.
+ *
+ * @return The current format.
*/
public Format getFormat() {
@@ -104,67 +107,68 @@ public class ColumnRowInfo {
}
/**
- * returns Name of the definition
- *
- * @return the name which identifies the definition
+ * Get the height (for rows) or width (for columns).
+ *
+ * @return The height or width.
*/
public int getSize() {
return dimension;
}
-
+
/**
- * sets the definition
+ * Set the height (for rows) or width (for columns).
*
- * @param newDefinition sets the definition
+ * @param dimension The height or width.
*/
public void setSize(int dimension) {
this.dimension = dimension;
}
+
/**
- * Returns the definition itself
+ * Get the repeat count for this item.
*
- * @return the definition
+ * @return The number of times this item is repeated.
*/
public int getRepeated() {
-
+
return repeated;
}
/**
- * Returns the base Cell address
- *
- * @return the base cell address
+ * Set the repeat count for this item.
+ *
+ * @param repeated The number of times this item is repeated.
*/
public void setRepeated(int repeated) {
this.repeated = repeated;
}
-
+
/**
- * Returns the definition itself
+ * Does this <code>ColumnRowInfo</code> represent a row?
*
- * @return the definition
+ * @return True if a row, false if not.
*/
public boolean isRow() {
-
+
if(type==ROW)
return true;
- else
+ else
return false;
}
/**
- * Returns the base Cell address
- *
- * @return the base cell address
+ * Does this <code>ColumnRowInfo</code> represent a column?
+ *
+ * @return True if a column, false if not.
*/
public boolean isColumn() {
if(type==COLUMN)
return true;
- else
+ else
return false;
}
@@ -177,7 +181,7 @@ public class ColumnRowInfo {
return userDefined;
}
-
+
/**
* Test if the row height is default
*
@@ -189,7 +193,7 @@ public class ColumnRowInfo {
dimension>DEFAULTROWSIZE_MIN &&
dimension<DEFAULTROWSIZE_MAX)
return true;
- else
+ else
return false;
- }
+ }
}
--
1.7.0.4
From 91353c5ecb2a166e12dc027fd569f3272ac598c7 Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 09:13:57 +0100
Subject: [PATCH 4/9] Fix javadoc comments in ColumnStyle.java
---
.../xmerge/converter/xml/sxc/ColumnStyle.java | 73 +++++++++-----------
1 files changed, 32 insertions(+), 41 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
index cee83b5..5a35b02 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/ColumnStyle.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,15 +40,15 @@ import org.openoffice.xmerge.util.TwipsConverter;
/**
* Represents a text <code>Style</code> in an OpenOffice document.
*
- * @author Martin Maher
+ * @author Martin Maher
*/
public class ColumnStyle extends Style implements Cloneable {
- private int colWidth = 0;
+ private int colWidth = 0;
/**
* Constructor for use when going from DOM to client device format.
*
- * @param Node The <i>style:style</i> <code>Node</code> containing
+ * @param node The <i>style:style</i> <code>Node</code> containing
* the <code>Style</code>. (This <code>Node</code> is
* assumed have a <i>family</i> attribute of <i>text</i>).
* @param sc The <code>StyleCatalog</code>, which is used for
@@ -56,7 +56,7 @@ public class ColumnStyle extends Style implements Cloneable {
*/
public ColumnStyle(Node node, StyleCatalog sc) {
super(node, sc);
-
+
// Run through the attributes of this node, saving
// the ones we're interested in.
NamedNodeMap attrNodes = node.getAttributes();
@@ -67,7 +67,7 @@ public class ColumnStyle extends Style implements Cloneable {
handleAttribute(attr.getNodeName(), attr.getNodeValue());
}
}
-
+
// Look for children. Only ones we care about are "style:properties"
// nodes. If any are found, recursively traverse them, passing
// along the style element to add properties to.
@@ -91,8 +91,7 @@ public class ColumnStyle extends Style implements Cloneable {
}
}
}
-
-
+
/**
* Constructor for use when going from client device format to DOM
*
@@ -101,11 +100,11 @@ public class ColumnStyle extends Style implements Cloneable {
* <i>text</i>). Can be null.
* @param parent Name of parent text <code>Style</code>, or null
* for none.
- * @param mask the width of this column
- * @param sc The <code>StyleCatalog</code>, which is used for
+ * @param colWidth the width of this column
+ * @param sc The <code>StyleCatalog</code>, which is used for
* looking up ancestor <code>Style</code> objects.
*/
- public ColumnStyle(String name, String family, String parent,int colWidth, StyleCatalog sc) {
+ public ColumnStyle(String name, String family, String parent, int colWidth, StyleCatalog sc) {
super(name, family, parent, sc);
this.colWidth = colWidth;
}
@@ -113,24 +112,24 @@ public class ColumnStyle extends Style implements Cloneable {
/**
* Returns the width of this column
*
- * @return the <code>Format</code> object
+ * @return The width of this column.
*/
public int getColWidth() {
return colWidth;
}
-
+
/**
* Sets the width of this column
*
- * @return the <code>Format</code> object
+ * @param colWidth The width of this column.
*/
public void setColWidth(int colWidth) {
this.colWidth = colWidth;
}
-
+
/**
- * Parse a colwidth in the form "1.234cm" to twips
+ * Parse a colwidth in the form "1.234cm" to twips
*
* @param value <code>String</code> specification to parse.
*
@@ -139,7 +138,7 @@ public class ColumnStyle extends Style implements Cloneable {
private int parseColWidth(String value) {
int width = 255; // Default value
-
+
if(value.indexOf("cm")!=-1) {
float widthCM = Float.parseFloat(value.substring(0,value.indexOf("c")));
width = TwipsConverter.cm2twips(widthCM);
@@ -147,10 +146,9 @@ public class ColumnStyle extends Style implements Cloneable {
float widthInch = Float.parseFloat(value.substring(0,value.indexOf("i")));
width = TwipsConverter.inches2twips(widthInch);
}
-
+
return (width);
}
-
/**
* Set an attribute.
@@ -159,7 +157,7 @@ public class ColumnStyle extends Style implements Cloneable {
* @param value The attribute value to set.
*/
private void handleAttribute(String attr, String value) {
-
+
if (attr.equals("style:column-width")) {
colWidth = parseColWidth(value);
}
@@ -167,16 +165,15 @@ public class ColumnStyle extends Style implements Cloneable {
Debug.log(Debug.INFO, "ColumnStyle Unhandled: " + attr + "=" + value);
}
}
-
-
+
/**
- * Return a <code>Style</code> object corresponding to this one,
+ * Return a <code>Style</code> object corresponding to this one,
* but with all of the inherited information from parent
* <code>Style</code> objects filled in. The object returned will
* be a new object, not a reference to this object, even if it does
* not need any information added.
*
- * @return The <code>StyleCatalog</code> in which to look up
+ * @return The <code>Style</code> in which to look up
* ancestors.
*/
public Style getResolved() {
@@ -187,7 +184,7 @@ public class ColumnStyle extends Style implements Cloneable {
} catch (Exception e) {
Debug.log(Debug.ERROR, "Can't clone", e);
}
-
+
// Look up the parentStyle. (If there is no style catalog
// specified, we can't do any lookups.)
ColumnStyle parentStyle = null;
@@ -206,19 +203,18 @@ public class ColumnStyle extends Style implements Cloneable {
null, this.getClass());
}
}
-
+
// If we found a parent, for any attributes which we don't have
// set, try to get the values from the parent.
if (parentStyle != null) {
parentStyle = (ColumnStyle)parentStyle.getResolved();
-
+
if ((colWidth == 0) && (parentStyle.getColWidth() != 0))
resolved.setColWidth(parentStyle.getColWidth());
}
return resolved;
}
-
-
+
/**
* Create a new <code>Node</code> in the <code>Document</code>, and
* write this <code>Style</code> to it.
@@ -235,10 +231,9 @@ public class ColumnStyle extends Style implements Cloneable {
writeAttributes(node);
return node;
}
-
-
+
/**
- * Return true if <code>style</code> specifies as much or less
+ * Return true if <code>style</code> specifies as much or less
* than this <code>Style</code>, and nothing it specifies
* contradicts this <code>Style</code>.
*
@@ -248,17 +243,16 @@ public class ColumnStyle extends Style implements Cloneable {
* otherwise.
*/
public boolean isSubset(Style style) {
- if (style.getClass() != this.getClass())
+ if (style.getClass() != this.getClass())
return false;
ColumnStyle tStyle = (ColumnStyle)style;
-
+
if(colWidth!=tStyle.getColWidth())
return false;
return true;
}
-
-
+
/**
* Write this <code>Style</code> object's attributes to a
* <code>Node</code> in the <code>Document</code>.
@@ -269,17 +263,15 @@ public class ColumnStyle extends Style implements Cloneable {
public void writeAttributes(Element node) {
if(colWidth!=0) {
- String width = TwipsConverter.twips2cm(colWidth) + "cm";
+ String width = TwipsConverter.twips2cm(colWidth) + "cm";
node.setAttribute("style:column-width", width);
}
}
-
private static String[] ignored = {
"fo:break-before", "fo:keep-with-next"
};
-
/*
* This code checks whether an attribute is one that we
* intentionally ignore.
@@ -291,10 +283,9 @@ public class ColumnStyle extends Style implements Cloneable {
*/
private boolean isIgnored(String attribute) {
for (int i = 0; i < ignored.length; i++) {
- if (ignored[i].equals(attribute))
+ if (ignored[i].equals(attribute))
return true;
}
return false;
}
}
-
--
1.7.0.4
From 71d55a542ba5deb93c52e3fee931d7357d2483f0 Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 09:45:33 +0100
Subject: [PATCH 5/9] Fix javadoc comments in Format.java
---
.../xmerge/converter/xml/sxc/Format.java | 186 +++++++++----------
1 files changed, 88 insertions(+), 98 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
index a3abda0..9e3e1a9 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/Format.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,12 +42,12 @@ public class Format implements Cloneable {
final public static int CENTER_ALIGN = 0x02;
final public static int LEFT_ALIGN = 0x03;
final public static int JUST_ALIGN = 0x04;
-
+
/** Vertical Alignment Constants. */
final public static int TOP_ALIGN = 0x01;
final public static int MIDDLE_ALIGN = 0x02;
final public static int BOTTOM_ALIGN = 0x03;
-
+
/** Indicates <i>bold</i> text. */
final public static int BOLD = 0x01;
/** Indicates <i>italic</i> text. */
@@ -60,12 +60,12 @@ public class Format implements Cloneable {
final public static int SUPERSCRIPT = 0x10;
/** Indicates <i>subscripted</i> text. */
final public static int SUBSCRIPT = 0x20;
-
+
final public static int LEFT_BORDER = 0x40;
final public static int RIGHT_BORDER = 0x80;
final public static int TOP_BORDER = 0x100;
final public static int BOTTOM_BORDER = 0x200;
-
+
final public static int WORD_WRAP = 0x400;
private int align;
@@ -74,14 +74,14 @@ public class Format implements Cloneable {
private String value;
private String formatSpecifier;
private int decimalPlaces;
-
+
/** Font name. */
private String fontName;
/** Font size in points. */
protected int sizeInPoints;
-
+
private Color foreground, background;
-
+
/** Values of text attributes. */
protected int attributes = 0;
/** Bitwise mask of text attributes. */
@@ -91,13 +91,16 @@ public class Format implements Cloneable {
* Constructor for creating a new <code>Format</code>.
*/
public Format() {
- clearFormatting();
+ clearFormatting();
}
-
+
/**
* Constructor that creates a new <code>Format</code> object
* by setting all the format attributes.
*
+ * @param attributes Attributes flags (alignment, bold, etc.)
+ * @param fontSize Size of the font in points.
+ * @param fontName Name of the font to use.
*/
public Format(int attributes, int fontSize, String fontName) {
@@ -107,7 +110,7 @@ public class Format implements Cloneable {
}
/**
- * Constructor for creating a new <code>Format</code> object
+ * Constructor for creating a new <code>Format</code> object
* based on an existing one.
*
* @param fmt <code>Format</code> to copy.
@@ -117,7 +120,7 @@ public class Format implements Cloneable {
value = fmt.getValue();
formatSpecifier = fmt.getFormatSpecifier();
decimalPlaces = fmt.getDecimalPlaces();
-
+
attributes = fmt.attributes;
mask = fmt.mask;
@@ -128,7 +131,6 @@ public class Format implements Cloneable {
background = fmt.getBackground();
sizeInPoints = fmt.sizeInPoints;
}
-
/**
* Reset this <code>Format</code> description.
@@ -147,32 +149,33 @@ public class Format implements Cloneable {
foreground = null;
background = null;
}
-
+
/**
- * Set one or more text attributes to <i>on</i>.
+ * Set one or more text attributes.
*
- * @param flags Flag attributes to set <i>on</i>.
+ * @param flags Flag attributes to set.
+ * @param toggle True to set flags, false to clear them.
*/
public void setAttribute(int flags, boolean toggle) {
mask |= flags;
if(toggle) {
attributes |= flags;
- } else {
+ } else {
attributes &= ~flags;
}
}
-
+
/**
* Return true if the <code>attribute</code> is set to <i>on</i>
*
* @param attribute Attribute to check ({@link #BOLD},
* {@link #ITALIC}, etc.)
*
- * @return true if <code>attribute</code> is set to <i>on</i>,
+ * @return true if <code>attribute</code> is set to <i>on</i>,
* otherwise false.
*/
public boolean getAttribute(int attribute) {
- if ((mask & attribute) == 0)
+ if ((mask & attribute) == 0)
return false;
return (!((attributes & attribute) == 0));
}
@@ -191,13 +194,12 @@ public class Format implements Cloneable {
public boolean isSet(int attribute) {
return (!((mask & attribute) == 0));
}
-
-
+
/**
* Set the formatting category of this object, ie number, date,
- * currency.The <code>OfficeConstants</code> class contains string
+ * currency.The <code>OfficeConstants</code> class contains string
* constants for the category types.
- *
+ *
* @see org.openoffice.xmerge.converter.xml.OfficeConstants
*
* @param newCategory The name of the category to be set.
@@ -205,7 +207,7 @@ public class Format implements Cloneable {
public void setCategory(String newCategory) {
category = newCategory;
}
-
+
/**
* Return the formatting category of the object.
*
@@ -220,22 +222,21 @@ public class Format implements Cloneable {
/**
* In the case of Formula returns the value of the formula.
*
- * @return The value of the formula
+ * @return The value of the formula
*/
public String getValue() {
return value;
}
-
+
/**
* In the case of formula the contents are set as the formula string and
* the value of the formula is a formatting attribute.
*
- * @param newValue the formuala value
+ * @param newValue the formuala value
*/
public void setValue(String newValue) {
value = newValue;
}
-
/**
* Set the <code>Format</code> specifier for this category.
@@ -245,7 +246,6 @@ public class Format implements Cloneable {
public void setFormatSpecifier(String formatString) {
formatSpecifier = formatString;
}
-
/**
* Get the <code>Format</code> specifier for this category.
@@ -255,17 +255,15 @@ public class Format implements Cloneable {
public String getFormatSpecifier() {
return formatSpecifier;
}
-
-
+
/**
* Set the precision of the number to be displayed.
- *
+ *
* @param precision The number of decimal places to display.
*/
public void setDecimalPlaces(int precision) {
decimalPlaces = precision;
}
-
/**
* Get the number of decimal places displayed.
@@ -275,17 +273,15 @@ public class Format implements Cloneable {
public int getDecimalPlaces() {
return decimalPlaces;
}
-
-
+
/**
* Set the font used for this cell.
- *
+ *
* @param fontName The name of the font.
*/
public void setFontName(String fontName) {
this.fontName = fontName;
}
-
/**
* Get the font used for this cell.
@@ -295,74 +291,71 @@ public class Format implements Cloneable {
public String getFontName() {
return fontName;
}
-
+
/**
- * Set the font used for this cell.
- *
- * @param fontName The name of the font.
+ * Set the font size (in points) used for this cell.
+ *
+ * @param fontSize The font size in points.
*/
public void setFontSize(int fontSize) {
sizeInPoints = fontSize;
}
-
/**
- * Get the font used for this cell.
+ * Get the font size (in points) used for this cell.
*
- * @return The font name.
+ * @return The font size in points.
*/
public int getFontSize() {
return sizeInPoints;
- }
+ }
/**
- * Set the alignmen used for this cell.
- *
- * @param fontName The name of the font.
+ * Set the vertical alignment used for this cell.
+ *
+ * @param vertAlign The vertical alignment.
*/
public void setVertAlign(int vertAlign) {
this.vertAlign = vertAlign;
}
-
/**
- * Get the alignment used for this cell.
+ * Get the vertical alignment used for this cell.
*
- * @return The font name.
+ * @return The vertical alignment.
*/
public int getVertAlign() {
return vertAlign;
- }
+ }
/**
- * Set the alignmen used for this cell.
- *
- * @param fontName The name of the font.
+ * Set the alignment used for this cell.
+ *
+ * @param align The alignment to use.
*/
public void setAlign(int align) {
this.align = align;
}
-
/**
* Get the alignment used for this cell.
*
- * @return The font name.
+ * @return The alignment.
*/
public int getAlign() {
return align;
- }
+ }
+
/**
* Set the Foreground <code>Color</code> for this cell.
- *
- * @param color A <code>Color</code> object representing the
+ *
+ * @param c A <code>Color</code> object representing the
* foreground color.
*/
public void setForeground(Color c) {
if(c!=null)
foreground = new Color(c.getRGB());
}
-
/**
* Get the Foreground <code>Color</code> for this cell.
@@ -372,12 +365,11 @@ public class Format implements Cloneable {
public Color getForeground() {
return foreground;
}
-
/**
* Set the Background <code>Color</code> for this cell
- *
- * @param color A <code>Color</code> object representing
+ *
+ * @param c A <code>Color</code> object representing
* the background color.
*/
public void setBackground(Color c) {
@@ -385,9 +377,8 @@ public class Format implements Cloneable {
background = new Color(c.getRGB());
}
-
/**
- * Get the Foreground <code>Color</code> for this cell
+ * Get the Background <code>Color</code> for this cell
*
* @return Background <code>Color</code> value
*/
@@ -396,80 +387,79 @@ public class Format implements Cloneable {
}
/**
- * Get the Foreground <code>Color</code> for this cell
+ * Get a string representation of this <code>Format</code>
*
- * @return Background <code>Color</code> value
+ * @return A string indicating the value and category.
*/
public String toString() {
return new String("Value : " + getValue() + " Category : " + getCategory());
}
- /**
+ /**
* Tests if the current <code>Format</code> object has default attribute
* values.
*
- * @return true if it contains default value
+ * @return true if it contains default value
*/
public boolean isDefault() {
Format rhs = new Format();
- if (rhs.attributes!= attributes)
+ if (rhs.attributes!= attributes)
return false;
-
- if (foreground!=rhs.foreground)
+
+ if (foreground!=rhs.foreground)
return false;
-
- if (background!=rhs.background)
+
+ if (background!=rhs.background)
return false;
- if (rhs.align!= align)
+ if (rhs.align!= align)
return false;
- if (rhs.vertAlign!= vertAlign)
+ if (rhs.vertAlign!= vertAlign)
return false;
-
+
return true;
}
-
+
/**
- * Return true if <code>style</code> specifies as much or less
- * than this <code>Style</code>, and nothing it specifies
- * contradicts this <code>Style</code>.
+ * Return true if passed <code>Format</code> specifies as much or less
+ * than this <code>Format</code>, and nothing it specifies
+ * contradicts this <code>Format</code>.
*
- * @param style The <code>Style</code> to check.
+ * @param rhs The <code>Format</code> to check.
*
- * @return true if <code>style</code> is a subset, false
+ * @return true if <code>rhs</code> is a subset, false
* otherwise.
*/
public boolean isSubset(Format rhs) {
- if (rhs.getClass() != this.getClass())
+ if (rhs.getClass() != this.getClass())
return false;
-
- if (rhs.attributes!= attributes)
+
+ if (rhs.attributes!= attributes)
return false;
-
+
if (rhs.sizeInPoints != 0) {
- if (sizeInPoints != rhs.sizeInPoints)
+ if (sizeInPoints != rhs.sizeInPoints)
return false;
}
if (fontName!=rhs.fontName)
return false;
-
- if (foreground!=rhs.foreground)
+
+ if (foreground!=rhs.foreground)
return false;
-
- if (background!=rhs.background)
+
+ if (background!=rhs.background)
return false;
- if (rhs.align!= align)
+ if (rhs.align!= align)
return false;
- if (rhs.vertAlign!= vertAlign)
+ if (rhs.vertAlign!= vertAlign)
return false;
return true;
- }
+ }
}
-
--
1.7.0.4
From e2279c5ee92ce70b06f196b80a4b03e236e4e24b Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 10:05:32 +0100
Subject: [PATCH 6/9] Fix javadoc comments in NameDefinition.java
---
.../xmerge/converter/xml/sxc/NameDefinition.java | 59 +++++++++++---------
1 files changed, 32 insertions(+), 27 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java
index 75d2c95..7ae5a87 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/NameDefinition.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -56,20 +56,25 @@ public class NameDefinition implements OfficeConstants {
public NameDefinition() {
}
-
+
/**
* Constructor that takes a <code>Node</code> to build a
* <code>NameDefinition</code>
*
- * @param root XML Node to read from
+ * @param root XML Node to read from
*/
public NameDefinition(Node root) {
readNode(root);
}
-
+
/**
- * Default Constructor for a <code>NameDefinition</code>
+ * Constructor for a <code>NameDefinition</code>
*
+ * @param name Name that identifies the definition
+ * @param definition The definition itself
+ * @param baseCellAddress The base cell address
+ * @param rangeType True if definition of range type
+ * @param expressionType True if definition of expression type
*/
public NameDefinition(String name, String definition, String
baseCellAddress, boolean rangeType, boolean expressionType ) {
@@ -79,10 +84,10 @@ public class NameDefinition implements OfficeConstants {
this.rangeType = rangeType;
this.expressionType = expressionType;
}
-
+
/**
- * returns Name of the definition
- *
+ * returns Name of the definition
+ *
* @return the name which identifies the definition
*/
public String getName() {
@@ -90,7 +95,7 @@ public class NameDefinition implements OfficeConstants {
return name;
}
/**
- * sets the definition
+ * sets the definition
*
* @param newDefinition sets the definition
*/
@@ -101,16 +106,16 @@ public class NameDefinition implements OfficeConstants {
/**
* Returns the definition itself
*
- * @return the definition
+ * @return the definition
*/
public String getDefinition() {
-
+
return definition;
}
/**
- * Returns the base Cell address
- *
+ * Returns the base Cell address
+ *
* @return the base cell address
*/
public String getBaseCellAddress() {
@@ -119,29 +124,29 @@ public class NameDefinition implements OfficeConstants {
}
/**
- * Tests if definition is of type expression
+ * Tests if definition is of type expression
*
* @return whether or not this name definition is of type expression
*/
public boolean isExpressionType() {
return expressionType;
}
-
+
/**
- * Tests if definition is of type range
+ * Tests if definition is of type range
*
- * @return whether or not this name definition is of type range
+ * @return whether or not this name definition is of type range
*/
public boolean isRangeType() {
return rangeType;
}
/**
- * Writes out a content.xml entry for this NameDefinition object
+ * Writes out a content.xml entry for this NameDefinition object
*
- * @param settings a <code>Document</code> object representing the settings.xml
- * @param root the root xml node to add to
- */
+ * @param doc A <code>Document</code> object representing the settings.xml
+ * @param root The root xml node to add to
+ */
public void writeNode(org.w3c.dom.Document doc, Node root) {
if(isRangeType()) {
@@ -153,7 +158,7 @@ public class NameDefinition implements OfficeConstants {
namedRangeElement.setAttribute(ATTRIBUTE_TABLE_CELL_RANGE_ADDRESS,
getDefinition());
root.appendChild(namedRangeElement);
} else if (isExpressionType()) {
-
+
Debug.log(Debug.TRACE, "Found Expression Name : " + getName());
Element namedExpressionElement = (Element)
doc.createElement(TAG_TABLE_NAMED_EXPRESSION);
namedExpressionElement.setAttribute(ATTRIBUTE_TABLE_NAME, getName());
@@ -165,11 +170,11 @@ public class NameDefinition implements OfficeConstants {
Debug.log(Debug.TRACE, "Unknown Name Definition : " + getName());
}
}
-
+
/**
* Reads document settings from xml and inits Settings variables
*
- * @param root XML Node to read from
+ * @param root XML Node to read from
*/
public void readNode(Node root) {
@@ -177,7 +182,7 @@ public class NameDefinition implements OfficeConstants {
NamedNodeMap cellAtt = root.getAttributes();
if (nodeName.equals(TAG_TABLE_NAMED_RANGE)) {
-
+
Node tableNameNode =
cellAtt.getNamedItem(ATTRIBUTE_TABLE_NAME);
Node tableBaseCellAddress =
@@ -191,7 +196,7 @@ public class NameDefinition implements OfficeConstants {
baseCellAddress = tableBaseCellAddress.getNodeValue();
expressionType = true;
rangeType = false;
-
+
} else if (nodeName.equals(TAG_TABLE_NAMED_EXPRESSION)) {
Node tableNameNode =
@@ -211,5 +216,5 @@ public class NameDefinition implements OfficeConstants {
Debug.log(Debug.TRACE, "<OTHERS " + XmlUtil.getNodeInfo(root) + " />");
}
}
-
+
}
--
1.7.0.4
From c7da801f88d77548d5f0417fae0963e9240dfd46 Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 10:11:09 +0100
Subject: [PATCH 7/9] Fix javadoc comments in RowStyle.java
---
.../xmerge/converter/xml/sxc/RowStyle.java | 73 +++++++++-----------
1 files changed, 32 insertions(+), 41 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
index 5766866..c3c6131 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/RowStyle.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,15 +40,15 @@ import org.openoffice.xmerge.util.TwipsConverter;
/**
* Represents a text <code>Style</code> in an OpenOffice document.
*
- * @author Martin Maher
+ * @author Martin Maher
*/
public class RowStyle extends Style implements Cloneable {
- private int rowHeight = 255;
+ private int rowHeight = 255;
/**
* Constructor for use when going from DOM to client device format.
*
- * @param Node The <i>style:style</i> <code>Node</code> containing
+ * @param node The <i>style:style</i> <code>Node</code> containing
* the <code>Style</code>. (This <code>Node</code> is
* assumed have a <i>family</i> attribute of <i>text</i>).
* @param sc The <code>StyleCatalog</code>, which is used for
@@ -56,7 +56,7 @@ public class RowStyle extends Style implements Cloneable {
*/
public RowStyle(Node node, StyleCatalog sc) {
super(node, sc);
-
+
// Run through the attributes of this node, saving
// the ones we're interested in.
NamedNodeMap attrNodes = node.getAttributes();
@@ -67,7 +67,7 @@ public class RowStyle extends Style implements Cloneable {
handleAttribute(attr.getNodeName(), attr.getNodeValue());
}
}
-
+
// Look for children. Only ones we care about are "style:properties"
// nodes. If any are found, recursively traverse them, passing
// along the style element to add properties to.
@@ -91,17 +91,16 @@ public class RowStyle extends Style implements Cloneable {
}
}
}
-
-
+
/**
* Constructor for use when going from client device format to DOM
*
- * @param name Name of text <code>Style</code>. Can be null.
- * @param family Family of text <code>Style</code> (usually
+ * @param name Name of text <code>Style</code>. Can be null.
+ * @param family Family of text <code>Style</code> (usually
* <i>text</i>). Can be null.
- * @param parent Name of parent text <code>Style</code>, or null
+ * @param parent Name of parent text <code>Style</code>, or null
* for none.
- * @param mask The height of this row
+ * @param rowHeight The height of this row
* @param sc The <code>StyleCatalog</code>, which is used for
* looking up ancestor <code>Style</code> objects.
*/
@@ -113,23 +112,23 @@ public class RowStyle extends Style implements Cloneable {
/**
* Returns the height of this row
*
- * @return the <code>Format</code> object
+ * @return The height of this row.
*/
public int getRowHeight() {
return rowHeight;
}
-
+
/**
* Sets the height of this row
*
- * @return the <code>Format</code> object
+ * @param RowHeight The height of this row.
*/
public void setRowHeight(int RowHeight) {
this.rowHeight = rowHeight;
- }
+ }
/**
- * Parse a colheight in the form "1.234cm" to twips
+ * Parse a rowheight in the form "1.234cm" to twips
*
* @param value <code>String</code> specification to parse.
*
@@ -138,7 +137,7 @@ public class RowStyle extends Style implements Cloneable {
private int parseRowHeight(String value) {
int height = 255; // Default value
-
+
if(value.indexOf("cm")!=-1) {
float heightCM = Float.parseFloat(value.substring(0,value.indexOf("c")));
height = TwipsConverter.cm2twips(heightCM);
@@ -146,11 +145,10 @@ public class RowStyle extends Style implements Cloneable {
float heightInch = Float.parseFloat(value.substring(0,value.indexOf("i")));
height = TwipsConverter.inches2twips(heightInch);
}
-
+
return (height);
}
-
/**
* Set an attribute.
@@ -159,7 +157,7 @@ public class RowStyle extends Style implements Cloneable {
* @param value The attribute value to set.
*/
private void handleAttribute(String attr, String value) {
-
+
if (attr.equals("style:row-height")) {
rowHeight = parseRowHeight(value);
}
@@ -167,10 +165,9 @@ public class RowStyle extends Style implements Cloneable {
Debug.log(Debug.INFO, "RowStyle Unhandled: " + attr + "=" + value);
}
}
-
-
+
/**
- * Return a <code>Style</code> object corresponding to this one,
+ * Return a <code>Style</code> object corresponding to this one,
* but with all of the inherited information from parent
* <code>Style</code> objects filled in. The object returned will
* be a new object, not a reference to this object, even if it does
@@ -187,7 +184,7 @@ public class RowStyle extends Style implements Cloneable {
} catch (Exception e) {
Debug.log(Debug.ERROR, "Can't clone", e);
}
-
+
// Look up the parentStyle. (If there is no style catalog
// specified, we can't do any lookups.)
RowStyle parentStyle = null;
@@ -206,19 +203,18 @@ public class RowStyle extends Style implements Cloneable {
null, this.getClass());
}
}
-
+
// If we found a parent, for any attributes which we don't have
// set, try to get the values from the parent.
if (parentStyle != null) {
parentStyle = (RowStyle)parentStyle.getResolved();
-
+
if ((rowHeight == 0) && (parentStyle.getRowHeight() != 0))
resolved.setRowHeight(parentStyle.getRowHeight());
}
return resolved;
}
-
-
+
/**
* Create a new <code>Node</code> in the <code>Document</code>, and
* write this <code>Style</code> to it.
@@ -235,10 +231,9 @@ public class RowStyle extends Style implements Cloneable {
writeAttributes(node);
return node;
}
-
-
+
/**
- * Return true if <code>style</code> specifies as much or less
+ * Return true if <code>style</code> specifies as much or less
* than this <code>Style</code>, and nothing it specifies
* contradicts this <code>Style</code>.
*
@@ -248,17 +243,16 @@ public class RowStyle extends Style implements Cloneable {
* otherwise.
*/
public boolean isSubset(Style style) {
- if (style.getClass() != this.getClass())
+ if (style.getClass() != this.getClass())
return false;
RowStyle tStyle = (RowStyle)style;
-
+
if(rowHeight!=tStyle.getRowHeight())
return false;
return true;
}
-
-
+
/**
* Write this <code>Style</code> object's attributes to a
* <code>Node</code> in the <code>Document</code>.
@@ -269,17 +263,15 @@ public class RowStyle extends Style implements Cloneable {
public void writeAttributes(Element node) {
if(rowHeight!=0) {
- String height = TwipsConverter.twips2cm(rowHeight) + "cm";
+ String height = TwipsConverter.twips2cm(rowHeight) + "cm";
node.setAttribute("style:row-height", height);
}
}
-
private static String[] ignored = {
"fo:break-before", "fo:keep-with-next"
};
-
/*
* This code checks whether an attribute is one that we
* intentionally ignore.
@@ -291,10 +283,9 @@ public class RowStyle extends Style implements Cloneable {
*/
private boolean isIgnored(String attribute) {
for (int i = 0; i < ignored.length; i++) {
- if (ignored[i].equals(attribute))
+ if (ignored[i].equals(attribute))
return true;
}
return false;
}
}
-
--
1.7.0.4
From 6070e65c8c361714b31b746e3079be401f61f70c Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 10:15:33 +0100
Subject: [PATCH 8/9] Fix javadoc comments in SheetSettings.java
---
.../xmerge/converter/xml/sxc/SheetSettings.java | 134 ++++++++++----------
1 files changed, 65 insertions(+), 69 deletions(-)
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java
index 290c16b..321557d 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SheetSettings.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,7 +37,7 @@ import org.openoffice.xmerge.converter.xml.OfficeConstants;
/**
* This is a class representing the different attributes for a worksheet
- * contained in settings.xml.
+ * contained in settings.xml.
*
* @author Martin Maher
*/
@@ -48,7 +48,7 @@ public class SheetSettings implements OfficeConstants {
private String sheetName;
private int cursorX = 0;
- private int cursorY = 0;
+ private int cursorY = 0;
private int splitTypeX;
private int splitTypeY;
private int splitPointX = 0;
@@ -58,51 +58,49 @@ public class SheetSettings implements OfficeConstants {
private int posBottom = 0;
private int posTop = 0;
private int paneNumber = 2;
-
+
final public static int NONE = 0x00;
final public static int SPLIT = 0x01;
final public static int FREEZE = 0x02;
-
-
+
/**
- * Default Constructor for a <code>ColumnRowInfo</code>
+ * Default Constructor for a <code>SheetSettings</code>
*
*/
public SheetSettings() {
}
-
+
/**
* Constructor that takes a <code>Node</code> to build a <code>SheetSettings</code>
*
- * @param root XML Node to read from
+ * @param root XML Node to read from
*/
public SheetSettings(Node root) {
readNode(root);
}
/**
- * Constructor for a <code>ColumnRowInfo</code>
+ * Constructor for a <code>SheetSettings</code>
*
- * @param dimension if it's a row the height, a column the width
- * @param repeated
+ * @param name The name for the new sheet
*/
public SheetSettings(String name) {
sheetName = name;
}
-
+
/**
- * sets the position of the acitve cell
+ * sets the position of the acitve cell
*
- * @param activeCell the current curor position
+ * @param activeCell the current curor position
*/
public void setCursor(Point activeCell) {
cursorX = (int) activeCell.getX();
cursorY = (int) activeCell.getY();
}
-
+
/**
- * Gets the position of the acitve cell
+ * Gets the position of the acitve cell
*
* @return The position as a <code>Point</code>
*/
@@ -112,7 +110,7 @@ public class SheetSettings implements OfficeConstants {
}
/**
- * Sets the position of the freeze
+ * Sets the position of the freeze
*
* @param splitPoint the point at where the split occurs
*/
@@ -125,7 +123,7 @@ public class SheetSettings implements OfficeConstants {
}
/**
- * Sets the position of the split
+ * Sets the position of the split
*
* @param splitPoint the point at where the split occurs
*/
@@ -136,9 +134,9 @@ public class SheetSettings implements OfficeConstants {
splitPointX = (int) splitPoint.getX();
splitPointY = (int) splitPoint.getY();
}
-
+
/**
- * sets the position and type of the split
+ * gets the position of the split
*
* @return The position as a <code>Point</code> where the split occurs
*/
@@ -146,11 +144,11 @@ public class SheetSettings implements OfficeConstants {
return (new Point(splitPointX, splitPointY));
}
-
+
/**
- * sets the position and type of the split
+ * gets the type of the split
*
- * @return The position as a <code>Point</code> where the split occurs
+ * @return The split type as a <code>Point</code>
*/
public Point getSplitType() {
@@ -161,7 +159,7 @@ public class SheetSettings implements OfficeConstants {
* Sets the top row visible in the lower pane and the leftmost column
* visibile in the right pane.
*
- * @param top The top row visible in the lower pane
+ * @param top The top row visible in the lower pane
* @param left The leftmost column visibile in the right pane
*/
public void setTopLeft(int top, int left) {
@@ -169,30 +167,28 @@ public class SheetSettings implements OfficeConstants {
posLeft = left;
posTop = top;
}
-
+
/**
* Gets the the leftmost column visibile in the right pane.
*
- * @return the 0-based index to the column
+ * @return the 0-based index to the column
*/
public int getLeft() {
return posLeft;
}
/**
- * Sets the top row visible in the lower pane and the leftmost column
- * visibile in the right pane.
+ * Gets the top row visible in the lower pane.
*
- * @param top The top row visible in the lower pane
- * @param left The leftmost column visibile in the right pane
+ * @return The top row visible in the lower pane
*/
public int getTop() {
return posTop;
}
-
+
/**
- * Gets the active Panel
+ * Gets the active Panel
* 0 - Bottom Right, 1 - Top Right
* 2 - Bottom Left, 3 - Top Left
*
@@ -202,32 +198,32 @@ public class SheetSettings implements OfficeConstants {
return paneNumber;
}
-
+
/**
- * Sets the sheetname this settings object applies to
+ * Sets the sheetname this settings object applies to
*
- * @param sheetName the name of the worksheet
+ * @param sheetName the name of the worksheet
*/
public void setSheetName(String sheetName) {
this.sheetName = sheetName;
}
-
+
/**
* Sets the active pane number
* 0 - Bottom Right, 1 - Top Right
* 2 - Bottom Left, 3 - Top Left
*
- * @param paneNumber the pane number
+ * @param paneNumber the pane number
*/
public void setPaneNumber(int paneNumber) {
this.paneNumber = paneNumber;
}
-
+
/**
- * Gets the name of the worksheet these <code>Settings</code> apply to
+ * Gets the name of the worksheet these <code>Settings</code> apply to
*
* @return the name of the worksheet
*/
@@ -249,54 +245,54 @@ public class SheetSettings implements OfficeConstants {
Element configItem = settings.createElement(TAG_CONFIG_ITEM);
configItem.setAttribute(ATTRIBUTE_CONFIG_NAME, attribute);
configItem.setAttribute(ATTRIBUTE_CONFIG_TYPE, type);
-
+
configItem.appendChild(settings.createTextNode(value));
root.appendChild(configItem);
}
/**
- * Writes out a settings.xml entry for this SheetSettings object
+ * Writes out a settings.xml entry for this SheetSettings object
*
- * @param settings a <code>Document</code> object representing the settings.xml
+ * @param settings a <code>Document</code> object representing the settings.xml
* @param root the root xml node to add to
*/
public void writeNode(org.w3c.dom.Document settings, Node root) {
-
+
this.settings = settings;
Element configItemMapEntry = (Element)
settings.createElement(TAG_CONFIG_ITEM_MAP_ENTRY);
configItemMapEntry.setAttribute(ATTRIBUTE_CONFIG_NAME, getSheetName());
- addConfigItem(configItemMapEntry, "CursorPositionX", "int", Integer.toString(cursorX));
- addConfigItem(configItemMapEntry, "CursorPositionY", "int", Integer.toString(cursorY));
+ addConfigItem(configItemMapEntry, "CursorPositionX", "int", Integer.toString(cursorX));
+ addConfigItem(configItemMapEntry, "CursorPositionY", "int", Integer.toString(cursorY));
String splitMode = Integer.toString(splitTypeX);
if(splitPointX==0) {
splitMode = "0";
}
- addConfigItem(configItemMapEntry, "HorizontalSplitMode", "short", splitMode);
+ addConfigItem(configItemMapEntry, "HorizontalSplitMode", "short", splitMode);
splitMode = Integer.toString(splitTypeY);
if(splitPointY==0) {
splitMode = "0";
}
- addConfigItem(configItemMapEntry, "VerticalSplitMode", "short", splitMode);
-
- addConfigItem(configItemMapEntry, "HorizontalSplitPosition", "int",
Integer.toString(splitPointX));
- addConfigItem(configItemMapEntry, "VerticalSplitPosition", "int",
Integer.toString(splitPointY));
- addConfigItem(configItemMapEntry, "ActiveSplitRange", "short",
Integer.toString(paneNumber));
-
- addConfigItem(configItemMapEntry, "PositionLeft", "int", "0");
- addConfigItem(configItemMapEntry, "PositionRight", "int", Integer.toString(posLeft));
- addConfigItem(configItemMapEntry, "PositionTop", "int", "0");
- addConfigItem(configItemMapEntry, "PositionBottom", "int", Integer.toString(posTop));
+ addConfigItem(configItemMapEntry, "VerticalSplitMode", "short", splitMode);
+
+ addConfigItem(configItemMapEntry, "HorizontalSplitPosition", "int",
Integer.toString(splitPointX));
+ addConfigItem(configItemMapEntry, "VerticalSplitPosition", "int",
Integer.toString(splitPointY));
+ addConfigItem(configItemMapEntry, "ActiveSplitRange", "short",
Integer.toString(paneNumber));
+
+ addConfigItem(configItemMapEntry, "PositionLeft", "int", "0");
+ addConfigItem(configItemMapEntry, "PositionRight", "int", Integer.toString(posLeft));
+ addConfigItem(configItemMapEntry, "PositionTop", "int", "0");
+ addConfigItem(configItemMapEntry, "PositionBottom", "int", Integer.toString(posTop));
root.appendChild(configItemMapEntry);
}
/**
- * Sets a variable based on a String value read from XML
+ * Sets a variable based on a String value read from XML
*
- * @param name xml name of the attribute to set
- * @param value String value fo the attribute
+ * @param name xml name of the attribute to set
+ * @param value String value fo the attribute
*/
public void addAttribute(String name, String value) {
@@ -304,7 +300,7 @@ public class SheetSettings implements OfficeConstants {
cursorX = Integer.parseInt(value);
} else if(name.equals("CursorPositionY")) {
cursorY = Integer.parseInt(value);
-
+
} else if(name.equals("HorizontalSplitPosition")) {
splitPointX = Integer.parseInt(value);
} else if(name.equals("VerticalSplitPosition")) {
@@ -316,7 +312,7 @@ public class SheetSettings implements OfficeConstants {
posLeft = Integer.parseInt(value);
} else if(name.equals("PositionBottom")) {
posTop = Integer.parseInt(value);
-
+
} else if(name.equals("HorizontalSplitMode")) {
splitTypeX = Integer.parseInt(value);
} else if(name.equals("VerticalSplitMode")) {
@@ -327,10 +323,10 @@ public class SheetSettings implements OfficeConstants {
/**
* Reads document settings from xml and inits SheetSettings variables
*
- * @param root XML Node to read from
+ * @param root XML Node to read from
*/
public void readNode(Node root) {
-
+
NamedNodeMap sheetAtt = root.getAttributes();
Node sheetNameNode = sheetAtt.getNamedItem(ATTRIBUTE_CONFIG_NAME);
@@ -348,24 +344,24 @@ public class SheetSettings implements OfficeConstants {
String nodeName = child.getNodeName();
if (nodeName.equals(TAG_CONFIG_ITEM)) {
-
+
NamedNodeMap cellAtt = child.getAttributes();
Node configNameNode =
cellAtt.getNamedItem(ATTRIBUTE_CONFIG_NAME);
-
+
String name = configNameNode.getNodeValue();
NodeList nodeList2 = child.getChildNodes();
int len2 = nodeList2.getLength();
- String s = "";
+ String s = "";
for (int j = 0; j < len2; j++) {
Node child2 = nodeList2.item(j);
if (child2.getNodeType() == Node.TEXT_NODE) {
s = child2.getNodeValue();
}
}
- addAttribute(name, s);
- }
+ addAttribute(name, s);
+ }
}
}
}
--
1.7.0.4
From bae357322dd4613a9459f53f1d00834cb148dcdc Mon Sep 17 00:00:00 2001
From: Nigel Hawkins <n.hawkins@gmx.com>
Date: Thu, 28 Oct 2010 10:19:11 +0100
Subject: [PATCH 9/9] Fix javadoc comments in SpreadsheetEncoder.java
---
.../converter/xml/sxc/SpreadsheetEncoder.java | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git
a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java
b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java
index f92d0bd..f2a5e6b 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SpreadsheetEncoder.java
@@ -105,24 +105,22 @@ public abstract class SpreadsheetEncoder {
/**
* Set the width of the columns in the WorkBook.
*
- * @param columnWidths An <code>IntArrayList</code> of column
+ * @param columnRows An <code>IntArrayList</code> of column
* widths.
*/
public abstract void setColumnRows(Vector columnRows) throws IOException;
/**
- * Set the width of the columns in the WorkBook.
+ * Set the name definition of this spreadsheet
*
- * @param columnWidths An <code>IntArrayList</code> of column
- * widths.
+ * @param nd The <code>NameDefinition</code> to use.
*/
public abstract void setNameDefinition(NameDefinition nd) throws IOException;
/**
- * Set the width of the columns in the WorkBook.
+ * Adds settings to the WorkBook.
*
- * @param columnWidths An <code>IntArrayList</code> of column
- * widths.
+ * @param s The <code>BookSettings</code> to add.
*/
public abstract void addSettings(BookSettings s) throws IOException;
}
--
1.7.0.4
Context
- [Libreoffice] [PATCH] Fix comments in filters/xmerge · Nigel Hawkins
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.