Skip to content

Commit

Permalink
[TD]fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Feb 16, 2020
1 parent 1c27611 commit d0215f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/Mod/TechDraw/Gui/MDIViewPage.cpp
Expand Up @@ -1020,7 +1020,7 @@ void MDIViewPage::clearSceneSelection()
{
// Base::Console().Message("MDIVP::clearSceneSelection()\n");
blockSelection(true);
m_sceneSelected.clear();
qgSceneSelected.clear();

std::vector<QGIView *> views = m_view->getViews();

Expand Down Expand Up @@ -1100,43 +1100,43 @@ void MDIViewPage::sceneSelectionManager()
QList<QGraphicsItem*> sceneSel = m_view->scene()->selectedItems();

if (sceneSel.isEmpty()) {
m_sceneSelected.clear(); //TODO: need to signal somebody? Tree? handled elsewhere
qgSceneSelected.clear(); //TODO: need to signal somebody? Tree? handled elsewhere
//clearSelection
return;
}

if (m_sceneSelected.isEmpty() &&
if (qgSceneSelected.isEmpty() &&
!sceneSel.isEmpty()) {
m_sceneSelected.push_back(sceneSel.front());
qgSceneSelected.push_back(sceneSel.front());
return;
}

//add to m_sceneSelected anything that is in q_sceneSel
//add to qgSceneSelected anything that is in q_sceneSel
for (auto qts: sceneSel) {
bool found = false;
for (auto ms: m_sceneSelected) {
for (auto ms: qgSceneSelected) {
if ( qts == ms ) {
found = true;
break;
}
}
if (!found) {
m_sceneSelected.push_back(qts);
qgSceneSelected.push_back(qts);
break;
}
}

//remove items from m_sceneSelected that are not in q_sceneSel
//remove items from qgSceneSelected that are not in q_sceneSel
QList<QGraphicsItem*> m_new;
for (auto m: m_sceneSelected) {
for (auto m: qgSceneSelected) {
for (auto q: sceneSel) {
if (m == q) {
m_new.push_back(m);
break;
}
}
}
m_sceneSelected = m_new;
qgSceneSelected = m_new;
}

//! update Tree Selection from QGraphicsScene selection
Expand All @@ -1154,7 +1154,7 @@ void MDIViewPage::sceneSelectionChanged()

std::vector<Gui::SelectionObject> treeSel = Gui::Selection().getSelectionEx();
// QList<QGraphicsItem*> sceneSel = m_view->scene()->selectedItems();
QList<QGraphicsItem*> sceneSel = m_sceneSelected;
QList<QGraphicsItem*> sceneSel = qgSceneSelected;

//check if really need to change selection
bool sameSel = compareSelections(treeSel,sceneSel);
Expand All @@ -1173,7 +1173,7 @@ void MDIViewPage::setTreeToSceneSelect(void)
blockSelection(true);
Gui::Selection().clearSelection();
// QList<QGraphicsItem*> sceneSel = m_view->scene()->selectedItems(); //"no particular order"!!!
QList<QGraphicsItem*> sceneSel = m_sceneSelected;
QList<QGraphicsItem*> sceneSel = qgSceneSelected;
for (QList<QGraphicsItem*>::iterator it = sceneSel.begin(); it != sceneSel.end(); ++it) {
QGIView *itemView = dynamic_cast<QGIView *>(*it);
if(itemView == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/MDIViewPage.h
Expand Up @@ -163,7 +163,7 @@ public Q_SLOTS:
QPrinter::PaperSize m_paperSize;
ViewProviderPage *m_vpPage;

QList<QGraphicsItem*> m_sceneSelected;
QList<QGraphicsItem*> qgSceneSelected;
QList<QGIView *> deleteItems;
};

Expand Down

0 comments on commit d0215f7

Please sign in to comment.