Skip to content

Commit

Permalink
V1.8.0 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed May 18, 2021
1 parent 1933e90 commit 144f2fb
Show file tree
Hide file tree
Showing 101 changed files with 1,061 additions and 479 deletions.
2 changes: 1 addition & 1 deletion Xceed.Document.NET/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
internal static class _XceedVersionInfo
{
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "1.7";
public const string BaseVersion = "1.8";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";
Expand Down
2 changes: 1 addition & 1 deletion Xceed.Document.NET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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


Expand Down
15 changes: 10 additions & 5 deletions Xceed.Document.NET/Src/Bookmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,26 @@ public Paragraph Paragraph

#endregion

#region Constructors
#region Internal Properties

public Bookmark()
internal string Id
{
get;
set;
}

#endregion

#region Public Methods
#region Constructors

public void SetText( string text )
public Bookmark()
{
this.Paragraph.ReplaceAtBookmark( text, this.Name );
}

#endregion

#region Public Methods

public void SetText( string text, Formatting formatting = null )
{
this.Paragraph.ReplaceAtBookmark( text, this.Name, formatting );
Expand Down
7 changes: 6 additions & 1 deletion Xceed.Document.NET/Src/Charts/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

namespace Xceed.Document.NET
{

/// <summary>
/// Axis base class
/// </summary>
Expand Down Expand Up @@ -55,7 +56,11 @@ public Boolean IsVisible
}
}

#endregion




#endregion

#region Internal Properties

Expand Down
68 changes: 46 additions & 22 deletions Xceed.Document.NET/Src/Charts/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class Chart
#region Private Members


#endregion
#endregion

#region Public Properties

Expand All @@ -58,7 +58,7 @@ public List<Series> Series
int index = 1;
foreach( var element in ChartXml.Elements( ser ) )
{
element.Add( new XElement( XName.Get("idx", Document.c.NamespaceName ) ), index.ToString() );
element.Add( new XElement( XName.Get( "idx", Document.c.NamespaceName ) ), index.ToString() );
series.Add( new Series( element ) );
++index;
}
Expand Down Expand Up @@ -247,7 +247,7 @@ public Chart()
}


#endregion
#endregion

#region Public Methods

Expand Down Expand Up @@ -302,7 +302,7 @@ public void RemoveLegend()
}


#endregion
#endregion

#region Protected Methods

Expand All @@ -319,7 +319,7 @@ public void RemoveLegend()



#endregion
#endregion
}

/// <summary>
Expand All @@ -336,6 +336,9 @@ public class Series

#region Public Properties




public Color Color
{
get
Expand All @@ -359,21 +362,42 @@ public Color Color
}
set
{
var colorElement = this.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
if( colorElement != null )
var spPrElement = this.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
string widthValue = string.Empty;

if( spPrElement != null )
{
colorElement.Remove();
var ln = spPrElement.Element( XName.Get( "ln", Document.a.NamespaceName ) );
if( ln != null )
{
var val = ln.Attribute( XName.Get( "w" ) );
if( val != null )
{
widthValue = val.Value;
}
}
spPrElement.Remove();
}

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

// When the chart containing this series is a lineChart, the line will be colored, else the shape will be colored.
colorElement = ( ( this.Xml.Parent != null ) && ( this.Xml.Parent.Name != null ) && (this.Xml.Parent.Name.LocalName == "lineChart" ) )
? new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
new XElement( XName.Get( "ln", Document.a.NamespaceName ), colorData ) )
: new XElement( XName.Get( "spPr", Document.c.NamespaceName ), colorData );
this.Xml.Element( XName.Get( "tx", Document.c.NamespaceName ) ).AddAfterSelf( colorElement );
if( string.IsNullOrEmpty( widthValue ) )
{
spPrElement = ( ( this.Xml.Parent != null ) && ( this.Xml.Parent.Name != null ) && ( this.Xml.Parent.Name.LocalName == "lineChart" ) )
? new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
new XElement( XName.Get( "ln", Document.a.NamespaceName ), colorData ) )
: new XElement( XName.Get( "spPr", Document.c.NamespaceName ), colorData );
}
else
{
spPrElement = new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
new XElement( XName.Get( "ln", Document.a.NamespaceName ),
new XAttribute( XName.Get( "w" ), widthValue ), colorData ) );
}

this.Xml.Element( XName.Get( "tx", Document.c.NamespaceName ) ).AddAfterSelf( spPrElement );
}
}

Expand All @@ -390,7 +414,7 @@ public Color Color



#endregion
#endregion

#region Internal Properties

Expand Down Expand Up @@ -422,7 +446,7 @@ internal Series( XElement xml )

var val = xml.Element( XName.Get( "val", Document.c.NamespaceName ) );
if( val != null )
{
{
_numCache = val.Descendants( XName.Get( "numCache", Document.c.NamespaceName ) ).FirstOrDefault();
if( _numCache == null )
{
Expand All @@ -438,18 +462,18 @@ public Series( String name )

this.Xml = new XElement( XName.Get( "ser", Document.c.NamespaceName ),
new XElement( XName.Get( "tx", Document.c.NamespaceName ),
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
new XElement( XName.Get( "strCache", Document.c.NamespaceName ),
new XElement( XName.Get( "pt", Document.c.NamespaceName ),
new XAttribute( XName.Get( "idx" ), "0" ),
new XElement( XName.Get( "pt", Document.c.NamespaceName ),
new XAttribute( XName.Get( "idx" ), "0" ),
new XElement( XName.Get( "v", Document.c.NamespaceName ), name ) ) ) ) ),
new XElement( XName.Get( "invertIfNegative", Document.c.NamespaceName ), "0" ),
new XElement( XName.Get( "cat", Document.c.NamespaceName ),
new XElement( XName.Get( "cat", Document.c.NamespaceName ),
new XElement( XName.Get( "strRef", Document.c.NamespaceName ),
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
_strCache ) ),
new XElement( XName.Get( "val", Document.c.NamespaceName ),
new XElement( XName.Get( "val", Document.c.NamespaceName ),
new XElement( XName.Get( "numRef", Document.c.NamespaceName ),
new XElement( XName.Get( "f", Document.c.NamespaceName ), "" ),
_numCache ) )
Expand All @@ -470,7 +494,7 @@ public void Bind( ICollection list, String categoryPropertyName, String valuePro

_strCache.Add( ptCount );
_numCache.Add( formatCode );
_numCache.Add( ptCount );
_numCache.Add( ptCount );

Int32 index = 0;
XElement pt;
Expand Down Expand Up @@ -587,7 +611,7 @@ internal ChartLegend( ChartLegendPosition position, Boolean overlay )
#region Internal Methods


#endregion
#endregion

#region Private Methods

Expand Down
14 changes: 10 additions & 4 deletions Xceed.Document.NET/Src/Charts/LineChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
using System.IO.Packaging;
using System.Xml.Linq;
using System.Linq;
using System.Globalization;

namespace Xceed.Document.NET
{
Expand Down Expand Up @@ -64,10 +65,15 @@ public override void AddSeries( Series series )
var spPr = series.Xml.Element( XName.Get( "spPr", Document.c.NamespaceName ) );
if( spPr != null )
{
var spPrContent = spPr.Elements().First();
var newSpPr = new XElement( XName.Get( "spPr", Document.c.NamespaceName ), new XElement( XName.Get( "ln", Document.a.NamespaceName ), spPrContent ) );
spPr.AddAfterSelf( newSpPr );
spPr.Remove();
if( spPr.Element( XName.Get( "ln", Document.a.NamespaceName ) ) == null )
{
var spPrContent = spPr.Elements().First(); // Only color tag is defined.

var newSpPr = new XElement( XName.Get( "spPr", Document.c.NamespaceName ),
new XElement( XName.Get( "ln", Document.a.NamespaceName ), spPrContent ) );
spPr.AddAfterSelf( newSpPr );
spPr.Remove();
}
}

base.AddSeries( series );
Expand Down
Loading

0 comments on commit 144f2fb

Please sign in to comment.