From 7220f4b4a09fd0278626bc5c787904c7f5df8ee5 Mon Sep 17 00:00:00 2001 From: Tom Jebo Date: Thu, 5 Jan 2023 09:40:24 -0800 Subject: [PATCH] clean up syntax --- .../Packaging/OpenSettings.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/DocumentFormat.OpenXml.Framework/Packaging/OpenSettings.cs b/src/DocumentFormat.OpenXml.Framework/Packaging/OpenSettings.cs index a14dc53c3..017d23d1a 100644 --- a/src/DocumentFormat.OpenXml.Framework/Packaging/OpenSettings.cs +++ b/src/DocumentFormat.OpenXml.Framework/Packaging/OpenSettings.cs @@ -10,9 +10,7 @@ namespace DocumentFormat.OpenXml.Packaging /// public class OpenSettings { - private bool? _autoSave; private MarkupCompatibilityProcessSettings? _mcSettings; - private bool? _ignoreExceptionsOnCalcChainPartMissing; /// /// Initializes a new instance of the class. @@ -40,11 +38,7 @@ internal OpenSettings(OpenSettings? other) /// Gets or sets a value indicating whether to auto save document modifications. /// The default value is true. /// - public bool AutoSave - { - get => _autoSave ?? true; - set => _autoSave = value; - } + public bool AutoSave { get; set; } = true; /// /// Gets or sets the value of the markup compatibility processing mode. @@ -53,10 +47,7 @@ public MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings { get { - if (_mcSettings is null) - { - _mcSettings = new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.NoProcess, FileFormatVersions.Office2007); - } + _mcSettings ??= new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.NoProcess, FileFormatVersions.Office2007); return _mcSettings; } @@ -84,10 +75,6 @@ public MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings /// Gets or sets a value indicating whether to ignore an exception if the calcChain part is missing. /// The default value is false which means missing calcChain part will throw an exception upon package open. /// - public bool IgnoreExceptionOnCalcChainPartMissing - { - get => _ignoreExceptionsOnCalcChainPartMissing ?? false; - set => _ignoreExceptionsOnCalcChainPartMissing = value; - } + public bool IgnoreExceptionOnCalcChainPartMissing { get; set; } } }