<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Add getter and setter for annotation's rectangle"
href="https://bugs.freedesktop.org/show_bug.cgi?id=70901#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Add getter and setter for annotation's rectangle"
href="https://bugs.freedesktop.org/show_bug.cgi?id=70901">bug 70901</a>
from <span class="vcard"><a class="email" href="mailto:carlosgc@gnome.org" title="Carlos Garcia Campos <carlosgc@gnome.org>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=70901#c6">comment #6</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=70901#c5">comment #5</a>)
> > (In reply to <a href="show_bug.cgi?id=70901#c3">comment #3</a>)
> > > Created <span class="bz_obsolete"><a href="attachment.cgi?id=88728" name="attach_88728" title="glib: Add getter and setter for annotation's rectangle">attachment 88728</a> <a href="attachment.cgi?id=88728&action=edit" title="glib: Add getter and setter for annotation's rectangle">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=70901&attachment=88728'>[review]</a> [review] [review] [review]
> > > glib: Add getter and setter for annotation's rectangle
> > >
> > > Updated patch.
> > >
> > > Instead of using a reference in poppler_annot_get_rectangle, I think it is
> > > better to just return a PopplerRectangle. I am unsure of the default values
> > > for g_return_val_if_fail. Either 0,0,0,0 or -1,-1,-1,-1.
> >
> > Same idea here. Instead of returning the struct, you can return a pointer as
> > an out parameter. To avoid the problem of how to represent an invalid
> > rectangle, make the function return a boolean. When the function returns
> > FALSE the value of the rectangle is undefined, whatever the user passed.
> >
> > PopplerRectangle rect;
> > if (!poppler_annot_get_rect (annot, &rect))
> > /* Do whatever with the rect */
>
> This is what the first patch did.</span >
Yes, and I only asked when can this return FALSE, because I still think that
from the user point of view, this should never be false. The rectangle is a
required field of any annotation, so it should always return a valid rectangle,
otherwise it's a bug because we are discarding invalid annots in the core. So,
I think we should just make it void and add g_return_if_fail if the passed in
pointer is not an annot. It's a programmer error to pass an invalid annot.
Sorry for the misunderstanding.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>