]> www.fi.muni.cz Git - evince.git/commitdiff
Make clipboard work again
authorMarco Pesenti Gritti <mpg@redhat.com>
Tue, 5 Apr 2005 09:34:03 +0000 (09:34 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Tue, 5 Apr 2005 09:34:03 +0000 (09:34 +0000)
2005-04-05  Marco Pesenti Gritti <mpg@redhat.com>

        * pdf/ev-poppler.cc:

        Make clipboard work again

ChangeLog
pdf/ev-poppler.cc

index ac173d374395e75302d31b1b2e30ac1160fffe1b..7c7cb417bf3fc9a4a1befe9031ac7cf8184dd2ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-05  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * pdf/ev-poppler.cc:
+
+       Make clipboard work again
+
 2005-04-04  Kristian Høgsberg  <krh@redhat.com>
 
        Make searching work again.
index 7fcc9c0d630ebe8607d4b2c03b1dc46933772703..4ca7d01798921e3600a00134479ab457d0a2a2d7 100644 (file)
@@ -328,7 +328,27 @@ pdf_document_set_password (EvDocumentSecurity *document_security,
        document->password = g_strdup (password);
 }
 
+static char *
+pdf_document_get_text (EvDocument *document, int page, EvRectangle *rect)
+{
+       PdfDocument *pdf_document = PDF_DOCUMENT (document);
+       PopplerPage *poppler_page;
+       PopplerRectangle r;
+       double height;
+       
+       poppler_page = poppler_document_get_page (pdf_document->document, page);
+       g_return_val_if_fail (poppler_page != NULL, NULL);
+
+       poppler_page_get_size (poppler_page, NULL, &height);
+       r.x1 = rect->x1;
+       r.y1 = height - rect->y2;
+       r.x2 = rect->x2;
+       r.y2 = height - rect->y1;
 
+       g_print ("%f %f %f %f\n", r.x1, r.y1, r.x2, r.y2);
+
+       return poppler_page_get_text (poppler_page, &r);
+}
 
 static void
 pdf_document_document_iface_init (EvDocumentIface *iface)
@@ -340,6 +360,7 @@ pdf_document_document_iface_init (EvDocumentIface *iface)
        iface->get_page_label = pdf_document_get_page_label;
        iface->get_links = pdf_document_get_links;
        iface->render_pixbuf = pdf_document_render_pixbuf;
+       iface->get_text = pdf_document_get_text;
 };
 
 static void
@@ -703,7 +724,7 @@ pdf_document_find_get_result (EvDocumentFind *document_find,
        PopplerPage *poppler_page;
        PopplerRectangle *r;
        int current_page;
-       double scale, height;
+       double height;
 
        if (search == NULL)
                return FALSE;