Skip to content

Add support for XDDF#1521

Merged
tonyqus merged 19 commits into
nissl-lab:masterfrom
antony-liu:poi/XDDF
Mar 12, 2026
Merged

Add support for XDDF#1521
tonyqus merged 19 commits into
nissl-lab:masterfrom
antony-liu:poi/XDDF

Conversation

@antony-liu
Copy link
Copy Markdown
Collaborator

@antony-liu antony-liu commented Mar 23, 2025

Fix #1143

These changes are mainly from POI 4.0.1

@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Mar 24, 2025

If this PR doesn't break any existing feature, I can directly merge this one to master branch

@Bykiev
Copy link
Copy Markdown
Collaborator

Bykiev commented Mar 31, 2025

Tests should be fixed before merging

@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Apr 6, 2025

I'm working on XSLF namespace migration

@antony-liu antony-liu marked this pull request as ready for review April 9, 2025 10:04
@antony-liu
Copy link
Copy Markdown
Collaborator Author

Migrate XDDF from POI to NPOI, based on POI 4.0.1

@antony-liu
Copy link
Copy Markdown
Collaborator Author

I'm working on XSLF namespace migration

GREAT!

@tonyqus tonyqus modified the milestones: NPOI 2.9.0, NPOI 3.0.0 Jun 2, 2025
@tonyqus tonyqus modified the milestones: NPOI 3.0.0, NPOI 2.8.0 Feb 27, 2026
@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Feb 27, 2026

I'd like to merge this after 2.7.6 release. Please help solve conflicts

# Conflicts:
#	OpenXmlFormats/Drawing/BaseTypes.cs
#	OpenXmlFormats/Drawing/Chart/Chart.cs
#	OpenXmlFormats/Drawing/ShapeEffects.cs
#	OpenXmlFormats/Drawing/ShapeLineProperties.cs
#	OpenXmlFormats/Drawing/TextCharacter.cs
#	OpenXmlFormats/Drawing/spreadsheetShape.cs
#	OpenXmlFormats/Spreadsheet/Sheet/CT_Table.cs
#	ooxml/XSSF/UserModel/Charts/XSSFDateAxis.cs
@antony-liu
Copy link
Copy Markdown
Collaborator Author

Conflicts resolved

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a large set of XDDF (DrawingML) usermodel types and supporting OpenXML format helpers to address #1143, including chart, text, and shape-related APIs.

Changes:

  • Introduces many new XDDF usermodel wrapper types (text + chart) and enum mappings to underlying OpenXML schema types.
  • Extends OpenXmlFormats generated classes with additional IsSet*, Unset*, and AddNew* helpers to support the new XDDF API surface.
  • Adds optional value helpers (Option<T>, ValueOption<T>) and a small numeric utility overload.

Reviewed changes

Copilot reviewed 114 out of 191 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
ooxml/XDDF/UserModel/Text/XDDFShapeAutoFit.cs Adds shape autofit wrapper implementing IXDDFAutoFit.
ooxml/XDDF/UserModel/Text/XDDFNormalAutoFit.cs Adds normal autofit wrapper with scale/reduction accessors.
ooxml/XDDF/UserModel/Text/XDDFNoAutoFit.cs Adds no-autofit wrapper implementing IXDDFAutoFit.
ooxml/XDDF/UserModel/Text/XDDFHyperlink.cs Adds hyperlink wrapper over CT_Hyperlink.
ooxml/XDDF/UserModel/Text/XDDFFont.cs Adds font wrapper mapping FontGroup + CT_TextFont.
ooxml/XDDF/UserModel/Text/XDDFBulletStylePicture.cs Adds picture bullet style wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletStyleNone.cs Adds “no bullet” style wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletStyleCharacter.cs Adds character bullet style wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletStyleAutoNumbered.cs Adds autonumber bullet style wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletStyle.cs Introduces IXDDFBulletStyle marker interface.
ooxml/XDDF/UserModel/Text/XDDFBulletSizePoints.cs Adds bullet size in points wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletSizePercent.cs Adds bullet size in percent wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletSizeFollowText.cs Adds “follow text” bullet size wrapper.
ooxml/XDDF/UserModel/Text/XDDFBulletSize.cs Introduces IXDDFBulletSize marker interface.
ooxml/XDDF/UserModel/Text/XDDFAutoFit.cs Introduces IXDDFAutoFit interface.
ooxml/XDDF/UserModel/Text/UnderlineType.cs Adds underline enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/TextContainer.cs Introduces ITextContainer property resolution helpers.
ooxml/XDDF/UserModel/Text/TextAlignment.cs Adds text alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/TabAlignment.cs Adds tab alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/StrikeType.cs Adds strike enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/FontAlignment.cs Adds font alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/CapsType.cs Adds caps enum + ST mapping helpers.
ooxml/XDDF/UserModel/Text/AnchorType.cs Adds anchor enum + ST mapping helpers.
ooxml/XDDF/UserModel/SystemColor.cs Adds system color enum + ST mapping helpers.
ooxml/XDDF/UserModel/SchemeColor.cs Adds scheme color enum + ST mapping helpers.
ooxml/XDDF/UserModel/RectangleAlignment.cs Adds rectangle alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/PresetLineDash.cs Adds preset line dash enum + ST mapping helpers.
ooxml/XDDF/UserModel/PenAlignment.cs Adds pen alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/PathShadeType.cs Adds path shade enum + ST mapping helpers.
ooxml/XDDF/UserModel/LineEndWidth.cs Adds line end width enum + ST mapping helpers.
ooxml/XDDF/UserModel/LineEndType.cs Adds line end type enum + ST mapping helpers.
ooxml/XDDF/UserModel/LineEndLength.cs Adds line end length enum + ST mapping helpers.
ooxml/XDDF/UserModel/LineCap.cs Adds line cap enum + ST mapping helpers.
ooxml/XDDF/UserModel/HasShapeProperties.cs Adds IHasShapeProperties interface.
ooxml/XDDF/UserModel/CompoundLine.cs Adds compound line enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/XDDFValueAxis.cs Adds value axis wrapper with helper methods.
ooxml/XDDF/UserModel/Chart/XDDFTitle.cs Adds title wrapper with rich-text support.
ooxml/XDDF/UserModel/Chart/XDDFSeriesAxis.cs Adds series axis wrapper.
ooxml/XDDF/UserModel/Chart/XDDFRadarChartData.cs Adds radar chart data wrapper + series implementation.
ooxml/XDDF/UserModel/Chart/XDDFPieChartData.cs Adds pie chart data wrapper + series implementation.
ooxml/XDDF/UserModel/Chart/XDDFNumericalDataSource.cs Adds numerical datasource interface with format code.
ooxml/XDDF/UserModel/Chart/XDDFManualLayout.cs Adds manual layout wrapper with properties.
ooxml/XDDF/UserModel/Chart/XDDFLegendEntry.cs Adds legend entry wrapper + text container implementation.
ooxml/XDDF/UserModel/Chart/XDDFLayout.cs Adds layout wrapper with manual layout support.
ooxml/XDDF/UserModel/Chart/XDDFDateAxis.cs Adds date axis wrapper.
ooxml/XDDF/UserModel/Chart/XDDFDataSource.cs Adds datasource interfaces.
ooxml/XDDF/UserModel/Chart/XDDFChartLegend.cs Adds chart legend wrapper, entries, and layout helpers.
ooxml/XDDF/UserModel/Chart/XDDFChartExtensionList.cs Adds chart extension list wrapper.
ooxml/XDDF/UserModel/Chart/XDDFCategoryDataSource.cs Adds category datasource interface.
ooxml/XDDF/UserModel/Chart/XDDFCategoryAxis.cs Adds category axis wrapper.
ooxml/XDDF/UserModel/Chart/XDDFBarChartData.cs Adds bar chart data wrapper + series implementation.
ooxml/XDDF/UserModel/Chart/ScatterStyle.cs Adds scatter style enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/RadarStyle.cs Adds radar style enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/MarkerStyle.cs Adds marker style enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/LegendPosition.cs Adds legend position enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/LayoutTarget.cs Adds layout target enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/LayoutMode.cs Adds layout mode enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/Grouping.cs Adds grouping enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/DisplayBlanks.cs Adds display blanks enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/ChartTypes.cs Adds ChartTypes enum.
ooxml/XDDF/UserModel/Chart/BarGrouping.cs Adds bar grouping enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/BarDirection.cs Adds bar direction enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisTickMark.cs Adds axis tick mark enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisTickLabelPosition.cs Adds tick label pos enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisPosition.cs Adds axis position enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisOrientation.cs Adds axis orientation enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisLabelAlignment.cs Adds label alignment enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisCrosses.cs Adds axis crosses enum + ST mapping helpers.
ooxml/XDDF/UserModel/Chart/AxisCrossBetween.cs Adds cross-between enum + ST mapping helpers.
ooxml/XDDF/UserModel/BlackWhiteMode.cs Adds black/white mode enum + ST mapping helpers.
ooxml/POIXMLDocumentPart.cs Adds a “committed” flag and short-circuit in OnSave.
ooxml/NPOI.OOXML.Core.csproj Removes an item group entry for preset style xml non-include.
main/Util/Optional/ValueOption.cs Adds ValueOption<T> optional for structs.
main/Util/Optional/OptionalExtensions.cs Adds nullable-to-option helpers.
main/Util/Optional/Option.cs Adds Option<T> optional for reference types.
main/Util/Number.cs Adds IsNumber(Type) overload.
main/NPOI.Core.csproj Adds folder include for optional utilities.
main/Common/UserModel/Fonts/FontPitch.cs Adds font pitch enum + mapping helpers.
main/Common/UserModel/Fonts/FontInfo.cs Adds IFontInfo abstraction.
main/Common/UserModel/Fonts/FontGroup.cs Adds font groups and Unicode range heuristics.
main/Common/UserModel/Fonts/FontFamily.cs Adds font family enum + mapping helpers.
OpenXmlFormats/Spreadsheet/Sheet/CT_Table.cs Fixes table column list initialization + refactors column APIs.
OpenXmlFormats/Drawing/spreadsheetShape.cs Removes duplicate spreadsheet CT_TextBody definition.
OpenXmlFormats/Drawing/TextParagraph.cs Adds many IsSet/Unset/Add/Remove helpers for text objects.
OpenXmlFormats/Drawing/TextBullet.cs Adds UnsetStartAt for autonumber bullets.
OpenXmlFormats/Drawing/Text.cs Adds many IsSet/Unset helpers and default list init for text bodies.
OpenXmlFormats/Drawing/ShapeProperties.cs Adds Unset*/IsSet* and a Set() copier; fixes method casing.
OpenXmlFormats/Drawing/Picture.cs Changes picture fields to be nullable + adds parse support.
OpenXmlFormats/Drawing/Chart/ScatterChart.cs Adds helper methods for series and chart arrays.
OpenXmlFormats/Drawing/Chart/RadarChart.cs Adds helper methods for series creation/flags/arrays.
OpenXmlFormats/Drawing/Chart/PieChart.cs Adds helper methods for series flags and vary colors.
OpenXmlFormats/Drawing/Chart/LineChart.cs Adds helper methods for series and chart arrays.
OpenXmlFormats/Drawing/Chart/BarChart.cs Adds helper methods for chart arrays, gap width, and series helpers.
Comments suppressed due to low confidence (2)

OpenXmlFormats/Drawing/Text.cs:1

  • These setters now always force *Specified = true even when assigning the schema default values. This changes serialization semantics (defaults will always be emitted) and removes the previous “set to default -> treat as unspecified” behavior. If callers relied on clearing attributes by setting defaults, this becomes impossible without explicit Unset* methods. Consider restoring conditional Specified handling or adding/using explicit UnsetLIns/UnsetTIns/… equivalents consistently.


OpenXmlFormats/Drawing/Text.cs:1

  • These setters now always force *Specified = true even when assigning the schema default values. This changes serialization semantics (defaults will always be emitted) and removes the previous “set to default -> treat as unspecified” behavior. If callers relied on clearing attributes by setting defaults, this becomes impossible without explicit Unset* methods. Consider restoring conditional Specified handling or adding/using explicit UnsetLIns/UnsetTIns/… equivalents consistently.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ooxml/XDDF/UserModel/Text/XDDFHyperlink.cs
Comment thread ooxml/XDDF/UserModel/Text/XDDFHyperlink.cs
Comment thread OpenXmlFormats/Drawing/TextParagraph.cs
Comment thread main/Common/UserModel/Fonts/FontFamily.cs
Comment thread main/Common/UserModel/Fonts/FontInfo.cs Outdated
Comment thread ooxml/POIXMLDocumentPart.cs
Comment thread OpenXmlFormats/Spreadsheet/Sheet/CT_Table.cs Outdated
Comment thread ooxml/XDDF/UserModel/Chart/XDDFChartLegend.cs Outdated
Comment thread ooxml/XDDF/UserModel/Chart/XDDFLegendEntry.cs
Comment thread ooxml/XDDF/UserModel/Text/XDDFBulletStyle.cs Outdated
@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Mar 5, 2026

Can you help fix the issues suggested by Copilot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate XDDF from POI to NPOI

4 participants