Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PDFsharp-Team committed Oct 11, 2023
1 parent 91feca7 commit a8fe909
Show file tree
Hide file tree
Showing 72 changed files with 1,159 additions and 307 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PDFsharp & MigraDoc 6.0

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

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.

Expand Down
4 changes: 4 additions & 0 deletions dev/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ function GetDllInfo($project) {

$debugFolder = Join-Path -Path $projectFolder "bin\debug"
$dllFile = Get-ChildItem -Path $debugFolder -Filter "$projectName.dll" -Recurse -ErrorAction SilentlyContinue -Force | Select-Object -first 1

if ($dllFile -eq $null) {
Write-Error "Could not finde file `"$debugFolder\**\$projectName.dll`". Maybe Debug Build has not been built."
}

$dllFolder = $dllFile.Directory.FullName | Resolve-Path -Relative
$dllFileName = $dllFile.Name
Expand Down
12 changes: 5 additions & 7 deletions docs/DevNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@

README.md


## Comments

### DELETE yyyy-mm-dd

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

After the specified date the code can be deleted.

### KEEP

Here is older code that is not used anymore but keeps here for
Here is older code that is not used anymore but kept here for
documentation or reference purposes and shall not be removed.

### TODO
Expand All @@ -36,9 +35,8 @@ for better reliability.

### OBSERVATION


### EXPERIMENTAL


### TEST
Here is code that should be coved by (more) unit tests.

Here is code that should be coved by (more) unit tests.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public static class BackwardCompatibility
public static bool DoNotCreateLastTable { get; set; } = false;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,7 @@ internal bool MoveToNextParagraphContentLine(bool rootLevel)
return false;
}

//TODO NiSc
//NYI
//TODO NiSc NYI
//Check.NotImplemented("empty line at non-root level");
}
break;
Expand Down Expand Up @@ -743,7 +742,7 @@ internal int GetTokenValueAsInt()
string number = _token.Substring(2);
return Int32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
}
//TODO NiSc
//TODO NiSc Check?
//Check.Assert(false);
return 0;
}
Expand All @@ -762,7 +761,7 @@ internal uint GetTokenValueAsUInt()
string number = _token.Substring(2);
return UInt32.Parse(number, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
}
//TODO NiSc
//TODO NiSc Check.
//Check.Assert(false);
return 0;
}
Expand Down Expand Up @@ -818,7 +817,7 @@ internal char ScanNextChar()
}
//else
//{
// //TODO NiSc
// //TOxDO NiSc NYI
// //NYI: MacOS uses CR only
// //Check.NotImplemented();
//}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static partial void ArgbValueIsConsideredEmptyColor(
// Differences in RTF vs Word (decimal tab)
// Performance optimization

// TODO Use logging instead of Console.WriteLine.
// TODO remove all Console.WriteLine calls.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public static class AppLogEvents

// TODO Not yet used.

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

#if DEBUG_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ internal override void Serialize(Serializer serializer)
var chartObject = Parent as Chart;
Debug.Assert(chartObject != null);

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

if (Values.MinimumScale is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ internal override void Serialize(Serializer serializer)
if (Values.Alignment is not null)
serializer.WriteSimpleAttribute("Alignment", Alignment);

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

if (Values.Caption is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public string Code
}

/// <summary>
/// ??? TODO
/// Ratio between narrow and wide lines.
/// </summary>
public double LineRatio
{
Expand All @@ -85,7 +85,7 @@ public double LineRatio
}

/// <summary>
/// ??? TODO
/// Height of lines.
/// </summary>
public double LineHeight
{
Expand All @@ -94,7 +94,7 @@ public double LineHeight
}

/// <summary>
/// ??? TODO
/// Width of a narrow line.
/// </summary>
public double NarrowLineWidth
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Unit DistanceRight
internal override void Serialize(Serializer serializer)
{
if (IsNull())
return; // BUG??? Not detected by the caller anymore.
return; // IsNull called here so callers must not make this check.

var pos = serializer.BeginContent("WrapFormat");
if (Values.Style is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ internal Cell(DocumentObject parent) : base(parent)
protected override object DeepCopy()
{
var cell = (Cell)base.DeepCopy();
// Remove all references to the original object hierarchy.
cell.ResetCachedValues();
// TODO Call ResetCachedValues() for all classes where this is needed!

// Remove all references to the original object hierarchy.
if (cell.Values.Format != null)
{
cell.Values.Format = cell.Values.Format.Clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void SetShading(int clm, int row, int clms, int rows, Color clr)
/// Sets the borders surrounding the specified range of the table.
/// </summary>
public void SetEdge(int clm, int row, int clms, int rows,
Edge edge, BorderStyle style, Unit width, Color clr) // TODO: make Color?
Edge edge, BorderStyle style, Unit width, Color clr)
{
int maxRow = row + rows - 1;
int maxClm = clm + clms - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static IEnumerable<T> GetElements<T>(this DocumentObject documentObject,
yield return element;

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

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

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

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

var children = element.GetElementsRecursively(includeHeaderFooter);
foreach (var child in children)
Expand Down
Loading

0 comments on commit a8fe909

Please sign in to comment.