summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-10 16:43:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 12:38:32 +0200
commitd347c2403605c5aa3ddd98fb605366914acab79f (patch)
treee39624030741234c514bccd858e69d6318dfba68 /extensions/source/propctrlr
parentf0e68d4feaaa43f7450432ad1ebd92c2b572400f (diff)
convert std::map::insert to std::map::emplace
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions/source/propctrlr')
-rw-r--r--extensions/source/propctrlr/eformshelper.cxx2
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx10
-rw-r--r--extensions/source/propctrlr/genericpropertyhandler.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx5
-rw-r--r--extensions/source/propctrlr/propertyeditor.cxx2
5 files changed, 10 insertions, 11 deletions
diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx
index 54720f479054..b907eec8b249 100644
--- a/extensions/source/propctrlr/eformshelper.cxx
+++ b/extensions/source/propctrlr/eformshelper.cxx
@@ -690,7 +690,7 @@ namespace pcr
OUString sUIName = composeModelElementUIName( *pModelName, sElementName );
OSL_ENSURE( rMapUINameToElement.find( sUIName ) == rMapUINameToElement.end(), "EFormsHelper::getAllElementUINames: duplicate name!" );
- rMapUINameToElement.insert( MapStringToPropertySet::value_type( sUIName, xElement ) );
+ rMapUINameToElement.emplace( sUIName, xElement );
}
}
}
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 9b690dbd135c..fe01b84ba6aa 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -156,9 +156,9 @@ namespace pcr
namespace
{
#define DESCRIBE_EVENT( asciinamespace, asciilistener, asciimethod, id_postfix ) \
- s_aKnownEvents.insert( EventMap::value_type( \
+ s_aKnownEvents.emplace( \
asciimethod, \
- EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) )
+ EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) )
bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription )
{
@@ -358,7 +358,7 @@ namespace pcr
void EventHolder::addEvent( EventId _nId, const OUString& _rEventName, const ScriptEventDescriptor& _rScriptEvent )
{
std::pair< EventMap::iterator, bool > insertionResult =
- m_aEventNameAccess.insert( EventMap::value_type( _rEventName, _rScriptEvent ) );
+ m_aEventNameAccess.emplace( _rEventName, _rScriptEvent );
OSL_ENSURE( insertionResult.second, "EventHolder::addEvent: there already was a MacroURL for this event!" );
m_aEventIndexAccess[ _nId ] = insertionResult.first;
}
@@ -730,8 +730,8 @@ namespace pcr
if ( !impl_filterMethod_nothrow( aEvent ) )
continue;
- m_aEvents.insert( EventMap::value_type(
- lcl_getEventPropertyName( sListenerClassName, *pMethods ), aEvent ) );
+ m_aEvents.emplace(
+ lcl_getEventPropertyName( sListenerClassName, *pMethods ), aEvent );
}
}
diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx
index 0eb9a657b63f..859b7ae76eff 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.cxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.cxx
@@ -508,7 +508,7 @@ namespace pcr
continue;
}
- m_aProperties.insert( PropertyMap::value_type( property.Name, property ) );
+ m_aProperties.emplace( property.Name, property );
}
}
catch( const Exception& )
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 4e7519a8701d..531c749941e4 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -1046,8 +1046,7 @@ namespace pcr
StlSyntaxSequence< OUString > aInterestingActuations( (*aHandler)->getActuatingProperties() );
for (const auto & aInterestingActuation : aInterestingActuations)
{
- m_aDependencyHandlers.insert( PropertyHandlerMultiRepository::value_type(
- aInterestingActuation, *aHandler ) );
+ m_aDependencyHandlers.emplace( aInterestingActuation, *aHandler );
}
++aHandler;
@@ -1065,7 +1064,7 @@ namespace pcr
sal_Int32 nRelativePropertyOrder = sourceProps - aProperties.begin();
if ( m_xModel.is() )
nRelativePropertyOrder = m_xModel->getPropertyOrderIndex( sourceProps->Name );
- m_aProperties.insert(OrderedPropertyMap::value_type(nRelativePropertyOrder, *sourceProps));
+ m_aProperties.emplace(nRelativePropertyOrder, *sourceProps);
}
// be notified when one of our inspectees dies
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index 714e640cc0ec..02e69a623bf4 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -401,7 +401,7 @@ namespace pcr
OSL_ENSURE( m_aPropertyPageIds.find( rData.sName ) == m_aPropertyPageIds.end(),
"OPropertyEditor::InsertEntry: property already present in the map!" );
- m_aPropertyPageIds.insert( MapStringToPageId::value_type( rData.sName, _nPageId ) );
+ m_aPropertyPageIds.emplace( rData.sName, _nPageId );
}