mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #40: Finish
This commit is contained in:
@ -320,6 +320,7 @@ PDFProgramController::PDFProgramController(QObject* parent) :
|
||||
m_recentFileManager(new PDFRecentFileManager(this)),
|
||||
m_optionalContentActivity(nullptr),
|
||||
m_textToSpeech(nullptr),
|
||||
m_isDocumentSetInProgress(false),
|
||||
m_futureWatcher(nullptr),
|
||||
m_CMSManager(new pdf::PDFCMSManager(this)),
|
||||
m_toolManager(nullptr),
|
||||
@ -1670,6 +1671,7 @@ void PDFProgramController::onDocumentModified(pdf::PDFModifiedDocument document)
|
||||
// We will create undo/redo step from old document, with flags from the new,
|
||||
// because new document is modification of old document with flags.
|
||||
|
||||
pdf::PDFBoolGuard guard(m_isDocumentSetInProgress);
|
||||
Q_ASSERT(m_pdfDocument);
|
||||
|
||||
if (m_undoRedoManager)
|
||||
@ -1677,6 +1679,12 @@ void PDFProgramController::onDocumentModified(pdf::PDFModifiedDocument document)
|
||||
m_undoRedoManager->createUndo(document, m_pdfDocument);
|
||||
}
|
||||
|
||||
// Retain pointer on old document, because during the update,
|
||||
// old pointer must be valid, because some widgets holds raw
|
||||
// pointer.
|
||||
pdf::PDFDocumentPointer oldDocument = std::move(m_pdfDocument);
|
||||
Q_UNUSED(oldDocument);
|
||||
|
||||
m_pdfDocument = document;
|
||||
document.setOptionalContentActivity(m_optionalContentActivity);
|
||||
setDocument(document);
|
||||
@ -2015,7 +2023,10 @@ void PDFProgramController::onActionCertificateManagerTriggered()
|
||||
|
||||
void PDFProgramController::onDrawSpaceChanged()
|
||||
{
|
||||
m_mainWindowInterface->updateUI(false);
|
||||
if (!m_isDocumentSetInProgress)
|
||||
{
|
||||
m_mainWindowInterface->updateUI(false);
|
||||
}
|
||||
}
|
||||
|
||||
void PDFProgramController::onPageLayoutChanged()
|
||||
|
Reference in New Issue
Block a user