X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fev-poppler.cc;h=ef95956e6a6a2225b1b1f81dbad0571979067b01;hb=65c06150e05948eb7b056b0ec5cb9c364b652cfe;hp=b4a6799521877a6c30733097665d29d4ec873e89;hpb=00efc5c16ed191f07f9a8a5d00acc41ddb064b46;p=evince.git diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index b4a67995..ef95956e 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -247,21 +247,19 @@ static void set_page_orientation (PdfDocument *pdf_document, PopplerPage *page, int rotation) { PopplerOrientation orientation; - int r = rotation; - orientation = poppler_page_get_orientation (page); - - while (r > 0) { - if (orientation == POPPLER_ORIENTATION_PORTRAIT) { - orientation = POPPLER_ORIENTATION_LANDSCAPE; - } else if (orientation == POPPLER_ORIENTATION_LANDSCAPE) { - orientation = POPPLER_ORIENTATION_UPSIDEDOWN; - } else if (orientation == POPPLER_ORIENTATION_UPSIDEDOWN) { - orientation = POPPLER_ORIENTATION_SEASCAPE; - } else { - orientation = POPPLER_ORIENTATION_PORTRAIT; - } - r -= 90; + switch (rotation) { + case 90: + orientation = POPPLER_ORIENTATION_LANDSCAPE; + break; + case 180: + orientation = POPPLER_ORIENTATION_UPSIDEDOWN; + break; + case 270: + orientation = POPPLER_ORIENTATION_SEASCAPE; + break; + default: + orientation = POPPLER_ORIENTATION_PORTRAIT; } poppler_page_set_orientation (page, orientation); @@ -1182,8 +1180,8 @@ pdf_selection_render_selection (EvSelection *selection, GdkPixbuf **pixbuf, EvRectangle *points, EvRectangle *old_points, - guint text, - guint base) + GdkColor *text, + GdkColor *base) { PdfDocument *pdf_document; double width_points, height_points;