* @return the horizontal alignment; null if there is no horizontal
* alignment setting.
*/
public HorizontalAlignmentType getHorizontalAlignment() {
HorizontalAlignmentType tempAlign = null;
ParagraphProperties properties = getParagraphPropertiesForRead();
if (properties != null) {
tempAlign = properties.getHorizontalAlignment();
}
if (tempAlign != null) {
return tempAlign;
}
boolean isDefault = isUseDefaultStyle;
// find in parent style definition
OdfStyleBase parentStyle = null;
if (!isDefault) {
parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
}
while ((!isDefault) && (parentStyle != null)) {
ParagraphProperties parentStyleSetting = ParagraphProperties.getParagraphProperties(parentStyle);
tempAlign = parentStyleSetting.getHorizontalAlignment();
if (tempAlign != null) {
return tempAlign;
}
if (parentStyle instanceof OdfDefaultStyle) {
isDefault = true;
} else {
parentStyle = getParentStyle((OdfStyle) parentStyle);
}
}
// find in default style definition
if (!isDefault) {
OdfDefaultStyle defaultStyle = getParagraphDefaultStyle();
ParagraphProperties defaultStyleSetting = ParagraphProperties.getParagraphProperties(defaultStyle);
tempAlign = defaultStyleSetting.getHorizontalAlignment();
}
// use default
if (tempAlign == null) {
return HorizontalAlignmentType.DEFAULT;
}