From 70b934ee0c61e4e781a830443a75ee23c07ced62 Mon Sep 17 00:00:00 2001 From: Said Ryan Ackley Date: Sun, 11 Jul 2004 04:38:32 +0000 Subject: [PATCH] fixes for article git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353571 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/usermodel/Range.java | 2 +- .../src/org/apache/poi/hwpf/usermodel/Section.java | 7 ++++++- .../src/org/apache/poi/hwpf/usermodel/Table.java | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java index a13931aa3f..0f55cbd557 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java @@ -336,7 +336,7 @@ public class Range int insertIndex = _end - tp.getStart(); - if (tp.getStringBuffer().charAt(_end - 1) == '\r') + if (tp.getStringBuffer().charAt(_end - 1) == '\r' && text.charAt(0) != '\u0007') { insertIndex--; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java index 73aff31376..65aee3748b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.hwpf.usermodel; @@ -37,6 +37,11 @@ public class Section return TYPE_SECTION; } + public int getNumColumns() + { + return _props.getCcolM1() + 1; + } + public Object clone() throws CloneNotSupportedException { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java index 6882c3aafa..42aa6570b4 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.hwpf.usermodel; import java.util.ArrayList; @@ -36,12 +36,12 @@ public class Table while (rowEnd < numParagraphs) { Paragraph p = getParagraph(rowEnd); - rowEnd++; if (p.isTableRowEnd() && p.getTableLevel() == levelNum) { _rows.add(new TableRow(rowStart, rowEnd, this, levelNum)); rowStart = rowEnd; } + rowEnd++; } } -- 2.39.5