pair::second is false if element with same key already existed

The pair::second element in the pair is set to true if a new element was
inserted or false if an element with the same value existed
This commit is contained in:
Caolán McNamara
2011-12-12 16:18:37 +00:00
parent 26c0c9d404
commit 20d6bd273c

View File

@@ -271,7 +271,7 @@ void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
delete pEntry;
}
else if ( mpData->maKeyMap.insert( std::make_pair( nCode, pEntry ) ).second )
else if ( !mpData->maKeyMap.insert( std::make_pair( nCode, pEntry ) ).second )
{
OSL_TRACE( "Accelerator::InsertItem(): KeyCode (Key: %lx) already exists", nCode );
delete pEntry;