From 4fefc60e3518887c5e5b4b7b1a435545480e55c0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 15 Jan 2013 01:17:14 +0100 Subject: [PATCH] Do not prepare the toc for reload until we are really reloading BUGS: 313147 --- part.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/part.cpp b/part.cpp index fe5656304..9c4baa8ea 100644 --- a/part.cpp +++ b/part.cpp @@ -1545,6 +1545,8 @@ void Part::slotFileDirty( const QString& path ) void Part::slotDoFileDirty() { + bool prepareTocForReload = false; + // do the following the first time the file is reloaded if ( m_viewportDirty.pageNumber == -1 ) { @@ -1559,11 +1561,11 @@ void Part::slotDoFileDirty() m_wasSidebarVisible = m_sidebar->isSidebarVisible(); m_wasSidebarCollapsed = m_sidebar->isCollapsed(); - // preserves the toc state after reload - m_toc->prepareForReload(); - // store if presentation view was open m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0); + + // preserves the toc state after reload + prepareTocForReload = true; // store the page rotation m_dirtyPageRotation = m_document->rotation(); @@ -1576,6 +1578,9 @@ void Part::slotDoFileDirty() // close and (try to) reopen the document if ( !closeUrl() ) return; + + if ( prepareTocForReload ) + m_toc->prepareForReload(); // inform the user about the operation in progress m_pageView->displayMessage( i18n("Reloading the document...") );