
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@272 f0f2a975-2e09-46c8-9428-3b39399b9f3c
65 lines
No EOL
2.3 KiB
Java
65 lines
No EOL
2.3 KiB
Java
/************************************************************************
|
|
*
|
|
* MasterPage.java
|
|
*
|
|
* Copyright: 2002-2005 by Henrik Just
|
|
*
|
|
* This file is part of Writer2LaTeX.
|
|
*
|
|
* Writer2LaTeX is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Writer2LaTeX is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Writer2LaTeX. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Version 0.5 (2005-10-10)
|
|
*
|
|
*/
|
|
|
|
package writer2latex.office;
|
|
|
|
import org.w3c.dom.Node;
|
|
import writer2latex.util.Misc;
|
|
|
|
/** <p> Class representing a master page in OOo Writer </p> */
|
|
public class MasterPage extends OfficeStyle {
|
|
private PropertySet properties = new PropertySet();
|
|
private Node header = null;
|
|
private Node headerLeft = null;
|
|
private Node footer = null;
|
|
private Node footerLeft = null;
|
|
|
|
public String getProperty(String sPropName) {
|
|
return properties.getProperty(sPropName);
|
|
}
|
|
|
|
public String getPageLayoutName() {
|
|
String sName = properties.getProperty(XMLString.STYLE_PAGE_MASTER_NAME);
|
|
if (sName==null) { // try oasis format
|
|
sName = properties.getProperty(XMLString.STYLE_PAGE_LAYOUT_NAME);
|
|
}
|
|
return sName;
|
|
}
|
|
|
|
public Node getHeader() { return header; }
|
|
public Node getHeaderLeft() { return headerLeft; }
|
|
public Node getFooter() { return footer; }
|
|
public Node getFooterLeft() { return footerLeft; }
|
|
|
|
public void loadStyleFromDOM(Node node) {
|
|
super.loadStyleFromDOM(node);
|
|
properties.loadFromDOM(node);
|
|
header = Misc.getChildByTagName(node,XMLString.STYLE_HEADER);
|
|
headerLeft = Misc.getChildByTagName(node,XMLString.STYLE_HEADER_LEFT);
|
|
footer = Misc.getChildByTagName(node,XMLString.STYLE_FOOTER);
|
|
footerLeft = Misc.getChildByTagName(node,XMLString.STYLE_FOOTER_LEFT);
|
|
}
|
|
|
|
} |