incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fh...@apache.org
Subject svn commit: r1684559 - in /incubator/odf/trunk: ./ simple/src/main/java/org/odftoolkit/simple/table/ simple/src/test/java/org/odftoolkit/simple/ simple/src/test/resources/
Date Wed, 10 Jun 2015 04:14:16 GMT
Author: fhopf
Date: Wed Jun 10 04:14:15 2015
New Revision: 1684559

URL: http://svn.apache.org/r1684559
Log:
ODFTOOLKIT-398: Prevent NPE in getCellBackgroundColor. Patch by David Reepmeyer.

Added:
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetWithoutTableCellPropertiesTest.java
    incubator/odf/trunk/simple/src/test/resources/TestCellWithoutTableCellProperties.ods 
 (with props)
Modified:
    incubator/odf/trunk/CHANGES.txt
    incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/table/CellStyleHandler.java

Modified: incubator/odf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/CHANGES.txt?rev=1684559&r1=1684558&r2=1684559&view=diff
==============================================================================
--- incubator/odf/trunk/CHANGES.txt (original)
+++ incubator/odf/trunk/CHANGES.txt Wed Jun 10 04:14:15 2015
@@ -1,6 +1,42 @@
 Apache ODF Toolkit Change Log
 =============================
 
+======= Release 0.6.2 =======
+
+The most notable changes in ODF Toolkit 0.6.2 incubating over previous release:
+
+Release wiki page: https://cwiki.apache.org/confluence/display/ODFTOOLKIT/0.6.2-incubating
+
+Versions of major components
+----------------------------
+
+* Xerces 2.9.1 (http://xerces.apache.org/mirrors.cgi)
+* Apache Jena 2.9.4 (http://jena.apache.org/download/index.html)
+* Apache Commons Validator 1.4.0 (http://commons.apache.org/proper/commons-validator//download_validator.cgi)
+
+For a full dependecy list run mvn dependency:tree from the top level in the source module
or see the release wiki page.
+
+Upgrading from 0.6.1-incubating
+-----------------------------
+
+
+Detailed Change List
+--------------------
+
+New Features
+------------
+
+Optimizations
+-------------
+
+Bug Fixes
+---------
+
+* ODFTOOLKIT-398 prevent NullPointerException in getCellBackgroundColor() (Florian Hopf,
Patch by David Reepmeyer)
+
+Other
+-----
+
 ======= Release 0.6.1 =======
 
 The most notable changes in ODF Toolkit 0.6.1 incubating over previous release:

Modified: incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/table/CellStyleHandler.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/table/CellStyleHandler.java?rev=1684559&r1=1684558&r2=1684559&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/table/CellStyleHandler.java
(original)
+++ incubator/odf/trunk/simple/src/main/java/org/odftoolkit/simple/table/CellStyleHandler.java
Wed Jun 10 04:14:15 2015
@@ -425,7 +425,9 @@ public class CellStyleHandler extends De
 		if (!isDefault) {
 			OdfDefaultStyle defaultStyle = getCellDefaultStyle();
 			TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
-			tempColor = defaultStyleSetting.getBackgroundColor();
+			if (defaultStyleSetting != null) {
+				tempColor = defaultStyleSetting.getBackgroundColor();
+			}
 		}
 		// use default
 		if (tempColor == null)

Added: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetWithoutTableCellPropertiesTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetWithoutTableCellPropertiesTest.java?rev=1684559&view=auto
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetWithoutTableCellPropertiesTest.java
(added)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetWithoutTableCellPropertiesTest.java
Wed Jun 10 04:14:15 2015
@@ -0,0 +1,46 @@
+/* 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package org.odftoolkit.simple;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+import org.odftoolkit.simple.table.Table;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+import org.odftoolkit.simple.table.Cell;
+import org.odftoolkit.odfdom.type.Color;
+
+public class SpreadsheetWithoutTableCellPropertiesTest {
+	
+	private final static String TEST_FILE_NAME = "TestCellWithoutTableCellProperties.ods";
+
+	@Test
+	public void testGetCellBackgroundColorOfEmptySpace() throws Exception {
+		SpreadsheetDocument document = SpreadsheetDocument.loadDocument(ResourceUtilities
+			.getTestResourceAsStream(TEST_FILE_NAME));
+		Table table = document.getSheetByIndex(0);
+		Cell cell = table.getCellByPosition(0, 0);
+		Color color = cell.getCellBackgroundColor();
+		Assert.assertEquals(color, org.odftoolkit.odfdom.type.Color.WHITE);
+	}
+}

Added: incubator/odf/trunk/simple/src/test/resources/TestCellWithoutTableCellProperties.ods
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/resources/TestCellWithoutTableCellProperties.ods?rev=1684559&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/odf/trunk/simple/src/test/resources/TestCellWithoutTableCellProperties.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message