[poppler] Annot Improving (VIII)

Jeff Muizelaar jeff at infidigm.net
Sun Dec 30 14:43:54 PST 2007


On Sun, Dec 30, 2007 at 11:19:22PM +0100, Iñigo Martínez wrote:
> 
> El dom, 30-12-2007 a las 16:56 -0500, Jeff Muizelaar escribió:
> > On Sun, Dec 30, 2007 at 09:32:05PM +0100, Iñigo Martínez wrote:
> > > Hi:
> > > 
> > > Here goes two new patches. The first one improves AnnotLink support,
> > > anyway it lacks a lot of features. The best option should be to merge
> > > the actual Link implementation with the AnnotLink one.
> > > 
> > > The second patch adds support for AnnotFreeText.
> > > 
> > > I have tested both (I have figured out the old problems, and now I can
> > > test them correctly, anyway I have a few glib test on the way) but I
> > > would prefer a review.
> > 
> > I had a quick look and things looked pretty good. My comments follow
> > below.
> > 
> > -Jeff
> 
> Thank you very much Jeff. I have done the changes to every if wrong
> typed. I wrote them incorrectly in the last patches too.
> 
> I have another question. I think I should move the AnnotQuadPoint
> parsing from AnnotFreeTex code to the class implementation itself.
> Something like (and yes, I will change quadrilateralsLength, I didn't
> liked it neither when I writed it):
> 

Yeah, this change looks like a good idea.

> AnnotQuadPoints::AnnotQuadPoints(Array *array) {
>     quadrilateralsLength = array->arrayGetLength();
>     if ((quadrilateralsLength % 8) == 0) {
>       Object obj2;
> 
>       quadrilaterals = (AnnotQuadPoints **) gmallocn
>         ((quadrilateralsLength / 8), sizeof(AnnotQuadPoints *));
>       for(int i = 0; i < quadrilateralsLength; i += 8) {
>         double x1, y1, x2, y2, x3, y3, x4, y4;
> 
>         (array->arrayGet(i, &obj2)->isNum() ? x1 = obj2.getNum() : x1 =
> 0);
>         obj2.free();
>         (array->arrayGet((i + 1), &obj2)->isNum() ? y1 = obj2.getNum() :
> y1 = 0);
>         obj2.free();
>         (array->arrayGet((i + 2), &obj2)->isNum() ? x2 = obj2.getNum() :
> x2 = 0);
>         obj2.free();
>         (array->arrayGet((i + 3), &obj2)->isNum() ? y2 = obj2.getNum() :
> y2 = 0);
>         obj2.free();
>         (array->arrayGet((i + 4), &obj2)->isNum() ? x3 = obj2.getNum() :
> x3 = 0);
>         obj2.free();
>         (array->arrayGet((i + 5), &obj2)->isNum() ? y3 = obj2.getNum() :
> y3 = 0);
>         obj2.free();
>         (array->arrayGet((i + 6), &obj2)->isNum() ? x4 = obj2.getNum() :
> x4 = 0);
>         obj2.free();
>         (array->arrayGet((i + 7), &obj2)->isNum() ? y4 = obj2.getNum() :
> y4 = 0);
>         obj2.free();
> 
>         quadrilaterals[i / 8] =
>           new AnnotQuadPoints(x1, y1, x2, y2, x3, y3, x4, y4);
>       }
>       quadrilateralsLength /= 8;
>     } else {
>       quadrilaterals = NULL;
>       quadrilateralsLength = 0;
>     }
> }
> 
> I have some doubts with AnnotCalloutLine and AnnotCalloutMultiline.
> Think that they use inheritance so they could need dynamic cast at some
> point in the future.

Can you explain this issue in more detail?

-Jeff


More information about the poppler mailing list