<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#c5">Comment # 5</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#c3">comment #3</a>)
<span class="quote">> Created <span class=""><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]
> 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.</span >

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 */</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>