mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
DocDiff application: view documents
This commit is contained in:
@ -76,11 +76,13 @@ QSize DifferenceItemDelegate::sizeHint(const QStyleOptionViewItem& option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DifferencesDockWidget::DifferencesDockWidget(QWidget* parent,
|
DifferencesDockWidget::DifferencesDockWidget(QWidget* parent,
|
||||||
|
pdf::PDFDiffResult* unfilteredDiffResult,
|
||||||
pdf::PDFDiffResult* diffResult,
|
pdf::PDFDiffResult* diffResult,
|
||||||
pdf::PDFDiffResultNavigator* diffNavigator,
|
pdf::PDFDiffResultNavigator* diffNavigator,
|
||||||
Settings* settings) :
|
Settings* settings) :
|
||||||
QDockWidget(parent),
|
QDockWidget(parent),
|
||||||
ui(new Ui::DifferencesDockWidget),
|
ui(new Ui::DifferencesDockWidget),
|
||||||
|
m_unfilteredDiffResult(unfilteredDiffResult),
|
||||||
m_diffResult(diffResult),
|
m_diffResult(diffResult),
|
||||||
m_diffNavigator(diffNavigator),
|
m_diffNavigator(diffNavigator),
|
||||||
m_settings(settings),
|
m_settings(settings),
|
||||||
@ -190,7 +192,17 @@ void DifferencesDockWidget::update()
|
|||||||
};
|
};
|
||||||
|
|
||||||
const size_t differenceCount = m_diffResult->getDifferencesCount();
|
const size_t differenceCount = m_diffResult->getDifferencesCount();
|
||||||
ui->infoTextLabel->setText(tr("%1 Differences").arg(differenceCount));
|
const size_t unfilteredDifferenceCount = m_unfilteredDiffResult->getDifferencesCount();
|
||||||
|
const size_t hiddenDifferences = unfilteredDifferenceCount - differenceCount;
|
||||||
|
|
||||||
|
if (hiddenDifferences > 0)
|
||||||
|
{
|
||||||
|
ui->infoTextLabel->setText(tr("%1 Differences (+%2 hidden)").arg(differenceCount).arg(hiddenDifferences));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->infoTextLabel->setText(tr("%1 Differences").arg(differenceCount));
|
||||||
|
}
|
||||||
|
|
||||||
pdf::PDFInteger lastLeftPageIndex = -1;
|
pdf::PDFInteger lastLeftPageIndex = -1;
|
||||||
pdf::PDFInteger lastRightPageIndex = -1;
|
pdf::PDFInteger lastRightPageIndex = -1;
|
||||||
|
@ -59,6 +59,7 @@ class DifferencesDockWidget : public QDockWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DifferencesDockWidget(QWidget* parent,
|
explicit DifferencesDockWidget(QWidget* parent,
|
||||||
|
pdf::PDFDiffResult* unfilteredDiffResult,
|
||||||
pdf::PDFDiffResult* diffResult,
|
pdf::PDFDiffResult* diffResult,
|
||||||
pdf::PDFDiffResultNavigator* diffNavigator,
|
pdf::PDFDiffResultNavigator* diffNavigator,
|
||||||
Settings* settings);
|
Settings* settings);
|
||||||
@ -76,6 +77,7 @@ private:
|
|||||||
QColor getColorForIndex(size_t index) const;
|
QColor getColorForIndex(size_t index) const;
|
||||||
QModelIndex findResultIndex(size_t index) const;
|
QModelIndex findResultIndex(size_t index) const;
|
||||||
|
|
||||||
|
pdf::PDFDiffResult* m_unfilteredDiffResult;
|
||||||
pdf::PDFDiffResult* m_diffResult;
|
pdf::PDFDiffResult* m_diffResult;
|
||||||
pdf::PDFDiffResultNavigator* m_diffNavigator;
|
pdf::PDFDiffResultNavigator* m_diffNavigator;
|
||||||
Settings* m_settings;
|
Settings* m_settings;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "pdfwidgetutils.h"
|
#include "pdfwidgetutils.h"
|
||||||
#include "pdfdocumentreader.h"
|
#include "pdfdocumentreader.h"
|
||||||
|
#include "pdfdrawspacecontroller.h"
|
||||||
|
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
@ -31,6 +32,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
namespace pdfdocdiff
|
namespace pdfdocdiff
|
||||||
{
|
{
|
||||||
@ -41,8 +43,11 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
m_progress(new pdf::PDFProgress(this)),
|
m_progress(new pdf::PDFProgress(this)),
|
||||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||||
m_progressTaskbarIndicator(nullptr),
|
m_progressTaskbarIndicator(nullptr),
|
||||||
|
m_cmsManager(nullptr),
|
||||||
|
m_pdfWidget(nullptr),
|
||||||
m_settingsDockWidget(nullptr),
|
m_settingsDockWidget(nullptr),
|
||||||
m_differencesDockWidget(nullptr),
|
m_differencesDockWidget(nullptr),
|
||||||
|
m_optionalContentActivity(nullptr),
|
||||||
m_diff(nullptr),
|
m_diff(nullptr),
|
||||||
m_isChangingProgressStep(false),
|
m_isChangingProgressStep(false),
|
||||||
m_dontDisplayErrorMessage(false),
|
m_dontDisplayErrorMessage(false),
|
||||||
@ -58,9 +63,16 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
m_settingsDockWidget = new SettingsDockWidget(this);
|
m_settingsDockWidget = new SettingsDockWidget(this);
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, m_settingsDockWidget);;
|
addDockWidget(Qt::LeftDockWidgetArea, m_settingsDockWidget);;
|
||||||
|
|
||||||
m_differencesDockWidget = new DifferencesDockWidget(this, &m_filteredDiffResult, &m_diffNavigator, &m_settings);
|
m_differencesDockWidget = new DifferencesDockWidget(this, &m_diffResult, &m_filteredDiffResult, &m_diffNavigator, &m_settings);
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, m_differencesDockWidget);
|
addDockWidget(Qt::LeftDockWidgetArea, m_differencesDockWidget);
|
||||||
|
|
||||||
|
ui->documentFrame->setLayout(new QVBoxLayout);
|
||||||
|
|
||||||
|
m_cmsManager = new pdf::PDFCMSManager(this);
|
||||||
|
m_pdfWidget = new pdf::PDFWidget(m_cmsManager, pdf::RendererEngine::Software, 1, ui->documentFrame);
|
||||||
|
m_pdfWidget->getDrawWidgetProxy()->setProgress(m_progress);
|
||||||
|
ui->documentFrame->layout()->addWidget(m_pdfWidget);
|
||||||
|
|
||||||
ui->menuView->addSeparator();
|
ui->menuView->addSeparator();
|
||||||
ui->menuView->addAction(m_settingsDockWidget->toggleViewAction());
|
ui->menuView->addAction(m_settingsDockWidget->toggleViewAction());
|
||||||
ui->menuView->addAction(m_differencesDockWidget->toggleViewAction());
|
ui->menuView->addAction(m_differencesDockWidget->toggleViewAction());
|
||||||
@ -86,6 +98,14 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
ui->actionShow_Pages_with_Differences->setData(int(Operation::ShowPageswithDifferences));
|
ui->actionShow_Pages_with_Differences->setData(int(Operation::ShowPageswithDifferences));
|
||||||
ui->actionSave_Differences_to_XML->setData(int(Operation::SaveDifferencesToXML));
|
ui->actionSave_Differences_to_XML->setData(int(Operation::SaveDifferencesToXML));
|
||||||
|
|
||||||
|
QActionGroup* actionGroup = new QActionGroup(this);
|
||||||
|
actionGroup->setExclusionPolicy(QActionGroup::ExclusionPolicy::Exclusive);
|
||||||
|
actionGroup->addAction(ui->actionView_Differences);
|
||||||
|
actionGroup->addAction(ui->actionView_Left);
|
||||||
|
actionGroup->addAction(ui->actionView_Right);
|
||||||
|
actionGroup->addAction(ui->actionView_Overlay);
|
||||||
|
ui->actionView_Differences->setChecked(true);
|
||||||
|
|
||||||
QToolBar* mainToolbar = addToolBar(tr("Main"));
|
QToolBar* mainToolbar = addToolBar(tr("Main"));
|
||||||
mainToolbar->setObjectName("main_toolbar");
|
mainToolbar->setObjectName("main_toolbar");
|
||||||
mainToolbar->addActions({ ui->actionOpen_Left, ui->actionOpen_Right });
|
mainToolbar->addActions({ ui->actionOpen_Left, ui->actionOpen_Right });
|
||||||
@ -170,6 +190,8 @@ void MainWindow::onMappedActionTriggered(int actionId)
|
|||||||
|
|
||||||
void MainWindow::onComparationFinished()
|
void MainWindow::onComparationFinished()
|
||||||
{
|
{
|
||||||
|
clear(false, false);
|
||||||
|
|
||||||
m_diffResult = m_diff.getResult();
|
m_diffResult = m_diff.getResult();
|
||||||
|
|
||||||
if (!m_dontDisplayErrorMessage)
|
if (!m_dontDisplayErrorMessage)
|
||||||
@ -326,6 +348,7 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
std::optional<pdf::PDFDocument> document = openDocument();
|
std::optional<pdf::PDFDocument> document = openDocument();
|
||||||
if (document)
|
if (document)
|
||||||
{
|
{
|
||||||
|
clear(true, false);
|
||||||
m_leftDocument = std::move(*document);
|
m_leftDocument = std::move(*document);
|
||||||
|
|
||||||
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
|
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
|
||||||
@ -341,11 +364,10 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
{
|
{
|
||||||
ui->leftPageSelectionEdit->clear();
|
ui->leftPageSelectionEdit->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateViewDocument();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->leftPageSelectionEdit->clear();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +379,7 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
std::optional<pdf::PDFDocument> document = openDocument();
|
std::optional<pdf::PDFDocument> document = openDocument();
|
||||||
if (document)
|
if (document)
|
||||||
{
|
{
|
||||||
|
clear(false, true);
|
||||||
m_rightDocument = std::move(*document);
|
m_rightDocument = std::move(*document);
|
||||||
|
|
||||||
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
|
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
|
||||||
@ -372,11 +395,10 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
{
|
{
|
||||||
ui->rightPageSelectionEdit->clear();
|
ui->rightPageSelectionEdit->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateViewDocument();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->rightPageSelectionEdit->clear();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,6 +473,9 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
case Operation::ViewLeft:
|
case Operation::ViewLeft:
|
||||||
case Operation::ViewRight:
|
case Operation::ViewRight:
|
||||||
case Operation::ViewOverlay:
|
case Operation::ViewOverlay:
|
||||||
|
updateViewDocument();
|
||||||
|
break;
|
||||||
|
|
||||||
case Operation::ShowPageswithDifferences:
|
case Operation::ShowPageswithDifferences:
|
||||||
case Operation::SaveDifferencesToXML:
|
case Operation::SaveDifferencesToXML:
|
||||||
case Operation::CreateCompareReport:
|
case Operation::CreateCompareReport:
|
||||||
@ -467,6 +492,53 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
updateActions();
|
updateActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setViewDocument(pdf::PDFDocument* document)
|
||||||
|
{
|
||||||
|
if (document != m_pdfWidget->getDrawWidgetProxy()->getDocument())
|
||||||
|
{
|
||||||
|
m_optionalContentActivity->deleteLater();
|
||||||
|
m_optionalContentActivity = nullptr;
|
||||||
|
|
||||||
|
if (document)
|
||||||
|
{
|
||||||
|
m_optionalContentActivity = new pdf::PDFOptionalContentActivity(document, pdf::OCUsage::View, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document)
|
||||||
|
{
|
||||||
|
pdf::PDFModifiedDocument modifiedDocument(document, m_optionalContentActivity);
|
||||||
|
m_pdfWidget->setDocument(modifiedDocument);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pdfWidget->setDocument(pdf::PDFModifiedDocument());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::clear(bool clearLeftDocument, bool clearRightDocument)
|
||||||
|
{
|
||||||
|
setViewDocument(nullptr);
|
||||||
|
|
||||||
|
if (clearLeftDocument)
|
||||||
|
{
|
||||||
|
m_leftDocument = pdf::PDFDocument();
|
||||||
|
ui->leftPageSelectionEdit->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearRightDocument)
|
||||||
|
{
|
||||||
|
m_rightDocument = pdf::PDFDocument();
|
||||||
|
ui->rightPageSelectionEdit->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_diffResult = pdf::PDFDiffResult();
|
||||||
|
m_filteredDiffResult = pdf::PDFDiffResult();
|
||||||
|
m_diffNavigator.update();
|
||||||
|
|
||||||
|
updateAll(false);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::updateAll(bool resetFilters)
|
void MainWindow::updateAll(bool resetFilters)
|
||||||
{
|
{
|
||||||
if (resetFilters)
|
if (resetFilters)
|
||||||
@ -479,6 +551,7 @@ void MainWindow::updateAll(bool resetFilters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateFilteredResult();
|
updateFilteredResult();
|
||||||
|
updateViewDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateFilteredResult()
|
void MainWindow::updateFilteredResult()
|
||||||
@ -498,6 +571,28 @@ void MainWindow::updateFilteredResult()
|
|||||||
updateActions();
|
updateActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateViewDocument()
|
||||||
|
{
|
||||||
|
pdf::PDFDocument* document = nullptr;
|
||||||
|
|
||||||
|
if (ui->actionView_Left->isChecked())
|
||||||
|
{
|
||||||
|
document = &m_leftDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ui->actionView_Right->isChecked())
|
||||||
|
{
|
||||||
|
document = &m_rightDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ui->actionView_Differences->isChecked() || ui->actionView_Overlay->isChecked())
|
||||||
|
{
|
||||||
|
document = &m_combinedDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
setViewDocument(document);
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select PDF document"), m_settings.directory, tr("PDF document (*.pdf)"));
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Select PDF document"), m_settings.directory, tr("PDF document (*.pdf)"));
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
|
|
||||||
#include "pdfdocument.h"
|
#include "pdfdocument.h"
|
||||||
#include "pdfdiff.h"
|
#include "pdfdiff.h"
|
||||||
|
#include "pdfdrawwidget.h"
|
||||||
|
#include "pdfcms.h"
|
||||||
|
#include "pdfoptionalcontent.h"
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
@ -95,8 +98,17 @@ private:
|
|||||||
bool canPerformOperation(Operation operation) const;
|
bool canPerformOperation(Operation operation) const;
|
||||||
void performOperation(Operation operation);
|
void performOperation(Operation operation);
|
||||||
|
|
||||||
|
void setViewDocument(pdf::PDFDocument* document);
|
||||||
|
|
||||||
|
/// Clears all data, and possibly documents also.
|
||||||
|
/// View document is set to nullptr.
|
||||||
|
/// \param clearLeftDocument Clear left document?
|
||||||
|
/// \param clearRightDocument Clear left document?
|
||||||
|
void clear(bool clearLeftDocument, bool clearRightDocument);
|
||||||
|
|
||||||
void updateAll(bool resetFilters);
|
void updateAll(bool resetFilters);
|
||||||
void updateFilteredResult();
|
void updateFilteredResult();
|
||||||
|
void updateViewDocument();
|
||||||
|
|
||||||
std::optional<pdf::PDFDocument> openDocument();
|
std::optional<pdf::PDFDocument> openDocument();
|
||||||
|
|
||||||
@ -105,8 +117,11 @@ private:
|
|||||||
pdf::PDFProgress* m_progress;
|
pdf::PDFProgress* m_progress;
|
||||||
QWinTaskbarButton* m_taskbarButton;
|
QWinTaskbarButton* m_taskbarButton;
|
||||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||||
|
pdf::PDFCMSManager* m_cmsManager;
|
||||||
|
pdf::PDFWidget* m_pdfWidget;
|
||||||
SettingsDockWidget* m_settingsDockWidget;
|
SettingsDockWidget* m_settingsDockWidget;
|
||||||
DifferencesDockWidget* m_differencesDockWidget;
|
DifferencesDockWidget* m_differencesDockWidget;
|
||||||
|
pdf::PDFOptionalContentActivity* m_optionalContentActivity;
|
||||||
|
|
||||||
Settings m_settings;
|
Settings m_settings;
|
||||||
QSignalMapper m_mapper;
|
QSignalMapper m_mapper;
|
||||||
@ -116,6 +131,7 @@ private:
|
|||||||
|
|
||||||
pdf::PDFDocument m_leftDocument;
|
pdf::PDFDocument m_leftDocument;
|
||||||
pdf::PDFDocument m_rightDocument;
|
pdf::PDFDocument m_rightDocument;
|
||||||
|
pdf::PDFDocument m_combinedDocument;
|
||||||
|
|
||||||
pdf::PDFDiffResult m_diffResult;
|
pdf::PDFDiffResult m_diffResult;
|
||||||
pdf::PDFDiffResult m_filteredDiffResult; ///< Difference result with filters applied
|
pdf::PDFDiffResult m_filteredDiffResult; ///< Difference result with filters applied
|
||||||
|
@ -54,16 +54,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="documentFrame">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::Box</enum>
|
<enum>QFrame::Box</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="midLineWidth">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -465,6 +465,8 @@ void PDFDiff::performCompare(const std::vector<PDFDiffPageContext>& leftPrepared
|
|||||||
using AlgorithmLCS = PDFAlgorithmLongestCommonSubsequenceBase;
|
using AlgorithmLCS = PDFAlgorithmLongestCommonSubsequenceBase;
|
||||||
|
|
||||||
auto modifiedRanges = AlgorithmLCS::getModifiedRanges(pageSequence);
|
auto modifiedRanges = AlgorithmLCS::getModifiedRanges(pageSequence);
|
||||||
|
PDFDiffResult::PageSequence resultPageSequence;
|
||||||
|
resultPageSequence.reserve(pageSequence.size());
|
||||||
|
|
||||||
// First find all moved pages
|
// First find all moved pages
|
||||||
for (const AlgorithmLCS::SequenceItem& item : pageSequence)
|
for (const AlgorithmLCS::SequenceItem& item : pageSequence)
|
||||||
@ -480,7 +482,21 @@ void PDFDiff::performCompare(const std::vector<PDFDiffPageContext>& leftPrepared
|
|||||||
{
|
{
|
||||||
result.addPageMoved(leftPreparedPages[item.index1].pageIndex, rightPreparedPages[item.index2].pageIndex);
|
result.addPageMoved(leftPreparedPages[item.index1].pageIndex, rightPreparedPages[item.index2].pageIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PDFDiffResult::PageSequenceItem pageSequenceItem;
|
||||||
|
if (item.isLeftValid())
|
||||||
|
{
|
||||||
|
const PDFInteger leftIndex = leftPreparedPages[item.index1].pageIndex;
|
||||||
|
pageSequenceItem.leftPage = leftIndex;
|
||||||
|
}
|
||||||
|
if (item.isRightValid())
|
||||||
|
{
|
||||||
|
const PDFInteger rightIndex = rightPreparedPages[item.index2].pageIndex;
|
||||||
|
pageSequenceItem.rightPage = rightIndex;
|
||||||
|
}
|
||||||
|
resultPageSequence.emplace_back(pageSequenceItem);
|
||||||
}
|
}
|
||||||
|
result.setPageSequence(std::move(resultPageSequence));
|
||||||
|
|
||||||
std::vector<PDFDiffHelper::TextFlowDifferences> textFlowDifferences;
|
std::vector<PDFDiffHelper::TextFlowDifferences> textFlowDifferences;
|
||||||
|
|
||||||
@ -1242,6 +1258,16 @@ void PDFDiffResult::addRectRight(Difference& difference, QRectF rect)
|
|||||||
m_rects.emplace_back(difference.pageIndex2, rect);
|
m_rects.emplace_back(difference.pageIndex2, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PDFDiffResult::PageSequence& PDFDiffResult::getPageSequence() const
|
||||||
|
{
|
||||||
|
return m_pageSequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PDFDiffResult::setPageSequence(PageSequence pageSequence)
|
||||||
|
{
|
||||||
|
m_pageSequence = pageSequence;
|
||||||
|
}
|
||||||
|
|
||||||
PDFDiffHelper::Differences PDFDiffHelper::calculateDifferences(const GraphicPieceInfos& left,
|
PDFDiffHelper::Differences PDFDiffHelper::calculateDifferences(const GraphicPieceInfos& left,
|
||||||
const GraphicPieceInfos& right,
|
const GraphicPieceInfos& right,
|
||||||
PDFReal epsilon)
|
PDFReal epsilon)
|
||||||
|
@ -59,6 +59,14 @@ public:
|
|||||||
TextRemoved = 0x2000,
|
TextRemoved = 0x2000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PageSequenceItem
|
||||||
|
{
|
||||||
|
PDFInteger leftPage = -1;
|
||||||
|
PDFInteger rightPage = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
using PageSequence = std::vector<PageSequenceItem>;
|
||||||
|
|
||||||
using RectInfos = std::vector<std::pair<PDFInteger, QRectF>>;
|
using RectInfos = std::vector<std::pair<PDFInteger, QRectF>>;
|
||||||
|
|
||||||
void setResult(PDFOperationResult result) { m_result = std::move(result); }
|
void setResult(PDFOperationResult result) { m_result = std::move(result); }
|
||||||
@ -110,6 +118,9 @@ public:
|
|||||||
bool filterImageDifferences,
|
bool filterImageDifferences,
|
||||||
bool filterShadingDifferences);
|
bool filterShadingDifferences);
|
||||||
|
|
||||||
|
const PageSequence& getPageSequence() const;
|
||||||
|
void setPageSequence(PageSequence pageSequence);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class PDFDiff;
|
friend class PDFDiff;
|
||||||
|
|
||||||
@ -180,6 +191,7 @@ private:
|
|||||||
PDFOperationResult m_result;
|
PDFOperationResult m_result;
|
||||||
QStringList m_strings;
|
QStringList m_strings;
|
||||||
uint32_t m_typeFlags = 0;
|
uint32_t m_typeFlags = 0;
|
||||||
|
PageSequence m_pageSequence;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Class for result navigation, can go to next, or previous result.
|
/// Class for result navigation, can go to next, or previous result.
|
||||||
|
Reference in New Issue
Block a user