}
}
private StyleMasterPageElement getMasterPage(boolean pFirstPage) throws Exception {
String pageStyleName = pFirstPage ? "First_20_Page" : "Standard";
OfficeDocumentStylesElement rootElement = getStylesDom().getRootElement();
OfficeMasterStylesElement masterStyles = OdfElement.findFirstChildNode(OfficeMasterStylesElement.class,
rootElement);
if (masterStyles == null) {
masterStyles = rootElement.newOfficeMasterStylesElement();
}
StyleMasterPageElement masterPageEle = null;
NodeList lastMasterPages = masterStyles.getElementsByTagNameNS(OdfDocumentNamespace.STYLE.getUri(),
"master-page");
if (lastMasterPages != null && lastMasterPages.getLength() > 0) {