From f1379b2963c7e49fcb747d741b95af476f3a3774 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sat, 16 Jul 2011 08:11:28 +0000 Subject: [PATCH] add get/set for _ixchFollow in listLevel git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147377 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/converter/AbstractWordUtils.java | 16 +--------------- .../src/org/apache/poi/hwpf/model/ListLevel.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java index 79c5f7e64..9a667ff91 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java @@ -146,7 +146,7 @@ public class AbstractWordUtils } } - byte follow = getIxchFollow( listLevel ); + byte follow = listLevel.getTypeOfCharFollowingTheNumber(); switch ( follow ) { case 0: @@ -203,20 +203,6 @@ public class AbstractWordUtils } } - public static byte getIxchFollow( ListLevel listLevel ) - { - try - { - Field field = ListLevel.class.getDeclaredField( "_ixchFollow" ); - field.setAccessible( true ); - return ( (Byte) field.get( listLevel ) ).byteValue(); - } - catch ( Exception exc ) - { - throw new Error( exc ); - } - } - public static String getJustification( int js ) { switch ( js ) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java b/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java index b8939b381..cb04af184 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/ListLevel.java @@ -147,6 +147,14 @@ public final class ListLevel return null; } + /** + * "The type of character following the number text for the paragraph: 0 == tab, 1 == space, 2 == nothing." + */ + public byte getTypeOfCharFollowingTheNumber() + { + return this._ixchFollow; + } + public void setStartAt(int startAt) { _iStartAt = startAt; @@ -162,6 +170,11 @@ public final class ListLevel _jc.setValue(_info, alignment); } + public void setTypeOfCharFollowingTheNumber( byte value ) + { + this._ixchFollow = value; + } + public void setNumberProperties(byte[] grpprl) { _grpprlChpx = grpprl;