diff options
author | Jérémie Laval <jeremie.laval@gmail.com> | 2011-10-11 18:13:51 +0400 |
---|---|---|
committer | Jérémie Laval <jeremie.laval@gmail.com> | 2011-10-11 18:14:50 +0400 |
commit | e42fb4ccafdfb6d651777ad110cc9ae4265e726a (patch) | |
tree | 6644d1eca366a05ab3d29d7e4edf7921ea7fb303 /mcs/class/WindowsBase | |
parent | b441b521635f57f996e1209677985fd435ed32ad (diff) |
[WindowsBase] Don't treat special file [Content-Types].xml as a part, ends up as a duplicate when writing back a package
Diffstat (limited to 'mcs/class/WindowsBase')
-rw-r--r-- | mcs/class/WindowsBase/System.IO.Packaging/ZipPackage.cs | 3 | ||||
-rw-r--r-- | mcs/class/WindowsBase/Test/System.IO.Packaging/PackagePartTest.cs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/mcs/class/WindowsBase/System.IO.Packaging/ZipPackage.cs b/mcs/class/WindowsBase/System.IO.Packaging/ZipPackage.cs index 0a113364c52..b6ff1ce50cb 100644 --- a/mcs/class/WindowsBase/System.IO.Packaging/ZipPackage.cs +++ b/mcs/class/WindowsBase/System.IO.Packaging/ZipPackage.cs @@ -157,6 +157,9 @@ namespace System.IO.Packaging { // The file names in the zip archive are not prepended with '/' foreach (string file in archive.GetFiles ()) { + if (file.Equals (ContentUri, StringComparison.Ordinal)) + continue; + XmlNode node; CompressionOption compression = archive.GetCompressionLevel (file); diff --git a/mcs/class/WindowsBase/Test/System.IO.Packaging/PackagePartTest.cs b/mcs/class/WindowsBase/Test/System.IO.Packaging/PackagePartTest.cs index 97aaa5b400d..0abdd2f23a1 100644 --- a/mcs/class/WindowsBase/Test/System.IO.Packaging/PackagePartTest.cs +++ b/mcs/class/WindowsBase/Test/System.IO.Packaging/PackagePartTest.cs @@ -325,11 +325,9 @@ namespace System.IO.Packaging.Tests { }
[Test]
- [ExpectedException (typeof (ArgumentException))]
- [Ignore ("Proper validation of the Uris is not performed")]
public void CheckContentTypes ()
{
- package.PartExists(new Uri ("/[Content_Types].xml", UriKind.Relative));
+ Assert.IsFalse (package.PartExists(new Uri ("[Content_Types].xml", UriKind.Relative)));
}
}
}
|