From: mzn Date: Thu, 20 Mar 2014 05:56:35 +0000 (+0000) Subject: Variables naming. X-Git-Tag: BR_hydro_v1_0_1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9e6e04c6bca34f61c17804b242d79e7113d8b2a6;p=modules%2Fhydro.git Variables naming. --- diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx b/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx index 25572638..f4ac8eae 100644 --- a/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx +++ b/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx @@ -205,45 +205,45 @@ bool HYDROGUI_ZLevelsModel::move( const int theItem, const OpType theType, return aRes; } - int aDestinationRow = -1; + int aDestinationIndex = -1; switch ( theType ) { case Up: if ( theItem > 0 ) { - aDestinationRow = theItem - 1; + aDestinationIndex = theItem - 1; if ( theIsVisibleOnly ) { - while ( aDestinationRow >= 0 && !myObjects.at( aDestinationRow ).second ) { - aDestinationRow--; + while ( aDestinationIndex >= 0 && !IsObjectVisible( aDestinationIndex ) ) { + aDestinationIndex--; } } } break; case Down: if ( theItem < myObjects.count() - 1 ) { - aDestinationRow = theItem + 1; + aDestinationIndex = theItem + 1; if ( theIsVisibleOnly ) { - while ( aDestinationRow < myObjects.count() && !myObjects.at( aDestinationRow ).second ) { - aDestinationRow++; + while ( aDestinationIndex < myObjects.count() && !IsObjectVisible( aDestinationIndex ) ) { + aDestinationIndex++; } } } break; case Top: if ( theItem > 0 ) { - aDestinationRow = 0; + aDestinationIndex = 0; } break; case Bottom: if ( theItem < myObjects.count() - 1 ) { - aDestinationRow = myObjects.count() - 1; + aDestinationIndex = myObjects.count() - 1; } break; } - if ( aDestinationRow >= 0 && aDestinationRow < myObjects.count() ) { - int aDestination = (theType == Up || theType == Top) ? aDestinationRow : aDestinationRow + 1; - if ( beginMoveRows( QModelIndex(), theItem, theItem, QModelIndex(), aDestination ) ) { - myObjects.move( theItem, aDestinationRow ); //TODO ??? + if ( aDestinationIndex >= 0 && aDestinationIndex < myObjects.count() ) { + int aDestinationRow = (theType == Up || theType == Top) ? aDestinationIndex : aDestinationIndex + 1; + if ( beginMoveRows( QModelIndex(), theItem, theItem, QModelIndex(), aDestinationRow ) ) { + myObjects.move( theItem, aDestinationIndex ); endMoveRows(); aRes = true; }