Merged from GIT source code. Code provided by Randall Borck and Fainzanj
Changes:
- Fix to allow font family for a paragraph text to be set and read. (faizanj)
- Tightened up how a paragraph is designated as a list item. (faizanj)
- Feature add insert next page section (rgborck)
- Added examples for the section break and the new next page break. (Randall Borck)
- Added Next Page Section break functionality. The new method is called InsertSectionPageBreak(...). (Randall Borck)
- Fix for bug with entering more than one numbering. The system was inserting the abstract in the wrong place. Now the abstract sections are grouped at the beginning and the num section is grouped at the end. This should allow word to find the correct list formatting when a document with multiplelists is created from docx. (Randall Borck)
- Fix for list defaults to help them be more consistant with MS Word. Bullets were indenting twice that of numbers, now they increase the same amount. (Randall Borck)
- Added test for creating text with formatting (fainzanj)
- Added capability to detect underlinestyle (fainzanj)
- Updated the default values to specify Heading styles. (Randall Borck)
- Updated DocX to allow you to create an empty list object. This change is useful for creating a list and then running an iterator or loop to populate it.(Randall Borck)
- Fixed issue with multiple lists in the same document. The second list was overwriting the document numbering instead of appending to it. Also updated the default to be numbering instead of bullet. Added an example of how to create lists.(Randall Borck)
- Updated list items to allow for a start value. (Randall Borck)
- Fixed the Apply Template unit test. (Randall Borck)
- Removed unneeded test. (faizanj)
- Fixed unit tests. (Randall Borck)
- Cleaned up redunant parameters in AddItemList(...) call. (Randall Borck)
- Undid signature changes because of issues. (Randall Borck)
- Fixed a method signature. (Randall Borck)
- Added test for List property (fainzanj)
- Added test for List property(fainzanj)
- Updated documentation comments and default values. (Randall Borck)
- Updates/refactoring changes to list. (Randall Borck)
- Added capability to append list to previous list (fainzanj)
- Updated docx to support adding a list. Added preliminary list support to allow docx to create a list. Currently missing functionality to add elements to the previous list (so each list can only have 1 element in the creation of new lists so far). (faizanj, brendanjerwin)
- Added tests for adding a list (fainzanj)
Known issues:
- Charts related documents doesn't open in Word 2012 (opens up fine in Word 2010)
Additionally:
- Removed StrongNameFile.pfx for easy compile
- Renamed file UnitTests1.cs into DocXUnitTests.cs
- Created Documentation.chm and commited with this release
The get and set methods for Paragraph.Hyperlinks where broken.
This changeset fixes that and another issue. I discovered that Word allows Hyperlinks to be defined in two ways, inline and normal. DocX now supports both.
This changeset also contains new unit tests that will hopefully prevent Hyperlink support from braking again.
Refactor the Table class: RowCount, ColumnCount, Rows properties and Insert/Remove methods. Also refactor CreateTable method - extract the same method CreateTableCell. Add powerfull unit test for this.
This projects contains many of the examples upload on my blog.
Each time docx is released, I will update these examples so as they still work regardless of API changes.
2) Gave UnitTests internal access to DocX.dll
DocX AssemblyInfo.cs
[assembly: InternalsVisibleTo("UnitTests")]
3) Updated target framework to .NET 4.0.
4) Fixed bug with InsertText() Formatting object was set to null by default, should have been new Formatting()
Added support for document orientation (portrait or landscape), below is a code example of how to use this new feature.
// Create a new document.
using (DocX document = DocX.Create(@"C:\Users\Cathal\Desktop\Hello.docx"))
{
// Set this documents orientation to landscape and save.
document.PageLayout.Orientation = Orientation.Landscape;
document.SaveAs(@"Landscape.docx");
// Set this documents orientation to portrait and save.
document.PageLayout.Orientation = Orientation.Portrait;
document.SaveAs(@"Portrait.docx");
}