Skip to content

Commit 58f7845

Browse files
GongHeng2017manisandro
authored andcommitted
chore: some function argument name different.
1. Variable 'child' can be declared as pointer to const. 2. Function 'moveItem' argument 3 names different: declaration 'row' definition 'newRow'. 3. Function 'swapItems' argument 2 names different: declaration 'startRow' definition 'firstRow'. 4. Function 'insertChild' argument 2 names different: declaration 'index' definition 'i'.
1 parent 18dbc68 commit 58f7845

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

qt/src/hocr/HOCRDocument.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ QModelIndex HOCRDocument::indexAtItem(const HOCRItem* item) const {
125125
parent = parent->parent();
126126
}
127127
QModelIndex idx;
128-
for (HOCRItem* parent : parents) {
128+
for (const HOCRItem* parent : parents) {
129129
idx = index(parent->index(), 0, idx);
130130
}
131131
return index(item->index(), 0, idx);
@@ -942,15 +942,15 @@ void HOCRItem::getPropagatableAttributes(QMap<QString, QMap<QString, QSet<QStrin
942942
QString childClass = m_childItems.isEmpty() ? "" : m_childItems.front()->itemClass();
943943
auto it = s_propagatableAttributes.find(childClass);
944944
if (it != s_propagatableAttributes.end()) {
945-
for (HOCRItem* child : m_childItems) {
945+
for (const HOCRItem* child : m_childItems) {
946946
QMap<QString, QString> attrs = child->getAttributes(it.value());
947947
for (auto attrIt = attrs.begin(), attrItEnd = attrs.end(); attrIt != attrItEnd; ++attrIt) {
948948
occurrences[childClass][attrIt.key()].insert(attrIt.value());
949949
}
950950
}
951951
}
952952
if (childClass != "ocrx_word") {
953-
for (HOCRItem* child : m_childItems) {
953+
for (const HOCRItem* child : m_childItems) {
954954
child->getPropagatableAttributes(occurrences);
955955
}
956956
}

qt/src/hocr/HOCRDocument.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public:
6262
}
6363
QModelIndex indexAtItem(const HOCRItem* item) const;
6464
bool editItemAttribute(const QModelIndex& index, const QString& name, const QString& value, const QString& attrItemClass = QString());
65-
QModelIndex moveItem(const QModelIndex& itemIndex, const QModelIndex& newParent, int row);
66-
QModelIndex swapItems(const QModelIndex& parent, int startRow, int endRow);
65+
QModelIndex moveItem(const QModelIndex& itemIndex, const QModelIndex& newParent, int newRow);
66+
QModelIndex swapItems(const QModelIndex& parent, int firstRow, int secondRow);
6767
QModelIndex mergeItems(const QModelIndex& parent, int startRow, int endRow);
6868
QModelIndex splitItem(const QModelIndex& itemIndex, int startRow, int endRow);
6969
QModelIndex splitItemText(const QModelIndex& itemIndex, int pos);
@@ -208,7 +208,7 @@ protected:
208208

209209
// All mutations must be done through methods of HOCRDocument
210210
void addChild(HOCRItem* child);
211-
void insertChild(HOCRItem* child, int index);
211+
void insertChild(HOCRItem* child, int i);
212212
void removeChild(HOCRItem* child);
213213
void takeChild(HOCRItem* child);
214214
QVector<HOCRItem*> takeChildren();

0 commit comments

Comments
 (0)