poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1730274 - in /poi/trunk: src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java test-data/spreadsheet/florida_data.ashx.xls
Date Sat, 13 Feb 2016 21:29:47 GMT
Author: centic
Date: Sat Feb 13 21:29:46 2016
New Revision: 1730274

URL: http://svn.apache.org/viewvc?rev=1730274&view=rev
Log:
Regression analysis: the additional testing of cloning sheets showed a
possible ArrayIndexOutOfBounds error which we can avoid to make cloning
fail a bit less.

Added:
    poi/trunk/test-data/spreadsheet/florida_data.ashx.xls
Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java?rev=1730274&r1=1730273&r2=1730274&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java Sat Feb 13 21:29:46
2016
@@ -214,9 +214,11 @@ public class HSSFPicture extends HSSFSim
     void afterInsert(HSSFPatriarch patriarch) {
         EscherAggregate agg = patriarch.getBoundAggregate();
         agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID),
getObjRecord());
-        EscherBSERecord bse =
-                patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
-        bse.setRef(bse.getRef() + 1);
+        if(getPictureIndex() != -1) {
+            EscherBSERecord bse =
+                    patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
+            bse.setRef(bse.getRef() + 1);
+        }
     }
 
     /**

Added: poi/trunk/test-data/spreadsheet/florida_data.ashx.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/florida_data.ashx.xls?rev=1730274&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/florida_data.ashx.xls (added) and poi/trunk/test-data/spreadsheet/florida_data.ashx.xls
Sat Feb 13 21:29:46 2016 differ



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message