lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b56fb86 6/6: Canonicalize a near-canonical re


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b56fb86 6/6: Canonicalize a near-canonical result
Date: Tue, 28 Feb 2017 22:02:59 -0500 (EST)

branch: master
commit b56fb860159549728cedadf4d072e9bee939e383
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Canonicalize a near-canonical result
    
    Prevent the GUI from transmogrifying simple sequences in the way that
    InputSequence::canonical_form() did before the 20170301T0145 commit.
---
 input_sequence_entry.cpp | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index f7ebc79..b9bdee3 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -533,7 +533,24 @@ std::string InputSequenceEditor::sequence_string()
             }
         }
 
-    return s;
+    // This code largely duplicates InputSequence::canonical_form(),
+    // but, unfortunately, the two cannot readily be combined. (It
+    // would be possible to produce a std::vector<ValueInterval> here
+    // and canonicalize it, but that would not be simpler.) Yet it
+    // makes no sense to maintain the two in parallel, so just
+    // recanonicalize the result to simplify it.
+    return InputSequence
+        (s
+        ,input_.years_to_maturity()
+        ,input_.issue_age        ()
+        ,input_.retirement_age   ()
+        ,input_.inforce_year     ()
+        ,input_.effective_year   ()
+        ,keywords_
+        ,keywords_only_
+        ,default_keyword_
+        ).canonical_form()
+        ;
 }
 
 void SizeWinForText(wxControl* win, wxString const& text)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]