summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 11:36:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 13:51:29 +0200
commitdb17a874af37350b3270932175854ee674447bc1 (patch)
treefecc983fb75d3a4072cc7bd344fc824d548deb0d /slideshow
parentdd8a400bbbb1b8d5592a870f2036a4df3d005a7d (diff)
convert std::map::insert to std::map::emplace II
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/slide/layermanager.cxx5
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.cxx10
-rw-r--r--slideshow/source/engine/slide/targetpropertiescreator.cxx5
-rw-r--r--slideshow/source/engine/slideshowimpl.cxx9
-rw-r--r--slideshow/source/engine/usereventqueue.cxx8
5 files changed, 11 insertions, 26 deletions
diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx
index 2a12f0543e5e..579797b23fcd 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -214,9 +214,8 @@ namespace slideshow
ENSURE_OR_THROW( rShape, "LayerManager::addShape(): invalid Shape" );
// add shape to XShape hash map
- if( !maXShapeHash.insert(
- XShapeHash::value_type( rShape->getXShape(),
- rShape) ).second )
+ if( !maXShapeHash.emplace(rShape->getXShape(),
+ rShape).second )
{
// entry already present, nothing to do
return;
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index e15936e685ea..3b8f730eb2c0 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -296,10 +296,7 @@ bool ShapeManagerImpl::listenerAdded(
ShapeSharedPtr pShape( lookupShape(xShape) );
if( pShape )
{
- maShapeListenerMap.insert(
- ShapeToListenersMap::value_type(
- pShape,
- aIter->second));
+ maShapeListenerMap.emplace(pShape, aIter->second);
}
return true;
@@ -343,10 +340,7 @@ void ShapeManagerImpl::cursorChanged( const uno::Reference<drawing::XShape>& x
if( (aIter = maShapeCursorMap.find(pShape))
== maShapeCursorMap.end() )
{
- maShapeCursorMap.insert(
- ShapeToCursorMap::value_type(
- pShape,
- nCursor ));
+ maShapeCursorMap.emplace(pShape, nCursor);
}
else
{
diff --git a/slideshow/source/engine/slide/targetpropertiescreator.cxx b/slideshow/source/engine/slide/targetpropertiescreator.cxx
index 73635e0053f6..451199ec507d 100644
--- a/slideshow/source/engine/slide/targetpropertiescreator.cxx
+++ b/slideshow/source/engine/slide/targetpropertiescreator.cxx
@@ -304,15 +304,14 @@ namespace internal
// target is set the 'visible' value,
// so we should record the opposite value
- mrShapeHash.insert(
- XShapeHash::value_type(
+ mrShapeHash.emplace(
aTarget,
VectorOfNamedValues(
1,
beans::NamedValue(
//xAnimateNode->getAttributeName(),
"visibility",
- uno::makeAny( bVisible ) ) ) ) );
+ uno::makeAny( bVisible ) ) ) );
break;
}
}
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 365b5ead28e8..2aa66dc29c1d 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1828,11 +1828,10 @@ void SlideShowImpl::addShapeEventListener(
maShapeEventListeners.end() )
{
// no entry for this shape -> create one
- aIter = maShapeEventListeners.insert(
- ShapeEventListenerMap::value_type(
+ aIter = maShapeEventListeners.emplace(
xShape,
std::make_shared<comphelper::OInterfaceContainerHelper2>(
- m_aMutex))).first;
+ m_aMutex)).first;
}
// add new listener to broadcaster
@@ -1890,9 +1889,7 @@ void SlideShowImpl::setShapeCursor(
// add new entry, unless shape shall display
// normal pointer arrow -> no need to handle that
// case
- maShapeCursors.insert(
- ShapeCursorMap::value_type(xShape,
- nPointerShape) );
+ maShapeCursors.emplace(xShape, nPointerShape);
}
}
else if( nPointerShape == awt::SystemPointer::ARROW )
diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx
index 66ddcb716318..8d7151036a80 100644
--- a/slideshow/source/engine/usereventqueue.cxx
+++ b/slideshow/source/engine/usereventqueue.cxx
@@ -158,9 +158,7 @@ public:
maAnimationEventMap.end() )
{
// no entry for this animation -> create one
- aIter = maAnimationEventMap.insert(
- ImpAnimationEventMap::value_type( xNode,
- ImpEventVector() ) ).first;
+ aIter = maAnimationEventMap.emplace( xNode, ImpEventVector() ).first;
}
// add new event to queue
@@ -300,9 +298,7 @@ public:
if( (aIter=maShapeEventMap.find( rShape )) == maShapeEventMap.end() )
{
// no entry for this shape -> create one
- aIter = maShapeEventMap.insert(
- ImpShapeEventMap::value_type( rShape,
- ImpEventQueue() ) ).first;
+ aIter = maShapeEventMap.emplace(rShape, ImpEventQueue()).first;
}
// add new event to queue