jferard / fastods

A very fast and lightweight (no dependency) library for creating ODS (Open Document Spreadsheet, mainly for Calc) files in Java. It's a Martin Schulz's SimpleODS fork
GNU General Public License v3.0
36 stars 6 forks source link

Allow page layout share between master pages #25

Closed jferard closed 7 years ago

jferard commented 7 years ago

Currently, the PageStyle handle two tags:

jferard commented 7 years ago

Current state: there is a StylesContainer that stores MasterPageStyles:

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.

jferard commented 7 years ago

The split is unsufficient: the PageStyle builder should provide two methods:

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.