fixed cut undo.
This commit is contained in:
@@ -128,14 +128,21 @@ const XQModelSection& XQSectionManager::sectionByKey( const QString& sectionKey
|
||||
const XQModelSection& XQSectionManager::sectionByRow(int itemRow ) const
|
||||
{
|
||||
|
||||
// wir gehen rückwärts, weil wir da nur einen vergleich brauchen
|
||||
// und uns den test mit lastRow() sparen können.
|
||||
|
||||
int i = _sections.size() - 1;
|
||||
for (; i >= 0; --i)
|
||||
if( _sections.size() > 0)
|
||||
{
|
||||
if ( _sections.at(i).startIndex().row() <= itemRow )
|
||||
return _sections.at(i);
|
||||
|
||||
// shortcut für die erste position
|
||||
|
||||
// wir gehen rückwärts, weil wir da nur einen vergleich brauchen
|
||||
// und uns den test mit lastRow() sparen können.
|
||||
|
||||
int i = _sections.size() - 1;
|
||||
for (; i >= 0; --i)
|
||||
{
|
||||
if ( _sections.at(i).startIndex().row() < itemRow )
|
||||
return _sections.at(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
throw XQException( "No section for item row: ", QString::number(itemRow));
|
||||
|
Reference in New Issue
Block a user