Skip to content

Commit a8fe909

Browse files
committed
1 parent 91feca7 commit a8fe909

File tree

72 files changed

+1159
-307
lines changed

Some content is hidden

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

72 files changed

+1159
-307
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PDFsharp & MigraDoc 6.0
22

3-
Version **6.0.0-preview-3**
4-
Published **2023-07-27**
3+
Version **6.0.0-preview-4**
4+
Published **2023-10-11**
55

66
This is the third preview of the **PDFsharp** project, the main project of PDFsharp & MigraDoc 6.0 with updates for C# 10 and .NET 6.0.
77

dev/run-tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function GetDllInfo($project) {
3939

4040
$debugFolder = Join-Path -Path $projectFolder "bin\debug"
4141
$dllFile = Get-ChildItem -Path $debugFolder -Filter "$projectName.dll" -Recurse -ErrorAction SilentlyContinue -Force | Select-Object -first 1
42+
43+
if ($dllFile -eq $null) {
44+
Write-Error "Could not finde file `"$debugFolder\**\$projectName.dll`". Maybe Debug Build has not been built."
45+
}
4246

4347
$dllFolder = $dllFile.Directory.FullName | Resolve-Path -Relative
4448
$dllFileName = $dllFile.Name

docs/DevNotes.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@
66

77
README.md
88

9-
109
## Comments
1110

1211
### DELETE yyyy-mm-dd
1312

14-
Here is code that is replaced by newer code and should be deleted in the future.
15-
But keeps here at the moment as reference in case the new code has bugs.
13+
Here is code that was replaced by newer code and should be deleted in the future.
14+
But kept here at the moment as reference in case the new code has bugs.
1615

1716
After the specified date the code can be deleted.
1817

1918
### KEEP
2019

21-
Here is older code that is not used anymore but keeps here for
20+
Here is older code that is not used anymore but kept here for
2221
documentation or reference purposes and shall not be removed.
2322

2423
### TODO
@@ -36,9 +35,8 @@ for better reliability.
3635

3736
### OBSERVATION
3837

39-
4038
### EXPERIMENTAL
4139

42-
4340
### TEST
44-
Here is code that should be coved by (more) unit tests.
41+
42+
Here is code that should be coved by (more) unit tests.

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/Capabilities.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public static class BackwardCompatibility
7676
public static bool DoNotCreateLastTable { get; set; } = false;
7777

7878
/// <summary>
79-
/// NYI
79+
/// Gets or sets a flag that defines what LastSection does if no section exists.
80+
/// If false, which is the default value, a new section is created and returned.
81+
/// If true, no section will be created and null is returned instead.
8082
/// </summary>
8183
public static bool DoNotCreateLastSection { get; set; } = false;
8284

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.IO/DdlScanner.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,7 @@ internal bool MoveToNextParagraphContentLine(bool rootLevel)
607607
return false;
608608
}
609609

610-
//TODO NiSc
611-
//NYI
610+
//TODO NiSc NYI
612611
//Check.NotImplemented("empty line at non-root level");
613612
}
614613
break;
@@ -743,7 +742,7 @@ internal int GetTokenValueAsInt()
743742
string number = _token.Substring(2);
744743
return Int32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
745744
}
746-
//TODO NiSc
745+
//TODO NiSc Check?
747746
//Check.Assert(false);
748747
return 0;
749748
}
@@ -762,7 +761,7 @@ internal uint GetTokenValueAsUInt()
762761
string number = _token.Substring(2);
763762
return UInt32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
764763
}
765-
//TODO NiSc
764+
//TODO NiSc Check.
766765
//Check.Assert(false);
767766
return 0;
768767
}
@@ -818,7 +817,7 @@ internal char ScanNextChar()
818817
}
819818
//else
820819
//{
821-
// //TODO NiSc
820+
// //TOxDO NiSc NYI
822821
// //NYI: MacOS uses CR only
823822
// //Check.NotImplemented();
824823
//}

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/LogMessages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static partial void ArgbValueIsConsideredEmptyColor(
2828
// Differences in RTF vs Word (decimal tab)
2929
// Performance optimization
3030

31+
// TODO Use logging instead of Console.WriteLine.
3132
// TODO remove all Console.WriteLine calls.
3233
}
3334
}

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Internals/Logging.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public static class AppLogEvents
2424

2525
// TODO Not yet used.
2626

27-
public static EventId FontCreated = new(1000, "Font created");
28-
public static EventId FontFound = new(1001, "Font found");
29-
public static EventId FontNotFound = new(1002, "Font not found");
27+
public static EventId FontCreated = new(AppLogEventIds.MDDOM + 0, "Font created");
28+
public static EventId FontFound = new(AppLogEventIds.MDDOM + 1, "Font found");
29+
public static EventId FontNotFound = new(AppLogEventIds.MDDOM + 2, "Font not found");
3030

3131
#if DEBUG_
3232

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/Axis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ internal override void Serialize(Serializer serializer)
221221
var chartObject = Parent as Chart;
222222
Debug.Assert(chartObject != null);
223223

224-
serializer.WriteLine("\\" + chartObject.CheckAxis(this)); // HACK // BUG: What if Parent is not Chart?
224+
serializer.WriteLine("\\" + chartObject.CheckAxis(this)); // Exception if Parent is not Chart. This is by design.
225225
var pos = serializer.BeginAttributes();
226226

227227
if (Values.MinimumScale is not null)

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes.Charts/AxisTitle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ internal override void Serialize(Serializer serializer)
123123
if (Values.Alignment is not null)
124124
serializer.WriteSimpleAttribute("Alignment", Alignment);
125125

126-
if (Values.VerticalAlignment is not null /*&& !Values.VerticalAlignment.IsNull*/) // BUG??? IsNull?
126+
if (Values.VerticalAlignment is not null)
127127
serializer.WriteSimpleAttribute("VerticalAlignment", VerticalAlignment);
128128

129129
if (Values.Caption is not null)

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/Barcode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public string Code
7676
}
7777

7878
/// <summary>
79-
/// ??? TODO
79+
/// Ratio between narrow and wide lines.
8080
/// </summary>
8181
public double LineRatio
8282
{
@@ -85,7 +85,7 @@ public double LineRatio
8585
}
8686

8787
/// <summary>
88-
/// ??? TODO
88+
/// Height of lines.
8989
/// </summary>
9090
public double LineHeight
9191
{
@@ -94,7 +94,7 @@ public double LineHeight
9494
}
9595

9696
/// <summary>
97-
/// ??? TODO
97+
/// Width of a narrow line.
9898
/// </summary>
9999
public double NarrowLineWidth
100100
{

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Shapes/WrapFormat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Unit DistanceRight
8181
internal override void Serialize(Serializer serializer)
8282
{
8383
if (IsNull())
84-
return; // BUG??? Not detected by the caller anymore.
84+
return; // IsNull called here so callers must not make this check.
8585

8686
var pos = serializer.BeginContent("WrapFormat");
8787
if (Values.Style is not null)

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Cell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ internal Cell(DocumentObject parent) : base(parent)
4545
protected override object DeepCopy()
4646
{
4747
var cell = (Cell)base.DeepCopy();
48-
// Remove all references to the original object hierarchy.
4948
cell.ResetCachedValues();
50-
// TODO Call ResetCachedValues() for all classes where this is needed!
49+
50+
// Remove all references to the original object hierarchy.
5151
if (cell.Values.Format != null)
5252
{
5353
cell.Values.Format = cell.Values.Format.Clone();

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Tables/Table.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void SetShading(int clm, int row, int clms, int rows, Color clr)
128128
/// Sets the borders surrounding the specified range of the table.
129129
/// </summary>
130130
public void SetEdge(int clm, int row, int clms, int rows,
131-
Edge edge, BorderStyle style, Unit width, Color clr) // TODO: make Color?
131+
Edge edge, BorderStyle style, Unit width, Color clr)
132132
{
133133
int maxRow = row + rows - 1;
134134
int maxClm = clm + clms - 1;

src/foundation/src/MigraDoc/src/MigraDoc.DocumentObjectModel/DocumentObjectModel.Visitors/ElementsExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static IEnumerable<T> GetElements<T>(this DocumentObject documentObject,
112112
yield return element;
113113

114114
if (element == null) // Null elements have no children.
115-
continue; // BUG Or throw instead?
115+
continue;
116116

117117
var children = element.GetElementsRecursively(includeHeaderFooter);
118118
foreach (var child in children)
@@ -135,7 +135,7 @@ public static IEnumerable<T> GetElements<T>(this DocumentObject documentObject,
135135
foreach (var element in elements)
136136
{
137137
var type = element?.GetType();
138-
var stop = type != null && stopAtElements.Contains(type); // BUG Or throw instead?
138+
var stop = type != null && stopAtElements.Contains(type);
139139

140140
if (stop && !includeStoppingElements)
141141
yield break;
@@ -146,7 +146,7 @@ public static IEnumerable<T> GetElements<T>(this DocumentObject documentObject,
146146
yield break;
147147

148148
if (element == null) // Null elements have no children.
149-
continue; // BUG Or throw instead?
149+
continue;
150150

151151
var children = element.GetElementsRecursively(includeHeaderFooter);
152152
foreach (var child in children)

0 commit comments

Comments
 (0)