summaryrefslogtreecommitdiff
path: root/glib/poppler-annot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'glib/poppler-annot.cc')
-rw-r--r--glib/poppler-annot.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
index a8bbd76f..08cd3633 100644
--- a/glib/poppler-annot.cc
+++ b/glib/poppler-annot.cc
@@ -924,7 +924,6 @@ const PDFRectangle *_poppler_annot_get_cropbox(PopplerAnnot *poppler_annot)
*/
void poppler_annot_get_rectangle(PopplerAnnot *poppler_annot, PopplerRectangle *poppler_rect)
{
- PDFRectangle *annot_rect;
const PDFRectangle *crop_box;
PDFRectangle zerobox;
Page *page = nullptr;
@@ -938,11 +937,11 @@ void poppler_annot_get_rectangle(PopplerAnnot *poppler_annot, PopplerRectangle *
crop_box = &zerobox;
}
- annot_rect = poppler_annot->annot->getRect();
- poppler_rect->x1 = annot_rect->x1 - crop_box->x1;
- poppler_rect->x2 = annot_rect->x2 - crop_box->x1;
- poppler_rect->y1 = annot_rect->y1 - crop_box->y1;
- poppler_rect->y2 = annot_rect->y2 - crop_box->y1;
+ const PDFRectangle &annot_rect = poppler_annot->annot->getRect();
+ poppler_rect->x1 = annot_rect.x1 - crop_box->x1;
+ poppler_rect->x2 = annot_rect.x2 - crop_box->x1;
+ poppler_rect->y1 = annot_rect.y1 - crop_box->y1;
+ poppler_rect->y2 = annot_rect.y2 - crop_box->y1;
}
/**
@@ -1139,7 +1138,6 @@ gboolean poppler_annot_markup_get_popup_rectangle(PopplerAnnotMarkup *poppler_an
{
AnnotMarkup *annot;
Annot *annot_popup;
- PDFRectangle *annot_rect;
g_return_val_if_fail(POPPLER_IS_ANNOT_MARKUP(poppler_annot), FALSE);
g_return_val_if_fail(poppler_rect != nullptr, FALSE);
@@ -1149,11 +1147,11 @@ gboolean poppler_annot_markup_get_popup_rectangle(PopplerAnnotMarkup *poppler_an
if (!annot_popup)
return FALSE;
- annot_rect = annot_popup->getRect();
- poppler_rect->x1 = annot_rect->x1;
- poppler_rect->x2 = annot_rect->x2;
- poppler_rect->y1 = annot_rect->y1;
- poppler_rect->y2 = annot_rect->y2;
+ const PDFRectangle &annot_rect = annot_popup->getRect();
+ poppler_rect->x1 = annot_rect.x1;
+ poppler_rect->x2 = annot_rect.x2;
+ poppler_rect->y1 = annot_rect.y1;
+ poppler_rect->y2 = annot_rect.y2;
return TRUE;
}