}
private void cleanBreakProperty(Paragraph paragraph) {
TextNavigation search = this.textSelection.getTextNavigation();
if (search == null)
throw new IllegalStateException("Navigation is null");
OdfStyleBase styleElement = paragraph.getStyleHandler()
.getStyleElementForRead();
String name = styleElement.getAttribute("style:name");
String newName = null;
OdfElement modifiedStyleElement = search
.getModifiedStyleElement(styleElement);
if (modifiedStyleElement == null) {
modifiedStyleElement = (OdfElement) styleElement.cloneNode(true);
search.addModifiedStyleElement(styleElement, modifiedStyleElement);
NodeList paragraphProperties = modifiedStyleElement
.getElementsByTagName("style:paragraph-properties");
if (paragraphProperties != null
&& paragraphProperties.getLength() > 0) {
StyleParagraphPropertiesElement property = (StyleParagraphPropertiesElement) paragraphProperties
.item(0);
property.removeAttribute("fo:break-before");
property.removeAttribute("fo:break-after");
property.removeAttribute("style:page-number");
}
modifiedStyleElement.removeAttribute("style:master-page-name");
newName = name + "-" + makeUniqueName();
NamedNodeMap attributes = modifiedStyleElement.getAttributes();
if (attributes != null) {
for (int i = 0; i < attributes.getLength(); i++) {
Node item = attributes.item(i);
String value = item.getNodeValue();
if (name.equals(value)) {
item.setNodeValue(newName);
break;
}
}
}
styleElement.getParentNode().appendChild(modifiedStyleElement);
} else {
newName = modifiedStyleElement.getAttribute("style:name");
}
NamedNodeMap attributes = paragraph.getOdfElement().getAttributes();
if (attributes != null) {