If I open, edit and reload a PDF document both with embedded annotations and table of contents ( e.g. http://www.pdfill.com/example/pdf_commenting_new.pdf ), Okular asks me if I want to save changes or not*. While the message box is open, in the background I can see that the table of contents has been cleared, and if I press Cancel the document stays open with an empty TOC. * = This message box is only shown with poppler >= 0.20 Reproducible: Always Steps to Reproduce: 1. Open pdf_commenting_new.pdf and show the TOC panel 2. Do some modification (e.g. create a new annotation) 3. Press Reload. A "Save changes?" prompt will be shown 4. Watch the TOC disappear in the background 5. Press Cancel 6. The document stays open but the TOC is empty The issue is that we're calling m_toc->prepareForReload() in Part::slotDoFileDirty() *before* Part::queryClose() is executed. TOC::prepareForReload() internally replaces the current TOCModel with an empty one, and that's why the table of contents disappears. This bug should be easy to fix, but I haven't done it myself because it touches the same code as bug 313146, which is more critical.
I'm working on it.
Git commit 4fefc60e3518887c5e5b4b7b1a435545480e55c0 by Albert Astals Cid. Committed on 15/01/2013 at 01:17. Pushed by aacid into branch 'master'. Do not prepare the toc for reload until we are really reloading M +8 -3 part.cpp http://commits.kde.org/okular/4fefc60e3518887c5e5b4b7b1a435545480e55c0