Commit d3de806a authored by Christopher Combs's avatar Christopher Combs
Browse files

Fixed segfault when trying to edit a control point by right-clicking its row. Fixes #4958.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7867 41f8697f-d340-4b68-9986-7bafba869bb8
parent 0ff99ad8
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -1363,17 +1363,29 @@ namespace Isis {

    void TableViewContent::editControlPoint() {

      AbstractTreeItem *item = m_activeCell->first;

      ControlPoint *cp;
      QString serialNumber;
      AbstractTreeItem *item;

      //  A single cell is chosen
      if (m_model->getSelectedItems().count() == 0) {
        item = m_activeCell->first;
      }
      // A row is chosen
      else {
        item = m_lastDirectlySelectedRow;
      }

      //  Item chosen from the Point table view
      if (item->getPointerType() == AbstractTreeItem::Point) {
        cp = (ControlPoint *) (item->getPointer());
      }
      //  Item chosen from the Measure table view
      else {
        cp = (ControlPoint *) (item->parent()->getPointer());
        serialNumber = item->getData("Image ID").toString();
      }

//    qDebug()<<"activeCell cpid = "<<cp->GetId()<<"  sn = "<<serialNumber;

      emit editControlPoint(cp, serialNumber);
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ namespace Isis {
     *                           the measure table.  If the point was chosen from the measure table,
     *                           the serial number of the measure is also passed. This was added for
     *                           IPCE, for the interaction with other views.
     *   @history 2017-07-18 Christopher Combs - Fixed bug in which trying to edit a selected row
     *                           would cause a segfault from m_activeCell being null. Fixes #4958.
     */
    class TableViewContent : public QAbstractScrollArea {
        Q_OBJECT