W2l paragraph style map enhancement (break-after)
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@103 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
f19433e716
commit
9fc63c43cb
6 changed files with 76 additions and 40 deletions
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2009 by Henrik Just
|
||||
* Copyright: 2002-2011 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2009-09-28)
|
||||
* Version 1.2 (2011-03-30)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -32,22 +32,24 @@ import java.util.Enumeration;
|
|||
public class StyleMap {
|
||||
private Hashtable<String, StyleMapItem> items = new Hashtable<String, StyleMapItem>();
|
||||
|
||||
public void put(String sName, String sBefore, String sAfter, String sNext, boolean bLineBreak, boolean bVerbatim) {
|
||||
public void put(String sName, String sBefore, String sAfter, String sNext, boolean bLineBreak, int nBreakAfter, boolean bVerbatim) {
|
||||
StyleMapItem item = new StyleMapItem();
|
||||
item.sBefore = sBefore;
|
||||
item.sAfter = sAfter;
|
||||
item.sNext = ";"+sNext+";";
|
||||
item.bLineBreak = bLineBreak;
|
||||
item.nBreakAfter = nBreakAfter;
|
||||
item.bVerbatim = bVerbatim;
|
||||
items.put(sName,item);
|
||||
}
|
||||
|
||||
public void put(String sName, String sBefore, String sAfter, boolean bLineBreak, boolean bVerbatim) {
|
||||
public void put(String sName, String sBefore, String sAfter, boolean bLineBreak, int nBreakAfter, boolean bVerbatim) {
|
||||
StyleMapItem item = new StyleMapItem();
|
||||
item.sBefore = sBefore;
|
||||
item.sAfter = sAfter;
|
||||
item.sNext = ";;";
|
||||
item.bLineBreak = bLineBreak;
|
||||
item.nBreakAfter = nBreakAfter;
|
||||
item.bVerbatim = bVerbatim;
|
||||
items.put(sName,item);
|
||||
}
|
||||
|
@ -58,6 +60,7 @@ public class StyleMap {
|
|||
item.sAfter = sAfter;
|
||||
item.sNext = ";"+sNext+";";
|
||||
item.bLineBreak = true;
|
||||
item.nBreakAfter = StyleMapItem.PAR;
|
||||
item.bVerbatim = bVerbatim;
|
||||
items.put(sName,item);
|
||||
}
|
||||
|
@ -68,6 +71,7 @@ public class StyleMap {
|
|||
item.sAfter = sAfter;
|
||||
item.sNext = ";;";
|
||||
item.bLineBreak = true;
|
||||
item.nBreakAfter = StyleMapItem.PAR;
|
||||
item.bVerbatim = false;
|
||||
items.put(sName,item);
|
||||
}
|
||||
|
@ -97,6 +101,10 @@ public class StyleMap {
|
|||
public boolean getLineBreak(String sName) {
|
||||
return contains(sName) && items.get(sName).bLineBreak;
|
||||
}
|
||||
|
||||
public int getBreakAfter(String sName) {
|
||||
return contains(sName) ? items.get(sName).nBreakAfter : StyleMapItem.PAR;
|
||||
}
|
||||
|
||||
public boolean getVerbatim(String sName) {
|
||||
return contains(sName) && items.get(sName).bVerbatim;
|
||||
|
|
|
@ -16,21 +16,26 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2007 by Henrik Just
|
||||
* Copyright: 2002-2011 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.0 (2007-07-30)
|
||||
* Version 1.2 (2011-03-30)
|
||||
*
|
||||
*/
|
||||
|
||||
package writer2latex.latex.util;
|
||||
|
||||
// A struct to hold data about a style map
|
||||
class StyleMapItem {
|
||||
public class StyleMapItem {
|
||||
public static final int NONE = 0;
|
||||
public static final int LINE = 1;
|
||||
public static final int PAR = 2;
|
||||
|
||||
String sBefore;
|
||||
String sAfter;
|
||||
String sNext;
|
||||
int nBreakAfter;
|
||||
boolean bLineBreak;
|
||||
boolean bVerbatim;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue