Commit d647f303 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - added new convencience getter for the last item in an itemselection.

parent 9448f7a8
......@@ -75,6 +75,18 @@ WItemSelector WItemSelection::getSelectorFirst()
return WItemSelector( shared_from_this(), l );
}
WItemSelector WItemSelection::getSelectorLast()
{
WItemSelector::IndexList l;
ReadTicket r = getReadTicket();
if ( r->get().size() >= 1 )
{
l.push_back( r->get().size() - 1 );
}
return WItemSelector( shared_from_this(), l );
}
WItemSelector WItemSelection::getSelector( size_t item )
{
WItemSelector::IndexList l;
......
......@@ -83,6 +83,13 @@ public:
*/
virtual WItemSelector getSelectorFirst();
/**
* Creates an default selection (last item selected). The selector gets invalid if another item is added.
*
* \return an selector.
*/
virtual WItemSelector getSelectorLast();
/**
* Creates an default selection (a specified items selected). The selector gets invalid if another item is added.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment