Skip to content

Commit

Permalink
V1.7.1 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Sep 22, 2020
1 parent e221274 commit 4d8bc57
Show file tree
Hide file tree
Showing 74 changed files with 737 additions and 332 deletions.
Binary file modified Xceed.Document.NET/Resources/default_styles.xml.gz
Binary file not shown.
Binary file modified Xceed.Document.NET/Resources/styles.xml.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions Xceed.Document.NET/Src/Bookmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public void SetText( string text )
this.Paragraph.ReplaceAtBookmark( text, this.Name );
}

public void SetText( string text, Formatting formatting = null )
{
this.Paragraph.ReplaceAtBookmark( text, this.Name, formatting );
}

public void Remove()
{
this.Paragraph.RemoveBookmark( this.Name );
Expand Down
25 changes: 22 additions & 3 deletions Xceed.Document.NET/Src/Charts/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ public Color Color




#endregion

#region Internal Properties
Expand All @@ -407,9 +408,27 @@ internal XElement Xml

internal Series( XElement xml )
{
Xml = xml;
_strCache = xml.Element( XName.Get( "cat", Document.c.NamespaceName ) ).Element( XName.Get( "strRef", Document.c.NamespaceName ) ).Element( XName.Get( "strCache", Document.c.NamespaceName ) );
_numCache = xml.Element( XName.Get( "val", Document.c.NamespaceName ) ).Element( XName.Get( "numRef", Document.c.NamespaceName ) ).Element( XName.Get( "numCache", Document.c.NamespaceName ) );
this.Xml = xml;

var cat = xml.Element( XName.Get( "cat", Document.c.NamespaceName ) );
if( cat != null )
{
_strCache = cat.Descendants( XName.Get( "strCache", Document.c.NamespaceName ) ).FirstOrDefault();
if( _strCache == null )
{
_strCache = cat.Descendants( XName.Get( "strLit", Document.c.NamespaceName ) ).FirstOrDefault();
}
}

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 )
{
_numCache = val.Descendants( XName.Get( "numLit", Document.c.NamespaceName ) ).FirstOrDefault();
}
}
}

public Series( String name )
Expand Down
33 changes: 11 additions & 22 deletions Xceed.Document.NET/Src/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,33 +725,19 @@ public virtual Table InsertTable( int index, Table t )
return newTable;
}

public virtual void InsertSection()
public virtual Section InsertSection()
{
this.InsertSection( false );
return this.InsertSection( false );
}

public virtual void InsertSection( bool trackChanges )
public virtual Section InsertSection( bool trackChanges )
{
var newSection = new XElement( XName.Get( "p", Document.w.NamespaceName ), new XElement( XName.Get( "pPr", Document.w.NamespaceName ), new XElement( XName.Get( "sectPr", Document.w.NamespaceName ), new XElement( XName.Get( "type", Document.w.NamespaceName ), new XAttribute( Document.w + "val", "continuous" ) ) ) ) );

if( trackChanges )
{
newSection = HelperFunctions.CreateEdit( EditType.ins, DateTime.Now, newSection );
}

this.AddElementInXml( newSection );
return null;
}

public virtual void InsertSectionPageBreak( bool trackChanges = false )
public virtual Section InsertSectionPageBreak( bool trackChanges = false )
{
var newSection = new XElement( XName.Get( "p", Document.w.NamespaceName ), new XElement( XName.Get( "pPr", Document.w.NamespaceName ), new XElement( XName.Get( "sectPr", Document.w.NamespaceName ) ) ) );

if( trackChanges )
{
newSection = HelperFunctions.CreateEdit( EditType.ins, DateTime.Now, newSection );
}

this.AddElementInXml( newSection );
return null;
}

public virtual List InsertList( List list )
Expand Down Expand Up @@ -971,9 +957,9 @@ private void SetParentContainer( Paragraph newParagraph )
}
}

private ListItemType GetListItemType( string styleName )
private ListItemType GetListItemType( string listItemType )
{
switch( styleName )
switch( listItemType )
{
case "bullet":
return ListItemType.Bulleted;
Expand All @@ -984,6 +970,9 @@ private ListItemType GetListItemType( string styleName )

private void InitParagraphs( List<Paragraph> paragraphs )
{
if( (this.Document.Sections == null) || (this.Document.Sections.Count == 0))
return;

foreach( var p in paragraphs )
{
var nextElement = p.Xml.ElementsAfterSelf().FirstOrDefault();
Expand Down
32 changes: 20 additions & 12 deletions Xceed.Document.NET/Src/CustomProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ internal string Type
private set;
}

internal Formatting Formatting
{
get;
set;
}

#endregion

#region Constructors
Expand All @@ -59,8 +65,8 @@ internal string Type
/// </summary>
/// <param name="name">The name of this CustomProperty.</param>
/// <param name="value">The value of this CustomProperty.</param>
public CustomProperty( string name, string value )
: this( name, "lpwstr", value )
public CustomProperty( string name, string value, Formatting formatting = null )
: this( name, "lpwstr", value, formatting )
{
}

Expand All @@ -69,8 +75,8 @@ public CustomProperty( string name, string value )
/// </summary>
/// <param name="name">The name of this CustomProperty.</param>
/// <param name="value">The value of this CustomProperty.</param>
public CustomProperty( string name, int value )
: this( name, "i4", value )
public CustomProperty( string name, int value, Formatting formatting = null )
: this( name, "i4", value, formatting )
{
}

Expand All @@ -79,8 +85,8 @@ public CustomProperty( string name, int value )
/// </summary>
/// <param name="name">The name of this CustomProperty.</param>
/// <param name="value">The value of this CustomProperty.</param>
public CustomProperty( string name, double value )
: this( name, "r8", value )
public CustomProperty( string name, double value, Formatting formatting = null )
: this( name, "r8", value, formatting )
{
}

Expand All @@ -89,8 +95,8 @@ public CustomProperty( string name, double value )
/// </summary>
/// <param name="name">The name of this CustomProperty.</param>
/// <param name="value">The value of this CustomProperty.</param>
public CustomProperty( string name, DateTime value )
: this( name, "filetime", value.ToUniversalTime() )
public CustomProperty( string name, DateTime value, Formatting formatting = null )
: this( name, "filetime", value.ToUniversalTime(), formatting )
{
}

Expand All @@ -99,12 +105,12 @@ public CustomProperty( string name, DateTime value )
/// </summary>
/// <param name="name">The name of this CustomProperty.</param>
/// <param name="value">The value of this CustomProperty.</param>
public CustomProperty( string name, bool value )
: this( name, "bool", value )
public CustomProperty( string name, bool value, Formatting formatting = null )
: this( name, "bool", value, formatting )
{
}

internal CustomProperty( string name, string type, string value )
internal CustomProperty( string name, string type, string value, Formatting formatting = null )
{
object realValue;
switch( type )
Expand Down Expand Up @@ -146,14 +152,16 @@ internal CustomProperty( string name, string type, string value )
this.Name = name;
this.Type = type;
this.Value = realValue;
this.Formatting = formatting;
}

private CustomProperty( string name, string type, object value )
private CustomProperty( string name, string type, object value, Formatting formatting = null )
{

this.Name = name;
this.Type = type;
this.Value = value;
this.Formatting = formatting;
}

#endregion
Expand Down
Loading

0 comments on commit 4d8bc57

Please sign in to comment.