[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] master 4ecd4fe: Print a page number on the dupli
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [lmi-commits] master 4ecd4fe: Print a page number on the duplicate signature page |
Date: |
Fri, 26 Apr 2019 00:11:39 +0200 |
On Thu, 25 Apr 2019 18:29:23 +0000 Greg Chicares <address@hidden> wrote:
GC> On 2019-04-24 17:47, Vadim Zeitlin wrote:
GC> > On Tue, 23 Apr 2019 16:29:15 +0000 Greg Chicares <address@hidden> wrote:
GC> [...]
GC> > GC> Is the {last_page_number_, start_numbering()} mechanism worth keeping?
GC> >
GC> > If we're never going to have unnumbered pages before the first numbered
GC> > one, things could be simplified, of course. I'm not sure how safe such
GC> > assumption would be however and adding this mechanism back if we need it
GC> > again would be much more complicated than just keeping it in the code even
GC> > if we don't use it.
GC>
GC> But see `git show e30ab034bdd149`, which suggests that this mechanism
GC> doesn't actually validate any such thing.
I did see this commit and was very surprised by its findings.
GC> I believe that branch commit demonstrates that the last_page_number_
GC> assertion does nothing if start_numbering() is called only on the last
GC> line of the function, and fails only if it's never called at all.
I couldn't see how could this happen from looking at the code and I can't
reproduce this neither, e.g. applying this patch:
---------------------------------- >8 --------------------------------------
diff --git a/pdf_command_wx.cpp b/pdf_command_wx.cpp
index 96bb26b45..0248de327 100644
--- a/pdf_command_wx.cpp
+++ b/pdf_command_wx.cpp
@@ -2889,8 +2889,8 @@ class pdf_illustration_finra : public pdf_illustration
// Add all the pages.
add<unnumbered_cover_page>();
- numbered_page::start_numbering();
add<finra_basic>();
+ numbered_page::start_numbering();
add<finra_supplemental>();
add<standard_page>("finra_column_headings");
add<standard_page>("finra_notes1");
---------------------------------- >8 --------------------------------------
does result in the expected message box:
---------------------------
Error
---------------------------
Assertion '0 <= last_page_number_' failed.
[pdf_command_wx.cpp : 1268]
---------------------------
OK
---------------------------
Could you please explain what am I missing here?
VZ