[evince] pdf: Remove leading spaces and tabs



commit c738a69035136d1f7f86971a3b4054bbf96a7c1e
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Mon Jul 9 11:50:19 2018 -0400

    pdf: Remove leading spaces and tabs
    
    Just to make avoid MR with accidental modification these lines
    and keep them focused on the issue to solve.

 backend/pdf/ev-poppler.cc | 138 +++++++++++++++++++++++-----------------------
 1 file changed, 69 insertions(+), 69 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 4f94ac4b..52f4c4d5 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -99,7 +99,7 @@ typedef struct {
        gint pages_y;
        gdouble paper_width;
        gdouble paper_height;
-       
+
 #ifdef HAVE_CAIRO_PRINT
        cairo_t *cr;
 #else
@@ -211,7 +211,7 @@ pdf_document_dispose (GObject *object)
                g_object_unref (pdf_document->document);
        }
 
-       if (pdf_document->font_info) { 
+       if (pdf_document->font_info) {
                poppler_font_info_free (pdf_document->font_info);
        }
 
@@ -242,7 +242,7 @@ convert_error (GError  *poppler_error,
                        code = EV_DOCUMENT_ERROR_INVALID;
                else if (poppler_error->code == POPPLER_ERROR_ENCRYPTED)
                        code = EV_DOCUMENT_ERROR_ENCRYPTED;
-                       
+
                g_set_error_literal (error,
                                      EV_DOCUMENT_ERROR,
                                      code,
@@ -375,7 +375,7 @@ pdf_document_get_page_size (EvDocument *document,
                            double     *height)
 {
        g_return_if_fail (POPPLER_IS_PAGE (page->backend_page));
-       
+
        poppler_page_get_size (POPPLER_PAGE (page->backend_page), width, height);
 }
 
@@ -470,7 +470,7 @@ make_thumbnail_for_page (PopplerPage     *poppler_page,
        ev_document_fc_mutex_lock ();
        surface = pdf_page_render (poppler_page, width, height, rc);
        ev_document_fc_mutex_unlock ();
-       
+
        pixbuf = ev_document_misc_pixbuf_from_surface (surface);
        cairo_surface_destroy (surface);
 
@@ -1297,7 +1297,7 @@ pdf_document_fonts_scan (EvDocumentFonts *document_fonts,
 
        g_return_val_if_fail (PDF_IS_DOCUMENT (document_fonts), FALSE);
 
-       if (pdf_document->font_info == NULL) { 
+       if (pdf_document->font_info == NULL) {
                pdf_document->font_info = poppler_font_info_new (pdf_document->document);
        }
 
@@ -1312,7 +1312,7 @@ pdf_document_fonts_scan (EvDocumentFonts *document_fonts,
        if (!result) {
                pdf_document->fonts_scanned_pages = 0;
                poppler_font_info_free (pdf_document->font_info);
-               pdf_document->font_info = NULL; 
+               pdf_document->font_info = NULL;
        }
 
        return result;
@@ -1412,7 +1412,7 @@ pdf_document_fonts_fill_model (EvDocumentFonts *document_fonts,
                const gchar *filename;
                const gchar *encoding;
                char *details;
-               
+
                name = poppler_fonts_iter_get_name (iter);
 
                if (name == NULL) {
@@ -1614,7 +1614,7 @@ ev_link_dest_from_dest (PdfDocument *pdf_document,
 
        if (!ev_dest)
                ev_dest = ev_link_dest_new_page (dest->page_num - 1);
-       
+
        return ev_dest;
 }
 
@@ -1631,7 +1631,7 @@ ev_link_from_action (PdfDocument   *pdf_document,
                        break;
                case POPPLER_ACTION_GOTO_DEST: {
                        EvLinkDest *dest;
-                       
+
                        dest = ev_link_dest_from_dest (pdf_document, action->goto_dest.dest);
                        ev_action = ev_link_action_new_dest (dest);
                        g_object_unref (dest);
@@ -1639,12 +1639,12 @@ ev_link_from_action (PdfDocument   *pdf_document,
                        break;
                case POPPLER_ACTION_GOTO_REMOTE: {
                        EvLinkDest *dest;
-                       
+
                        dest = ev_link_dest_from_dest (pdf_document, action->goto_remote.dest);
-                       ev_action = ev_link_action_new_remote (dest, 
+                       ev_action = ev_link_action_new_remote (dest,
                                                               action->goto_remote.file_name);
                        g_object_unref (dest);
-                       
+
                }
                        break;
                case POPPLER_ACTION_LAUNCH:
@@ -1711,18 +1711,18 @@ ev_link_from_action (PdfDocument   *pdf_document,
                case POPPLER_ACTION_UNKNOWN:
                        unimplemented_action = "POPPLER_ACTION_UNKNOWN";
        }
-       
+
        if (unimplemented_action) {
                g_warning ("Unimplemented action: %s, please post a bug report "
                           "in Evince issue tracker (https://gitlab.gnome.org/GNOME/evince/issues) "
                           "with a testcase.", unimplemented_action);
        }
-       
+
        link = ev_link_new (action->any.title, ev_action);
        if (ev_action)
                g_object_unref (ev_action);
 
-       return link;    
+       return link;
 }
 
 static void
@@ -1731,7 +1731,7 @@ build_tree (PdfDocument      *pdf_document,
            GtkTreeIter      *parent,
            PopplerIndexIter *iter)
 {
-       
+
        do {
                GtkTreeIter tree_iter;
                PopplerIndexIter *child;
@@ -1739,7 +1739,7 @@ build_tree (PdfDocument      *pdf_document,
                EvLink *link = NULL;
                gboolean expand;
                char *title_markup;
-               
+
                action = poppler_index_iter_get_action (iter);
                expand = poppler_index_iter_is_open (iter);
 
@@ -1751,28 +1751,28 @@ build_tree (PdfDocument      *pdf_document,
                        poppler_action_free (action);
                        if (link)
                                g_object_unref (link);
-                       
+
                        continue;
                }
 
                gtk_tree_store_append (GTK_TREE_STORE (model), &tree_iter, parent);
                title_markup = g_markup_escape_text (ev_link_get_title (link), -1);
-               
+
                gtk_tree_store_set (GTK_TREE_STORE (model), &tree_iter,
                                    EV_DOCUMENT_LINKS_COLUMN_MARKUP, title_markup,
                                    EV_DOCUMENT_LINKS_COLUMN_LINK, link,
                                    EV_DOCUMENT_LINKS_COLUMN_EXPAND, expand,
                                    -1);
-               
+
                g_free (title_markup);
                g_object_unref (link);
-               
+
                child = poppler_index_iter_get_child (iter);
                if (child)
                        build_tree (pdf_document, model, &tree_iter, child);
                poppler_index_iter_free (child);
                poppler_action_free (action);
-               
+
        } while (poppler_index_iter_next (iter));
 }
 
@@ -1782,7 +1782,7 @@ pdf_document_links_get_links_model (EvDocumentLinks *document_links)
        PdfDocument *pdf_document = PDF_DOCUMENT (document_links);
        GtkTreeModel *model = NULL;
        PopplerIndexIter *iter;
-       
+
        g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), NULL);
 
        iter = poppler_index_iter_new (pdf_document->document);
@@ -1796,7 +1796,7 @@ pdf_document_links_get_links_model (EvDocumentLinks *document_links)
                build_tree (pdf_document, model, NULL, iter);
                poppler_index_iter_free (iter);
        }
-       
+
        return model;
 }
 
@@ -1905,7 +1905,7 @@ pdf_document_images_get_image_mapping (EvDocumentImages *document_images,
                image_mapping = (PopplerImageMapping *)list->data;
 
                ev_image_mapping = g_new (EvMapping, 1);
-               
+
                ev_image_mapping->data = ev_image_new (page->index, image_mapping->image_id);
                ev_image_mapping->area.x1 = image_mapping->area.x1;
                ev_image_mapping->area.y1 = image_mapping->area.y1;
@@ -2054,19 +2054,19 @@ pdf_document_file_exporter_begin (EvFileExporter        *exporter,
 #ifdef HAVE_CAIRO_PRINT
        cairo_surface_t *surface = NULL;
 #endif
-       
+
        if (pdf_document->print_ctx)
                pdf_print_context_free (pdf_document->print_ctx);
        pdf_document->print_ctx = g_new0 (PdfPrintContext, 1);
        ctx = pdf_document->print_ctx;
        ctx->format = fc->format;
-       
+
 #ifdef HAVE_CAIRO_PRINT
        ctx->pages_per_sheet = CLAMP (fc->pages_per_sheet, 1, 16);
 
        ctx->paper_width = fc->paper_width;
        ctx->paper_height = fc->paper_height;
-       
+
        switch (fc->pages_per_sheet) {
                default:
                case 1:
@@ -2096,7 +2096,7 @@ pdf_document_file_exporter_begin (EvFileExporter        *exporter,
        }
 
        ctx->pages_printed = 0;
-       
+
        switch (fc->format) {
                case EV_FILE_FORMAT_PS:
 #ifdef HAVE_CAIRO_PS
@@ -2131,11 +2131,11 @@ pdf_document_file_exporter_begin_page (EvFileExporter *exporter)
 {
        PdfDocument *pdf_document = PDF_DOCUMENT (exporter);
        PdfPrintContext *ctx = pdf_document->print_ctx;
-       
+
        g_return_if_fail (pdf_document->print_ctx != NULL);
 
        ctx->pages_printed = 0;
-       
+
 #ifdef HAVE_CAIRO_PRINT
        if (ctx->paper_width > ctx->paper_height) {
                if (ctx->format == EV_FILE_FORMAT_PS) {
@@ -2170,7 +2170,7 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
        g_return_if_fail (pdf_document->print_ctx != NULL);
 
        poppler_page = POPPLER_PAGE (rc->page->backend_page);
-       
+
 #ifdef HAVE_CAIRO_PRINT
        x = (ctx->pages_printed % ctx->pages_per_sheet) % ctx->pages_x;
        y = (ctx->pages_printed % ctx->pages_per_sheet) / ctx->pages_x;
@@ -2194,7 +2194,7 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
 
        if (ctx->pages_per_sheet == 2 || ctx->pages_per_sheet == 6) {
                rotate = !rotate;
-       }       
+       }
 
        if (rotate) {
                gint tmp1;
@@ -2216,14 +2216,14 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
            (page_width < pwidth && page_height < pheight)) {
                xscale = pwidth / page_width;
                yscale = pheight / page_height;
-               
+
                if (yscale < xscale) {
                        xscale = yscale;
                } else {
                        yscale = xscale;
                }
-               
-       } else {        
+
+       } else {
                xscale = yscale = 1;
        }
 
@@ -2232,7 +2232,7 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
        cairo_save (ctx->cr);
        if (rotate) {
                cairo_matrix_t matrix;
-               
+
                cairo_translate (ctx->cr, (2 * y + 1) * pwidth, 0);
                cairo_matrix_init (&matrix,
                                   0,  1,
@@ -2240,7 +2240,7 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
                                   0,  0);
                cairo_transform (ctx->cr, &matrix);
        }
-       
+
        cairo_translate (ctx->cr,
                         x * (rotate ? pheight : pwidth),
                         y * (rotate ? pwidth : pheight));
@@ -2249,7 +2249,7 @@ pdf_document_file_exporter_do_page (EvFileExporter  *exporter,
        poppler_page_render_for_printing (poppler_page, ctx->cr);
 
        ctx->pages_printed++;
-                       
+
        cairo_restore (ctx->cr);
 #else /* HAVE_CAIRO_PRINT */
        if (ctx->format == EV_FILE_FORMAT_PS)
@@ -2262,7 +2262,7 @@ pdf_document_file_exporter_end_page (EvFileExporter *exporter)
 {
        PdfDocument *pdf_document = PDF_DOCUMENT (exporter);
        PdfPrintContext *ctx = pdf_document->print_ctx;
-       
+
        g_return_if_fail (pdf_document->print_ctx != NULL);
 
 #ifdef HAVE_CAIRO_PRINT
@@ -2291,7 +2291,7 @@ pdf_document_file_exporter_get_capabilities (EvFileExporter *exporter)
 #ifdef HAVE_CAIRO_PRINT
                EV_FILE_EXPORTER_CAN_NUMBER_UP |
 #endif
-               
+
 #ifdef HAVE_CAIRO_PDF
                EV_FILE_EXPORTER_CAN_GENERATE_PDF |
 #endif
@@ -2358,7 +2358,7 @@ pdf_selection_render_selection (EvSelection      *selection,
        if (*surface == NULL) {
                *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                                       width, height);
-               
+
        }
 
        cr = cairo_create (*surface);
@@ -2439,7 +2439,7 @@ pdf_selection_get_selection_region (EvSelection     *selection,
        ev_render_context_compute_scales (rc, page_width, page_height, &xscale, &yscale);
        retval = create_region_from_poppler_region (region, xscale, yscale);
        g_list_free (region);
-       
+
        return retval;
 }
 
@@ -2629,8 +2629,8 @@ pdf_document_page_transition_iface_init (EvDocumentTransitionInterface *iface)
 /* Forms */
 #if 0
 static void
-pdf_document_get_crop_box (EvDocument  *document, 
-                          int          page, 
+pdf_document_get_crop_box (EvDocument  *document,
+                          int          page,
                           EvRectangle *rect)
 {
        PdfDocument *pdf_document;
@@ -2678,7 +2678,7 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
                                        ev_text_type = EV_FORM_FIELD_TEXT_FILE_SELECT;
                                        break;
                        }
-                       
+
                        ev_field = ev_form_field_text_new (id, ev_text_type);
                        field_text = EV_FORM_FIELD_TEXT (ev_field);
 
@@ -2709,7 +2709,7 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
 
                        ev_field = ev_form_field_button_new (id, ev_button_type);
                        field_button = EV_FORM_FIELD_BUTTON (ev_field);
-                       
+
                        field_button->state = poppler_form_field_button_get_state (poppler_field);
                }
                        break;
@@ -2734,7 +2734,7 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
                        field_choice->do_spell_check = poppler_form_field_choice_do_spell_check 
(poppler_field);
                        field_choice->commit_on_sel_change = poppler_form_field_choice_commit_on_change 
(poppler_field);
 
-                       /* TODO: we need poppler_form_field_choice_get_selected_items in poppler 
+                       /* TODO: we need poppler_form_field_choice_get_selected_items in poppler
                        field_choice->selected_items = poppler_form_field_choice_get_selected_items 
(poppler_field);*/
                        if (field_choice->is_editable)
                                field_choice->text = poppler_form_field_choice_get_text (poppler_field);
@@ -2758,7 +2758,7 @@ ev_form_field_from_poppler_field (PdfDocument      *pdf_document,
 }
 
 static EvMappingList *
-pdf_document_forms_get_form_fields (EvDocumentForms *document, 
+pdf_document_forms_get_form_fields (EvDocumentForms *document,
                                    EvPage          *page)
 {
        PopplerPage *poppler_page;
@@ -2768,7 +2768,7 @@ pdf_document_forms_get_form_fields (EvDocumentForms *document,
        double height;
 
        g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL);
-       
+
        poppler_page = POPPLER_PAGE (page->backend_page);
        fields = poppler_page_get_form_field_mapping (poppler_page);
        poppler_page_get_size (poppler_page, NULL, &height);
@@ -2796,10 +2796,10 @@ pdf_document_forms_get_form_fields (EvDocumentForms *document,
                                        "poppler-field",
                                        g_object_ref (mapping->field),
                                        (GDestroyNotify) g_object_unref);
-               
+
                retval = g_list_prepend (retval, field_mapping);
        }
-       
+
        poppler_page_free_form_field_mapping (fields);
 
        return retval ? ev_mapping_list_new (page->index,
@@ -2816,7 +2816,7 @@ pdf_document_forms_document_is_modified (EvDocumentForms *document)
 static gchar *
 pdf_document_forms_form_field_text_get_text (EvDocumentForms *document,
                                             EvFormField     *field)
-       
+
 {
        PopplerFormField *poppler_field;
        gchar *text;
@@ -2824,14 +2824,14 @@ pdf_document_forms_form_field_text_get_text (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return NULL;
-       
+
        text = poppler_form_field_text_get_text (poppler_field);
 
        return text;
 }
 
 static void
-pdf_document_forms_form_field_text_set_text (EvDocumentForms *document, 
+pdf_document_forms_form_field_text_set_text (EvDocumentForms *document,
                                             EvFormField     *field,
                                             const gchar     *text)
 {
@@ -2840,14 +2840,14 @@ pdf_document_forms_form_field_text_set_text (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return;
-       
+
        poppler_form_field_text_set_text (poppler_field, text);
        PDF_DOCUMENT (document)->forms_modified = TRUE;
        ev_document_set_modified (EV_DOCUMENT (document), TRUE);
 }
 
 static void
-pdf_document_forms_form_field_button_set_state (EvDocumentForms *document, 
+pdf_document_forms_form_field_button_set_state (EvDocumentForms *document,
                                                EvFormField     *field,
                                                gboolean         state)
 {
@@ -2856,14 +2856,14 @@ pdf_document_forms_form_field_button_set_state (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return;
-       
+
        poppler_form_field_button_set_state (poppler_field, state);
        PDF_DOCUMENT (document)->forms_modified = TRUE;
        ev_document_set_modified (EV_DOCUMENT (document), TRUE);
 }
 
 static gboolean
-pdf_document_forms_form_field_button_get_state (EvDocumentForms *document, 
+pdf_document_forms_form_field_button_get_state (EvDocumentForms *document,
                                                EvFormField     *field)
 {
        PopplerFormField *poppler_field;
@@ -2879,7 +2879,7 @@ pdf_document_forms_form_field_button_get_state (EvDocumentForms *document,
 }
 
 static gchar *
-pdf_document_forms_form_field_choice_get_item (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_get_item (EvDocumentForms *document,
                                               EvFormField     *field,
                                               gint             index)
 {
@@ -2896,7 +2896,7 @@ pdf_document_forms_form_field_choice_get_item (EvDocumentForms *document,
 }
 
 static int
-pdf_document_forms_form_field_choice_get_n_items (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_get_n_items (EvDocumentForms *document,
                                                  EvFormField     *field)
 {
        PopplerFormField *poppler_field;
@@ -2905,14 +2905,14 @@ pdf_document_forms_form_field_choice_get_n_items (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return -1;
-       
+
        n_items = poppler_form_field_choice_get_n_items (poppler_field);
 
        return n_items;
 }
 
 static gboolean
-pdf_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document,
                                                       EvFormField     *field,
                                                       gint             index)
 {
@@ -2929,7 +2929,7 @@ pdf_document_forms_form_field_choice_is_item_selected (EvDocumentForms *document
 }
 
 static void
-pdf_document_forms_form_field_choice_select_item (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_select_item (EvDocumentForms *document,
                                                  EvFormField     *field,
                                                  gint             index)
 {
@@ -2945,7 +2945,7 @@ pdf_document_forms_form_field_choice_select_item (EvDocumentForms *document,
 }
 
 static void
-pdf_document_forms_form_field_choice_toggle_item (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_toggle_item (EvDocumentForms *document,
                                                  EvFormField     *field,
                                                  gint             index)
 {
@@ -2961,7 +2961,7 @@ pdf_document_forms_form_field_choice_toggle_item (EvDocumentForms *document,
 }
 
 static void
-pdf_document_forms_form_field_choice_unselect_all (EvDocumentForms *document, 
+pdf_document_forms_form_field_choice_unselect_all (EvDocumentForms *document,
                                                   EvFormField     *field)
 {
        PopplerFormField *poppler_field;
@@ -2969,7 +2969,7 @@ pdf_document_forms_form_field_choice_unselect_all (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return;
-       
+
        poppler_form_field_choice_unselect_all (poppler_field);
        PDF_DOCUMENT (document)->forms_modified = TRUE;
        ev_document_set_modified (EV_DOCUMENT (document), TRUE);
@@ -2985,7 +2985,7 @@ pdf_document_forms_form_field_choice_set_text (EvDocumentForms *document,
        poppler_field = POPPLER_FORM_FIELD (g_object_get_data (G_OBJECT (field), "poppler-field"));
        if (!poppler_field)
                return;
-       
+
        poppler_form_field_choice_set_text (poppler_field, text);
        PDF_DOCUMENT (document)->forms_modified = TRUE;
        ev_document_set_modified (EV_DOCUMENT (document), TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]