Compare commits

...

13 Commits

Author SHA1 Message Date
dependabot[bot]
094968cfc3 Bump bouncyCastleVersion from 1.82 to 1.83 (#953)
Bumps `bouncyCastleVersion` from 1.82 to 1.83.

Updates `org.bouncycastle:bcpkix-jdk18on` from 1.82 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Updates `org.bouncycastle:bcutil-jdk18on` from 1.82 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

---
updated-dependencies:
- dependency-name: org.bouncycastle:bcpkix-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.bouncycastle:bcutil-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 20:52:50 +01:00
PJ Fanning
df2ebd6a88 license headers 2025-11-26 13:42:28 +01:00
Jacobo Aragunde Pérez
9ad8e753a6 Fix NPE in XWPFParagraph.getCTSpacing(). (#950)
We recently changed the getters so they don't create the PPr object if
it doesn't exist, but we missed adding one null check for the new
situation.

Add a test to exercise all the getters in a case where there isn't a PPr
object.
2025-11-24 20:44:49 +01:00
dependabot[bot]
456550b6c5 Bump commons-codec:commons-codec from 1.19.0 to 1.20.0 (#946)
Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.19.0 to 1.20.0.
- [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.19.0...rel/commons-codec-1.20.0)

---
updated-dependencies:
- dependency-name: commons-codec:commons-codec
  dependency-version: 1.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 15:29:03 +01:00
PJ Fanning
f9760568da reduce use of setCellType (#943) 2025-11-20 15:09:29 +01:00
PJ Fanning
11941cc4f7 prepare 5.5.1 2025-11-19 00:36:22 +01:00
dependabot[bot]
ea0f06ae21 Bump org.apache.pdfbox:pdfbox from 3.0.5 to 3.0.6 (#938)
Bumps org.apache.pdfbox:pdfbox from 3.0.5 to 3.0.6.

---
updated-dependencies:
- dependency-name: org.apache.pdfbox:pdfbox
  dependency-version: 3.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 23:13:31 +01:00
dependabot[bot]
faee1813fa Bump commons-io:commons-io from 2.20.0 to 2.21.0 (#937)
Bumps [commons-io:commons-io](https://github.com/apache/commons-io) from 2.20.0 to 2.21.0.
- [Changelog](https://github.com/apache/commons-io/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-io/compare/rel/commons-io-2.20.0...rel/commons-io-2.21.0)

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-version: 2.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 23:13:31 +01:00
PJ Fanning
ec9b9d9c44 try to fix issue with missing module-info classes 2025-11-17 17:02:38 +01:00
PJ Fanning
d472b9c32b Revert "test with java 8 on 5.5.x branch"
This reverts commit 85cdbcbe131aedfdf3775454c1a73e38180b51ea.
2025-11-17 15:19:43 +01:00
PJ Fanning
85cdbcbe13 test with java 8 on 5.5.x branch 2025-11-17 15:05:33 +01:00
PJ Fanning
2b6589d4fb 5.5.1-SNAPSHOT 2025-11-17 15:01:42 +01:00
PJ Fanning
86e9f9a71c Update test-gradle.yml 2025-11-17 15:00:49 +01:00
15 changed files with 115 additions and 48 deletions

View File

@ -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: {}

View File

@ -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")

View File

@ -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"/>

View File

@ -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/
//

View File

@ -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>

View File

@ -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.

View File

@ -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.

View File

@ -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();

View File

@ -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));
}
}

View File

@ -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());

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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

Binary file not shown.