diff --git a/Src/xWorks/DictionaryDetailsView/SenseOptionsView.cs b/Src/xWorks/DictionaryDetailsView/SenseOptionsView.cs index 3a9300c717..0b5803838a 100644 --- a/Src/xWorks/DictionaryDetailsView/SenseOptionsView.cs +++ b/Src/xWorks/DictionaryDetailsView/SenseOptionsView.cs @@ -66,8 +66,12 @@ public string NumberingStyle { get { - // Return null if string is empty, because returning an empty string for reversal numbers - // also forces sense numbers not to be displayed. Null doesn't cause the same problem. + // Handles NumberingStyle for the dictionary/reversal configuration dialog preview display. + // Both empty string and null mean there is no numbering style to use. + // Numbering style will be null if no numbering style has ever been selected. + // Numbering style will be an empty string if a numbering style was selected at some point and then turned back off. + // Returning an empty string for reversal numbering style forces sense numbers to be turned off too, but null doesn't cause this problem. + // Return null if numbering style is empty. var formatString = ((NumberingStyleComboItem)dropDownNumberingStyle.SelectedItem).FormatString; return string.IsNullOrEmpty(formatString) ? null : formatString; } diff --git a/Src/xWorks/DictionaryNodeOptions.cs b/Src/xWorks/DictionaryNodeOptions.cs index 209d8768a6..58a6322030 100644 --- a/Src/xWorks/DictionaryNodeOptions.cs +++ b/Src/xWorks/DictionaryNodeOptions.cs @@ -56,7 +56,22 @@ public class DictionaryNodeSenseOptions : DictionaryNodeOptions // Example values: ""->none; %O->1.2.3; %d->1, 2, 3 [XmlAttribute(AttributeName = "numberingStyle")] - public string NumberingStyle { get; set; } + private string _numberingStyle; + + public string NumberingStyle + { + get + { + // Handles NumberingStyle for the dictionary and reversal displays. + // Both empty string and null mean there is no numbering style to use. + // Numbering style will be null if no numbering style has ever been selected. + // Numbering style will be an empty string if a numbering style was selected at some point and then turned back off. + // Returning an empty string for reversal numbering style forces sense numbers to be turned off too, but null doesn't cause this problem. + // Return null if numbering style is empty. + return string.IsNullOrEmpty(_numberingStyle)? null : _numberingStyle; + } + set { _numberingStyle = value; } + } // Example values: ""->none; %j->Joined; %.->Separated by dot [XmlAttribute(AttributeName = "parentSenseNumberingStyle")]