incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liud...@apache.org
Subject svn commit: r1406031 - /incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java
Date Tue, 06 Nov 2012 02:48:54 GMT
Author: liudali
Date: Tue Nov  6 02:48:54 2012
New Revision: 1406031

URL: http://svn.apache.org/viewvc?rev=1406031&view=rev
Log:
Fix for ODFTOOLKIT-338, The Value of VariableField always is "" when try to get a VariableField
instance by TextDocument.getVariableFieldByName(String)
https://issues.apache.org/jira/browse/ODFTOOLKIT-338

Modified:
    incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java

Modified: incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java?rev=1406031&r1=1406030&r2=1406031&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java
(original)
+++ incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/common/field/AbstractVariableContainer.java
Tue Nov  6 02:48:54 2012
@@ -73,7 +73,14 @@ public abstract class AbstractVariableCo
 					.getFirstChild();
 			while (userVariableElement != null) {
 				if (name.equals(userVariableElement.getTextNameAttribute())) {
-					return Fields.createUserVariableField(this, name, "");
+					String type = userVariableElement.getOfficeValueTypeAttribute();
+					if(type.equalsIgnoreCase("string")){
+						String stringValue = userVariableElement.getOfficeStringValueAttribute();
+						return Fields.createUserVariableField(this, name, stringValue);
+					}
+					Double DoubleValue = userVariableElement.getOfficeValueAttribute();
+					DoubleValue.toString();
+					return Fields.createUserVariableField(this, name, DoubleValue.toString());
 				} else {
 					userVariableElement = (TextUserFieldDeclElement) userVariableElement.getNextSibling();
 				}



Mime
View raw message