incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florian Hopf (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ODFTOOLKIT-338) [Simple API]The Value of VariableField always is "" when try to get a VariableField instance by TextDocument.getVariableFieldByName(String)
Date Wed, 19 Dec 2012 05:43:12 GMT

     [ https://issues.apache.org/jira/browse/ODFTOOLKIT-338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Florian Hopf updated ODFTOOLKIT-338:
------------------------------------

        Fix Version/s:     (was: simple-odfdom-0.8)
                       0.6-incubating
    Affects Version/s:     (was: simple-odfdom-0.7)
                       0.5-incubating
    
> [Simple API]The Value of VariableField always is "" when try to get a VariableField instance
by TextDocument.getVariableFieldByName(String)
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-338
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-338
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: 0.5-incubating
>            Reporter: DaLi Liu
>            Assignee: DaLi Liu
>             Fix For: 0.6-incubating
>
>         Attachments: 338_AbstractVariableContainer.java.patch, TestMySelectionResultsssss.odt
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The Value of VariableField always is "" when try to get a VariableField instance by TextDocument.getVariableFieldByName.
> Here is the sample codes to show the error.
> try {
> 		TextDocument sourcedoc = (TextDocument) Document.loadDocument(ResourceUtilities.getAbsolutePath("TestMySelectionResultsssss.odt"));
> 			VariableField userVariableField = sourcedoc.getVariableFieldByName("textt");
> 			if (userVariableField.getOdfElement() instanceof TextUserFieldDeclElement) {
> 				TextUserFieldDeclElement textUserFieldDeclElement = (TextUserFieldDeclElement) userVariableField.getOdfElement();
> 				String fieldname = userVariableField.getVariableName();
> 				String value = textUserFieldDeclElement.getOfficeStringValueAttribute();
> 				System.out.println("FieldName:" + fieldname);
> 				System.out.println("Fieldvalue:" + value);// value always is ""
> 			}
> 		} catch (FileNotFoundException e1) {
> 			e1.printStackTrace();
> 		} catch (Exception e1) {
> 			e1.printStackTrace();
> 		}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message