mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #182: PDF4QT Document Diff command line cmd line arguments ignored
This commit is contained in:
@ -458,22 +458,7 @@ void MainWindow::performOperation(Operation operation)
|
||||
if (document)
|
||||
{
|
||||
clear(true, false);
|
||||
m_leftDocument = std::move(*document);
|
||||
|
||||
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->clear();
|
||||
}
|
||||
|
||||
setLeftDocument(std::move(*document));
|
||||
updateViewDocument();
|
||||
}
|
||||
|
||||
@ -489,22 +474,7 @@ void MainWindow::performOperation(Operation operation)
|
||||
if (document)
|
||||
{
|
||||
clear(false, true);
|
||||
m_rightDocument = std::move(*document);
|
||||
|
||||
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->clear();
|
||||
}
|
||||
|
||||
setRightDocument(std::move(*document));
|
||||
updateViewDocument();
|
||||
}
|
||||
|
||||
@ -863,6 +833,44 @@ std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
||||
return pdf::PDFDocument();
|
||||
}
|
||||
|
||||
void MainWindow::setRightDocument(pdf::PDFDocument&& newRightDocument)
|
||||
{
|
||||
m_rightDocument = newRightDocument;
|
||||
|
||||
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settingsDockWidget->getRightPageSelectionEdit()->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setLeftDocument(pdf::PDFDocument&& newLeftDocument)
|
||||
{
|
||||
m_leftDocument = newLeftDocument;
|
||||
|
||||
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settingsDockWidget->getLeftPageSelectionEdit()->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
{
|
||||
#ifdef WIN_TASKBAR_BUTTON
|
||||
|
Reference in New Issue
Block a user