13681 Commits

Author SHA1 Message Date
Dominik Stadler
017ff5f8f8 Implement lazy allocation of data for complex escher properties
This may reduce memory usage if the content is never used
or not populated for some reason.

This should fix https://issues.oss-fuzz.com/issues/42528528
2026-01-10 13:14:34 +01:00
PJ Fanning
cc8b6d7591 Update XWPFTheme.java 2026-01-09 14:35:59 +01:00
Jacobo Aragunde Pérez
6670c48c30
Add getter for body elements in XWPFSDTContent. (#991)
* Add getter for body elements in XWPFSDTContent.

This getter allows to navigate the POI objects stored inside a
XWPFSDTContent object without resorting to navigating XML.

* Address comments in review.
2026-01-09 13:28:30 +01:00
Etienne Gautier
aead782eb2
XWPF Themes: allow public access of theme and add helpers for theme fonts (#986)
* allow public access of theme and add helpers for theme fonts

* nit:naming

* add javadoc and tests

* Fix formatting of getMajorFontForScript method

* Refactor font retrieval methods for null checks

* Update XWPFTheme.java

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2026-01-09 13:09:12 +01:00
Dominik Stadler
c94e795f35 Avoid NPE with broken files when writing endnotes for Word documents
https://issues.oss-fuzz.com/issues/391728757
2026-01-09 08:45:03 +01:00
Dominik Stadler
e9b33c0b08 Avoid NPE with broken files when writing endnotes for Word documents
Fixes https://issues.oss-fuzz.com/issues/392690733
2026-01-09 08:45:03 +01:00
Dominik Stadler
befc941dcf Avoid NPE with broken files when handling paint-style for fill 2026-01-09 08:45:03 +01:00
Dominik Stadler
ac989335d7 Avoid NPE with broken files when handling text-shapes 2026-01-09 08:45:03 +01:00
Dominik Stadler
0ec4434f59 Avoid NPE with broken file 2026-01-09 08:45:03 +01:00
Dominik Stadler
c28aec61d4 Avoid an NPE when reading broken SlideShow-files 2026-01-09 08:45:03 +01:00
Dominik Stadler
b195a3b9ed Avoid an NPE when OPCPackage is closed without being fully initialized 2026-01-06 22:47:00 +01:00
Dominik Stadler
ddf71d0984 Avoid two NPEs which were currently "expected" in tests
When things go wrong, we always want to give an
explanation via an exception instead of an NPE.
2026-01-06 22:47:00 +01:00
Dominik Stadler
fb75600872 Don't throw RuntimeException in integration-tests
This prepares us to include the FileHandlers in fuzz-testing
via oss-fuzz while keeping to not expect any direct
RuntimeException being caught.
2026-01-06 22:47:00 +01:00
PJ Fanning
4dadb9d6cc
Update copyright year in NOTICE file 2026-01-03 14:38:23 +01:00
PJ Fanning
e7515ba5e6 log4j 2.25.3 2025-12-29 13:29:43 +01:00
dependabot[bot]
c1fac56998
Bump log4jVersion from 2.24.3 to 2.25.3 (#975)
Bumps `log4jVersion` from 2.24.3 to 2.25.3.

Updates `org.apache.logging.log4j:log4j-bom` from 2.24.3 to 2.25.3
- [Release notes](https://github.com/apache/logging-log4j2/releases)
- [Changelog](https://github.com/apache/logging-log4j2/blob/2.x/RELEASE-NOTES.adoc)
- [Commits](https://github.com/apache/logging-log4j2/compare/rel/2.24.3...rel/2.25.3)

Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.24.3 to 2.25.3

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-bom
  dependency-version: 2.25.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl
  dependency-version: 2.25.3
  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-12-29 13:27:00 +01:00
PJ Fanning
3a56bbd73b Update TestDetectAsOOXML.java 2025-12-25 11:17:12 +01:00
dependabot[bot]
6d42ff955a
Bump net.bytebuddy:byte-buddy from 1.18.2 to 1.18.3 (#984)
Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.18.2 to 1.18.3.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.18.2...byte-buddy-1.18.3)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-version: 1.18.3
  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-12-22 16:10:05 +01:00
emmanueldufour
528591ba11
Allow to load a word document with chartex chart (#982)
* Allow to load a word document with chartex chart

ChartEx (new charts introduced in Office 2016) will raise exceptions in underlying XML parsing, we catch them here in order to still be able to load the document

* spacing

some extra spaces were unbearable and could have prevented the pull request

* add test

* Update POIXMLDocumentPart.java

* Update POIXMLDocumentPart.java

* Update POIXMLDocumentPart.java

* reduce risk of swallowing zip bomb exceptions

* Update POIXMLDocumentPart.java

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2025-12-19 20:10:25 +01:00
PJ Fanning
c703d00300 Update build.gradle 2025-12-19 17:31:40 +01:00
Dominik Stadler
9e1afbbab1 Fix some more Gradle deprecation-warnings in preparation for Gradle 9
Only signing-handling in poi-ooxml is still remaining, but
this deprecation seems to have been moved to Gradle 10 anyway.

Gradle 9 will require JDK 17, though, so we can only upgrade
when the min. supported JDK is bumped once more.
2025-12-19 16:15:21 +01:00
dependabot[bot]
3ac160b57d
Bump org.sonarqube from 7.2.1.6560 to 7.2.2.6593 (#983)
Bumps org.sonarqube from 7.2.1.6560 to 7.2.2.6593.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.2.6593
  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-12-19 16:09:48 +01:00
PJ Fanning
f2c52141c7
remove pre-existing inline strings when updating value (#962)
* remove pre-existing inline strings when updating value

* Update TestXSSFCell.java
2025-12-18 19:45:50 +01:00
Dominik Stadler
fd66689944 Improve message if test fails 2025-12-17 22:12:41 +01:00
Dominik Stadler
97a97bd75c JavaDoc: Don't link to classes from "poi-ooxml" in module "poi"
Otherwise building javadoc in CI fails sometimes, maybe if
the repository is cleaned before building.

And add some missing javadoc
2025-12-17 22:12:41 +01:00
Dominik Stadler
338882ac88 Convert some files to unix newlines
Otherwise these can cause issues when checking out
sources on Windows
2025-12-17 22:11:29 +01:00
Dominik Stadler
2dd124eb42 Fix some Gradle deprecation warnings
A number of warnings still remain,
they seem a bit more complicated to fix.
2025-12-17 22:11:29 +01:00
PJ Fanning
fe3359bd79
refactor recurse check (#979) 2025-12-17 22:08:23 +01:00
PJ Fanning
6762b5a9fb Revert "Update XSSFCell.java"
This reverts commit 037a001719d3beb8f31cb4022dd34cd28a318c61.
2025-12-17 21:49:08 +01:00
PJ Fanning
037a001719 Update XSSFCell.java 2025-12-17 21:31:06 +01:00
PJ Fanning
3a69605f4c
[bz-69905] check cell before recursing (#978) 2025-12-17 21:29:03 +01:00
dependabot[bot]
08e9bb00d4
Bump org.sonarqube from 7.2.0.6526 to 7.2.1.6560 (#976)
Bumps org.sonarqube from 7.2.0.6526 to 7.2.1.6560.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.1.6560
  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-12-17 21:24:32 +01:00
Jacobo Aragunde Pérez
4fb34ebeae
Fix rules for table style application in XSLFTables. (#969)
* Fix rules for table style application in XSLFTables.

Table styles contain rules for first and last rows/columns, even and
odd rows/columns... When one of these rules is empty, we are supposed
to fall back to the "whole table" rules. The fallback must also be
applied for the format that's not explicitly specified in the specific
rules.

when the corresponding specific rule is missing some info.

Fallback must also be applied when the corresponding specific rule is
missing some info. A couple of examples from the reproducer/test file
included:

The included reproducer/test file contained a few problems related to
table style application:
* The second style for horizontal/vertical banding (band2H, band2V) was
  never applied.
* In the table with horizontal banding enabled, the style band1H did
  not set a font color, POI returned a null font color instead of the
  color from wholeTable.
* In the table with horizontal banding enabled, the style band2H did
  not set a background color, POI returned null instead of the color
  specified in wholeTable.

This patches fixes the behaviors mentioned above, making POI behavior
match the one from MS Office and LibreOffice.

* Replace uses of java.util.list.getFirst().
2025-12-16 18:03:45 +01:00
dependabot[bot]
f476c64179
Bump com.github.spotbugs from 6.4.7 to 6.4.8 (#972)
Bumps com.github.spotbugs from 6.4.7 to 6.4.8.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.8
  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-12-16 15:44:28 +01:00
dependabot[bot]
a9bc28a4bb
Bump org.mockito:mockito-core from 5.20.0 to 5.21.0 (#970)
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.20.0 to 5.21.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.20.0...v5.21.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-version: 5.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-12-15 20:43:46 +01:00
dependabot[bot]
0eb7135f2b
Bump org.sonarqube from 7.1.0.6387 to 7.2.0.6526 (#960)
Bumps org.sonarqube from 7.1.0.6387 to 7.2.0.6526.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.0.6526
  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-12-13 13:06:56 +01:00
hyun1024
4b3c688d51
Add methods to manage first slide number(firstSlideNum) (#968)
* Add methods to manage first slide number(firstSlideNum)

Adds methods to manage the custom starting slide number in XSLF (PowerPoint) presentations. This property is stored as the 'firstSlideNum' attribute in ppt/presentation.xml.

The following methods are added to XMLSlideShow:
- getFirstSlideNumber(): Retrieves the current starting slide number (default is 1).
- setFirstSlideNumber(int num): Sets the custom starting slide number.
- unsetFirstSlideNumber(): Removes the 'firstSlideNum' attribute, reverting to the default (1).

Constraints:
The 'set' method enforces the bounds [0, 9999] as defined by Microsoft's implementation specifications (MS-OI29500, Part 1, Section 19.2.1.26) to ensure the creation of valid PowerPoint files.

Also includes TestXSLFSlideShow updates to cover the new functionality, persistence, and validation checks.

* Review: Apply review feedback to firstSlideNumber feature

- Add @since 6.0.0 Javadoc tag to getFirstSlideNumber(), setFirstSlideNumber(), and unsetFirstSlideNumber() methods in XMLSlideShow.
- Refactor TestXSLFSlideShow to use explicit static JUnit imports (e.g., assertEquals, assertThrows) instead of wildcard imports, adhering to project coding style guidelines.

* whitespace

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2025-12-13 13:06:04 +01:00
PJ Fanning
e4e4582689
add cell tests (#965) 2025-12-08 20:56:38 +01:00
PJ Fanning
027927bfad
[bz-69897] Fix null check for LineDash properties (#964) 2025-12-08 15:47:50 +01:00
PJ Fanning
2098df7467 broken javadoc 2025-12-08 14:04:45 +01:00
PJ Fanning
40ca9bd085 commercial support page 2025-12-08 11:33:53 +01:00
PJ Fanning
88836e1614 add versioning support section 2025-12-08 10:44:42 +01:00
PJ Fanning
e7620b7ce7 set up default impls of new(-ish) methods 2025-12-05 10:58:48 +01:00
PJ Fanning
6d6089eee5
nullSafeFormatProperties (#961) 2025-12-05 10:51:57 +01:00
Dominik Stadler
57ffd3aa12 Remove unused list of pivot-caches and update deprecations
Seems the list is currently never accessed any more.
2025-12-03 21:35:02 +01:00
Dominik Stadler
2428265d35 Update Gradle Wrapper 2025-12-03 21:35:02 +01:00
Dominik Stadler
3d9c243943 Ant-target "javadoc" requires compiled sources 2025-12-03 21:35:02 +01:00
Dominik Stadler
236784371b Update JavaDoc-references to JDK 11 2025-12-03 21:35:02 +01:00
Dominik Stadler
47d0e956b8 Add missing Mockito which is needed for module-based execution of tests
This seems to only fail in Ant-based test-execution for some reason
2025-12-02 20:33:42 +01:00
Dominik Stadler
74bdee9c0d Avoid usage of package org.mockito.internal
Otherwise JUnit tests fail in CI now when
the module-system is used.
2025-12-02 20:33:42 +01:00