From a9354072adb807513f3f79a6c993fd020a7f4a4d Mon Sep 17 00:00:00 2001 From: Christopher Reichert Date: Sat, 25 Jun 2011 17:14:04 -0500 Subject: [PATCH] View orientation cached in memory. Cache the view orientation in memory to anticipate a document reload. CCBUG: 184518 --- part.cpp | 4 ++++ part.h | 1 + 2 files changed, 5 insertions(+) diff --git a/part.cpp b/part.cpp index e98329f5a..e6b80a520 100644 --- a/part.cpp +++ b/part.cpp @@ -1239,6 +1239,9 @@ void Part::slotDoFileDirty() // store if presentation view was open m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0); + // store the page rotation + m_dirtyPageRotation = m_document->rotation(); + // inform the user about the operation in progress m_pageView->displayMessage( i18n("Reloading the document...") ); } @@ -1251,6 +1254,7 @@ void Part::slotDoFileDirty() m_viewportDirty.pageNumber = (int) m_document->pages() - 1; m_document->setViewport( m_viewportDirty ); m_viewportDirty.pageNumber = -1; + m_document->setRotation( m_dirtyPageRotation ); if ( m_sidebar->currentIndex() != m_dirtyToolboxIndex && m_sidebar->isItemEnabled( m_dirtyToolboxIndex ) ) { m_sidebar->setCurrentIndex( m_dirtyToolboxIndex ); diff --git a/part.h b/part.h index 69652a398..a36031bb1 100644 --- a/part.h +++ b/part.h @@ -220,6 +220,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi int m_dirtyToolboxIndex; bool m_wasSidebarVisible; bool m_fileWasRemoved; + Rotation m_dirtyPageRotation; // Remember the search history QStringList m_searchHistory;