@@ -28,7 +28,7 @@ static void DuplicateEntry(Entry sourceEntry, Archive targetArchive)
2828 var targetEntry = CreateEntry ( sourceEntry , targetArchive ) ;
2929 using var targetStream = targetEntry . Open ( ) ;
3030
31- if ( IsRelationships ( sourceEntry ) )
31+ if ( sourceEntry . IsRelationships ( ) )
3232 {
3333 var xml = Relationships . PatchRelationships ( sourceStream , true ) ;
3434 SaveXml ( xml , targetStream ) ;
@@ -62,7 +62,7 @@ static async Task DuplicateEntryAsync(Entry sourceEntry, Archive targetArchive,
6262 using var sourceStream = await sourceEntry . OpenAsync ( cancel ) ;
6363 var targetEntry = CreateEntry ( sourceEntry , targetArchive ) ;
6464 using var targetStream = await targetEntry . OpenAsync ( cancel ) ;
65- if ( IsRelationships ( sourceEntry ) )
65+ if ( sourceEntry . IsRelationships ( ) )
6666 {
6767 var xml = Relationships . PatchRelationships ( sourceStream , true ) ;
6868 await SaveXml ( xml , targetStream , cancel ) ;
@@ -92,21 +92,6 @@ static Task SaveXml(XDocument xml, Stream targetStream, Cancel cancel) =>
9292 static void SaveXml ( XDocument xml , Stream targetStream ) =>
9393 xml . Save ( targetStream , SaveOptions . DisableFormatting ) ;
9494
95-
96-
97- static XDocument PatchSheet ( Stream sourceStream )
98- {
99- var xml = XDocument . Load ( sourceStream ) ;
100- return PatchSheet ( xml ) ;
101- }
102-
103- internal static XDocument PatchSheet ( XDocument xml )
104- {
105- XNamespace xr = "http://schemas.microsoft.com/office/spreadsheetml/2014/revision" ;
106- xml . Root ! . Attribute ( xr + "uid" ) ? . Remove ( ) ;
107- return xml ;
108- }
109-
11095 static Entry CreateEntry ( Entry source , Archive target )
11196 {
11297 var entry = target . CreateEntry ( source . FullName , CompressionLevel . Fastest ) ;
@@ -117,7 +102,4 @@ static Entry CreateEntry(Entry source, Archive target)
117102 static bool IsPsmdcp ( Entry entry ) =>
118103 entry . FullName . StartsWith ( "package/services/metadata/core-properties/" ) &&
119104 entry . Name . EndsWith ( "psmdcp" ) ;
120-
121- static bool IsRelationships ( Entry _ ) =>
122- _ . FullName is "_rels/.rels" ;
123105}
0 commit comments