SvgDocument.cs 22.1 KB
Newer Older
davescriven's avatar
davescriven committed
1
2
3
4
5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
6
7
using System.Drawing.Drawing2D;
using System.Drawing.Text;
davescriven's avatar
davescriven committed
8
9
10
using System.IO;
using System.Text;
using System.Xml;
11
using System.Linq;
Eric Domke's avatar
Eric Domke committed
12
13
using ExCSS;
using Svg.Css;
14
15
using System.Threading;
using System.Globalization;
davescriven's avatar
davescriven committed
16
17
18
19

namespace Svg
{
    /// <summary>
20
    /// The class used to create and load SVG documents.
davescriven's avatar
davescriven committed
21
22
23
    /// </summary>
    public class SvgDocument : SvgFragment, ITypeDescriptorContext
    {
24
        public static readonly int PointsPerInch = 96;
25
        private SvgElementIdManager _idManager;
26

Eric Domke's avatar
Eric Domke committed
27
28
29
30
31
32
33
34
35
36
37
38
        private Dictionary<string, IEnumerable<SvgFontFace>> _fontDefns = null;
        internal Dictionary<string, IEnumerable<SvgFontFace>> FontDefns()
        {
            if (_fontDefns == null)
            {
                _fontDefns = (from f in Descendants().OfType<SvgFontFace>()
                              group f by f.FontFamily into family
                              select family).ToDictionary(f => f.Key, f => (IEnumerable<SvgFontFace>)f);
            }
            return _fontDefns;
        }

39
40
41
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgDocument"/> class.
        /// </summary>
42
        public SvgDocument()
davescriven's avatar
davescriven committed
43
        {
James Welle's avatar
James Welle committed
44
            Ppi = PointsPerInch;
davescriven's avatar
davescriven committed
45
46
        }

47
48
        public Uri BaseUri { get; set; }

davescriven's avatar
davescriven committed
49
50
51
52
53
54
55
        /// <summary>
        /// Gets an <see cref="SvgElementIdManager"/> for this document.
        /// </summary>
        protected internal virtual SvgElementIdManager IdManager
        {
            get
            {
56
                if (_idManager == null)
57
                {
58
                    _idManager = new SvgElementIdManager(this);
59
                }
davescriven's avatar
davescriven committed
60

61
                return _idManager;
davescriven's avatar
davescriven committed
62
63
            }
        }
Eric Domke's avatar
Eric Domke committed
64

65
66
67
68
69
70
71
72
        /// <summary>
        /// Overwrites the current IdManager with a custom implementation. 
        /// Be careful with this: If elements have been inserted into the document before,
        /// you have to take care that the new IdManager also knows of them.
        /// </summary>
        /// <param name="manager"></param>
        public void OverwriteIdManager(SvgElementIdManager manager)
        {
James Welle's avatar
James Welle committed
73
            _idManager = manager;
74
        }
davescriven's avatar
davescriven committed
75

76
77
78
        /// <summary>
        /// Gets or sets the Pixels Per Inch of the rendered image.
        /// </summary>
79
        public int Ppi { get; set; }
sschurig's avatar
sschurig committed
80
81
82
83
84
        
        /// <summary>
        /// Gets or sets an external Cascading Style Sheet (CSS)
        /// </summary>
        public string ExternalCSSHref { get; set; }        
85
86
87
88

        #region ITypeDescriptorContext Members

        IContainer ITypeDescriptorContext.Container
davescriven's avatar
davescriven committed
89
        {
90
            get { throw new NotImplementedException(); }
davescriven's avatar
davescriven committed
91
92
        }

93
        object ITypeDescriptorContext.Instance
davescriven's avatar
davescriven committed
94
        {
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
            get { return this; }
        }

        void ITypeDescriptorContext.OnComponentChanged()
        {
            throw new NotImplementedException();
        }

        bool ITypeDescriptorContext.OnComponentChanging()
        {
            throw new NotImplementedException();
        }

        PropertyDescriptor ITypeDescriptorContext.PropertyDescriptor
        {
            get { throw new NotImplementedException(); }
        }

        object IServiceProvider.GetService(Type serviceType)
        {
            throw new NotImplementedException();
        }

        #endregion

        /// <summary>
        /// Retrieves the <see cref="SvgElement"/> with the specified ID.
        /// </summary>
        /// <param name="id">A <see cref="string"/> containing the ID of the element to find.</param>
        /// <returns>An <see cref="SvgElement"/> of one exists with the specified ID; otherwise false.</returns>
        public virtual SvgElement GetElementById(string id)
        {
            return IdManager.GetElementById(id);
davescriven's avatar
davescriven committed
128
129
        }

130
131
132
133
134
135
136
137
138
        /// <summary>
        /// Retrieves the <see cref="SvgElement"/> with the specified ID.
        /// </summary>
        /// <param name="id">A <see cref="string"/> containing the ID of the element to find.</param>
        /// <returns>An <see cref="SvgElement"/> of one exists with the specified ID; otherwise false.</returns>
        public virtual TSvgElement GetElementById<TSvgElement>(string id) where TSvgElement : SvgElement
        {
            return (this.GetElementById(id) as TSvgElement);
        }
Eric Domke's avatar
Eric Domke committed
139
140

        /// <summary>
141
142
143
144
145
146
147
148
149
        /// Opens the document at the specified path and loads the SVG contents.
        /// </summary>
        /// <param name="path">A <see cref="string"/> containing the path of the file to open.</param>
        /// <returns>An <see cref="SvgDocument"/> with the contents loaded.</returns>
        /// <exception cref="FileNotFoundException">The document at the specified <paramref name="path"/> cannot be found.</exception>
        public static SvgDocument Open(string path)
        {
            return Open<SvgDocument>(path, null);
        }
150

davescriven's avatar
davescriven committed
151
        /// <summary>
152
        /// Opens the document at the specified path and loads the SVG contents.
davescriven's avatar
davescriven committed
153
154
155
156
        /// </summary>
        /// <param name="path">A <see cref="string"/> containing the path of the file to open.</param>
        /// <returns>An <see cref="SvgDocument"/> with the contents loaded.</returns>
        /// <exception cref="FileNotFoundException">The document at the specified <paramref name="path"/> cannot be found.</exception>
157
        public static T Open<T>(string path) where T : SvgDocument, new()
158
        {
159
            return Open<T>(path, null);
160
161
        }

162
        /// <summary>
163
        /// Opens the document at the specified path and loads the SVG contents.
164
165
166
167
        /// </summary>
        /// <param name="path">A <see cref="string"/> containing the path of the file to open.</param>
        /// <param name="entities">A dictionary of custom entity definitions to be used when resolving XML entities within the document.</param>
        /// <returns>An <see cref="SvgDocument"/> with the contents loaded.</returns>
168
        /// <exception cref="FileNotFoundException">The document at the specified <paramref name="path"/> cannot be found.</exception>
169
        public static T Open<T>(string path, Dictionary<string, string> entities) where T : SvgDocument, new()
davescriven's avatar
davescriven committed
170
        {
171
172
173
174
175
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }

davescriven's avatar
davescriven committed
176
            if (!File.Exists(path))
177
            {
davescriven's avatar
davescriven committed
178
                throw new FileNotFoundException("The specified document cannot be found.", path);
179
            }
davescriven's avatar
davescriven committed
180

Eric Domke's avatar
Eric Domke committed
181
182
183
184
185
186
            using (var stream = File.OpenRead(path))
            {
                var doc = Open<T>(stream, entities);
                doc.BaseUri = new Uri(System.IO.Path.GetFullPath(path));
                return doc;
            }
davescriven's avatar
davescriven committed
187
188
        }

189
190
191
192
        /// <summary>
        /// Attempts to open an SVG document from the specified <see cref="Stream"/>.
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> containing the SVG document to open.</param>
193
        public static T Open<T>(Stream stream) where T : SvgDocument, new()
davescriven's avatar
davescriven committed
194
        {
195
            return Open<T>(stream, null);
davescriven's avatar
davescriven committed
196
197
        }

Eric Domke's avatar
Eric Domke committed
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218

        /// <summary>
        /// Attempts to create an SVG document from the specified string data.
        /// </summary>
        /// <param name="svg">The SVG data.</param>
        public static T FromSvg<T>(string svg) where T : SvgDocument, new()
        {
            if (string.IsNullOrEmpty(svg))
            {
                throw new ArgumentNullException("svg");
            }

            using (var strReader = new System.IO.StringReader(svg))
            {
                var reader = new SvgTextReader(strReader, null);
                reader.XmlResolver = new SvgDtdResolver();
                reader.WhitespaceHandling = WhitespaceHandling.None;
                return Open<T>(reader);
            }
        }

219
        /// <summary>
220
        /// Opens an SVG document from the specified <see cref="Stream"/> and adds the specified entities.
221
222
223
        /// </summary>
        /// <param name="stream">The <see cref="Stream"/> containing the SVG document to open.</param>
        /// <param name="entities">Custom entity definitions.</param>
224
        /// <exception cref="ArgumentNullException">The <paramref name="stream"/> parameter cannot be <c>null</c>.</exception>
225
        public static T Open<T>(Stream stream, Dictionary<string, string> entities) where T : SvgDocument, new()
davescriven's avatar
davescriven committed
226
        {
227
228
229
230
231
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

Eric Domke's avatar
Eric Domke committed
232
233
234
235
236
237
            // Don't close the stream via a dispose: that is the client's job.
            var reader = new SvgTextReader(stream, entities);
            reader.XmlResolver = new SvgDtdResolver();
            reader.WhitespaceHandling = WhitespaceHandling.None;
            return Open<T>(reader);
        }
davescriven's avatar
davescriven committed
238

Eric Domke's avatar
Eric Domke committed
239
240
241
242
243
244
245
        private static T Open<T>(XmlReader reader) where T : SvgDocument, new()
        {
            var elementStack = new Stack<SvgElement>();
            bool elementEmpty;
            SvgElement element = null;
            SvgElement parent;
            T svgDocument = null;
246
247
			var elementFactory = new SvgElementFactory();

Eric Domke's avatar
Eric Domke committed
248
249
250
            var styles = new List<ISvgNode>();

            while (reader.Read())
davescriven's avatar
davescriven committed
251
            {
Eric Domke's avatar
Eric Domke committed
252
                try
davescriven's avatar
davescriven committed
253
                {
Eric Domke's avatar
Eric Domke committed
254
                    switch (reader.NodeType)
davescriven's avatar
davescriven committed
255
                    {
Eric Domke's avatar
Eric Domke committed
256
257
258
259
260
261
262
                        case XmlNodeType.Element:
                            // Does this element have a value or children
                            // (Must do this check here before we progress to another node)
                            elementEmpty = reader.IsEmptyElement;
                            // Create element
                            if (elementStack.Count > 0)
                            {
263
                                element = elementFactory.CreateElement(reader, svgDocument);
Eric Domke's avatar
Eric Domke committed
264
265
266
                            }
                            else
                            {
267
                                svgDocument = elementFactory.CreateDocument<T>(reader);
Eric Domke's avatar
Eric Domke committed
268
269
270
271
272
273
274
275
                                element = svgDocument;
                            }

                            // Add to the parents children
                            if (elementStack.Count > 0)
                            {
                                parent = elementStack.Peek();
                                if (parent != null && element != null)
davescriven's avatar
davescriven committed
276
                                {
Eric Domke's avatar
Eric Domke committed
277
278
                                    parent.Children.Add(element);
                                    parent.Nodes.Add(element);
davescriven's avatar
davescriven committed
279
                                }
Eric Domke's avatar
Eric Domke committed
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
                            }

                            // Push element into stack
                            elementStack.Push(element);

                            // Need to process if the element is empty
                            if (elementEmpty)
                            {
                                goto case XmlNodeType.EndElement;
                            }

                            break;
                        case XmlNodeType.EndElement:

                            // Pop the element out of the stack
                            element = elementStack.Pop();

                            if (element.Nodes.OfType<SvgContentNode>().Any())
                            {
                                element.Content = (from e in element.Nodes select e.Content).Aggregate((p, c) => p + c);
                            }
                            else
                            {
                                element.Nodes.Clear(); // No sense wasting the space where it isn't needed
                            }

                            var unknown = element as SvgUnknownElement;
                            if (unknown != null && unknown.ElementName == "style")
                            {
                                styles.Add(unknown);
                            }
                            break;
                        case XmlNodeType.CDATA:
                        case XmlNodeType.Text:
                            element = elementStack.Peek();
                            element.Nodes.Add(new SvgContentNode() { Content = reader.Value });
                            break;
                        case XmlNodeType.EntityReference:
                            reader.ResolveEntity();
                            element = elementStack.Peek();
                            element.Nodes.Add(new SvgContentNode() { Content = reader.Value });
                            break;
                    }
                }
                catch (Exception exc)
                {
                    Trace.TraceError(exc.Message);
                }
            }
davescriven's avatar
davescriven committed
329

Eric Domke's avatar
Eric Domke committed
330
331
332
333
334
            if (styles.Any())
            {
                var cssTotal = styles.Select((s) => s.Content).Aggregate((p, c) => p + Environment.NewLine + c);
                var cssParser = new Parser();
                var sheet = cssParser.Parse(cssTotal);
335
336
                AggregateSelectorList aggList;
                IEnumerable<BaseSelector> selectors;
Eric Domke's avatar
Eric Domke committed
337
                IEnumerable<SvgElement> elemsToStyle;
davescriven's avatar
davescriven committed
338

Eric Domke's avatar
Eric Domke committed
339
340
                foreach (var rule in sheet.StyleRules)
                {
341
342
343
344
345
346
347
348
349
350
351
                    aggList = rule.Selector as AggregateSelectorList;
                    if (aggList != null && aggList.Delimiter == ",")
                    {
                        selectors = aggList;
                    }
                    else
                    {
                        selectors = Enumerable.Repeat(rule.Selector, 1);
                    }

                    foreach (var selector in selectors)
davescriven's avatar
davescriven committed
352
                    {
353
                        elemsToStyle = svgDocument.QuerySelectorAll(rule.Selector.ToString(), elementFactory);
354
                        foreach (var elem in elemsToStyle)
Eric Domke's avatar
Eric Domke committed
355
                        {
356
357
358
359
                            foreach (var decl in rule.Declarations)
                            {
                                elem.AddStyle(decl.Name, decl.Term.ToString(), rule.Selector.GetSpecificity());
                            }
Eric Domke's avatar
Eric Domke committed
360
                        }
davescriven's avatar
davescriven committed
361
362
                    }
                }
Eric Domke's avatar
Eric Domke committed
363
364
            }

365
            if (svgDocument != null) FlushStyles(svgDocument);
Eric Domke's avatar
Eric Domke committed
366
367
            return svgDocument;
        }
davescriven's avatar
davescriven committed
368

Eric Domke's avatar
Eric Domke committed
369
370
371
372
373
374
        private static void FlushStyles(SvgElement elem)
        {
            elem.FlushStyles();
            foreach (var child in elem.Children)
            {
                FlushStyles(child);
davescriven's avatar
davescriven committed
375
376
377
            }
        }

378
379
380
381
382
        /// <summary>
        /// Opens an SVG document from the specified <see cref="XmlDocument"/>.
        /// </summary>
        /// <param name="document">The <see cref="XmlDocument"/> containing the SVG document XML.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="document"/> parameter cannot be <c>null</c>.</exception>
383
        public static SvgDocument Open(XmlDocument document)
davescriven's avatar
davescriven committed
384
        {
385
386
387
388
389
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

390
391
            var reader = new SvgNodeReader(document.DocumentElement, null);
            return Open<SvgDocument>(reader);
davescriven's avatar
davescriven committed
392
393
394
395
396
397
398
        }

        public static Bitmap OpenAsBitmap(string path)
        {
            return null;
        }

399
        public static Bitmap OpenAsBitmap(XmlDocument document)
davescriven's avatar
davescriven committed
400
401
402
403
        {
            return null;
        }

404
        /// <summary>
Eric Domke's avatar
Eric Domke committed
405
        /// Renders the <see cref="SvgDocument"/> to the specified <see cref="ISvgRenderer"/>.
406
        /// </summary>
Eric Domke's avatar
Eric Domke committed
407
        /// <param name="renderer">The <see cref="ISvgRenderer"/> to render the document with.</param>
408
        /// <exception cref="ArgumentNullException">The <paramref name="renderer"/> parameter cannot be <c>null</c>.</exception>
Eric Domke's avatar
Eric Domke committed
409
        public void Draw(ISvgRenderer renderer)
davescriven's avatar
davescriven committed
410
        {
411
412
413
414
415
            if (renderer == null)
            {
                throw new ArgumentNullException("renderer");
            }

Eric Domke's avatar
Eric Domke committed
416
            renderer.SetBoundable(this);
417
            this.Render(renderer);
davescriven's avatar
davescriven committed
418
419
        }

420
421
422
423
424
425
426
427
428
429
430
431
        /// <summary>
        /// Renders the <see cref="SvgDocument"/> to the specified <see cref="Graphics"/>.
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> to be rendered to.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="graphics"/> parameter cannot be <c>null</c>.</exception>
        public void Draw(Graphics graphics)
        {
            if (graphics == null)
            {
                throw new ArgumentNullException("graphics");
            }

432
            var renderer = SvgRenderer.FromGraphics(graphics);
Eric Domke's avatar
Eric Domke committed
433
            renderer.SetBoundable(this);
434
            this.Render(renderer);
435
436
        }

437
438
439
440
        /// <summary>
        /// Renders the <see cref="SvgDocument"/> and returns the image as a <see cref="Bitmap"/>.
        /// </summary>
        /// <returns>A <see cref="Bitmap"/> containing the rendered document.</returns>
davescriven's avatar
davescriven committed
441
442
        public virtual Bitmap Draw()
        {
443
            //Trace.TraceInformation("Begin Render");
davescriven's avatar
davescriven committed
444

445
            var size = GetDimensions();
Eric Domke's avatar
Eric Domke committed
446
            var bitmap = new Bitmap((int)Math.Round(size.Width), (int)Math.Round(size.Height));
Eric Domke's avatar
Eric Domke committed
447
            // 	bitmap.SetResolution(300, 300);
Tebjan Halm's avatar
Tebjan Halm committed
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
            try
            {
                Draw(bitmap);
            }
            catch
            {
                bitmap.Dispose();
                throw;
            }

            //Trace.TraceInformation("End Render");
            return bitmap;
        }

        /// <summary>
        /// Renders the <see cref="SvgDocument"/> into a given Bitmap <see cref="Bitmap"/>.
        /// </summary>
        public virtual void Draw(Bitmap bitmap)
        {
            //Trace.TraceInformation("Begin Render");

469
            try
davescriven's avatar
davescriven committed
470
            {
471
472
473
474
475
				using (var renderer = SvgRenderer.FromImage(bitmap))
				{
					renderer.SetBoundable(new GenericBoundable(0, 0, bitmap.Width, bitmap.Height));

					//EO, 2014-12-05: Requested to ensure proper zooming (draw the svg in the bitmap size, ==> proper scaling)
476
					//EO, 2015-01-09, Added GetDimensions to use its returned size instead of this.Width and this.Height (request of Icarrere).
477
478
479
480

          //BBN, 2015-07-29, it is unnecassary to call again GetDimensions and transform to 1x1
          //SizeF size = this.GetDimensions();
					//renderer.ScaleTransform(bitmap.Width / size.Width, bitmap.Height / size.Height);
481

482
					//EO, 2014-12-05: Requested to ensure proper zooming out (reduce size). Otherwise it clip the image.
483
					this.Overflow = SvgOverflow.Auto;
484
485
486

					this.Render(renderer);
				}
487
488
489
490
            }
            catch
            {
                throw;
davescriven's avatar
davescriven committed
491
492
            }

493
            //Trace.TraceInformation("End Render");
davescriven's avatar
davescriven committed
494
495
        }

496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
        /// <summary>
        /// Renders the <see cref="SvgDocument"/> in given size and returns the image as a <see cref="Bitmap"/>.
        /// </summary>
        /// <returns>A <see cref="Bitmap"/> containing the rendered document.</returns>
        public virtual Bitmap Draw(int rasterWidth, int rasterHeight)
        {
          var size = GetDimensions();
          RasterizeDimensions(ref size, rasterWidth, rasterHeight);

          if (size.Width == 0 || size.Height == 0)
            return null;

          var bitmap = new Bitmap((int)Math.Round(size.Width), (int)Math.Round(size.Height));
          try
          {
            Draw(bitmap);
          }
          catch
          {
            bitmap.Dispose();
            throw;
          }

          //Trace.TraceInformation("End Render");
          return bitmap;
        }

        /// <summary>
        /// If both or one of raster height and width is not given (0), calculate that missing value from original SVG size
        /// while keeping original SVG size ratio
        /// </summary>
        /// <param name="size"></param>
        /// <param name="rasterWidth"></param>
        /// <param name="rasterHeight"></param>
        public virtual void RasterizeDimensions(ref SizeF size, int rasterWidth, int rasterHeight)
        {
          if (size == null || size.Width == 0)
            return;

          // Ratio of height/width of the original SVG size, to be used for scaling transformation
          float ratio = size.Height / size.Width;

          size.Width = rasterWidth > 0 ? (float)rasterWidth : size.Width;
          size.Height = rasterHeight > 0 ? (float)rasterHeight : size.Height;

          if (rasterHeight == 0 && rasterWidth > 0)
          {
            size.Height = (int)(rasterWidth * ratio);
          }
          else if (rasterHeight > 0 && rasterWidth == 0)
          {
            size.Width = (int)(rasterHeight / ratio);
          }
        }

551
552
553
554
555
556
557
558
559
560
561
562
        public override void Write(XmlTextWriter writer)
        {
            //Save previous culture and switch to invariant for writing
            var previousCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            base.Write(writer);

            //Switch culture back
            Thread.CurrentThread.CurrentCulture = previousCulture;
        }

davescriven's avatar
davescriven committed
563
564
        public void Write(Stream stream)
        {
Tebjan Halm's avatar
Tebjan Halm committed
565
566
567

            var xmlWriter = new XmlTextWriter(stream, Encoding.UTF8);
            xmlWriter.Formatting = Formatting.Indented;
568

Tebjan Halm's avatar
Tebjan Halm committed
569
            xmlWriter.WriteDocType("svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", null);
sschurig's avatar
sschurig committed
570
571
572
            
            if (!String.IsNullOrEmpty(this.ExternalCSSHref))
                xmlWriter.WriteProcessingInstruction("xml-stylesheet", String.Format("type=\"text/css\" href=\"{0}\"", this.ExternalCSSHref));
Tebjan Halm's avatar
Tebjan Halm committed
573

574
            this.Write(xmlWriter);
Tebjan Halm's avatar
Tebjan Halm committed
575

Tebjan Halm's avatar
Tebjan Halm committed
576
            xmlWriter.Flush();
davescriven's avatar
davescriven committed
577
578
579
580
        }

        public void Write(string path)
        {
Eric Domke's avatar
Eric Domke committed
581
            using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write))
Tebjan Halm's avatar
Tebjan Halm committed
582
583
584
            {
                this.Write(fs);
            }
davescriven's avatar
davescriven committed
585
586
        }
    }
sschurig's avatar
sschurig committed
587
}