svn commit: r1878740 - /xmlbeans/trunk/build.xml
Author: fanningpj Date: Thu Jun 11 07:57:46 2020 New Revision: 1878740 URL: http://svn.apache.org/viewvc?rev=1878740&view=rev Log: saxon-he 10.1 Modified: xmlbeans/trunk/build.xml Modified: xmlbeans/trunk/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=1878740&r1=1878739&r2=1878740&view=diff == --- xmlbeans/trunk/build.xml (original) +++ xmlbeans/trunk/build.xml Thu Jun 11 07:57:46 2020 @@ -75,7 +75,7 @@ http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-7-3j.zip http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip --> - + - To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org
svn commit: r1878746 - in /poi/trunk/src/ooxml: java/org/apache/poi/xssf/usermodel/XSSFSheet.java testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java
Author: fanningpj Date: Thu Jun 11 09:19:26 2020 New Revision: 1878746 URL: http://svn.apache.org/viewvc?rev=1878746&view=rev Log: [bug-64516] XSSFSheet.shiftRows has a bug when shifting rows affect the order of the rows. Thanks to Alex Richter Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1878746&r1=1878745&r2=1878746&view=diff == --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Thu Jun 11 09:19:26 2020 @@ -3037,14 +3037,24 @@ public class XSSFSheet extends POIXMLDoc } private void rebuildRows() { +//rebuild the CTSheetData CTRow order +SortedMap ctRows = new TreeMap<>(); +CTSheetData sheetData = getCTWorksheet().getSheetData(); +for (CTRow ctRow : sheetData.getRowList()) { +Long rownumL = ctRow.getR(); +ctRows.put(rownumL, ctRow); +} +List ctRowList = new ArrayList(ctRows.values()); +CTRow[] ctRowArray = new CTRow[ctRowList.size()]; +ctRowArray = ctRowList.toArray(ctRowArray); +sheetData.setRowArray(ctRowArray); + //rebuild the _rows map -List rowList = new ArrayList<>(_rows.values()); _rows.clear(); -for(XSSFRow r : rowList) { -// Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory -//noinspection UnnecessaryBoxing -final Integer rownumI = new Integer(r.getRowNum()); // NOSONAR -_rows.put(rownumI, r); +for (CTRow ctRow : sheetData.getRowList()) { +XSSFRow row = new XSSFRow(ctRow, this); +Integer rownumI = Math.toIntExact(row.getRowNum()); +_rows.put(rownumI, row); } } Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java?rev=1878746&r1=1878745&r2=1878746&view=diff == --- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Thu Jun 11 09:19:26 2020 @@ -24,6 +24,7 @@ import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; import org.apache.xmlbeans.impl.values.XmlValueDisconnectedException; +import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -370,9 +371,6 @@ public final class TestXSSFSheetShiftRow wb.close(); } -// This test is written as expected-to-fail and should be rewritten -// as expected-to-pass when the bug is fixed. -//@Ignore("Bug 59733 - shiftRows() causes org.apache.xmlbeans.impl.values.XmlValueDisconnectedException") @Test public void bug59733() throws IOException { Workbook workbook = new XSSFWorkbook(); @@ -384,25 +382,9 @@ public final class TestXSSFSheetShiftRow // Shift the 2nd row on top of the 0th row sheet.shiftRows(2, 2, -2); -/* - * The following error is thrown when shifting the 3rd row on top of the 0th row - * If the rows are not created, the error does not occur - -org.apache.xmlbeans.impl.values.XmlValueDisconnectedException -at org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1258) -at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTRowImpl.getR(Unknown Source) -at org.apache.poi.xssf.usermodel.XSSFRow.getRowNum(XSSFRow.java:363) -at org.apache.poi.xssf.usermodel.TestXSSFSheetShiftRows.bug59733(TestXSSFSheetShiftRows.java:393) - */ -// FIXME: remove try, catch, and testPassesNow, skipTest when test passes -try { -sheet.removeRow(sheet.getRow(0)); -assertEquals(1, sheet.getRow(1).getRowNum()); -testPassesNow(59733); -} catch (XmlValueDisconnectedException e) { -skipTest(e); -} - +sheet.removeRow(sheet.getRow(0)); +assertEquals(1, sheet.getRow(1).getRowNum()); + workbook.close(); } @@ -418,6 +400,7 @@ public final class TestXSSFSheetShiftRow // bug 59983: Wrong update of shared formulas after shiftRow @Test +@Ignore public void test
svn commit: r1878747 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Author: fanningpj Date: Thu Jun 11 09:20:29 2020 New Revision: 1878747 URL: http://svn.apache.org/viewvc?rev=1878747&view=rev Log: [bug-64516] XSSFSheet.shiftRows has a bug when shifting rows affect the order of the rows. Thanks to Alex Richter Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1878747&r1=1878746&r2=1878747&view=diff == --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Thu Jun 11 09:20:29 2020 @@ -3044,7 +3044,7 @@ public class XSSFSheet extends POIXMLDoc Long rownumL = ctRow.getR(); ctRows.put(rownumL, ctRow); } -List ctRowList = new ArrayList(ctRows.values()); +List ctRowList = new ArrayList<>(ctRows.values()); CTRow[] ctRowArray = new CTRow[ctRowList.size()]; ctRowArray = ctRowList.toArray(ctRowArray); sheetData.setRowArray(ctRowArray); - To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org
svn commit: r1878749 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java
Author: fanningpj Date: Thu Jun 11 09:31:07 2020 New Revision: 1878749 URL: http://svn.apache.org/viewvc?rev=1878749&view=rev Log: remove unnecessary imports Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java?rev=1878749&r1=1878748&r2=1878749&view=diff == --- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Thu Jun 11 09:31:07 2020 @@ -23,14 +23,11 @@ import org.apache.poi.ss.util.CellUtil; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; -import org.apache.xmlbeans.impl.values.XmlValueDisconnectedException; import org.junit.Ignore; import org.junit.Test; import java.io.IOException; -import static org.apache.poi.POITestCase.skipTest; -import static org.apache.poi.POITestCase.testPassesNow; import static org.junit.Assert.*; public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { - To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org
svn commit: r1878750 - in /poi/trunk/src/ooxml: java/org/apache/poi/xssf/usermodel/XSSFSheet.java testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java
Author: fanningpj Date: Thu Jun 11 11:04:23 2020 New Revision: 1878750 URL: http://svn.apache.org/viewvc?rev=1878750&view=rev Log: try to fix broken test Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1878750&r1=1878749&r2=1878750&view=diff == --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Thu Jun 11 11:04:23 2020 @@ -3545,8 +3545,9 @@ public class XSSFSheet extends POIXMLDoc // see more details in https://issues.apache.org/bugzilla/show_bug.cgi?id=51710 if(cellRef.getCol() > sfRef.getFirstColumn() || cellRef.getRow() > sfRef.getFirstRow()){ String effectiveRef = new CellRangeAddress( -Math.max(cellRef.getRow(), sfRef.getFirstRow()), sfRef.getLastRow(), -Math.max(cellRef.getCol(), sfRef.getFirstColumn()), sfRef.getLastColumn()).formatAsString(); +Math.max(cellRef.getRow(), sfRef.getFirstRow()), Math.max(cellRef.getRow(), sfRef.getLastRow()), +Math.max(cellRef.getCol(), sfRef.getFirstColumn()), Math.max(cellRef.getCol(), sfRef.getLastColumn())) +.formatAsString(); sf.setRef(effectiveRef); } Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java?rev=1878750&r1=1878749&r2=1878750&view=diff == --- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java Thu Jun 11 11:04:23 2020 @@ -23,7 +23,6 @@ import org.apache.poi.ss.util.CellUtil; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -397,7 +396,6 @@ public final class TestXSSFSheetShiftRow // bug 59983: Wrong update of shared formulas after shiftRow @Test -@Ignore public void testSharedFormulas() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("TestShiftRowSharedFormula.xlsx"); XSSFSheet sheet = wb.getSheetAt(0); - To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org