summaryrefslogtreecommitdiffstats
path: root/chart2
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 /chart2
parentpython3: upgrade to release 3.5.4 (diff)
downloadcore-d347c2403605c5aa3ddd98fb605366914acab79f.tar.gz
core-d347c2403605c5aa3ddd98fb605366914acab79f.zip
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 'chart2')
-rw-r--r--chart2/source/model/main/DataSeries.cxx2
-rw-r--r--chart2/source/model/main/Diagram.cxx2
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx2
-rw-r--r--chart2/source/tools/NameContainer.cxx2
-rw-r--r--chart2/source/tools/PropertyHelper.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx36
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx2
8 files changed, 25 insertions, 25 deletions
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index 0df608770e26..6440d4d30225 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -113,7 +113,7 @@ void lcl_CloneAttributedDataPoints(
if( xPoint.is())
{
lcl_SetParent( xPoint, xSeries );
- rDestination.insert( lcl_tDataPointMap::value_type( (*aIt).first, xPoint ));
+ rDestination.emplace( (*aIt).first, xPoint );
}
}
}
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 40a40cc75341..d38130d6e0cd 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -293,7 +293,7 @@ lcl_tCooSysMapping lcl_CloneCoordinateSystems(
if( xClone.is())
{
rDestination.push_back( xClone );
- aResult.insert( lcl_tCooSysMapping::value_type( *aIt, xClone ));
+ aResult.emplace( *aIt, xClone );
}
else
rDestination.push_back( *aIt );
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index cc6a7c31e49c..2888ece39dba 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -454,7 +454,7 @@ void InternalDataProvider::adaptMapReferences(
if( xNamed.is())
xNamed->setName( rNewRangeRepresentation );
}
- aNewElements.insert( tSequenceMap::value_type( rNewRangeRepresentation, aIt->second ));
+ aNewElements.emplace( rNewRangeRepresentation, aIt->second );
}
// erase map values for old index
m_aSequenceMap.erase( aRange.first, aRange.second );
diff --git a/chart2/source/tools/NameContainer.cxx b/chart2/source/tools/NameContainer.cxx
index 58e9296a678b..77cac3860f9e 100644
--- a/chart2/source/tools/NameContainer.cxx
+++ b/chart2/source/tools/NameContainer.cxx
@@ -78,7 +78,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& rName, const Any& rEl
{
if( m_aMap.find( rName ) != m_aMap.end() )
throw container::ElementExistException();
- m_aMap.insert( tContentMap::value_type( rName, rElement ));
+ m_aMap.emplace( rName, rElement );
}
void SAL_CALL NameContainer::removeByName( const OUString& Name )
diff --git a/chart2/source/tools/PropertyHelper.cxx b/chart2/source/tools/PropertyHelper.cxx
index 3b0f71839830..780afb3c981a 100644
--- a/chart2/source/tools/PropertyHelper.cxx
+++ b/chart2/source/tools/PropertyHelper.cxx
@@ -266,7 +266,7 @@ void setPropertyValueAny( tPropertyValueMap & rOutMap, tPropertyValueMapKey key,
{
tPropertyValueMap::iterator aIt( rOutMap.find( key ));
if( aIt == rOutMap.end())
- rOutMap.insert( tPropertyValueMap::value_type( key, rAny ));
+ rOutMap.emplace( key, rAny );
else
(*aIt).second = rAny;
}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 111fe2ba9281..dc69bc4aa0b5 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2574,7 +2574,7 @@ void formatPage(
PropertyMapper::getValueMap( aNameValueMap, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), xModelPage );
OUString aCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
- aNameValueMap.insert( tPropertyNameValueMap::value_type( "Name", uno::Any( aCID ) ) ); //CID OUString
+ aNameValueMap.emplace( "Name", uno::Any( aCID ) ); //CID OUString
tNameSequence aNames;
tAnySequence aValues;
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index 15bc0dbea5a6..07bf987ec336 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -97,7 +97,7 @@ void PropertyMapper::getValueMap(
for(sal_Int32 i = 0, n = rNameMap.size(); i < n; ++i)
{
if( xValues[i].hasValue() )
- rValueMap.insert( tPropertyNameValueMap::value_type( aPropTargetNames[i], xValues[i] ) );
+ rValueMap.emplace( aPropTargetNames[i], xValues[i] );
}
}
else
@@ -110,7 +110,7 @@ void PropertyMapper::getValueMap(
{
uno::Any aAny( xSourceProp->getPropertyValue(aSource) );
if( aAny.hasValue() )
- rValueMap.insert( tPropertyNameValueMap::value_type( aTarget, aAny ) );
+ rValueMap.emplace( aTarget, aAny );
}
catch( const uno::Exception& e )
{
@@ -452,20 +452,20 @@ void PropertyMapper::getTextLabelMultiPropertyLists(
PropertyMapper::getValueMap(aValueMap, aNameMap, xSourceProp);
//some more shape properties apart from character properties, position-matrix and label string
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) ) ); // drawing::TextHorizontalAdjust - needs to be overwritten
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) ) ); //drawing::TextVerticalAdjust - needs to be overwritten
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::Any(true) ) ); // sal_Bool
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::Any(true) ) ); // sal_Bool
+ aValueMap.emplace( "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) ); // drawing::TextHorizontalAdjust - needs to be overwritten
+ aValueMap.emplace( "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) ); //drawing::TextVerticalAdjust - needs to be overwritten
+ aValueMap.emplace( "TextAutoGrowHeight", uno::Any(true) ); // sal_Bool
+ aValueMap.emplace( "TextAutoGrowWidth", uno::Any(true) ); // sal_Bool
if( bName )
- aValueMap.insert( tPropertyNameValueMap::value_type( "Name", uno::Any( OUString() ) ) ); //CID OUString - needs to be overwritten for each point
+ aValueMap.emplace( "Name", uno::Any( OUString() ) ); //CID OUString - needs to be overwritten for each point
if( nLimitedSpace > 0 )
{
if(bLimitedHeight)
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameHeight", uno::Any(nLimitedSpace) ) ); //sal_Int32
+ aValueMap.emplace( "TextMaximumFrameHeight", uno::Any(nLimitedSpace) ); //sal_Int32
else
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameWidth", uno::Any(nLimitedSpace) ) ); //sal_Int32
- aValueMap.insert( tPropertyNameValueMap::value_type( "ParaIsHyphenation", uno::Any(true) ) );
+ aValueMap.emplace( "TextMaximumFrameWidth", uno::Any(nLimitedSpace) ); //sal_Int32
+ aValueMap.emplace( "ParaIsHyphenation", uno::Any(true) );
}
PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
@@ -482,18 +482,18 @@ void PropertyMapper::getPreparedTextShapePropertyLists(
, xSourceProp );
// auto-grow makes sure the shape has the correct size after setting text
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::Any( drawing::TextHorizontalAdjust_CENTER )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::Any( drawing::TextVerticalAdjust_CENTER )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::Any( true )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::Any( true )));
+ aValueMap.emplace( "TextHorizontalAdjust", uno::Any( drawing::TextHorizontalAdjust_CENTER ));
+ aValueMap.emplace( "TextVerticalAdjust", uno::Any( drawing::TextVerticalAdjust_CENTER ));
+ aValueMap.emplace( "TextAutoGrowHeight", uno::Any( true ));
+ aValueMap.emplace( "TextAutoGrowWidth", uno::Any( true ));
// set some distance to the border, in case it is shown
const sal_Int32 nWidthDist = 250;
const sal_Int32 nHeightDist = 125;
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextLeftDistance", uno::Any( nWidthDist )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextRightDistance", uno::Any( nWidthDist )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextUpperDistance", uno::Any( nHeightDist )));
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextLowerDistance", uno::Any( nHeightDist )));
+ aValueMap.emplace( "TextLeftDistance", uno::Any( nWidthDist ));
+ aValueMap.emplace( "TextRightDistance", uno::Any( nWidthDist ));
+ aValueMap.emplace( "TextUpperDistance", uno::Any( nHeightDist ));
+ aValueMap.emplace( "TextLowerDistance", uno::Any( nHeightDist ));
// use a line-joint showing the border of thick lines like two rectangles
// filled in between.
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index ff26c60e366b..35c450eafe71 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2281,7 +2281,7 @@ uno::Reference< drawing::XShape >
//set name/classified ObjectID (CID)
if( !aName.isEmpty() )
- aValueMap.insert( tPropertyNameValueMap::value_type( "Name", uno::Any( aName ) ) ); //CID OUString
+ aValueMap.emplace( "Name", uno::Any( aName ) ); //CID OUString
}
//set global title properties