* get a map containing text properties of the specified styleable element.
* @return a map of text properties.
*/
private Map<OdfStyleProperty, String> getTextStyleProperties(OdfStylableElement element) {
String styleName = element.getStyleName();
OdfStyleBase styleElement = element.getAutomaticStyles().getStyle(
styleName, element.getStyleFamily());
if (styleElement == null) {
styleElement = element.getDocumentStyle();
}
if (styleElement != null) {
//check if it is the style:defaut-style
if ((styleElement.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties) == null) &&
(styleElement.getPropertiesElement(OdfStylePropertiesSet.TextProperties) == null)) {
styleElement = ((OdfDocument) ((OdfFileDom) styleElement.getOwnerDocument()).getDocument()).getDocumentStyles().getDefaultStyle(styleElement.getFamily());
}
TreeMap<OdfStyleProperty, String> result = new TreeMap<OdfStyleProperty, String>();
OdfStyleFamily family = OdfStyleFamily.Text;
if (family != null) {
for (OdfStyleProperty property : family.getProperties()) {
if (styleElement.hasProperty(property)) {
result.put(property, styleElement.getProperty(property));
}
}
}
return result;
}