`PresentationDocument.Save()` doesn't apply changes
- Dominant language
- C#
- Stars
- 4.6k
- Forks
- 605
- PR merge metrics
- No merged PRs in 30d
Description
**Description**
`PresentationDocument.Save()` doesn't apply changes that are deleting presentation sections. It works if I call `doc.Close()` _(check Repro)_, but I don't wanna close presentation before `mStream.ToArray()`.
Looks like `PresentationDocument.Save()` doesn't flush changes to `mStream` stream.
**Information**
- .NET Target: .NET 6
- DocumentFormat.OpenXml Version: 2.16.0
**Repro**
[base.pptx](https://github.com/OfficeDev/Open-XML-SDK/files/8662785/base.pptx)
```csharp
using DocumentFormat.OpenXml.Office2010.PowerPoint;
using DocumentFormat.OpenXml.Packaging;
using var fStream = File.OpenRead(@"c:\temp\base.pptx");
var mStream = new MemoryStream();
fStream.CopyTo(mStream);
fStream.Close();
using var doc = PresentationDocument.Open(mStream, true);
var sectionList = doc.PresentationPart!.Presentation.PresentationExtensionList?.Descendants().First();
sectionList.Remove();
doc.Save();
// doc.Close() // it works
File.WriteAllBytes(@"c:\temp\edited.pptx", mStream.ToArray());
// ...
```
**Observed**
edited.pptx still has section.
**Expected**
edited.pptx doesn't have sections.
Contributor guide
Assessment
This issue has not been assessed yet.