mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
094968cfc3 | ||
|
|
df2ebd6a88 | ||
|
|
9ad8e753a6 | ||
|
|
456550b6c5 | ||
|
|
f9760568da | ||
|
|
11941cc4f7 | ||
|
|
ea0f06ae21 | ||
|
|
faee1813fa | ||
|
|
ec9b9d9c44 | ||
|
|
d472b9c32b | ||
|
|
85cdbcbe13 | ||
|
|
2b6589d4fb | ||
|
|
86e9f9a71c |
4
.github/workflows/test-gradle.yml
vendored
4
.github/workflows/test-gradle.yml
vendored
@ -5,9 +5,9 @@ name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ trunk ]
|
||||
branches: [ trunk, 5.5.x ]
|
||||
pull_request:
|
||||
branches: [ trunk ]
|
||||
branches: [ trunk, 5.5.x ]
|
||||
|
||||
permissions: {}
|
||||
|
||||
|
||||
12
build.gradle
12
build.gradle
@ -89,7 +89,7 @@ allprojects {
|
||||
// apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
version = '5.5.0'
|
||||
version = '5.5.1'
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,10 +107,10 @@ subprojects {
|
||||
apply plugin: 'com.adarshr.test-logger'
|
||||
|
||||
ext {
|
||||
bouncyCastleVersion = '1.82'
|
||||
commonsCodecVersion = '1.19.0'
|
||||
bouncyCastleVersion = '1.83'
|
||||
commonsCodecVersion = '1.20.0'
|
||||
commonsCompressVersion = '1.28.0'
|
||||
commonsIoVersion = '2.20.0'
|
||||
commonsIoVersion = '2.21.0'
|
||||
commonsMathVersion = '3.6.1'
|
||||
junitVersion = '5.13.4'
|
||||
log4jVersion = '2.24.3'
|
||||
@ -119,7 +119,7 @@ subprojects {
|
||||
xmlbeansVersion = '5.3.0'
|
||||
batikVersion = '1.19'
|
||||
graphics2dVersion = '3.0.5'
|
||||
pdfboxVersion = '3.0.5'
|
||||
pdfboxVersion = '3.0.6'
|
||||
saxonVersion = '12.9'
|
||||
xmlSecVersion = '3.0.6'
|
||||
apiGuardianVersion = '1.1.2'
|
||||
@ -132,7 +132,7 @@ subprojects {
|
||||
JAVA9_OUT = layout.buildDirectory.dir('classes/java9/main/').get().asFile.absolutePath
|
||||
TEST9_SRC = 'src/test/java9'
|
||||
TEST9_OUT = layout.buildDirectory.dir('classes/java9/test/').get().asFile.absolutePath
|
||||
VERSIONS9 = 'META-INF/versions/9'
|
||||
VERSIONS9 = '/META-INF/versions/9'
|
||||
|
||||
NO_SCRATCHPAD = (findProperty("scratchpad.ignore") == "true")
|
||||
SAXON_TEST = (findProperty("saxon.test") == "true")
|
||||
|
||||
@ -42,7 +42,7 @@ under the License.
|
||||
|
||||
<description>The Apache POI project Ant build.</description>
|
||||
|
||||
<property name="version.id" value="5.5.0"/>
|
||||
<property name="version.id" value="5.5.1"/>
|
||||
<property name="release.rc" value=""/>
|
||||
|
||||
<property environment="env"/>
|
||||
|
||||
@ -1,3 +1,20 @@
|
||||
/* ====================================================================
|
||||
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.
|
||||
==================================================================== */
|
||||
|
||||
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
|
||||
// Apache POI uses on the public Jenkins instance at https://ci-builds.apache.org/job/POI/
|
||||
//
|
||||
|
||||
@ -24,12 +24,12 @@
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-bundle</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<version>5.5.0</version>
|
||||
<version>5.5.1</version>
|
||||
|
||||
<name>Apache POI OSGi bundle</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<poi.version>5.5.0</poi.version>
|
||||
<poi.version>5.5.1</poi.version>
|
||||
<pax.exam.version>4.14.0</pax.exam.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow>
|
||||
* Use this to create new cells within the row and return it.
|
||||
* <p>
|
||||
* The cell that is returned is a {@link CellType#BLANK}. The type can be changed
|
||||
* either through calling {@code setCellValue} or {@code setCellType}.
|
||||
* either through calling {@code setCellValue} or {@code setCellFormula}.
|
||||
*
|
||||
* @param column - the column number this cell represents (zero-based)
|
||||
* @return Cell a high level representation of the created cell.
|
||||
@ -128,7 +128,7 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow>
|
||||
* Use this to create new cells within the row and return it.
|
||||
* <p>
|
||||
* The cell that is returned is a {@link CellType#BLANK}. The type can be changed
|
||||
* either through calling setCellValue or setCellType.
|
||||
* either through calling setCellValue or setCellFormula.
|
||||
*
|
||||
* @param column - the column number this cell represents (zero-based)
|
||||
* @return Cell a high level representation of the created cell.
|
||||
|
||||
@ -187,7 +187,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||
* Use this to create new cells within the row and return it.
|
||||
* <p>
|
||||
* The cell that is returned is a {@link CellType#BLANK}. The type can be changed
|
||||
* either through calling {@code setCellValue} or {@code setCellType}.
|
||||
* either through calling {@code setCellValue} or {@code setCellFormula}.
|
||||
* </p>
|
||||
* @param columnIndex - the column number this cell represents
|
||||
* @return Cell a high level representation of the created cell.
|
||||
|
||||
@ -1457,6 +1457,9 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
||||
*/
|
||||
private CTSpacing getCTSpacing(boolean create) {
|
||||
CTPPr pr = getCTPPr(create);
|
||||
if (pr == null) {
|
||||
return null;
|
||||
}
|
||||
CTSpacing ct = pr.getSpacing();
|
||||
if (create && ct == null) {
|
||||
ct = pr.addNewSpacing();
|
||||
|
||||
@ -71,7 +71,6 @@ class TestXSSFSheetShiftRowsAndColumns {
|
||||
final XSSFRow row = sheet.createRow(nRow);
|
||||
for (int nCol = 0; nCol < numCols; ++nCol) {
|
||||
final XSSFCell cell = row.createCell(nCol);
|
||||
cell.setCellType(CellType.STRING);
|
||||
cell.setCellValue(String.format(Locale.US, "Row %d col %d", nRow, nCol));
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,6 +921,50 @@ public final class TestXWPFParagraph {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGettersWithEmptyParagraphProperties() throws IOException {
|
||||
try (XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("emptyPPr.docx")) {
|
||||
XWPFParagraph p = doc.getParagraphArray(0);
|
||||
|
||||
assertNull(p.getNumID());
|
||||
assertNull(p.getNumIlvl());
|
||||
assertNull(p.getNumFmt());
|
||||
assertNull(p.getNumLevelText());
|
||||
assertNull(p.getNumStartOverride());
|
||||
assertFalse(p.isKeepNext());
|
||||
|
||||
assertFalse(p.isAlignmentSet());
|
||||
assertEquals(ParagraphAlignment.LEFT, p.getAlignment());
|
||||
assertEquals(TextAlignment.AUTO, p.getVerticalAlignment());
|
||||
|
||||
assertEquals(Borders.NONE, p.getBorderTop());
|
||||
assertEquals(Borders.NONE, p.getBorderBottom());
|
||||
assertEquals(Borders.NONE, p.getBorderLeft());
|
||||
assertEquals(Borders.NONE, p.getBorderRight());
|
||||
assertEquals(Borders.NONE, p.getBorderBetween());
|
||||
|
||||
assertEquals(-1, p.getSpacingAfter());
|
||||
assertEquals(-1, p.getSpacingAfterLines());
|
||||
assertEquals(-1, p.getSpacingBefore());
|
||||
assertEquals(-1, p.getSpacingBeforeLines());
|
||||
assertEquals(-1, p.getSpacingBetween());
|
||||
assertEquals(LineSpacingRule.AUTO, p.getSpacingLineRule());
|
||||
|
||||
assertEquals(-1, p.getIndentationLeft());
|
||||
assertEquals(-1, p.getIndentationLeftChars());
|
||||
assertEquals(-1, p.getIndentationRight());
|
||||
assertEquals(-1, p.getIndentationRightChars());
|
||||
assertEquals(-1, p.getIndentationHanging());
|
||||
assertEquals(-1, p.getIndentationFirstLine());
|
||||
|
||||
assertFalse(p.isPageBreak());
|
||||
assertFalse(p.isWordWrapped());
|
||||
|
||||
assertNull(p.getStyleID());
|
||||
assertNull(p.getStyle());
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkSearchText(XWPFParagraph paragraph, String search, int beginRun, int endRun, int beginText, int endText,
|
||||
int beginChar, int endChar) {
|
||||
TextSegment result = paragraph.searchText(search, new PositionInParagraph());
|
||||
|
||||
@ -114,7 +114,7 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
|
||||
* Use this to create new cells within the row and return it.
|
||||
* <p>
|
||||
* The cell that is returned is a {@link CellType#BLANK}. The type can be changed
|
||||
* either through calling <code>setCellValue</code> or <code>setCellType</code>.
|
||||
* either through calling <code>setCellValue</code> or <code>setCellFormula</code>.
|
||||
*
|
||||
* @param column - the column number this cell represents
|
||||
*
|
||||
@ -125,7 +125,7 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
|
||||
@Override
|
||||
public HSSFCell createCell(int column)
|
||||
{
|
||||
return this.createCell(column,CellType.BLANK);
|
||||
return this.createCell(column, CellType.BLANK);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +133,7 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> {
|
||||
* <p>
|
||||
* The cell that is returned will be of the requested type.
|
||||
* The type can be changed either through calling setCellValue
|
||||
* or setCellType, but there is a small overhead to doing this,
|
||||
* or setCellFormula, but there is a small overhead to doing this,
|
||||
* so it is best to create the required type up front.
|
||||
*
|
||||
* @param columnIndex - the column number this cell represents
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
/* Copyright 2004 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.
|
||||
* 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.
|
||||
*/
|
||||
/* ====================================================================
|
||||
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.logging;
|
||||
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
/* Copyright 2004 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.
|
||||
* 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.
|
||||
*/
|
||||
/* ====================================================================
|
||||
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.logging;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ public interface Row extends Iterable<Cell> {
|
||||
* Use this to create new cells within the row and return it.
|
||||
* <p>
|
||||
* The cell that is returned is a {@link CellType#BLANK}. The type can be changed
|
||||
* either through calling <code>setCellValue</code> or <code>setCellType</code>.
|
||||
* either through calling <code>setCellValue</code> or <code>setCellFormula</code>.
|
||||
*
|
||||
* @param column - the column number this cell represents
|
||||
* @return Cell a high level representation of the created cell.
|
||||
@ -44,7 +44,7 @@ public interface Row extends Iterable<Cell> {
|
||||
* <p>
|
||||
* The cell that is returned will be of the requested type.
|
||||
* The type can be changed either through calling setCellValue
|
||||
* or setCellType, but there is a small overhead to doing this,
|
||||
* or setCellFormula, but there is a small overhead to doing this,
|
||||
* so it is best to create of the required type up front.
|
||||
*
|
||||
* @param column - the column number this cell represents
|
||||
|
||||
BIN
test-data/document/emptyPPr.docx
Normal file
BIN
test-data/document/emptyPPr.docx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user