diff --git a/Pdf4QtLib/sources/pdfdocument.h b/Pdf4QtLib/sources/pdfdocument.h index 6a0d5f8..d6b11ac 100644 --- a/Pdf4QtLib/sources/pdfdocument.h +++ b/Pdf4QtLib/sources/pdfdocument.h @@ -553,6 +553,7 @@ public: bool hasReset() const { return m_flags.testFlag(Reset); } bool hasPageContentsChanged() const { return m_flags.testFlag(PageContents); } + bool hasPreserveUndoRedo() const { return m_flags.testFlag(PreserveUndoRedo); } bool hasFlag(ModificationFlag flag) const { return m_flags.testFlag(flag); } operator PDFDocument*() const { return m_document; } diff --git a/Pdf4QtViewer/pdfviewermainwindow.cpp b/Pdf4QtViewer/pdfviewermainwindow.cpp index 89c639b..d94f016 100644 --- a/Pdf4QtViewer/pdfviewermainwindow.cpp +++ b/Pdf4QtViewer/pdfviewermainwindow.cpp @@ -464,7 +464,7 @@ void PDFViewerMainWindow::setDocument(const pdf::PDFModifiedDocument& document) { m_sidebarDockWidget->hide(); } - else + else if (document.hasReset() && !document.hasPreserveUndoRedo()) { m_sidebarDockWidget->show(); }