Skip to content

Commit 92b530a

Browse files
authored
Merge pull request #226 from jafin/refactor/conditionals
Drop stale conditionals (WPF, GPI, CORE, true, NETCOREAPP1_1; PORTABLE)
2 parents e8f79a8 + 51dd927 commit 92b530a

File tree

135 files changed

+349
-14187
lines changed

Some content is hidden

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

135 files changed

+349
-14187
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
options:
12+
- framework: net6.0
1213
- framework: net5.0
1314
- framework: netcoreapp3.1
1415
steps:

MigraDocCore.DocumentObjectModel/MigraDoc/MigraDoc.DocumentObjectModel/Color.backup.cs

Lines changed: 0 additions & 323 deletions
This file was deleted.

MigraDocCore.DocumentObjectModel/MigraDoc/MigraDoc.DocumentObjectModel/Font.cs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,6 @@ public bool Subscript
269269
// .Animation = wdAnimationNone
270270
#endregion
271271

272-
#if !PORTABLE
273-
/// <summary>
274-
/// Gets a value indicating whether the specified font exists.
275-
/// </summary>
276-
public static bool Exists(string fontName)
277-
{
278-
System.Drawing.FontFamily[] families = System.Drawing.FontFamily.Families;
279-
foreach (System.Drawing.FontFamily family in families)
280-
{
281-
if (String.Compare(family.Name, fontName, true) == 0)
282-
return true;
283-
}
284-
return false;
285-
}
286-
#endif
287-
288-
289272
#region Internal
290273
/// <summary>
291274
/// Get a bitmask of all non-null properties.
@@ -394,7 +377,6 @@ internal void Serialize(Serializer serializer, Font font)
394377
{
395378
int pos = serializer.BeginContent("Font");
396379

397-
#if true
398380
// Don't write null values if font is null.
399381
// Do write null values if font is not null!
400382
if ((!name.IsNull && Name != String.Empty && font == null) ||
@@ -425,31 +407,7 @@ internal void Serialize(Serializer serializer, Font font)
425407

426408
if (!color.IsNull && (font == null || this.Color.Argb != font.Color.Argb))// && this.Color.RGB != Color.Transparent.RGB)
427409
serializer.WriteSimpleAttribute("Color", this.Color);
428-
#else
429-
if ((!this.name.IsNull && this.Name != String.Empty) && (font == null || this.Name != font.Name))
430-
serializer.WriteSimpleAttribute("Name", this.Name);
431-
432-
if (!this.size.IsNull && (font == null || this.Size != font.Size))
433-
serializer.WriteSimpleAttribute("Size", this.Size);
434-
//NBool and NEnum have to be compared directly to check whether the value Null is
435-
if (!this.bold.IsNull && (font == null || this.Bold != font.Bold))
436-
serializer.WriteSimpleAttribute("Bold", this.Bold);
437-
438-
if (!this.italic.IsNull && (font == null || this.Italic != font.Italic))
439-
serializer.WriteSimpleAttribute("Italic", this.Italic);
440-
441-
if (!this.underline.IsNull && (font == null || this.Underline != font.Underline))
442-
serializer.WriteSimpleAttribute("Underline", this.Underline);
443410

444-
if (!this.superscript.IsNull && (font == null || this.Superscript != font.Superscript))
445-
serializer.WriteSimpleAttribute("Superscript", this.Superscript);
446-
447-
if (!this.subscript.IsNull && (font == null || this.Subscript != font.Subscript))
448-
serializer.WriteSimpleAttribute("Subscript", this.Subscript);
449-
450-
if (!this.color.IsNull && (font == null || this.Color.Argb != font.Color.Argb))// && this.Color.RGB != Color.Transparent.RGB)
451-
serializer.WriteSimpleAttribute("Color", this.Color);
452-
#endif
453411
serializer.EndContent(pos);
454412
}
455413
}

0 commit comments

Comments
 (0)