Skip to content

Commit 383fb48

Browse files
committed
V4.0.0 Released
1 parent a17932d commit 383fb48

File tree

154 files changed

+4303
-687
lines changed

Some content is hidden

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

154 files changed

+4303
-687
lines changed

Xceed.Document.NET/AssemblyVersionInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -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 = "3.0";
24+
public const string BaseVersion = "4.0";
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -26,7 +26,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
2626

2727
[assembly: AssemblyCompany( "Xceed Software Inc." )]
2828
[assembly: AssemblyProduct( "Xceed Document for .NET" )]
29-
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2009-2024" )]
29+
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2009-2025" )]
3030
[assembly: AssemblyCulture("")]
3131

3232

Binary file not shown.
Binary file not shown.

Xceed.Document.NET/Src/Bookmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

Xceed.Document.NET/Src/BookmarkCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

Xceed.Document.NET/Src/Border.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -14,7 +14,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1414
*************************************************************************************/
1515

1616

17-
using System.Drawing;
17+
using Xceed.Drawing;
1818

1919
namespace Xceed.Document.NET
2020
{

Xceed.Document.NET/Src/Borders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -15,12 +15,10 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1515

1616

1717
using System;
18-
using System.ComponentModel;
19-
using System.Drawing;
2018
using System.Globalization;
2119
using System.Linq;
22-
using System.Xml;
2320
using System.Xml.Linq;
21+
using Xceed.Drawing;
2422

2523
namespace Xceed.Document.NET
2624
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -18,11 +18,9 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1818
using System.Collections.Generic;
1919
using System.Linq;
2020
using System.Xml.Linq;
21-
using System.Collections;
22-
using System.Drawing;
23-
using System.Globalization;
2421
using System.IO.Packaging;
2522
using System.IO;
23+
using Xceed.Drawing;
2624

2725
namespace Xceed.Document.NET
2826
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -17,11 +17,11 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1717
using System;
1818
using System.Collections;
1919
using System.Collections.Generic;
20-
using System.Drawing;
2120
using System.Globalization;
2221
using System.IO.Packaging;
2322
using System.Linq;
2423
using System.Xml.Linq;
24+
using Xceed.Drawing;
2525

2626
namespace Xceed.Document.NET
2727
{
@@ -79,8 +79,7 @@ public Color Color
7979
var val = srgbClr.Attribute( XName.Get( "val" ) );
8080
if( val != null )
8181
{
82-
var rgb = Color.FromArgb( Int32.Parse( val.Value, NumberStyles.HexNumber ) );
83-
return Color.FromArgb( 255, rgb );
82+
var rgb = Color.Parse( val.Value );
8483
}
8584
}
8685

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

Xceed.Document.NET/Src/Container.cs

Lines changed: 78 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
@@ -465,7 +465,74 @@ public virtual bool ReplaceTextWithObject( ObjectReplaceTextOptions replaceTextO
465465
return this.ReplaceTextCore( replaceTextOptions );
466466
}
467467

468+
public Picture ReplacePicture( Picture toBeReplaced, Picture replaceWith )
469+
{
470+
if( toBeReplaced == null )
471+
return null;
472+
473+
Picture newPicture = null;
474+
var paragraphContainingOldPicture = this.Paragraphs.FirstOrDefault( paragraph => paragraph.Pictures.FirstOrDefault( picture => picture.Id == toBeReplaced.Id ) != null );
475+
if( paragraphContainingOldPicture != null )
476+
{
477+
newPicture = paragraphContainingOldPicture.ReplacePicture( toBeReplaced, replaceWith );
478+
}
479+
480+
return newPicture;
481+
}
482+
483+
484+
485+
486+
487+
488+
489+
public virtual bool RemoveText( string startingTag, string endingTag )
490+
{
491+
var paragraphs = this.Paragraphs;
492+
var startingParagraph = paragraphs.FirstOrDefault( p => p.Text.Contains( startingTag ) );
493+
var endingParagraph = paragraphs.FirstOrDefault( p => p.Text.Contains( endingTag ) );
494+
495+
if( ( startingParagraph == null ) || ( endingParagraph == null ) )
496+
return false;
497+
498+
var startIndex = startingParagraph.Text.IndexOf( startingTag );
499+
if( startIndex >= 0 )
500+
{
501+
var endIndex = startingParagraph.Text.IndexOf( endingTag );
502+
503+
// Text to remove starts and ends in the same paragraph.
504+
if( endIndex > 0 )
505+
{
506+
startingParagraph.RemoveText( startIndex, endIndex + endingTag.Length - startIndex, false, true );
507+
}
508+
else
509+
{
510+
// Text to remove starts in this paragraph, but ends in another paragraph.
511+
startingParagraph.RemoveText( startIndex, startingParagraph.Text.Length - startIndex, false, true );
512+
var currentParagraph = startingParagraph.NextParagraph;
513+
while( true && ( currentParagraph != null ) )
514+
{
515+
endIndex = currentParagraph.Text.IndexOf( endingTag );
516+
517+
// Text to remove ends in this paragraph.
518+
if( endIndex >= 0 )
519+
{
520+
currentParagraph.RemoveText( 0, endIndex + endingTag.Length, false, true );
521+
return true;
522+
}
523+
else
524+
{
525+
// Text to remove is not located in this paragraph so we remove this whole paragraph.
526+
var nextParagraph = currentParagraph.NextParagraph;
527+
currentParagraph.Remove( false );
528+
currentParagraph = nextParagraph;
529+
}
530+
}
531+
}
532+
}
468533

534+
return false;
535+
}
469536

470537
public virtual void InsertAtBookmark( string toInsert, string bookmarkName, Formatting formatting = null )
471538
{
@@ -1062,7 +1129,7 @@ internal int RecursiveRemoveText( XElement element, Formatting formattingToMatch
10621129
return count;
10631130
}
10641131

1065-
internal void RemoveParagraph( Paragraph paragraph, bool trackChanges )
1132+
internal void RemoveParagraph( Paragraph paragraph, bool trackChanges, RemoveParagraphFlags removeParagraphFlags )
10661133
{
10671134
if( trackChanges )
10681135
{
@@ -1084,24 +1151,16 @@ internal void RemoveParagraph( Paragraph paragraph, bool trackChanges )
10841151
{
10851152
if( temp.Count() > 0 )
10861153
{
1087-
e.AddBeforeSelf( Paragraph.CreateEdit( EditType.del, now, temp.Elements() ) );
1154+
e.AddBeforeSelf( Document.CreateEdit( EditType.del, now, temp.Elements() ) );
10881155
temp.Clear();
10891156
}
10901157
}
10911158
}
10921159

10931160
if( temp.Count() > 0 )
1094-
paragraph.Xml.Add( Paragraph.CreateEdit( EditType.del, now, temp ) );
1161+
paragraph.Xml.Add( Document.CreateEdit( EditType.del, now, temp ) );
10951162

1096-
if( paragraph.FollowingTables != null )
1097-
{
1098-
foreach( var table in paragraph.FollowingTables.ToList() )
1099-
{
1100-
paragraph.FollowingTables.Remove( table );
1101-
1102-
table.Remove();
1103-
}
1104-
}
1163+
paragraph.UpdateObjects( removeParagraphFlags );
11051164

11061165
//Remove paragraph from Cache
11071166
this.RemoveParagraphFromCache( paragraph );
@@ -1118,21 +1177,7 @@ internal void RemoveParagraph( Paragraph paragraph, bool trackChanges )
11181177
}
11191178
else
11201179
{
1121-
if( paragraph.FollowingTables != null )
1122-
{
1123-
foreach( var table in paragraph.FollowingTables.ToList() )
1124-
{
1125-
paragraph.FollowingTables.Remove( table );
1126-
1127-
table.Remove();
1128-
}
1129-
}
1130-
1131-
foreach( var picture in paragraph.Pictures )
1132-
{
1133-
picture.Remove();
1134-
}
1135-
1180+
paragraph.UpdateObjects( removeParagraphFlags );
11361181

11371182
//Remove paragraph from Cache
11381183
this.RemoveParagraphFromCache( paragraph );
@@ -1349,10 +1394,14 @@ private bool ReplaceTextCore( ReplaceTextOptionsBase replaceTextOptions )
13491394
{
13501395
result = p.ReplaceText( replaceTextOptions as FunctionReplaceTextOptions );
13511396
}
1352-
else
1397+
else if( replaceTextOptions is ObjectReplaceTextOptions )
13531398
{
13541399
result = p.ReplaceTextWithObject( replaceTextOptions as ObjectReplaceTextOptions );
13551400
}
1401+
else
1402+
{
1403+
throw new InvalidDataException( "Unknown ReplaceTextOptions. ");
1404+
}
13561405

13571406
if( !replaceSuccess )
13581407
{

Xceed.Document.NET/Src/CustomProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

Xceed.Document.NET/Src/DocProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
DocX – DocX is the community edition of Xceed Words for .NET
44
5-
Copyright (C) 2009-2024 Xceed Software Inc.
5+
Copyright (C) 2009-2025 Xceed Software Inc.
66
77
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
88
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

0 commit comments

Comments
 (0)