Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-23 Thread Francesco Pretto
On 23 February 2018 at 19:27, Francesco Pretto wrote: > I tested it with following code: > Oops...a missing fragment in the test code. Here it again complete: PdfMemDocument document; PdfRect rect; auto pageA = document.InsertPage(rect, 0); auto pageB =

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-23 Thread Francesco Pretto
On 23 February 2018 at 01:32, Matthew Brincke wrote: > you mean that the GetKey() call in > src/doc/PdfPagesTree.cpp line 620 throws then? No. The crash I noticed will happen with empty document, calling InserPage with index 0. PdfPagesTreeCache::AddPageObject() will be called

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Matthew Brincke
Hello Francesco, hello all, > On 23 February 2018 at 01:05 Francesco Pretto wrote: > > > On 23 February 2018 at 00:13, Matthew Brincke wrote: > > where did it crash? What kind of crash was it, please? I've looked in > > the source code and couldn't find a

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Francesco Pretto
On 23 February 2018 at 00:13, Matthew Brincke wrote: > where did it crash? What kind of crash was it, please? I've looked in > the source code and couldn't find a reason for a crash, the index -1 > for InsertPage(int, PdfPage*) just means "insert before the first page". >

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Matthew Brincke
Hello Francesco, hello all, > On 22 February 2018 at 12:20 Francesco Pretto wrote: > > > This is also specified in the API documentation. Without the fix > there was a crash trying to insert page at index 0 where did it crash? What kind of crash was it, please? I've looked in

[Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Francesco Pretto
This is also specified in the API documentation. Without the fix there was a crash trying to insert page at index 0 --- src/doc/PdfPagesTree.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/PdfPagesTree.cpp b/src/doc/PdfPagesTree.cpp index 2ee8ea2..9d851d3