From a806e6360ab5f703dfd15e8565e3b456f800cd8b Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 3 May 2006 08:30:56 +0000 Subject: [PATCH] Bugzilla #38243: Bugfix for NPE when there are gaps in the table-column setup. Submitted by: Gerhard Oettl git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@399200 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/table/ColumnSetup.java | 7 ++- status.xml | 7 +++ .../standard-testcases/table-column_gap.xml | 58 +++++++++++++++++++ 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 test/layoutengine/standard-testcases/table-column_gap.xml diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java index 00784fc5c..7b5db7df0 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java +++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,9 +61,10 @@ public class ColumnSetup { ListIterator iter = rawCols.listIterator(); while (iter.hasNext()) { TableColumn col = (TableColumn)iter.next(); - if (col != null) { - colnum = col.getColumnNumber(); + if (col == null) { + continue; } + colnum = col.getColumnNumber(); for (int i = 0; i < col.getNumberColumnsRepeated(); i++) { while (colnum > columns.size()) { columns.add(null); diff --git a/status.xml b/status.xml index dd7d23a41..36fc373ed 100644 --- a/status.xml +++ b/status.xml @@ -27,6 +27,13 @@ + + Bugfix: Gaps in table-columns cause a NullPointerException. + + + Changed the internal representation of colors to use Java's own color infrastructure + instead of FOP's home-grown classes. + Bugfix: TABs were not correctly replaced by spaces in some circumstances. diff --git a/test/layoutengine/standard-testcases/table-column_gap.xml b/test/layoutengine/standard-testcases/table-column_gap.xml new file mode 100644 index 000000000..df4d775bd --- /dev/null +++ b/test/layoutengine/standard-testcases/table-column_gap.xml @@ -0,0 +1,58 @@ + + + + + +

+ This test checks gaps in the table-column setup. Bug 38243 describes a NullPointerException in this case. +

+
+ + + + + + + + + + + + + + + + + cell 1/1 + + + + + cell 1/3 + + + + + + + + + + + + +
-- 2.39.5