// returns NULL if no entry exists, or a pointer to the internal value const SvxMacro* SvxMacroTableDtor::Get(SvMacroItemId nEvent) const
{
SvxMacroTable::const_iterator it = aSvxMacroTable.find(nEvent); return it == aSvxMacroTable.end() ? nullptr : &(it->second);
}
// returns NULL if no entry exists, or a pointer to the internal value
SvxMacro* SvxMacroTableDtor::Get(SvMacroItemId nEvent)
{
SvxMacroTable::iterator it = aSvxMacroTable.find(nEvent); return it == aSvxMacroTable.end() ? nullptr : &(it->second);
}
// return true if the key exists bool SvxMacroTableDtor::IsKeyValid(SvMacroItemId nEvent) const
{
SvxMacroTable::const_iterator it = aSvxMacroTable.find(nEvent); return it != aSvxMacroTable.end();
}
// This stores a copy of the rMacro parameter
SvxMacro& SvxMacroTableDtor::Insert(SvMacroItemId nEvent, const SvxMacro& rMacro)
{ return aSvxMacroTable.emplace( nEvent, rMacro ).first->second;
}
// If the entry exists, remove it from the map and release it's storage void SvxMacroTableDtor::Erase(SvMacroItemId nEvent)
{
SvxMacroTable::iterator it = aSvxMacroTable.find(nEvent); if ( it != aSvxMacroTable.end())
{
aSvxMacroTable.erase(it);
}
}
void SvxMacroItem::SetMacro( SvMacroItemId nEvent, const SvxMacro& rMacro )
{ // tdf#141123: emplace doesn't replace the element in the map if already exists // see https://en.cppreference.com/w/cpp/container/map/emplace // so first erase the macro if there's one for this event
aMacroTable.Erase(nEvent);
aMacroTable.Insert( nEvent, rMacro);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.