Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/ev-poppler.cc
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-08-15 04:41:30 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-08-15 04:41:30 (GMT)
commit09458b5fc51b3504582e76a12b7a57cbba332ac0 (patch)
treeabdc6fb099a4fab1cd79f9bd7a32f32aa6142ec1 /pdf/ev-poppler.cc
parent6e5cbc7bbdd23310885fd983499008f544b269ee (diff)
* shell/ev-metadata-manager.c: (ev_metadata_manager_init): *
Mon Aug 15 00:40:21 2005 Jonathan Blandford <jrb@redhat.com> * 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.
Diffstat (limited to 'pdf/ev-poppler.cc')
-rw-r--r--pdf/ev-poppler.cc26
1 files changed, 12 insertions, 14 deletions
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);