Refactoring - prepare for undo/redo and document modification

This commit is contained in:
Jakub Melka
2020-04-25 14:21:06 +02:00
parent 76af397b07
commit 57b3711210
28 changed files with 318 additions and 114 deletions

View File

@ -49,14 +49,20 @@ PDFAdvancedFindWidget::~PDFAdvancedFindWidget()
delete ui;
}
void PDFAdvancedFindWidget::setDocument(const pdf::PDFDocument* document)
void PDFAdvancedFindWidget::setDocument(const pdf::PDFModifiedDocument& document)
{
if (m_document != document)
{
m_document = document;
m_findResults.clear();
updateUI();
updateResultsUI();
// If document is not being reset, then page text should remain the same,
// so, there is no need to clear the results.
if (document.hasReset())
{
m_findResults.clear();
updateUI();
updateResultsUI();
}
}
}