aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2020-12-20 18:47:56 +0000
committerDominik Stadler <centic@apache.org>2020-12-20 18:47:56 +0000
commit01dabc0d1b76bafa136248ef7676060f65cc45ec (patch)
tree4821be7c0b64647187b85f1a05ba2f2f57cd6f09 /src/ooxml/testcases
parentd20fa4430554760967f193cafc3e1a07fb28ced0 (diff)
downloadpoi-01dabc0d1b76bafa136248ef7676060f65cc45ec.tar.gz
poi-01dabc0d1b76bafa136248ef7676060f65cc45ec.zip
Fix NullPointerException in Autosize introduced via #64981
Only happened when alignment is set Add a test reproducing the problem Also verify auto-size on SXSSF git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884653 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java
new file mode 100644
index 0000000000..38ff1fc352
--- /dev/null
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java
@@ -0,0 +1,39 @@
+/* ====================================================================
+ 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.apache.poi.xssf.usermodel;
+
+import org.apache.poi.ss.usermodel.BaseTestSheetAutosizeColumn;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.SXSSFITestDataProvider;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+
+/**
+ * @author Yegor Kozlov
+ */
+public final class TestSXSSFSheetAutosizeColumn extends BaseTestSheetAutosizeColumn {
+
+ public TestSXSSFSheetAutosizeColumn(){
+ super(SXSSFITestDataProvider.instance);
+ }
+
+ @Override
+ protected void trackColumnsForAutoSizingIfSXSSF(Sheet sheet) {
+ ((SXSSFSheet)sheet).trackAllColumnsForAutoSizing();
+ }
+} \ No newline at end of file