mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
DocPage Organize: Regroup actions
This commit is contained in:
@ -24,7 +24,7 @@ VERSION = 1.0.0
|
|||||||
|
|
||||||
RC_ICONS = $$PWD/app-icon.ico
|
RC_ICONS = $$PWD/app-icon.ico
|
||||||
|
|
||||||
QMAKE_TARGET_DESCRIPTION = "PDF document page organizer"
|
QMAKE_TARGET_DESCRIPTION = "PDF Document Page Organizer"
|
||||||
QMAKE_TARGET_COPYRIGHT = "(c) Jakub Melka 2018-2021"
|
QMAKE_TARGET_COPYRIGHT = "(c) Jakub Melka 2018-2021"
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
@ -83,6 +83,12 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
ui->actionInsert_PDF->setData(int(Operation::InsertPDF));
|
ui->actionInsert_PDF->setData(int(Operation::InsertPDF));
|
||||||
ui->actionGet_Source->setData(int(Operation::GetSource));
|
ui->actionGet_Source->setData(int(Operation::GetSource));
|
||||||
ui->actionAbout->setData(int(Operation::About));
|
ui->actionAbout->setData(int(Operation::About));
|
||||||
|
ui->actionInvert_Selection->setData(int(Operation::InvertSelection));
|
||||||
|
ui->actionRegroup_Even_Odd->setData(int(Operation::RegroupEvenOdd));
|
||||||
|
ui->actionRegroup_by_Page_Pairs->setData(int(Operation::RegroupPaired));
|
||||||
|
ui->actionRegroup_by_Bookmarks->setData(int(Operation::RegroupBookmarks));
|
||||||
|
ui->actionRegroup_by_Alternating_Pages->setData(int(Operation::RegroupAlternatingPages));
|
||||||
|
ui->actionRegroup_by_Alternating_Pages_Reversed_Order->setData(int(Operation::RegroupAlternatingPagesReversed));
|
||||||
|
|
||||||
QToolBar* mainToolbar = addToolBar(tr("Main"));
|
QToolBar* mainToolbar = addToolBar(tr("Main"));
|
||||||
mainToolbar->setObjectName("main_toolbar");
|
mainToolbar->setObjectName("main_toolbar");
|
||||||
@ -98,7 +104,10 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
insertToolbar->addActions({ ui->actionInsert_PDF, ui->actionInsert_Image, ui->actionInsert_Empty_Page });
|
insertToolbar->addActions({ ui->actionInsert_PDF, ui->actionInsert_Image, ui->actionInsert_Empty_Page });
|
||||||
QToolBar* selectToolbar = addToolBar(tr("Select"));
|
QToolBar* selectToolbar = addToolBar(tr("Select"));
|
||||||
selectToolbar->setObjectName("select_toolbar");
|
selectToolbar->setObjectName("select_toolbar");
|
||||||
selectToolbar->addActions({ ui->actionSelect_None, ui->actionSelect_All, ui->actionSelect_Even, ui->actionSelect_Odd, ui->actionSelect_Portrait, ui->actionSelect_Landscape });
|
selectToolbar->addActions({ ui->actionSelect_None, ui->actionSelect_All, ui->actionSelect_Even, ui->actionSelect_Odd, ui->actionSelect_Portrait, ui->actionSelect_Landscape, ui->actionInvert_Selection });
|
||||||
|
QToolBar* regroupToolbar = addToolBar(tr("Regroup"));
|
||||||
|
regroupToolbar->setObjectName("regroup_toolbar");
|
||||||
|
regroupToolbar->addActions({ ui->actionRegroup_Even_Odd, ui->actionRegroup_by_Page_Pairs, ui->actionRegroup_by_Bookmarks, ui->actionRegroup_by_Alternating_Pages, ui->actionRegroup_by_Alternating_Pages_Reversed_Order });
|
||||||
QToolBar* zoomToolbar = addToolBar(tr("Zoom"));
|
QToolBar* zoomToolbar = addToolBar(tr("Zoom"));
|
||||||
zoomToolbar->setObjectName("zoom_toolbar");
|
zoomToolbar->setObjectName("zoom_toolbar");
|
||||||
zoomToolbar->addActions({ ui->actionZoom_In, ui->actionZoom_Out });
|
zoomToolbar->addActions({ ui->actionZoom_In, ui->actionZoom_Out });
|
||||||
@ -111,7 +120,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
for (QToolBar* toolbar : toolbars)
|
for (QToolBar* toolbar : toolbars)
|
||||||
{
|
{
|
||||||
toolbar->setIconSize(iconSize);
|
toolbar->setIconSize(iconSize);
|
||||||
ui->menuWindow->addAction(toolbar->toggleViewAction());
|
ui->menuToolbars->addAction(toolbar->toggleViewAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(&m_mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &MainWindow::onMappedActionTriggered);
|
connect(&m_mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &MainWindow::onMappedActionTriggered);
|
||||||
@ -341,6 +350,31 @@ bool MainWindow::canPerformOperation(Operation operation) const
|
|||||||
case Operation::About:
|
case Operation::About:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case Operation::InvertSelection:
|
||||||
|
return !isModelEmpty;
|
||||||
|
|
||||||
|
case Operation::RegroupEvenOdd:
|
||||||
|
{
|
||||||
|
PageItemModel::SelectionInfo info = m_model->getSelectionInfo(selection);
|
||||||
|
return info.isDocumentOnly();
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupPaired:
|
||||||
|
return !isModelEmpty && !selection.isEmpty();
|
||||||
|
|
||||||
|
case Operation::RegroupBookmarks:
|
||||||
|
{
|
||||||
|
PageItemModel::SelectionInfo info = m_model->getSelectionInfo(selection);
|
||||||
|
return info.isSingleDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupAlternatingPages:
|
||||||
|
case Operation::RegroupAlternatingPagesReversed:
|
||||||
|
{
|
||||||
|
PageItemModel::SelectionInfo info = m_model->getSelectionInfo(selection);
|
||||||
|
return info.isTwoDocuments();
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
break;
|
break;
|
||||||
@ -695,9 +729,58 @@ void MainWindow::performOperation(Operation operation)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Operation::InvertSelection:
|
||||||
|
{
|
||||||
|
QModelIndex rootIndex = ui->documentItemsView->rootIndex();
|
||||||
|
|
||||||
|
QModelIndex firstIndex = rootIndex.child(0, 0);
|
||||||
|
QModelIndex lastIndex = rootIndex.child(rootIndex.model()->rowCount() - 1, 0);
|
||||||
|
QItemSelection selection(firstIndex, lastIndex);
|
||||||
|
|
||||||
|
ui->documentItemsView->selectionModel()->select(selection, QItemSelectionModel::Toggle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupEvenOdd:
|
||||||
|
{
|
||||||
|
QModelIndexList indexes = ui->documentItemsView->selectionModel()->selection().indexes();
|
||||||
|
m_model->regroupEvenOdd(indexes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupPaired:
|
||||||
|
{
|
||||||
|
QModelIndexList indexes = ui->documentItemsView->selectionModel()->selection().indexes();
|
||||||
|
m_model->regroupPaired(indexes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupBookmarks:
|
||||||
|
{
|
||||||
|
QModelIndexList indexes = ui->documentItemsView->selectionModel()->selection().indexes();
|
||||||
|
m_model->regroupBookmarks(indexes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupAlternatingPages:
|
||||||
|
{
|
||||||
|
QModelIndexList indexes = ui->documentItemsView->selectionModel()->selection().indexes();
|
||||||
|
m_model->regroupAlternatingPages(indexes, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Operation::RegroupAlternatingPagesReversed:
|
||||||
|
{
|
||||||
|
QModelIndexList indexes = ui->documentItemsView->selectionModel()->selection().indexes();
|
||||||
|
m_model->regroupAlternatingPages(indexes, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateActions();
|
updateActions();
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
SelectOdd,
|
SelectOdd,
|
||||||
SelectPortrait,
|
SelectPortrait,
|
||||||
SelectLandscape,
|
SelectLandscape,
|
||||||
|
InvertSelection,
|
||||||
|
|
||||||
ZoomIn,
|
ZoomIn,
|
||||||
ZoomOut,
|
ZoomOut,
|
||||||
@ -81,6 +82,12 @@ public:
|
|||||||
InsertEmptyPage,
|
InsertEmptyPage,
|
||||||
InsertPDF,
|
InsertPDF,
|
||||||
|
|
||||||
|
RegroupEvenOdd,
|
||||||
|
RegroupPaired,
|
||||||
|
RegroupBookmarks,
|
||||||
|
RegroupAlternatingPages,
|
||||||
|
RegroupAlternatingPagesReversed,
|
||||||
|
|
||||||
GetSource,
|
GetSource,
|
||||||
About
|
About
|
||||||
};
|
};
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
<addaction name="actionSelect_Odd"/>
|
<addaction name="actionSelect_Odd"/>
|
||||||
<addaction name="actionSelect_Portrait"/>
|
<addaction name="actionSelect_Portrait"/>
|
||||||
<addaction name="actionSelect_Landscape"/>
|
<addaction name="actionSelect_Landscape"/>
|
||||||
|
<addaction name="actionInvert_Selection"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionZoom_In"/>
|
<addaction name="actionZoom_In"/>
|
||||||
<addaction name="actionZoom_Out"/>
|
<addaction name="actionZoom_Out"/>
|
||||||
@ -115,17 +116,28 @@
|
|||||||
<addaction name="actionGet_Source"/>
|
<addaction name="actionGet_Source"/>
|
||||||
<addaction name="actionAbout"/>
|
<addaction name="actionAbout"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuWindow">
|
<widget class="QMenu" name="menuToolbars">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Window</string>
|
<string>Toolbars</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuRegroup">
|
||||||
|
<property name="title">
|
||||||
|
<string>Regroup</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionRegroup_Even_Odd"/>
|
||||||
|
<addaction name="actionRegroup_by_Page_Pairs"/>
|
||||||
|
<addaction name="actionRegroup_by_Bookmarks"/>
|
||||||
|
<addaction name="actionRegroup_by_Alternating_Pages"/>
|
||||||
|
<addaction name="actionRegroup_by_Alternating_Pages_Reversed_Order"/>
|
||||||
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuEdit"/>
|
<addaction name="menuEdit"/>
|
||||||
<addaction name="menuInsert"/>
|
<addaction name="menuInsert"/>
|
||||||
|
<addaction name="menuRegroup"/>
|
||||||
<addaction name="menuView"/>
|
<addaction name="menuView"/>
|
||||||
<addaction name="menuMake"/>
|
<addaction name="menuMake"/>
|
||||||
<addaction name="menuWindow"/>
|
<addaction name="menuToolbars"/>
|
||||||
<addaction name="menuHelp"/>
|
<addaction name="menuHelp"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
@ -489,6 +501,60 @@
|
|||||||
<string>Ctrl+W</string>
|
<string>Ctrl+W</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionRegroup_Even_Odd">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/regroup-even-odd.svg</normaloff>:/pdfdocpage/resources/regroup-even-odd.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Regroup by Even/Odd Pages</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRegroup_by_Page_Pairs">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/regroup-pairs.svg</normaloff>:/pdfdocpage/resources/regroup-pairs.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Regroup by Page Pairs</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRegroup_by_Bookmarks">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/regroup-bookmarks.svg</normaloff>:/pdfdocpage/resources/regroup-bookmarks.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Regroup by Bookmarks</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRegroup_by_Alternating_Pages">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/regroup-alternating.svg</normaloff>:/pdfdocpage/resources/regroup-alternating.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Regroup by Alternating Pages</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRegroup_by_Alternating_Pages_Reversed_Order">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/regroup-alternating-reversed.svg</normaloff>:/pdfdocpage/resources/regroup-alternating-reversed.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Regroup by Alternating Pages (Reversed Order)</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionInvert_Selection">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/pdfdocpage/resources/invert-selection.svg</normaloff>:/pdfdocpage/resources/invert-selection.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Invert Selection</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources.qrc"/>
|
<include location="resources.qrc"/>
|
||||||
|
@ -435,6 +435,25 @@ void PageItemModel::insertEmptyPage(const QModelIndex& index)
|
|||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<PageGroupItem::GroupItem> PageItemModel::extractItems(std::vector<PageGroupItem>& items,
|
||||||
|
const QModelIndexList& selection) const
|
||||||
|
{
|
||||||
|
std::vector<PageGroupItem::GroupItem> extractedItems;
|
||||||
|
|
||||||
|
std::vector<int> rows;
|
||||||
|
rows.reserve(selection.size());
|
||||||
|
std::transform(selection.cbegin(), selection.cend(), std::back_inserter(rows), [](const auto& index) { return index.row(); });
|
||||||
|
std::sort(rows.begin(), rows.end(), std::greater<int>());
|
||||||
|
|
||||||
|
for (int row : rows)
|
||||||
|
{
|
||||||
|
extractedItems.insert(extractedItems.begin(), items[row].groups.cbegin(), items[row].groups.cend());
|
||||||
|
items.erase(std::next(items.begin(), row));
|
||||||
|
}
|
||||||
|
|
||||||
|
return extractedItems;
|
||||||
|
}
|
||||||
|
|
||||||
void PageItemModel::rotateLeft(const QModelIndexList& list)
|
void PageItemModel::rotateLeft(const QModelIndexList& list)
|
||||||
{
|
{
|
||||||
if (list.isEmpty())
|
if (list.isEmpty())
|
||||||
@ -489,6 +508,176 @@ void PageItemModel::rotateRight(const QModelIndexList& list)
|
|||||||
emit dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex()));
|
emit dataChanged(index(rowMin, 0, QModelIndex()), index(rowMax, 0, QModelIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PageItemModel::SelectionInfo PageItemModel::getSelectionInfo(const QModelIndexList& list) const
|
||||||
|
{
|
||||||
|
SelectionInfo info;
|
||||||
|
|
||||||
|
std::set<int> documents;
|
||||||
|
std::set<int> images;
|
||||||
|
|
||||||
|
for (const QModelIndex& index : list)
|
||||||
|
{
|
||||||
|
const PageGroupItem* item = getItem(index);
|
||||||
|
|
||||||
|
if (!item)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const PageGroupItem::GroupItem& groupItem : item->groups)
|
||||||
|
{
|
||||||
|
switch (groupItem.pageType)
|
||||||
|
{
|
||||||
|
case pdfdocpage::PT_DocumentPage:
|
||||||
|
documents.insert(groupItem.documentIndex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case pdfdocpage::PT_Image:
|
||||||
|
images.insert(groupItem.imageIndex);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case pdfdocpage::PT_Empty:
|
||||||
|
++info.blankPageCount;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Q_ASSERT(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
info.documentCount = int(documents.size());
|
||||||
|
info.imageCount = int(images.size());
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageItemModel::regroupEvenOdd(const QModelIndexList& list)
|
||||||
|
{
|
||||||
|
if (list.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PageGroupItem> pageGroupItems = m_pageGroupItems;
|
||||||
|
std::vector<PageGroupItem::GroupItem> extractedItems = extractItems(pageGroupItems, list);
|
||||||
|
|
||||||
|
auto it = std::stable_partition(extractedItems.begin(), extractedItems.end(), [](const auto& item) { return item.pageIndex % 2 == 1; });
|
||||||
|
std::vector<PageGroupItem::GroupItem> oddItems(extractedItems.begin(), it);
|
||||||
|
std::vector<PageGroupItem::GroupItem> evenItems(it, extractedItems.end());
|
||||||
|
|
||||||
|
if (!oddItems.empty())
|
||||||
|
{
|
||||||
|
PageGroupItem item;
|
||||||
|
item.groups = std::move(oddItems);
|
||||||
|
updateItemCaptionAndTags(item);
|
||||||
|
pageGroupItems.emplace_back(std::move(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!evenItems.empty())
|
||||||
|
{
|
||||||
|
PageGroupItem item;
|
||||||
|
item.groups = std::move(evenItems);
|
||||||
|
updateItemCaptionAndTags(item);
|
||||||
|
pageGroupItems.emplace_back(std::move(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageGroupItems != m_pageGroupItems)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_pageGroupItems = std::move(pageGroupItems);
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageItemModel::regroupPaired(const QModelIndexList& list)
|
||||||
|
{
|
||||||
|
if (list.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PageGroupItem> pageGroupItems = m_pageGroupItems;
|
||||||
|
std::vector<PageGroupItem::GroupItem> extractedItems = extractItems(pageGroupItems, list);
|
||||||
|
|
||||||
|
auto it = extractedItems.begin();
|
||||||
|
while (it != extractedItems.cend())
|
||||||
|
{
|
||||||
|
PageGroupItem item;
|
||||||
|
item.groups = { *it++ };
|
||||||
|
|
||||||
|
if (it != extractedItems.cend())
|
||||||
|
{
|
||||||
|
item.groups.emplace_back(std::move(*it++));
|
||||||
|
}
|
||||||
|
|
||||||
|
updateItemCaptionAndTags(item);
|
||||||
|
pageGroupItems.emplace_back(std::move(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pageGroupItems != m_pageGroupItems)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_pageGroupItems = std::move(pageGroupItems);
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageItemModel::regroupBookmarks(const QModelIndexList& list)
|
||||||
|
{
|
||||||
|
Q_ASSERT(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageItemModel::regroupAlternatingPages(const QModelIndexList& list, bool reversed)
|
||||||
|
{
|
||||||
|
if (list.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PageGroupItem> pageGroupItems = m_pageGroupItems;
|
||||||
|
std::vector<PageGroupItem::GroupItem> extractedItems = extractItems(pageGroupItems, list);
|
||||||
|
const int documentIndex = extractedItems.front().documentIndex;
|
||||||
|
|
||||||
|
auto it = std::stable_partition(extractedItems.begin(), extractedItems.end(), [documentIndex](const auto& item) { return item.documentIndex == documentIndex; });
|
||||||
|
std::vector<PageGroupItem::GroupItem> firstDocItems(extractedItems.begin(), it);
|
||||||
|
std::vector<PageGroupItem::GroupItem> secondDocItems(it, extractedItems.end());
|
||||||
|
|
||||||
|
if (reversed)
|
||||||
|
{
|
||||||
|
std::reverse(secondDocItems.begin(), secondDocItems.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto itF = firstDocItems.begin();
|
||||||
|
auto itS = secondDocItems.begin();
|
||||||
|
|
||||||
|
PageGroupItem item;
|
||||||
|
|
||||||
|
while (itF != firstDocItems.cend() || itS != secondDocItems.cend())
|
||||||
|
{
|
||||||
|
if (itF != firstDocItems.cend())
|
||||||
|
{
|
||||||
|
item.groups.emplace_back(std::move(*itF++));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itS != secondDocItems.cend())
|
||||||
|
{
|
||||||
|
item.groups.emplace_back(std::move(*itS++));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateItemCaptionAndTags(item);
|
||||||
|
pageGroupItems.emplace_back(std::move(item));
|
||||||
|
|
||||||
|
if (pageGroupItems != m_pageGroupItems)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_pageGroupItems = std::move(pageGroupItems);
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QItemSelection PageItemModel::getSelectionImpl(std::function<bool (const PageGroupItem::GroupItem&)> filter) const
|
QItemSelection PageItemModel::getSelectionImpl(std::function<bool (const PageGroupItem::GroupItem&)> filter) const
|
||||||
{
|
{
|
||||||
QItemSelection result;
|
QItemSelection result;
|
||||||
|
@ -32,7 +32,8 @@ enum PageType
|
|||||||
{
|
{
|
||||||
PT_DocumentPage,
|
PT_DocumentPage,
|
||||||
PT_Image,
|
PT_Image,
|
||||||
PT_Empty
|
PT_Empty,
|
||||||
|
PT_Last
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PageGroupItem
|
struct PageGroupItem
|
||||||
@ -167,12 +168,32 @@ public:
|
|||||||
const std::map<int, DocumentItem>& getDocuments() const { return m_documents; }
|
const std::map<int, DocumentItem>& getDocuments() const { return m_documents; }
|
||||||
const std::map<int, ImageItem>& getImages() const { return m_images; }
|
const std::map<int, ImageItem>& getImages() const { return m_images; }
|
||||||
|
|
||||||
|
struct SelectionInfo
|
||||||
|
{
|
||||||
|
int documentCount = 0;
|
||||||
|
int imageCount = 0;
|
||||||
|
int blankPageCount = 0;
|
||||||
|
|
||||||
|
bool isDocumentOnly() const { return documentCount > 0 && imageCount == 0 && blankPageCount == 0; }
|
||||||
|
bool isSingleDocument() const { return isDocumentOnly() && documentCount == 1; }
|
||||||
|
bool isTwoDocuments() const { return isDocumentOnly() && documentCount == 2; }
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectionInfo getSelectionInfo(const QModelIndexList& list) const;
|
||||||
|
|
||||||
|
void regroupEvenOdd(const QModelIndexList& list);
|
||||||
|
void regroupPaired(const QModelIndexList& list);
|
||||||
|
void regroupBookmarks(const QModelIndexList& list);
|
||||||
|
void regroupAlternatingPages(const QModelIndexList& list, bool reversed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createDocumentGroup(int index, const QModelIndex& insertIndex);
|
void createDocumentGroup(int index, const QModelIndex& insertIndex);
|
||||||
QString getGroupNameFromDocument(int index) const;
|
QString getGroupNameFromDocument(int index) const;
|
||||||
void updateItemCaptionAndTags(PageGroupItem& item) const;
|
void updateItemCaptionAndTags(PageGroupItem& item) const;
|
||||||
void insertEmptyPage(const QModelIndex& index);
|
void insertEmptyPage(const QModelIndex& index);
|
||||||
|
|
||||||
|
std::vector<PageGroupItem::GroupItem> extractItems(std::vector<PageGroupItem>& items, const QModelIndexList& selection) const;
|
||||||
|
|
||||||
QItemSelection getSelectionImpl(std::function<bool(const PageGroupItem::GroupItem&)> filter) const;
|
QItemSelection getSelectionImpl(std::function<bool(const PageGroupItem::GroupItem&)> filter) const;
|
||||||
|
|
||||||
std::vector<PageGroupItem> m_pageGroupItems;
|
std::vector<PageGroupItem> m_pageGroupItems;
|
||||||
|
@ -30,5 +30,11 @@
|
|||||||
<file>resources/zoom-in.svg</file>
|
<file>resources/zoom-in.svg</file>
|
||||||
<file>resources/zoom-out.svg</file>
|
<file>resources/zoom-out.svg</file>
|
||||||
<file>resources/clear.svg</file>
|
<file>resources/clear.svg</file>
|
||||||
|
<file>resources/invert-selection.svg</file>
|
||||||
|
<file>resources/regroup-alternating.svg</file>
|
||||||
|
<file>resources/regroup-alternating-reversed.svg</file>
|
||||||
|
<file>resources/regroup-bookmarks.svg</file>
|
||||||
|
<file>resources/regroup-even-odd.svg</file>
|
||||||
|
<file>resources/regroup-pairs.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
108
Pdf4QtDocPageOrganizer/resources/invert-selection.svg
Normal file
108
Pdf4QtDocPageOrganizer/resources/invert-selection.svg
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="select-all.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="5.656854"
|
||||||
|
inkscape:cx="148.43961"
|
||||||
|
inkscape:cy="135.18316"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919" /></flowRoot> <g
|
||||||
|
aria-label="?"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||||
|
id="text849"
|
||||||
|
transform="translate(-4.7625002,-4.2333335)">
|
||||||
|
<path
|
||||||
|
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||||
|
style="stroke-width:0.26458332"
|
||||||
|
id="path851"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="zoom-out.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="95.629471"
|
||||||
|
inkscape:cy="75.073314"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919"></flowPara></flowRoot> <ellipse
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path5985"
|
||||||
|
cx="10.996745"
|
||||||
|
cy="278.08231"
|
||||||
|
rx="6.4988279"
|
||||||
|
ry="6.4161458" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.64349,283.14245 6.482291,7.27604"
|
||||||
|
id="path5987"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
|
d="m 6.8988947,278.38468 8.1617433,-0.0935"
|
||||||
|
id="path5991"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
114
Pdf4QtDocPageOrganizer/resources/regroup-alternating.svg
Normal file
114
Pdf4QtDocPageOrganizer/resources/regroup-alternating.svg
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="zoom-out.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="95.629471"
|
||||||
|
inkscape:cy="75.073314"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919"></flowPara></flowRoot> <ellipse
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path5985"
|
||||||
|
cx="10.996745"
|
||||||
|
cy="278.08231"
|
||||||
|
rx="6.4988279"
|
||||||
|
ry="6.4161458" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.64349,283.14245 6.482291,7.27604"
|
||||||
|
id="path5987"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
|
d="m 6.8988947,278.38468 8.1617433,-0.0935"
|
||||||
|
id="path5991"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
114
Pdf4QtDocPageOrganizer/resources/regroup-bookmarks.svg
Normal file
114
Pdf4QtDocPageOrganizer/resources/regroup-bookmarks.svg
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="zoom-out.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="95.629471"
|
||||||
|
inkscape:cy="75.073314"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919"></flowPara></flowRoot> <ellipse
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path5985"
|
||||||
|
cx="10.996745"
|
||||||
|
cy="278.08231"
|
||||||
|
rx="6.4988279"
|
||||||
|
ry="6.4161458" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.64349,283.14245 6.482291,7.27604"
|
||||||
|
id="path5987"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
|
d="m 6.8988947,278.38468 8.1617433,-0.0935"
|
||||||
|
id="path5991"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
114
Pdf4QtDocPageOrganizer/resources/regroup-even-odd.svg
Normal file
114
Pdf4QtDocPageOrganizer/resources/regroup-even-odd.svg
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="zoom-out.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="95.629471"
|
||||||
|
inkscape:cy="75.073314"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919"></flowPara></flowRoot> <ellipse
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path5985"
|
||||||
|
cx="10.996745"
|
||||||
|
cy="278.08231"
|
||||||
|
rx="6.4988279"
|
||||||
|
ry="6.4161458" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.64349,283.14245 6.482291,7.27604"
|
||||||
|
id="path5987"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
|
d="m 6.8988947,278.38468 8.1617433,-0.0935"
|
||||||
|
id="path5991"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
114
Pdf4QtDocPageOrganizer/resources/regroup-pairs.svg
Normal file
114
Pdf4QtDocPageOrganizer/resources/regroup-pairs.svg
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="30mm"
|
||||||
|
height="30mm"
|
||||||
|
viewBox="0 0 30 30"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5291"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
|
sodipodi:docname="zoom-out.svg">
|
||||||
|
<defs
|
||||||
|
id="defs5285">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="0 : 15 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="30 : 15 : 1"
|
||||||
|
inkscape:persp3d-origin="15 : 10 : 1"
|
||||||
|
id="perspective5921" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="95.629471"
|
||||||
|
inkscape:cy="75.073314"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3840"
|
||||||
|
inkscape:window-height="2035"
|
||||||
|
inkscape:window-x="-13"
|
||||||
|
inkscape:window-y="-13"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5288">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Jakub Melka</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Vrstva 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-267)">
|
||||||
|
<flowRoot
|
||||||
|
xml:space="preserve"
|
||||||
|
id="flowRoot5913"
|
||||||
|
style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||||
|
id="flowRegion5915"><rect
|
||||||
|
id="rect5917"
|
||||||
|
width="129.22377"
|
||||||
|
height="91.747108"
|
||||||
|
x="-13.788582"
|
||||||
|
y="-33.515606" /></flowRegion><flowPara
|
||||||
|
id="flowPara5919"></flowPara></flowRoot> <ellipse
|
||||||
|
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path5985"
|
||||||
|
cx="10.996745"
|
||||||
|
cy="278.08231"
|
||||||
|
rx="6.4988279"
|
||||||
|
ry="6.4161458" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 15.64349,283.14245 6.482291,7.27604"
|
||||||
|
id="path5987"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||||
|
d="m 6.8988947,278.38468 8.1617433,-0.0935"
|
||||||
|
id="path5991"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
@ -343,7 +343,7 @@ PDFDocumentManipulator::ProcessedPages PDFDocumentManipulator::collectObjectsAnd
|
|||||||
auto referenceIt = references.begin();
|
auto referenceIt = references.begin();
|
||||||
for (auto currentIt = it; currentIt != itEnd; ++currentIt, ++referenceIt)
|
for (auto currentIt = it; currentIt != itEnd; ++currentIt, ++referenceIt)
|
||||||
{
|
{
|
||||||
it->second = *referenceIt;
|
currentIt->second = *referenceIt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user