From 079afa9b7a4b9c3fec0b90315f1d58cb0d9c0c41 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 21 Dec 2016 20:23:39 +0300 Subject: [PATCH] Fix for corrupted list styles --- source/java/writer2latex/office/ListCounter.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/java/writer2latex/office/ListCounter.java b/source/java/writer2latex/office/ListCounter.java index 541af33..88a24ec 100644 --- a/source/java/writer2latex/office/ListCounter.java +++ b/source/java/writer2latex/office/ListCounter.java @@ -102,15 +102,16 @@ public class ListCounter { } public String getPrefix() { - if (style.isNumber(nLevel)) { - String sPrefix = style.getLevelProperty(nLevel,XMLString.STYLE_NUM_PREFIX); - return sPrefix!=null ? sPrefix : ""; - } + if (style != null && style.isNumber(nLevel)) { + String sPrefix = style.getLevelProperty(nLevel,XMLString.STYLE_NUM_PREFIX); + return sPrefix!=null ? sPrefix : ""; + } + return ""; } public String getLabelAndSuffix() { - if (style.isNumber(nLevel)) { + if (style != null && style.isNumber(nLevel)) { String sLabel=""; if (sNumFormat[nLevel]==null) return ""; int nLevels = Misc.getPosInteger(style.getLevelProperty(nLevel, @@ -126,7 +127,7 @@ public class ListCounter { if (sLabel.length()>0 && sSpace!=null) { sLabel+=sSpace; } return sLabel; } - else if (style.isBullet(nLevel)) { + else if (style != null && style.isBullet(nLevel)) { return style.getLevelProperty(nLevel,XMLString.TEXT_BULLET_CHAR); } else {