X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2Fpdf-document.cc;h=06c82cc903a6b35c71896086b0eeea181df0f889;hb=1aff4f0d0e68dfccf5236289feb2fb58dfac8936;hp=b9180bd9988b1e712c4c79a445401f5777e33e3e;hpb=16291d257b4e25d4d49588ae0c4f309e6fe81cd1;p=evince.git diff --git a/pdf/xpdf/pdf-document.cc b/pdf/xpdf/pdf-document.cc index b9180bd9..06c82cc9 100644 --- a/pdf/xpdf/pdf-document.cc +++ b/pdf/xpdf/pdf-document.cc @@ -484,8 +484,8 @@ pdf_document_search_page_changed (PdfDocumentSearch *search) &xMin, &yMin, &xMax, &yMax)) { result.page_num = pdf_document->page; - result.highlight_area.x = xMin + pdf_document->page_x_offset; - result.highlight_area.y = yMin + pdf_document->page_y_offset; + result.highlight_area.x = xMin; + result.highlight_area.y = yMin; result.highlight_area.width = xMax - xMin; result.highlight_area.height = yMax - yMin; @@ -499,8 +499,8 @@ pdf_document_search_page_changed (PdfDocumentSearch *search) result.page_num = pdf_document->page; - result.highlight_area.x = xMin + pdf_document->page_x_offset; - result.highlight_area.y = yMin + pdf_document->page_y_offset; + result.highlight_area.x = xMin; + result.highlight_area.y = yMin; result.highlight_area.width = xMax - xMin; result.highlight_area.height = yMax - yMin; @@ -1006,6 +1006,8 @@ pdf_document_get_title (PdfDocument *pdf_document) char *title = NULL; Object info; + if (pdf_document->doc == NULL) + return NULL; pdf_document->doc->getDocInfo (&info); if (info.isDict ()) { @@ -1041,17 +1043,21 @@ pdf_document_get_link (EvDocument *document, int x, int y) LinkAction *action; double link_x, link_y; - /* Zoom */ - link_x = x / pdf_document->scale; - link_y = y / pdf_document->scale; + if (pdf_document->links == NULL) { + return NULL; + } /* Offset */ - link_x -= pdf_document->page_x_offset; - link_y -= pdf_document->page_y_offset; + link_x = x - pdf_document->page_x_offset; + link_y = y - pdf_document->page_y_offset; /* Inverse y */ link_y = pdf_document->out->getBitmapHeight() - link_y; + /* Zoom */ + link_x = link_x / pdf_document->scale; + link_y = link_y / pdf_document->scale; + action = pdf_document->links->find (link_x, link_y); if (action) {