From 09458b5fc51b3504582e76a12b7a57cbba332ac0 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Mon, 15 Aug 2005 04:41:30 +0000 Subject: * shell/ev-metadata-manager.c: (ev_metadata_manager_init): * Mon Aug 15 00:40:21 2005 Jonathan Blandford * pdf/ev-poppler.cc: * shell/ev-metadata-manager.c: (ev_metadata_manager_init): * shell/ev-view.c: (ev_view_rotate_left), (ev_view_set_rotation), (ev_view_get_rotation): * shell/ev-view.h: * shell/ev-window.c: (setup_view_from_metadata), (save_rotation_to_file), (ev_window_cmd_edit_rotate_left), (ev_window_cmd_edit_rotate_right): Fix rotation. Save it to disk. --- (limited to 'pdf') diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index 610f598..ef95956 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); -- cgit v0.9.1