lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Number of "eligibles" [Was: Group premium quotes]


From: Greg Chicares
Subject: Re: [lmi] Number of "eligibles" [Was: Group premium quotes]
Date: Wed, 26 Aug 2015 20:16:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 2015-08-26 17:11, Vadim Zeitlin wrote:
> On Wed, 26 Aug 2015 15:54:48 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> On 2015-08-18 21:41, Vadim Zeitlin wrote:
> GC> > On Tue, 18 Aug 2015 18:50:33 +0000 Greg Chicares <address@hidden> wrote:
> GC> [...]
> GC> > GC> PDF says:
> GC> > GC>   "Number of eligibles: 2"
> GC> > GC> but the count should probably be one, not two.
> GC> [...guessing...]
> GC> > GC> that the composite ledger has been counted rather than ignored.
> GC> > 
> GC> >  Yes, you're right.
> GC> 
> GC> I generally feel uncomfortable about adding "+ 1" or "- 1" to fix an 
> anomaly
> GC> (because that often indicates a fencepost error that is likely to manifest
> GC> itself in multiple ways, some of which may have eluded notice), but in 
> this
> GC> case that's what I did (committed 20150826T1546Z, revision 6265) because 
> the
> GC> composite isn't an additional fencepost--it's different in kind. (I tried
> GC> adding an extra member for this count, but it didn't seem cleaner that 
> way.)
> 
>  FWIW I planned to fix it by not incrementing row_num_ for the composite
> ledger in the first place. I'm not sure if you consider this cleaner or
> not, but it seems ever so slightly preferable to me.

I sketched it out that way, too, something like this IIRC:

 group_quote_pdf_generator_wx::group_quote_pdf_generator_wx()
-    :row_num_(0)
+    :row_num_(1) // Use counting numbers for rows.
...
-                rd.values[col] = wxString::Format("%d", 
++row_num_).ToStdString();
+                rd.values[col] = wxString::Format("%d", 
row_num_).ToStdString();
...
     if(!is_composite)
         {
         rows_.push_back(rd);
+        ++row_num_;
         }

If you prefer that, I'll commit it; or, if you see a better way, send a
patch and I'll commit it.

(It would be ideal to use
  multiple_cell_document::cell_parms().size()
but the input data object of that class is (appropriately, I think) hidden.
And (again appropriately, I think) the "ledger" classes don't know the
cardinality of the collection they compose, which has never been needed
anywhere else.)




reply via email to

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