Closed jferard closed 7 years ago
Current state: there is a StylesContainer
that stores MasterPageStyle
s:
MasterPageStyle.addToElements(e)
stores the style into elements with a call to e.addPageStyle
OdsElements.addPageStyle(m)
adds the style to the container, in CREATE_OR_UPDATE
mode.If we split, as stated above, the class into, we could have two containers (master and layout) with CREATE_OR_UPDATE
and the duplicates will be automatically removed.
The split is unsufficient: the PageStyle builder should provide two methods:
PageStyleBuilder.masterPageStyle(mps)
PageStyleBuilder.pageStyleLayout(mps)
With the following usage:
PageStyle ps1 = PageStyle.builder()....build();
PageStyle ps2 = PageStyle.builder()....build();
PageStyle ps3 = PageStyle.builder()
.pageLayoutStyle(ps1.getPageLayoutStyle())
.masterPageStyle(ps2.getMasterPage()).build();
It's quite simple, but there is one difficulty: the names are currently the same for master-page and page-layout.
Currently, the
PageStyle
handle two tags:style:master-page
in styles.xml > master-stylesstyle:page-layout
in styles.xml >automatic-styles If we splitPageStyle
intoMasterPageStyle
andPageLyout
, a page layout could be shared between two master pages.