[OpenVPMS Developers] [JIRA] (OVPMS-1278) Sort document input fields according to document position
Sort document input fields according to document position ---------------------------------------------------------
Key: OVPMS-1278 URL: https://openvpms.atlassian.net/browse/OVPMS-1278 Project: VPMS Web Application Issue Type: Improvement Components: Reporting Affects Versions: 1.6, 1.5 Reporter: Tim Anderson Assignee: Tim Anderson Priority: Minor
Document input fields returned by OpenOfficeDocument.getInputFields() are returned in random order. When prompting for documents parameters, this means that the parameters appear in a different order each time a document is generated.
According to http://www.oooforum.org/forum/viewtopic.phtml?t=124460 it should be possible to sort the fields according to their X,Y coordinates in the document. The coordinates may be accessed as follows: {code} XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)UnoRuntime.queryInterface(XTextFieldsSupplier.class, xCurrentComponent); XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields(); XEnumeration enumeration = xEnumeratedFields.createEnumeration(); LlistaMarquesFusionables retorn = new LlistaMarquesFusionables(); while(enumeration.hasMoreElements()){ Object nextMark = enumeration.nextElement(); XDependentTextField dependentTextField = (XDependentTextField)UnoRuntime.queryInterface(XDependentTextField.class, nextMark); ... XTextViewCursor xTextViewCursor = xViewCursorSupplier.getViewCursor(); XTextRange xTextRange = dependentTextField.getAnchor(); xTextViewCursor.gotoRange(xTextRange, false); int x = xTextViewCursor.getPosition().X; int y= xTextViewCursor.getPosition().Y; } {code}
-- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://openvpms.atlassian.net/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf