Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regression cased by migration to struct inside OpenXML v3 #75

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Clippit/PowerPoint/FluentPresentationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ private void CopyRelatedPartsForContentParts(OpenXmlPart oldContentPart, OpenXml
if (newContentPart.HasRelationship(relId))
continue;

if (oldContentPart.Parts.FirstOrDefault(p => p.RelationshipId == relId) is {} oldPartIdPair)
var oldPartIdPair = oldContentPart.Parts.FirstOrDefault(p => p.RelationshipId == relId);
if (oldPartIdPair != default)
{
var oldPart = oldPartIdPair.OpenXmlPart;
OpenXmlPart newPart = null;
Expand Down Expand Up @@ -751,7 +752,7 @@ private void CopyRelatedPartsForContentParts(OpenXmlPart oldContentPart, OpenXml
continue;

var oldPartIdPair9 = oldContentPart.Parts.FirstOrDefault(p => p.RelationshipId == relId);
if (oldPartIdPair9 is {})
if (oldPartIdPair9 != default)
{
var newPart = _newDocument.PresentationPart.AddCustomXmlPart(CustomXmlPartType.CustomXml);
using (var stream = oldPartIdPair9.OpenXmlPart.GetStream())
Expand Down
6 changes: 4 additions & 2 deletions Clippit/PowerPoint/PresentationBuilderTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ internal static void CopyChartObjects(ChartPart oldChart, ChartPart newChart)
{
var relId = dataReference.Attribute(R.id).Value;

if (oldChart.Parts.FirstOrDefault(p => p.RelationshipId == relId) is {} oldPartIdPair)
var oldPartIdPair = oldChart.Parts.FirstOrDefault(p => p.RelationshipId == relId);
if (oldPartIdPair != default)
{
switch (oldPartIdPair.OpenXmlPart)
{
Expand Down Expand Up @@ -196,7 +197,8 @@ internal static void CopyExtendedChartObjects(ExtendedChartPart oldChart, Extend
{
var relId = dataReference.Attribute(R.id).Value;

if (oldChart.Parts.FirstOrDefault(p => p.RelationshipId == relId) is {} oldPartIdPair)
var oldPartIdPair = oldChart.Parts.FirstOrDefault(p => p.RelationshipId == relId);
if (oldPartIdPair != default)
{
switch (oldPartIdPair.OpenXmlPart)
{
Expand Down
Loading