From 99d0791b5f2ada62f3d39e5dbdf4fe81fa95c892 Mon Sep 17 00:00:00 2001 From: David Colmenares Date: Mon, 25 Oct 2021 17:52:59 -0400 Subject: [PATCH] (optional)Leave [memory]Stream opened for further processing --- OpenXmlPowerTools/PtOpenXmlUtil.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenXmlPowerTools/PtOpenXmlUtil.cs b/OpenXmlPowerTools/PtOpenXmlUtil.cs index c64fc7f4..06144a58 100644 --- a/OpenXmlPowerTools/PtOpenXmlUtil.cs +++ b/OpenXmlPowerTools/PtOpenXmlUtil.cs @@ -1944,10 +1944,10 @@ public bool Compare(MediaData arg) #if !NET35 public static class UriFixer { - public static void FixInvalidUri(Stream fs, Func invalidUriHandler) + public static void FixInvalidUri(Stream fs, Func invalidUriHandler, bool leaveOpen = false) { XNamespace relNs = "http://schemas.openxmlformats.org/package/2006/relationships"; - using (ZipArchive za = new ZipArchive(fs, ZipArchiveMode.Update)) + using (ZipArchive za = new ZipArchive(fs, ZipArchiveMode.Update, leaveOpen)) { foreach (var entry in za.Entries.ToList()) {