Skip to content

Commit 144f2fb

Browse files
committed
V1.8.0 Released
1 parent 1933e90 commit 144f2fb

File tree

101 files changed

+1061
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1061
-479
lines changed

Xceed.Document.NET/AssemblyVersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
2121
internal static class _XceedVersionInfo
2222
{
2323
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
24-
public const string BaseVersion = "1.7";
24+
public const string BaseVersion = "1.8";
2525
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
2626
public const string Version = BaseVersion +
2727
".0.0";

Xceed.Document.NET/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
2727

2828
[assembly: AssemblyCompany( "Xceed Software Inc." )]
2929
[assembly: AssemblyProduct( "Xceed Document for .NET Standard" )]
30-
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2009-2020" )]
30+
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2009-2021" )]
3131
[assembly: AssemblyCulture("")]
3232

3333

Xceed.Document.NET/Src/Bookmark.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,26 @@ public Paragraph Paragraph
3131

3232
#endregion
3333

34-
#region Constructors
34+
#region Internal Properties
3535

36-
public Bookmark()
36+
internal string Id
3737
{
38+
get;
39+
set;
3840
}
3941

4042
#endregion
4143

42-
#region Public Methods
44+
#region Constructors
4345

44-
public void SetText( string text )
46+
public Bookmark()
4547
{
46-
this.Paragraph.ReplaceAtBookmark( text, this.Name );
4748
}
4849

50+
#endregion
51+
52+
#region Public Methods
53+
4954
public void SetText( string text, Formatting formatting = null )
5055
{
5156
this.Paragraph.ReplaceAtBookmark( text, this.Name, formatting );

Xceed.Document.NET/Src/Charts/Axis.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1919

2020
namespace Xceed.Document.NET
2121
{
22+
2223
/// <summary>
2324
/// Axis base class
2425
/// </summary>
@@ -55,7 +56,11 @@ public Boolean IsVisible
5556
}
5657
}
5758

58-
#endregion
59+
60+
61+
62+
63+
#endregion
5964

6065
#region Internal Properties
6166

Xceed.Document.NET/Src/Charts/Chart.cs

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public abstract class Chart
3434
#region Private Members
3535

3636

37-
#endregion
37+
#endregion
3838

3939
#region Public Properties
4040

@@ -58,7 +58,7 @@ public List<Series> Series
5858
int index = 1;
5959
foreach( var element in ChartXml.Elements( ser ) )
6060
{
61-
element.Add( new XElement( XName.Get("idx", Document.c.NamespaceName ) ), index.ToString() );
61+
element.Add( new XElement( XName.Get( "idx", Document.c.NamespaceName ) ), index.ToString() );
6262
series.Add( new Series( element ) );
6363
++index;
6464
}
@@ -247,7 +247,7 @@ public Chart()
247247
}
248248

249249

250-
#endregion
250+
#endregion
251251

252252
#region Public Methods
253253

@@ -302,7 +302,7 @@ public void RemoveLegend()
302302
}
303303

304304

305-
#endregion
305+
#endregion
306306

307307
#region Protected Methods
308308

@@ -319,7 +319,7 @@ public void RemoveLegend()
319319

320320

321321

322-
#endregion
322+
#endregion
323323
}
324324

325325
/// <summary>
@@ -336,6 +336,9 @@ public class Series
336336

337337
#region Public Properties
338338

339+
340+
341+
339342
public Color Color
340343
{
341344
get
@@ -359,21 +362,42 @@ public Color Color
359362
}
360363
set
361364
{
362-
var colorElement = this.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
363-
if( colorElement != null )
365+
var spPrElement = this.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
366+
string widthValue = string.Empty;
367+
368+
if( spPrElement != null )
364369
{
365-
colorElement.Remove();
370+
var ln = spPrElement.Element( XName.Get( "ln", Document.a.NamespaceName ) );
371+
if( ln != null )
372+
{
373+
var val = ln.Attribute( XName.Get( "w" ) );
374+
if( val != null )
375+
{
376+
widthValue = val.Value;
377+
}
378+
}
379+
spPrElement.Remove();
366380
}
367381

368382
var colorData = new XElement( XName.Get( "solidFill", Document.a.NamespaceName ),
369383
new XElement( XName.Get( "srgbClr", Document.a.NamespaceName ), new XAttribute( XName.Get( "val" ), value.ToHex() ) ) );
370384

371385
// When the chart containing this series is a lineChart, the line will be colored, else the shape will be colored.
372-
colorElement = ( ( this.Xml.Parent != null ) && ( this.Xml.Parent.Name != null ) && (this.Xml.Parent.Name.LocalName == "lineChart" ) )
373-
? new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
374-
new XElement( XName.Get( "ln", Document.a.NamespaceName ), colorData ) )
375-
: new XElement( XName.Get( "spPr", Document.c.NamespaceName ), colorData );
376-
this.Xml.Element( XName.Get( "tx", Document.c.NamespaceName ) ).AddAfterSelf( colorElement );
386+
if( string.IsNullOrEmpty( widthValue ) )
387+
{
388+
spPrElement = ( ( this.Xml.Parent != null ) && ( this.Xml.Parent.Name != null ) && ( this.Xml.Parent.Name.LocalName == "lineChart" ) )
389+
? new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
390+
new XElement( XName.Get( "ln", Document.a.NamespaceName ), colorData ) )
391+
: new XElement( XName.Get( "spPr", Document.c.NamespaceName ), colorData );
392+
}
393+
else
394+
{
395+
spPrElement = new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
396+
new XElement( XName.Get( "ln", Document.a.NamespaceName ),
397+
new XAttribute( XName.Get( "w" ), widthValue ), colorData ) );
398+
}
399+
400+
this.Xml.Element( XName.Get( "tx", Document.c.NamespaceName ) ).AddAfterSelf( spPrElement );
377401
}
378402
}
379403

@@ -390,7 +414,7 @@ public Color Color
390414

391415

392416

393-
#endregion
417+
#endregion
394418

395419
#region Internal Properties
396420

@@ -422,7 +446,7 @@ internal Series( XElement xml )
422446

423447
var val = xml.Element( XName.Get( "val", Document.c.NamespaceName ) );
424448
if( val != null )
425-
{
449+
{
426450
_numCache = val.Descendants( XName.Get( "numCache", Document.c.NamespaceName ) ).FirstOrDefault();
427451
if( _numCache == null )
428452
{
@@ -438,18 +462,18 @@ public Series( String name )
438462

439463
this.Xml = new XElement( XName.Get( "ser", Document.c.NamespaceName ),
440464
new XElement( XName.Get( "tx", Document.c.NamespaceName ),
441-
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
465+
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
442466
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
443467
new XElement( XName.Get( "strCache", Document.c.NamespaceName ),
444-
new XElement( XName.Get( "pt", Document.c.NamespaceName ),
445-
new XAttribute( XName.Get( "idx" ), "0" ),
468+
new XElement( XName.Get( "pt", Document.c.NamespaceName ),
469+
new XAttribute( XName.Get( "idx" ), "0" ),
446470
new XElement( XName.Get( "v", Document.c.NamespaceName ), name ) ) ) ) ),
447471
new XElement( XName.Get( "invertIfNegative", Document.c.NamespaceName ), "0" ),
448-
new XElement( XName.Get( "cat", Document.c.NamespaceName ),
472+
new XElement( XName.Get( "cat", Document.c.NamespaceName ),
449473
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
450474
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
451475
_strCache ) ),
452-
new XElement( XName.Get( "val", Document.c.NamespaceName ),
476+
new XElement( XName.Get( "val", Document.c.NamespaceName ),
453477
new XElement( XName.Get( "numRef", Document.c.NamespaceName ),
454478
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
455479
_numCache ) )
@@ -470,7 +494,7 @@ public void Bind( ICollection list, String categoryPropertyName, String valuePro
470494

471495
_strCache.Add( ptCount );
472496
_numCache.Add( formatCode );
473-
_numCache.Add( ptCount );
497+
_numCache.Add( ptCount );
474498

475499
Int32 index = 0;
476500
XElement pt;
@@ -587,7 +611,7 @@ internal ChartLegend( ChartLegendPosition position, Boolean overlay )
587611
#region Internal Methods
588612

589613

590-
#endregion
614+
#endregion
591615

592616
#region Private Methods
593617

Xceed.Document.NET/Src/Charts/LineChart.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1717
using System.IO.Packaging;
1818
using System.Xml.Linq;
1919
using System.Linq;
20+
using System.Globalization;
2021

2122
namespace Xceed.Document.NET
2223
{
@@ -64,10 +65,15 @@ public override void AddSeries( Series series )
6465
var spPr = series.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
6566
if( spPr != null )
6667
{
67-
var spPrContent = spPr.Elements().First();
68-
var newSpPr = new XElement( XName.Get( "spPr", Document.c.NamespaceName ), new XElement( XName.Get( "ln", Document.a.NamespaceName ), spPrContent ) );
69-
spPr.AddAfterSelf( newSpPr );
70-
spPr.Remove();
68+
if( spPr.Element( XName.Get( "ln", Document.a.NamespaceName ) ) == null )
69+
{
70+
var spPrContent = spPr.Elements().First(); // Only color tag is defined.
71+
72+
var newSpPr = new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
73+
new XElement( XName.Get( "ln", Document.a.NamespaceName ), spPrContent ) );
74+
spPr.AddAfterSelf( newSpPr );
75+
spPr.Remove();
76+
}
7177
}
7278

7379
base.AddSeries( series );

0 commit comments

Comments
 (0)