diff --git a/OpenXmlFormats/Vml/Main.cs b/OpenXmlFormats/Vml/Main.cs index 200143488..c4c8a2970 100644 --- a/OpenXmlFormats/Vml/Main.cs +++ b/OpenXmlFormats/Vml/Main.cs @@ -11,6 +11,7 @@ using System.Text; using System.ComponentModel; using NPOI.OpenXml4Net.Util; +using NPOI.Util; namespace NPOI.OpenXmlFormats.Vml { @@ -634,6 +635,7 @@ public class CT_Shape { private ST_TrueFalse strokedField; private string wrapcoordsField; + private string _xml; public static CT_Shape Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) @@ -693,11 +695,28 @@ public static CT_Shape Parse(XmlNode node, XmlNamespaceManager namespaceManager) else if (childNode.LocalName == "ClientData") ctObj.ClientData.Add(CT_ClientData.Parse(childNode, namespaceManager)); } + ctObj._xml = node.OuterXml; return ctObj; } - + public override string ToString() + { + if(string.IsNullOrEmpty(this._xml)) + { + using(MemoryStream out1 = new MemoryStream()) + using(StreamWriter sw = new StreamWriter(out1)) + { + Write(sw, "shape"); + return Encoding.UTF8.GetString(out1.ToArray()); + } + } + else + { + return this._xml; + } + + } public void Write(StreamWriter sw, string nodeName) { sw.Write(string.Format(" + /// + /// Simple FilterInputStream that can replace occurrences of bytes with something else. + /// + /// + /// This has been taken from inbot-utils. (MIT licensed) + /// + /// + /// @see inbot-utils + public class ReplacingInputStream : FilterInputStream + { + + // while matching, this is where the bytes go. + int[] buf; + private int matchedIndex=0; + private int unbufferIndex=0; + private int replacedIndex=0; + + private byte[] pattern; + private byte[] replacement; + private State state=State.NOT_MATCHED; + + // simple state machine for keeping track of what we are doing + private enum State + { + NOT_MATCHED, + MATCHING, + REPLACING, + UNBUFFER + } + + //private static Charset UTF8 = Charset.forName("UTF-8"); + + /// + /// Replace occurrences of pattern in the input. Note: input is assumed to be UTF-8 encoded. If not the case use byte[] based pattern and replacement. + /// + /// input + /// pattern to replace. + /// the replacement or null + public ReplacingInputStream(InputStream in1, String pattern, String replacement) + : this(in1, Encoding.UTF8.GetBytes(pattern), replacement==null ? null : Encoding.UTF8.GetBytes(replacement)) + { + + } + + /// + /// + /// Replace occurrences of pattern in the input. + /// + /// + /// If you want to normalize line endings DOS/MAC (\n\r | \r) to UNIX (\n), you can call the following:
+ /// {@code new ReplacingInputStream(new ReplacingInputStream(is, "\n\r", "\n"), "\r", "\n")} + ///
+ ///
+ /// input + /// pattern to replace + /// the replacement or null + public ReplacingInputStream(InputStream in1, byte[] pattern, byte[] replacement) + : base(in1) + { + ; + if(pattern == null || pattern.Length == 0) + { + throw new ArgumentException("pattern length should be > 0"); + } + this.pattern = pattern; + this.replacement = replacement; + // we will never match more than the pattern length + buf = new int[pattern.Length]; + } + public override int Read(byte[] b, int off, int len) + { + + // copy of parent logic; we need to call our own read() instead of super.read(), which delegates instead of calling our read + if(b == null) + { + throw new NullReferenceException(); + } + else if(off < 0 || len < 0 || len > b.Length - off) + { + throw new IndexOutOfRangeException(); + } + else if(len == 0) + { + return 0; + } + + int c = Read(); + if(c == -1) + { + return -1; + } + b[off] = (byte) c; + + int i = 1; + for(; i < len; i++) + { + c = Read(); + if(c == -1) + { + break; + } + b[off + i] = (byte) c; + } + return i; + + } + public override int Read(byte[] b) + { + + // call our own read + return Read(b, 0, b.Length); + } + public override int Read() + { + + // use a simple state machine to figure out what we are doing + int next; + switch(state) + { + default: + case State.NOT_MATCHED: + // we are not currently matching, replacing, or unbuffering + next=base.Read(); + if(pattern[0] != next) + { + return next; + } + + // clear whatever was there + Arrays.Fill(buf, 0); + // make sure we start at 0 + matchedIndex=0; + + buf[matchedIndex++]=next; + if(pattern.Length == 1) + { + // edge-case when the pattern length is 1 we go straight to replacing + state=State.REPLACING; + // reset replace counter + replacedIndex=0; + } + else + { + // pattern of length 1 + state=State.MATCHING; + } + // recurse to continue matching + return Read(); + + case State.MATCHING: + // the previous bytes matched part of the pattern + next=base.Read(); + if(pattern[matchedIndex]==next) + { + buf[matchedIndex++]=next; + if(matchedIndex==pattern.Length) + { + // we've found a full match! + if(replacement==null || replacement.Length==0) + { + // the replacement is empty, go straight to NOT_MATCHED + state=State.NOT_MATCHED; + matchedIndex=0; + } + else + { + // start replacing + state=State.REPLACING; + replacedIndex=0; + } + } + } + else + { + // mismatch -> unbuffer + buf[matchedIndex++]=next; + state=State.UNBUFFER; + unbufferIndex=0; + } + return Read(); + + case State.REPLACING: + // we've fully matched the pattern and are returning bytes from the replacement + next=replacement[replacedIndex++]; + if(replacedIndex==replacement.Length) + { + state=State.NOT_MATCHED; + replacedIndex=0; + } + return next; + + case State.UNBUFFER: + // we partially matched the pattern before encountering a non matching byte + // we need to serve up the buffered bytes before we go back to NOT_MATCHED + next=buf[unbufferIndex++]; + if(unbufferIndex==matchedIndex) + { + state=State.NOT_MATCHED; + matchedIndex=0; + } + return next; + } + } + public override String ToString() + { + return state.ToString() + " " + matchedIndex + " " + replacedIndex + " " + unbufferIndex; + } + + } +} + diff --git a/ooxml/XSSF/UserModel/XSSFVMLDrawing.cs b/ooxml/XSSF/UserModel/XSSFVMLDrawing.cs index d28f1f575..9ffb52844 100644 --- a/ooxml/XSSF/UserModel/XSSFVMLDrawing.cs +++ b/ooxml/XSSF/UserModel/XSSFVMLDrawing.cs @@ -29,6 +29,7 @@ limitations under the License. using NPOI.OpenXmlFormats.Vml.Spreadsheet; using System.Text; using ICSharpCode.SharpZipLib.Zip.Compression.Streams; +using NPOI.Util; namespace NPOI.XSSF.UserModel { @@ -116,7 +117,7 @@ internal void Read(Stream is1) //Stream vmlsm = new EvilUnclosedBRFixingInputStream(is1); --TODO:: add later doc.LoadXml( - data.Replace("
","").Replace("
", "") + data.Replace("
", "
").Replace("
", "
") ); XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); diff --git a/ooxml/XSSF/Util/EvilUnclosedBRFixingInputStream.cs b/ooxml/XSSF/Util/EvilUnclosedBRFixingInputStream.cs index 0e0e514d8..80dbb41ab 100644 --- a/ooxml/XSSF/Util/EvilUnclosedBRFixingInputStream.cs +++ b/ooxml/XSSF/Util/EvilUnclosedBRFixingInputStream.cs @@ -17,6 +17,7 @@ limitations under the License. using System.IO; using System; using System.Collections.Generic; +using NPOI.Util; namespace NPOI.XSSF.Util { @@ -36,272 +37,281 @@ namespace NPOI.XSSF.Util * It should only be used where experience Shows the problem * can occur... */ - public class EvilUnclosedBRFixingInputStream : Stream + [Obsolete("use ReplacingInputStream(source, \">br<\", \">br/<\")")] + public class EvilUnclosedBRFixingInputStream : ReplacingInputStream { - private Stream source; - private byte[] spare; - - private static byte[] detect = new byte[] { - (byte)'<', (byte)'b', (byte)'r', (byte)'>' - }; - - public EvilUnclosedBRFixingInputStream(Stream source) - { - this.source = source; - } - - /** - * Warning - doesn't fix! - */ - - public int Read() - { - return source.ReadByte(); - } - - - public override int Read(byte[] b, int off, int len) - { - // Grab any data left from last time - int readA = ReadFromSpare(b, off, len); - - // Now read from the stream - int readB = source.Read(b, off + readA, len - readA); - - // Figure out how much we've done - int read; - if (readB == -1 || readB == 0) - { - if (readA == 0) - { - return readB; - } - read = readA; - } - else - { - read = readA + readB; - } - - // Fix up our data - if (read > 0) - { - read = fixUp(b, off, read); - } - - // All done - return read; - } - - - public int Read(byte[] b) - { - return this.Read(b, 0, b.Length); - } - - /** - * Reads into the buffer from the spare bytes - */ - private int ReadFromSpare(byte[] b, int offset, int len) - { - if (spare == null) return 0; - if (len == 0) throw new ArgumentException("Asked to read 0 bytes"); - - if (spare.Length <= len) - { - // All fits, good - Array.Copy(spare, 0, b, offset, spare.Length); - int read = spare.Length; - spare = null; - return read; - } - else - { - // We have more spare than they can copy with... - byte[] newspare = new byte[spare.Length - len]; - Array.Copy(spare, 0, b, offset, len); - Array.Copy(spare, len, newspare, 0, newspare.Length); - spare = newspare; - return len; - } - } - private void AddToSpare(byte[] b, int offset, int len, bool atTheEnd) - { - if (spare == null) - { - spare = new byte[len]; - Array.Copy(b, offset, spare, 0, len); - } - else - { - byte[] newspare = new byte[spare.Length + len]; - if (atTheEnd) - { - Array.Copy(spare, 0, newspare, 0, spare.Length); - Array.Copy(b, offset, newspare, spare.Length, len); - } - else - { - Array.Copy(b, offset, newspare, 0, len); - Array.Copy(spare, 0, newspare, len, spare.Length); - } - spare = newspare; - } - } - - private int fixUp(byte[] b, int offset, int read) - { - // Do we have any potential overhanging ones? - for (int i = 0; i < detect.Length - 1; i++) - { - int base1 = offset + read - 1 - i; - if (base1 < 0) continue; - - bool going = true; - for (int j = 0; j <= i && going; j++) - { - if (b[base1 + j] == detect[j]) - { - // Matches - } - else - { - going = false; - } - } - if (going) - { - // There could be a
handing over the end, eg fixAt = new List(); - for (int i = offset; i <= offset + read - detect.Length; i++) - { - bool going = true; - for (int j = 0; j < detect.Length && going; j++) - { - if (b[i + j] != detect[j]) - { - going = false; - } - } - if (going) - { - fixAt.Add(i); - } - } - - if (fixAt.Count == 0) - { - return read; - } - - // If there isn't space in the buffer to contain - // all the fixes, then save the overshoot for next time - int needed = offset + read + fixAt.Count; - int overshoot = needed - b.Length; - if (overshoot > 0) - { - // Make sure we don't loose part of a
! - int fixes = 0; - foreach (int at in fixAt) - { - if (at > offset + read - detect.Length - overshoot - fixes) - { - overshoot = needed - at - 1 - fixes; - break; - } - fixes++; - } - - AddToSpare(b, offset + read - overshoot, overshoot, false); - read -= overshoot; - } - - // Fix them, in reverse order so the - // positions are valid - for (int j = fixAt.Count - 1; j >= 0; j--) - { - int i = fixAt[j]; - if (i >= read + offset) - { - // This one has Moved into the overshoot - continue; - } - if (i > read - 3) - { - // This one has Moved into the overshoot - continue; - } - - byte[] tmp = new byte[read - i - 3]; - Array.Copy(b, i + 3, tmp, 0, tmp.Length); - b[i + 3] = (byte)'/'; - Array.Copy(tmp, 0, b, i + 4, tmp.Length); - // It got one longer - read++; - } - return read; - } - - public override bool CanRead + public EvilUnclosedBRFixingInputStream(InputStream source) + : base(source, "
", "
") { - get { return true; } - } - public override bool CanSeek - { - get { return true; } - } - - public override bool CanWrite - { - get { return false; } - } - - public override void Flush() - { - - } - - public override long Length - { - get { return source.Length; } - } - - public override long Position - { - get - { - return source.Position; - } - set - { - source.Position = value; - } - } - - public override long Seek(long offset, SeekOrigin origin) - { - return source.Seek(offset, origin); - } - - public override void SetLength(long value) - { - throw new InvalidOperationException(); - } - - public override void Write(byte[] buffer, int offset, int count) - { - throw new InvalidOperationException(); } } + //public class EvilUnclosedBRFixingInputStream : Stream + //{ + // private Stream source; + // private byte[] spare; + + // private static byte[] detect = new byte[] { + // (byte)'<', (byte)'b', (byte)'r', (byte)'>' + // }; + + // public EvilUnclosedBRFixingInputStream(Stream source) + // { + // this.source = source; + // } + + // /** + // * Warning - doesn't fix! + // */ + + // public int Read() + // { + // return source.ReadByte(); + // } + + + // public override int Read(byte[] b, int off, int len) + // { + // // Grab any data left from last time + // int readA = ReadFromSpare(b, off, len); + + // // Now read from the stream + // int readB = source.Read(b, off + readA, len - readA); + + // // Figure out how much we've done + // int read; + // if (readB == -1 || readB == 0) + // { + // if (readA == 0) + // { + // return readB; + // } + // read = readA; + // } + // else + // { + // read = readA + readB; + // } + + // // Fix up our data + // if (read > 0) + // { + // read = fixUp(b, off, read); + // } + + // // All done + // return read; + // } + + + // public int Read(byte[] b) + // { + // return this.Read(b, 0, b.Length); + // } + + // /** + // * Reads into the buffer from the spare bytes + // */ + // private int ReadFromSpare(byte[] b, int offset, int len) + // { + // if (spare == null) return 0; + // if (len == 0) throw new ArgumentException("Asked to read 0 bytes"); + + // if (spare.Length <= len) + // { + // // All fits, good + // Array.Copy(spare, 0, b, offset, spare.Length); + // int read = spare.Length; + // spare = null; + // return read; + // } + // else + // { + // // We have more spare than they can copy with... + // byte[] newspare = new byte[spare.Length - len]; + // Array.Copy(spare, 0, b, offset, len); + // Array.Copy(spare, len, newspare, 0, newspare.Length); + // spare = newspare; + // return len; + // } + // } + // private void AddToSpare(byte[] b, int offset, int len, bool atTheEnd) + // { + // if (spare == null) + // { + // spare = new byte[len]; + // Array.Copy(b, offset, spare, 0, len); + // } + // else + // { + // byte[] newspare = new byte[spare.Length + len]; + // if (atTheEnd) + // { + // Array.Copy(spare, 0, newspare, 0, spare.Length); + // Array.Copy(b, offset, newspare, spare.Length, len); + // } + // else + // { + // Array.Copy(b, offset, newspare, 0, len); + // Array.Copy(spare, 0, newspare, len, spare.Length); + // } + // spare = newspare; + // } + // } + + // private int fixUp(byte[] b, int offset, int read) + // { + // // Do we have any potential overhanging ones? + // for (int i = 0; i < detect.Length - 1; i++) + // { + // int base1 = offset + read - 1 - i; + // if (base1 < 0) continue; + + // bool going = true; + // for (int j = 0; j <= i && going; j++) + // { + // if (b[base1 + j] == detect[j]) + // { + // // Matches + // } + // else + // { + // going = false; + // } + // } + // if (going) + // { + // // There could be a
handing over the end, eg fixAt = new List(); + // for (int i = offset; i <= offset + read - detect.Length; i++) + // { + // bool going = true; + // for (int j = 0; j < detect.Length && going; j++) + // { + // if (b[i + j] != detect[j]) + // { + // going = false; + // } + // } + // if (going) + // { + // fixAt.Add(i); + // } + // } + + // if (fixAt.Count == 0) + // { + // return read; + // } + + // // If there isn't space in the buffer to contain + // // all the fixes, then save the overshoot for next time + // int needed = offset + read + fixAt.Count; + // int overshoot = needed - b.Length; + // if (overshoot > 0) + // { + // // Make sure we don't loose part of a
! + // int fixes = 0; + // foreach (int at in fixAt) + // { + // if (at > offset + read - detect.Length - overshoot - fixes) + // { + // overshoot = needed - at - 1 - fixes; + // break; + // } + // fixes++; + // } + + // AddToSpare(b, offset + read - overshoot, overshoot, false); + // read -= overshoot; + // } + + // // Fix them, in reverse order so the + // // positions are valid + // for (int j = fixAt.Count - 1; j >= 0; j--) + // { + // int i = fixAt[j]; + // if (i >= read + offset) + // { + // // This one has Moved into the overshoot + // continue; + // } + // if (i > read - 3) + // { + // // This one has Moved into the overshoot + // continue; + // } + + // byte[] tmp = new byte[read - i - 3]; + // Array.Copy(b, i + 3, tmp, 0, tmp.Length); + // b[i + 3] = (byte)'/'; + // Array.Copy(tmp, 0, b, i + 4, tmp.Length); + // // It got one longer + // read++; + // } + // return read; + // } + + // public override bool CanRead + // { + // get { return true; } + // } + + // public override bool CanSeek + // { + // get { return true; } + // } + + // public override bool CanWrite + // { + // get { return false; } + // } + + // public override void Flush() + // { + + // } + + // public override long Length + // { + // get { return source.Length; } + // } + + // public override long Position + // { + // get + // { + // return source.Position; + // } + // set + // { + // source.Position = value; + // } + // } + + // public override long Seek(long offset, SeekOrigin origin) + // { + // return source.Seek(offset, origin); + // } + + // public override void SetLength(long value) + // { + // throw new InvalidOperationException(); + // } + + // public override void Write(byte[] buffer, int offset, int count) + // { + // throw new InvalidOperationException(); + // } + //} } diff --git a/testcases/ooxml/XSSF/UserModel/TestXSSFVMLDrawing.cs b/testcases/ooxml/XSSF/UserModel/TestXSSFVMLDrawing.cs index 98d825f06..96c16fa7d 100644 --- a/testcases/ooxml/XSSF/UserModel/TestXSSFVMLDrawing.cs +++ b/testcases/ooxml/XSSF/UserModel/TestXSSFVMLDrawing.cs @@ -22,6 +22,7 @@ limitations under the License. using System; using System.Collections; using System.IO; +using System.Text.RegularExpressions; namespace TestCases.XSSF.UserModel { @@ -47,7 +48,7 @@ public void TestNew() Assert.IsTrue(items[1] is CT_Shapetype); CT_Shapetype type = (CT_Shapetype)items[1]; Assert.AreEqual("21600,21600", type.coordsize); - Assert.AreEqual(202.0f, type.spt); + Assert.AreEqual(202.0f, type.spt, 0); Assert.AreEqual("m,l,21600r21600,l21600,xe", type.path2); Assert.AreEqual("_x0000_t202", type.id); Assert.AreEqual(NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t, type.path.gradientshapeok); @@ -79,7 +80,7 @@ public void TestNew() //each of the properties of CT_ClientData should occurs 0 or 1 times, and CT_ClientData has multiple properties. //Assert.AreEqual("[]", cldata.GetVisibleList().ToString()); Assert.AreEqual(ST_TrueFalseBlank.NONE, cldata.visible); - cldata.visible = (ST_TrueFalseBlank)Enum.Parse(typeof(ST_TrueFalseBlank), "true"); + cldata.visible = (ST_TrueFalseBlank) Enum.Parse(typeof(ST_TrueFalseBlank), "true"); Assert.AreEqual(ST_TrueFalseBlank.@true, cldata.visible); //serialize and read again MemoryStream out1 = new MemoryStream(); @@ -173,27 +174,27 @@ public void TestCommentShowsBox() XSSFVMLDrawing vml = sheet.GetVMLDrawing(false); CT_Shapetype shapetype = null; ArrayList items = vml.GetItems(); - foreach (object o in items) - if (o is CT_Shapetype) - shapetype = (CT_Shapetype)o; + foreach(object o in items) + if(o is CT_Shapetype) + shapetype = (CT_Shapetype) o; Assert.AreEqual(NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t, shapetype.stroked); Assert.AreEqual(NPOI.OpenXmlFormats.Vml.ST_TrueFalse.t, shapetype.filled); - using (MemoryStream ws = new MemoryStream()) + using(MemoryStream ws = new MemoryStream()) { wb.Write(ws); - using (MemoryStream rs = new MemoryStream(ws.GetBuffer())) + using(MemoryStream rs = new MemoryStream(ws.GetBuffer())) { wb = new XSSFWorkbook(rs); - sheet = (XSSFSheet)wb.GetSheetAt(0); + sheet = (XSSFSheet) wb.GetSheetAt(0); vml = sheet.GetVMLDrawing(false); shapetype = null; items = vml.GetItems(); - foreach (object o in items) - if (o is CT_Shapetype) - shapetype = (CT_Shapetype)o; + foreach(object o in items) + if(o is CT_Shapetype) + shapetype = (CT_Shapetype) o; //wb.Write(new FileStream("comments.xlsx", FileMode.Create)); //using (MemoryStream ws2 = new MemoryStream()) @@ -207,5 +208,26 @@ public void TestCommentShowsBox() } } } + + [Test] + public void TestEvilUnclosedBRFixing() { + XSSFVMLDrawing vml = new XSSFVMLDrawing(); + Stream stream = POIDataSamples.GetOpenXML4JInstance().OpenResourceAsStream("bug-60626.vml"); + try { + vml.Read(stream); + } finally { + stream.Close(); + } + Regex p = new Regex("", RegexOptions.Compiled); + int count = 0; + foreach(Object xo in vml.GetItems()) + { + var t = xo.ToString(); + String[] split = p.Split(t); + count += split.Length-1; + } + + Assert.AreEqual(16, count); + } } } diff --git a/testcases/ooxml/XSSF/Util/TestEvilUnclosedBRFixingInputStream.cs b/testcases/ooxml/XSSF/Util/TestEvilUnclosedBRFixingInputStream.cs index a48e28c8d..e533c0352 100644 --- a/testcases/ooxml/XSSF/Util/TestEvilUnclosedBRFixingInputStream.cs +++ b/testcases/ooxml/XSSF/Util/TestEvilUnclosedBRFixingInputStream.cs @@ -20,10 +20,12 @@ limitations under the License. using System.Text; using NPOI.Util; using NPOI.XSSF.Util; +using System; namespace TestCases.XSSF.Util { [TestFixture] + [Obsolete] public class TestEvilUnclosedBRFixingInputStream { [Test] @@ -32,27 +34,11 @@ public void TestOK() byte[] ok = Encoding.UTF8.GetBytes("

Hello There!
Tags!

"); EvilUnclosedBRFixingInputStream inp = new EvilUnclosedBRFixingInputStream( - new MemoryStream(ok) + new ByteArrayInputStream(ok) ); - MemoryStream bout = new MemoryStream(); - bool going = true; - while (going) - { - byte[] b = new byte[1024]; - int r = inp.Read(b); - if (r > 0) - { - bout.Write(b, 0, r); - } - else - { - going = false; - } - } - - byte[] result = bout.ToArray(); - Assert.IsTrue(Arrays.Equals(ok, result)); + Assert.IsTrue(Arrays.Equals(ok, IOUtils.ToByteArray(inp))); + inp.Close(); } [Test] public void TestProblem() @@ -61,27 +47,11 @@ public void TestProblem() byte[] fixed1 = Encoding.UTF8.GetBytes("

Hello
There!
Tags!

"); EvilUnclosedBRFixingInputStream inp = new EvilUnclosedBRFixingInputStream( - new MemoryStream(orig) + new ByteArrayInputStream(orig) ); - MemoryStream bout = new MemoryStream(); - bool going = true; - while (going) - { - byte[] b = new byte[1024]; - int r = inp.Read(b); - if (r > 0) - { - bout.Write(b, 0, r); - } - else - { - going = false; - } - } - - byte[] result = bout.ToArray(); - Assert.IsTrue(Arrays.Equals(fixed1, result)); + Assert.IsTrue(Arrays.Equals(fixed1, IOUtils.ToByteArray(inp))); + inp.Close(); } /** @@ -98,7 +68,7 @@ public void TestBufferSize() for (int i = 5; i < orig.Length; i++) { EvilUnclosedBRFixingInputStream inp = new EvilUnclosedBRFixingInputStream( - new MemoryStream(orig) + new ByteArrayInputStream(orig) ); MemoryStream bout = new MemoryStream(); @@ -119,6 +89,7 @@ public void TestBufferSize() byte[] result = bout.ToArray(); Assert.IsTrue(Arrays.Equals(fixed1, result)); + inp.Close(); } } } diff --git a/testcases/test-data/openxml4j/bug-60626.vml b/testcases/test-data/openxml4j/bug-60626.vml new file mode 100644 index 000000000..83225a1db --- /dev/null +++ b/testcases/test-data/openxml4j/bug-60626.vml @@ -0,0 +1,658 @@ + + + + + + + + + + + + + 1, 2, 23, 2, 1, 199, 24, 0 + False + False + Risikodaten!$AF$48 + 0 + 0 + 3 + 1 + 1 + 16 + Risikodaten!$AG$44:$AG$47 + 4 + + Single + Normal + Combo + 8 + + + + + +
+
+ + + + 20, 14, 15, 2, 21, 1, 16, 5 + False + False + Center + $U$16 + + +
+ + + +
+
+ + + + 20, 14, 11, 0, 20, 37, 12, 4 + False + False + Center + 1 + Risikodaten!E16 + + +
+ + + + + + 1, 2, 24, 0, 1, 199, 24, 19 + False + False + Antrag!$Y$65 + 0 + 0 + 1 + 1 + 1 + 16 + Antrag!$Z$63:$Z$64 + 2 + + Single + Normal + Combo + 8 + + + + + + + 21, 4, 7, 11, 23, 28, 8, 14 + False + Risikodaten!$AF$22 + 0 + 0 + 0 + 1 + 3 + 16 + Risikodaten!$AG$19:$AG$21 + 2 + + Single + Normal + Combo + 8 + + + + + +
+
+ + + + 20, 14, 13, 3, 20, 34, 14, 0 + False + False + Center + 1 + Risikodaten!$J$13 + + +
+ + + +
+
+ + + + 20, 14, 14, 3, 20, 34, 15, 0 + False + False + Center + Risikodaten!$J$14 + + +
+ + + +
+
+ + + + 20, 14, 12, 3, 20, 34, 13, 0 + False + False + Center + 1 + Risikodaten!$J$12 + + +
+ + + +
+
+ + + + 20, 14, 9, 2, 20, 34, 9, 17 + False + False + Center + Risikodaten!$J$9 + + +
+ + + +
+
+ + + + 25, 70, 24, 0, 26, 19, 24, 15 + False + False + Center + Risikodaten!$AD$8 + + +
+ + + + + 24, 55, 0, 9, 27, 70, 2, 13 + False + Vermittler!$B$2 + Vermittler!$M$6:$N$206 + Pict + + + + + + + +
Ausblenden
+

+
+
+ + + 9, 12, 25, 9, 9, 88, 25, 25 + False + False + [0]!Ausblenden_Allianz + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 7, 12, 25, 9, 7, 88, 25, 25 + False + False + [0]!Ausblenden_Generali + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 5, 13, 25, 9, 5, 89, 25, 25 + False + False + [0]!Ausblenden_Donau + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 11, 11, 25, 9, 11, 87, 25, 25 + False + False + [0]!Ausblenden_AragSE + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 13, 12, 25, 9, 13, 88, 25, 25 + False + False + [0]!Ausblenden_HDI + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 15, 12, 25, 9, 15, 88, 25, 25 + False + False + [0]!Ausblenden_Zürich + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 17, 12, 25, 9, 17, 88, 25, 25 + False + False + [0]!Ausblenden_Uniqa + Center + Center + +
+ + + +
Ausblenden
+

+
+
+ + + 3, 11, 25, 4, 3, 85, 25, 19 + False + False + [0]!Ausblenden_VU_bisher + Center + Center + +
+ + + +
erh.NL
+
+ + + + 21, 2, 19, 14, 22, 2, 20, 11 + False + False + Center + 1 + Risikodaten!Y20 + + +
+ + + +
erh.NL
+
+ + + + 22, 2, 19, 14, 22, 68, 20, 11 + False + False + Center + 1 + Risikodaten!Z20 + + +
+ + + +
erh.NL
+
+ + + + 23, 2, 19, 14, 23, 68, 20, 11 + False + False + Center + 1 + Risikodaten!AA20 + + +
+ + + +
erh.NL
+
+ + + + 24, 2, 19, 14, 24, 68, 20, 11 + False + False + Center + 1 + Risikodaten!AB20 + + +
+ + + +
erh.NL
+
+ + + + 25, 2, 19, 14, 25, 68, 20, 11 + False + False + Center + 1 + Risikodaten!AC20 + + +
+ + + +
erh.NL
+
+ + + + 26, 2, 19, 14, 26, 68, 20, 11 + False + False + Center + 1 + Risikodaten!AD20 + + +
+ + + +
erh.NL
+
+ + + + 27, 2, 19, 14, 27, 68, 20, 11 + False + False + Center + 1 + Risikodaten!AE20 + + +
+ + + + +
+
+ + + + 20, 13, 1, 1, 20, 33, 1, 15 + False + False + [0]!Anzeige_Deckung + Center + 1 + Risikodaten!$I$8 + + +
+ + + + +
+
+ + + + 20, 13, 2, 1, 20, 33, 2, 16 + False + False + [0]!Anzeige_Deckung + Center + 1 + Risikodaten!$I22 + + +
+ + + + +
+
+ + + + 20, 13, 3, 1, 20, 33, 3, 16 + False + False + [0]!Anzeige_Deckung + Center + Risikodaten!$I$29 + + +
+ + + + + + + + + + + + + + + + + + + + + + + 1, 1, 5, 9, 13, 23, 13, 2 + Antrag!$B$7:$K$13 + Pict + + + + + + + + + 1, 2, 0, 1, 13, 23, 3, 10 + $DO$1:$DZ$3 + Pict + + +
\ No newline at end of file