[Libreoffice-commits] core.git: chart2/source codemaker/source comphelper/source configmgr/source connectivity/source cppuhelper/source cppu/source dbaccess/source desktop/source extensions/source formula/source framework/source idlc/source include/oox oox/source reportdesign/source sal/rtl sc/inc sc/qa sc/source sdext/source sd/source sfx2/source slideshow/source stoc/source svtools/source svx/source sw/source ucb/source unoidl/source unotools/source unoxml/source xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Aug 11 11:52:41 UTC 2017


 chart2/source/controller/dialogs/DialogModel.cxx                |   11 -
 chart2/source/tools/InternalDataProvider.cxx                    |    5 
 chart2/source/view/charttypes/VSeriesPlotter.cxx                |    3 
 codemaker/source/cppumaker/cpputype.cxx                         |   14 -
 codemaker/source/cppumaker/dependencies.cxx                     |    3 
 codemaker/source/cppumaker/includes.cxx                         |    3 
 codemaker/source/javamaker/classfile.cxx                        |   36 +---
 codemaker/source/javamaker/javatype.cxx                         |    7 
 comphelper/source/misc/accessiblewrapper.cxx                    |    3 
 configmgr/source/access.cxx                                     |    5 
 configmgr/source/components.cxx                                 |    3 
 configmgr/source/data.cxx                                       |    5 
 configmgr/source/modifications.cxx                              |    3 
 connectivity/source/commontools/TTableHelper.cxx                |    2 
 connectivity/source/commontools/parameters.cxx                  |    4 
 connectivity/source/drivers/hsqldb/HStorageMap.cxx              |    2 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx           |    2 
 connectivity/source/drivers/odbc/OConnection.cxx                |    2 
 connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx |    5 
 connectivity/source/drivers/odbc/OResultSet.cxx                 |    5 
 connectivity/source/drivers/odbc/OResultSetMetaData.cxx         |    2 
 cppu/source/uno/lbenv.cxx                                       |    3 
 cppuhelper/source/component_context.cxx                         |    4 
 cppuhelper/source/propertysetmixin.cxx                          |    5 
 cppuhelper/source/servicemanager.cxx                            |   14 -
 cppuhelper/source/unourl.cxx                                    |    5 
 dbaccess/source/core/dataaccess/connection.cxx                  |    5 
 dbaccess/source/core/dataaccess/definitioncontainer.cxx         |    3 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx              |    2 
 dbaccess/source/ui/misc/WCopyTable.cxx                          |    7 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx              |    4 
 desktop/source/deployment/misc/dp_update.cxx                    |   10 -
 desktop/source/deployment/registry/dp_registry.cxx              |    9 -
 extensions/source/config/ldap/ldapaccess.cxx                    |    8 
 extensions/source/dbpilots/controlwizard.cxx                    |    2 
 formula/source/ui/dlg/formula.cxx                               |    2 
 framework/source/services/ContextChangeEventMultiplexer.cxx     |    5 
 framework/source/uielement/toolbarmanager.cxx                   |    5 
 idlc/source/astinterface.cxx                                    |   20 --
 include/oox/core/relations.hxx                                  |    5 
 oox/source/core/relationshandler.cxx                            |    2 
 reportdesign/source/filter/xml/xmlExport.cxx                    |    4 
 sal/rtl/bootstrap.cxx                                           |    3 
 sc/inc/reordermap.hxx                                           |    8 
 sc/qa/unit/ucalc_formula.cxx                                    |    3 
 sc/source/core/data/conditio.cxx                                |    6 
 sc/source/core/data/documen3.cxx                                |    2 
 sc/source/core/data/dpgroup.cxx                                 |    3 
 sc/source/core/data/dpsave.cxx                                  |    3 
 sc/source/core/data/dptabres.cxx                                |    7 
 sc/source/core/data/mtvelements.cxx                             |    6 
 sc/source/core/data/table3.cxx                                  |    4 
 sc/source/core/tool/addincol.cxx                                |   30 +--
 sc/source/core/tool/formulagroup.cxx                            |    3 
 sc/source/core/tool/reordermap.cxx                              |   21 --
 sc/source/core/tool/tokenstringcontext.cxx                      |    6 
 sc/source/filter/excel/impop.cxx                                |    3 
 sc/source/filter/excel/xichart.cxx                              |    3 
 sc/source/filter/lotus/op.cxx                                   |    2 
 sc/source/filter/xml/editattributemap.cxx                       |    8 
 sc/source/filter/xml/xmlimprt.cxx                               |    5 
 sc/source/ui/dbgui/pvfundlg.cxx                                 |    3 
 sc/source/ui/docshell/externalrefmgr.cxx                        |   23 +-
 sc/source/ui/docshell/macromgr.cxx                              |    4 
 sc/source/ui/view/gridwin.cxx                                   |    3 
 sc/source/ui/view/gridwin2.cxx                                  |    8 
 sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx               |   12 -
 sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx          |    7 
 sd/source/ui/tools/PropertySet.cxx                              |    5 
 sd/source/ui/view/ViewShellManager.cxx                          |    3 
 sdext/source/presenter/PresenterPaneBorderPainter.cxx           |    3 
 sfx2/source/appl/newhelp.cxx                                    |    6 
 sfx2/source/sidebar/ResourceManager.cxx                         |    8 
 slideshow/source/engine/slide/layermanager.cxx                  |    5 
 slideshow/source/engine/slide/shapemanagerimpl.cxx              |   10 -
 slideshow/source/engine/slide/targetpropertiescreator.cxx       |    5 
 slideshow/source/engine/slideshowimpl.cxx                       |    9 -
 slideshow/source/engine/usereventqueue.cxx                      |    8 
 stoc/source/inspect/introspection.cxx                           |    3 
 stoc/source/security/lru_cache.h                                |    2 
 svtools/source/brwbox/brwbox3.cxx                               |    2 
 svx/source/dialog/searchcharmap.cxx                             |    2 
 svx/source/form/fmundo.cxx                                      |    2 
 svx/source/form/formcontroller.cxx                              |    4 
 svx/source/gallery2/galbrws2.cxx                                |   15 -
 sw/source/core/access/accfrmobjmap.cxx                          |    6 
 sw/source/core/access/accfrmobjmap.hxx                          |    3 
 sw/source/core/access/acchypertextdata.hxx                      |    3 
 sw/source/core/access/accmap.cxx                                |   39 +---
 sw/source/core/access/accpara.cxx                               |    3 
 sw/source/core/txtnode/thints.cxx                               |    3 
 sw/source/uibase/utlui/content.cxx                              |    2 
 ucb/source/ucp/file/filtask.cxx                                 |    4 
 ucb/source/ucp/tdoc/tdoc_storage.cxx                            |    5 
 unoidl/source/sourceprovider-parser.y                           |   89 +++-------
 unoidl/source/sourcetreeprovider.cxx                            |    3 
 unotools/source/misc/fontcvt.cxx                                |    8 
 unoxml/source/dom/document.cxx                                  |   13 -
 xmloff/source/chart/SchXMLPropertyMappingContext.cxx            |    5 
 xmloff/source/chart/SchXMLSeries2Context.cxx                    |   24 +-
 xmloff/source/chart/SchXMLTools.cxx                             |    5 
 xmloff/source/core/nmspmap.cxx                                  |    4 
 xmloff/source/style/xmlexppr.cxx                                |    2 
 103 files changed, 285 insertions(+), 463 deletions(-)

New commits:
commit db17a874af37350b3270932175854ee674447bc1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Aug 11 11:36:47 2017 +0200

    convert std::map::insert to std::map::emplace II
    
    Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331
    Reviewed-on: https://gerrit.libreoffice.org/41019
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index f361a432ee64..a84fc811b30b 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -216,18 +216,15 @@ struct lcl_RolesWithRangeAppend : public
                     Reference< beans::XPropertySet > xProp( xSeq, uno::UNO_QUERY_THROW );
                     if( xProp->getPropertyValue( "Role" ) >>= aRole )
                     {
-                        m_rDestCnt->insert(
-                            tContainerType::value_type(
-                                aRole, xSeq->getSourceRangeRepresentation()));
+                        m_rDestCnt->emplace(aRole, xSeq->getSourceRangeRepresentation());
                         // label
                         if( aRole == m_aRoleForLabelSeq )
                         {
                             Reference< data::XDataSequence > xLabelSeq( xVal->getLabel());
                             if( xLabelSeq.is())
                             {
-                                m_rDestCnt->insert(
-                                    tContainerType::value_type(
-                                        lcl_aLabelRole, xLabelSeq->getSourceRangeRepresentation()));
+                                m_rDestCnt->emplace(
+                                        lcl_aLabelRole, xLabelSeq->getSourceRangeRepresentation());
                             }
                         }
                     }
@@ -471,7 +468,7 @@ void addMissingRoles(DialogModel::tRolesWithRanges& rResult, const uno::Sequence
     for(sal_Int32 i = 0, n = rRoles.getLength(); i < n; ++i)
     {
         if(rResult.find(rRoles[i]) == rResult.end())
-            rResult.insert(DialogModel::tRolesWithRanges::value_type(rRoles[i], OUString()));
+            rResult.emplace(rRoles[i], OUString());
     }
 }
 
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 2888ece39dba..e1a629f04e68 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -415,10 +415,9 @@ void InternalDataProvider::addDataSequenceToMap(
     const OUString & rRangeRepresentation,
     const Reference< chart2::data::XDataSequence > & xSequence )
 {
-    m_aSequenceMap.insert(
-        tSequenceMap::value_type(
+    m_aSequenceMap.emplace(
             rRangeRepresentation,
-            uno::WeakReference< chart2::data::XDataSequence >( xSequence )));
+            uno::WeakReference< chart2::data::XDataSequence >( xSequence ));
 }
 
 void InternalDataProvider::deleteMapReferences( const OUString & rRangeRepresentation )
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 160fbd7f194d..ba3ac187a80c 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1785,8 +1785,7 @@ private:
                 TotalStoreType::iterator itr = aStore.find(fX);
                 if (itr == aStore.end())
                     // New min-max pair for give X value.
-                    aStore.insert(
-                        TotalStoreType::value_type(fX, std::pair<double,double>(fYMin,fYMax)));
+                    aStore.emplace(fX, std::pair<double,double>(fYMin,fYMax));
                 else
                 {
                     MinMaxType& r = itr->second;
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index a8ac2ba4822c..28efa3fbf1f9 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2025,9 +2025,8 @@ void PlainStructType::dumpComprehensiveGetCppuType(FileStream & out)
     std::map< OUString, sal_uInt32 > types;
     std::vector< unoidl::PlainStructTypeEntity::Member >::size_type n = 0;
     for (const unoidl::PlainStructTypeEntity::Member& member : entity_->getDirectMembers()) {
-        if (types.insert(
-                std::map< OUString, sal_uInt32 >::value_type(
-                    member.type, static_cast< sal_uInt32 >(types.size()))).
+        if (types.emplace(
+                    member.type, static_cast< sal_uInt32 >(types.size())).
             second) {
             dumpCppuGetType(out, member.type, &name_);
             // For typedefs, use the resolved type name, as there will be no
@@ -2530,9 +2529,8 @@ void PolyStructType::dumpComprehensiveGetCppuType(FileStream & out)
     size_type n = 0;
     for (const unoidl::PolymorphicStructTypeTemplateEntity::Member& member : entity_->getMembers()) {
         if (member.parameterized) {
-            if (parameters.insert(
-                    std::map< OUString, sal_uInt32 >::value_type(
-                        member.type, static_cast< sal_uInt32 >(parameters.size()))).
+            if (parameters.emplace(
+                        member.type, static_cast< sal_uInt32 >(parameters.size())).
                 second) {
                 sal_uInt32 k = static_cast< sal_uInt32 >(parameters.size() - 1);
                 out << indent()
@@ -2546,9 +2544,7 @@ void PolyStructType::dumpComprehensiveGetCppuType(FileStream & out)
                     << "::rtl::OUString the_pname" << k << "(the_ptype" << k
                     << ".getTypeName());\n";
             }
-        } else if (types.insert(
-                       std::map< OUString, sal_uInt32 >::value_type(
-                           member.type, static_cast< sal_uInt32 >(types.size()))).
+        } else if (types.emplace(member.type, static_cast< sal_uInt32 >(types.size())).
                    second) {
             dumpCppuGetType(out, member.type, &name_);
             // For typedefs, use the resolved type name, as there will be no
diff --git a/codemaker/source/cppumaker/dependencies.cxx b/codemaker/source/cppumaker/dependencies.cxx
index 99da99fdf7a4..314e0213fec0 100644
--- a/codemaker/source/cppumaker/dependencies.cxx
+++ b/codemaker/source/cppumaker/dependencies.cxx
@@ -282,8 +282,7 @@ void Dependencies::insert(OUString const & name, Kind kind) {
     case UnoType::Sort::Typedef:
         {
             std::pair< Map::iterator, bool > i(
-                m_map.insert(
-                    Map::value_type(n, kind)));
+                m_map.emplace(n, kind));
             if (!i.second && kind == KIND_BASE) {
                 assert(i.first->second != KIND_EXCEPTION);
                 i.first->second = KIND_BASE;
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx
index 7ab37166ec61..2a57b1332395 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -111,8 +111,7 @@ void Includes::add(OString const & entityName) {
     case codemaker::UnoType::Sort::Exception:
     case codemaker::UnoType::Sort::Interface:
     case codemaker::UnoType::Sort::Typedef:
-        m_map.insert(
-            Dependencies::Map::value_type(n, Dependencies::KIND_NORMAL));
+        m_map.emplace(n, Dependencies::KIND_NORMAL);
         break;
     default:
         throw CannotDumpException(
diff --git a/codemaker/source/javamaker/classfile.cxx b/codemaker/source/javamaker/classfile.cxx
index 19de29c22d38..4431005b9e74 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -491,8 +491,7 @@ sal_uInt16 ClassFile::addIntegerInfo(sal_Int32 value) {
     sal_uInt16 index = nextConstantPoolIndex(1);
     appendU1(m_constantPool, 3);
     appendU4(m_constantPool, static_cast< sal_uInt32 >(value));
-    if (!m_integerInfos.insert(
-            std::map< sal_Int32, sal_uInt16 >::value_type(value, index)).second)
+    if (!m_integerInfos.emplace(value, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -509,8 +508,7 @@ sal_uInt16 ClassFile::addFloatInfo(float value) {
     union { float floatBytes; sal_uInt32 uint32Bytes; } bytes;
     bytes.floatBytes = value;
     appendU4(m_constantPool, bytes.uint32Bytes);
-    if (!m_floatInfos.insert(
-            std::map< float, sal_uInt16 >::value_type(value, index)).second)
+    if (!m_floatInfos.emplace(value, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -525,8 +523,7 @@ sal_uInt16 ClassFile::addLongInfo(sal_Int64 value) {
     sal_uInt16 index = nextConstantPoolIndex(2);
     appendU1(m_constantPool, 5);
     appendU8(m_constantPool, static_cast< sal_uInt64 >(value));
-    if (!m_longInfos.insert(
-            std::map< sal_Int64, sal_uInt16 >::value_type(value, index)).second)
+    if (!m_longInfos.emplace(value, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -543,8 +540,7 @@ sal_uInt16 ClassFile::addDoubleInfo(double value) {
     union { double doubleBytes; sal_uInt64 uint64Bytes; } bytes;
     bytes.doubleBytes = value;
     appendU8(m_constantPool, bytes.uint64Bytes);
-    if (!m_doubleInfos.insert(
-            std::map< double, sal_uInt16 >::value_type(value, index)).second)
+    if (!m_doubleInfos.emplace(value, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -685,9 +681,7 @@ sal_uInt16 ClassFile::addUtf8Info(OString const & value) {
     for (sal_Int32 j = 0; j < value.getLength(); ++j) {
         appendU1(m_constantPool, static_cast< sal_uInt8 >(value[j]));
     }
-    if (!m_utf8Infos.insert(
-            std::map< OString, sal_uInt16 >::value_type(value, index)).
-        second)
+    if (!m_utf8Infos.emplace(value, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -704,9 +698,7 @@ sal_uInt16 ClassFile::addClassInfo(OString const & type) {
     sal_uInt16 index = nextConstantPoolIndex(1);
     appendU1(m_constantPool, 7);
     appendU2(m_constantPool, nameIndex);
-    if (!m_classInfos.insert(
-            std::map< sal_uInt16, sal_uInt16 >::value_type(nameIndex, index)).
-        second)
+    if (!m_classInfos.emplace(nameIndex, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -723,9 +715,7 @@ sal_uInt16 ClassFile::addStringInfo(OString const & value) {
     sal_uInt16 index = nextConstantPoolIndex(1);
     appendU1(m_constantPool, 8);
     appendU2(m_constantPool, stringIndex);
-    if (!m_stringInfos.insert(
-            std::map< sal_uInt16, sal_uInt16 >::value_type(stringIndex, index)).
-        second)
+    if (!m_stringInfos.emplace(stringIndex, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -748,8 +738,7 @@ sal_uInt16 ClassFile::addFieldrefInfo(
     appendU1(m_constantPool, 9);
     appendU2(m_constantPool, classIndex);
     appendU2(m_constantPool, nameAndTypeIndex);
-    if (!m_fieldrefInfos.insert(
-            std::map< sal_uInt32, sal_uInt16 >::value_type(key, index)).second)
+    if (!m_fieldrefInfos.emplace(key, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -772,8 +761,7 @@ sal_uInt16 ClassFile::addMethodrefInfo(
     appendU1(m_constantPool, 10);
     appendU2(m_constantPool, classIndex);
     appendU2(m_constantPool, nameAndTypeIndex);
-    if (!m_methodrefInfos.insert(
-            std::map< sal_uInt32, sal_uInt16 >::value_type(key, index)).second)
+    if (!m_methodrefInfos.emplace(key, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -797,8 +785,7 @@ sal_uInt16 ClassFile::addInterfaceMethodrefInfo(
     appendU1(m_constantPool, 11);
     appendU2(m_constantPool, classIndex);
     appendU2(m_constantPool, nameAndTypeIndex);
-    if (!m_interfaceMethodrefInfos.insert(
-            std::map< sal_uInt32, sal_uInt16 >::value_type(key, index)).second)
+    if (!m_interfaceMethodrefInfos.emplace(key, index).second)
     {
         OSL_ASSERT(false);
     }
@@ -821,8 +808,7 @@ sal_uInt16 ClassFile::addNameAndTypeInfo(
     appendU1(m_constantPool, 12);
     appendU2(m_constantPool, nameIndex);
     appendU2(m_constantPool, descriptorIndex);
-    if (!m_nameAndTypeInfos.insert(
-            std::map< sal_uInt32, sal_uInt16 >::value_type(key, index)).second)
+    if (!m_nameAndTypeInfos.emplace(key, index).second)
     {
         OSL_ASSERT(false);
     }
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 1092557e888d..f2ce8454ef26 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -742,9 +742,7 @@ void handleEnumType(
     {
         min = std::min(min, member.value);
         max = std::max(max, member.value);
-        map.insert(
-            std::map< sal_Int32, OString >::value_type(
-                member.value, codemaker::convertString(member.name)));
+        map.emplace(member.value, codemaker::convertString(member.name));
     }
     sal_uInt64 size = static_cast< sal_uInt64 >(map.size());
     if ((static_cast< sal_uInt64 >(max) - static_cast< sal_uInt64 >(min)
@@ -1458,8 +1456,7 @@ void handlePolyStructType(
     for (const OUString& param : entity->getTypeParameters())
     {
         sig.append(codemaker::convertString(param) + ":Ljava/lang/Object;");
-        if (!typeParameters.insert(
-                std::map< OUString, sal_Int32 >::value_type(param, index++)).second)
+        if (!typeParameters.emplace(param, index++).second)
         {
             throw CannotDumpException("Bad type information"); //TODO
         }
diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx
index 77f712c8d080..b28b2a240e56 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -112,8 +112,7 @@ namespace comphelper
             // see if we do cache children
             if ( !m_bTransientChildren )
             {
-                if (!m_aChildrenMap.insert(
-                        AccessibleMap::value_type( _rxKey, xValue ) ).second)
+                if (!m_aChildrenMap.emplace( _rxKey, xValue ).second)
                 {
                     OSL_FAIL(
                         "OWrappedAccessibleChildrenManager::"
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 13a52885e6c2..0f062b30bdf7 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -154,10 +154,9 @@ void Access::markChildAsModified(rtl::Reference< ChildAccess > const & child) {
             break;
         }
         assert(dynamic_cast< ChildAccess * >(p.get()) != nullptr);
-        parent->modifiedChildren_.insert(
-            ModifiedChildren::value_type(
+        parent->modifiedChildren_.emplace(
                 p->getNameInternal(),
-                ModifiedChild(static_cast< ChildAccess * >(p.get()), false)));
+                ModifiedChild(static_cast< ChildAccess * >(p.get()), false));
         p = parent;
     }
 }
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 39783056aa2e..af4a2396e285 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -440,8 +440,7 @@ css::beans::Optional< css::uno::Any > Components::getExternalValue(
         if (service.is()) {
             propset.set( service, css::uno::UNO_QUERY_THROW);
         }
-        j = externalServices_.insert(
-            ExternalServices::value_type(name, propset)).first;
+        j = externalServices_.emplace(name, propset).first;
     }
     css::beans::Optional< css::uno::Any > value;
     if (j->second.is()) {
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 70ce467b8805..a24359fdb664 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -302,9 +302,8 @@ Additions * Data::addExtensionXcuAdditions(
 {
     rtl::Reference< ExtensionXcu > item(new ExtensionXcu);
     ExtensionXcuAdditions::iterator i(
-        extensionXcuAdditions_.insert(
-            ExtensionXcuAdditions::value_type(
-                url, rtl::Reference< ExtensionXcu >())).first);
+        extensionXcuAdditions_.emplace(
+                url, rtl::Reference< ExtensionXcu >()).first);
     if (i->second.is()) {
         throw css::uno::RuntimeException(
             "already added extension xcu " + url);
diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx
index 630de8fbc8a6..f385fc3215bc 100644
--- a/configmgr/source/modifications.cxx
+++ b/configmgr/source/modifications.cxx
@@ -40,8 +40,7 @@ void Modifications::add(std::vector<OUString> const & path) {
             if (wasPresent && p->children.empty()) {
                 return;
             }
-            j = p->children.insert(Node::Children::value_type(*i, Node())).
-                first;
+            j = p->children.emplace(*i, Node()).first;
             wasPresent = false;
         } else {
             wasPresent = true;
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index 8569f225b132..25492b36c43c 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -89,7 +89,7 @@ public:
     {
     }
     void clear() { m_pComponent = nullptr; }
-    void add(const OUString& _sRefName) { m_aRefNames.insert(std::map< OUString,bool>::value_type(_sRefName,true)); }
+    void add(const OUString& _sRefName) { m_aRefNames.emplace(_sRefName,true); }
 };
 }
 namespace connectivity
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index e5513f078055..716e5e6941f7 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -304,8 +304,8 @@ namespace dbtools
 
                     // remember meta information about this new parameter
                     std::pair< ParameterInformation::iterator, bool > aInsertionPos =
-                        m_aParameterInformation.insert(
-                            ParameterInformation::value_type( sNewParamName, ParameterMetaData( nullptr ) )
+                        m_aParameterInformation.emplace(
+                            sNewParamName, ParameterMetaData( nullptr )
                         );
                     OSL_ENSURE( aInsertionPos.second, "ParameterManager::classifyLinks: there already was a parameter with this name!" );
                     aInsertionPos.first->second.eType = ParameterClassification::LinkedByColumnName;
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index 7ff389c76bc0..4f53c25fc35c 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -307,7 +307,7 @@ namespace connectivity
                                 }
                                 pHelper.reset( new StreamHelper(storage->openStreamElement( sStrippedName, _nMode ) ) );
                             }
-                            aFind->second.streams.insert(TStreamMap::value_type(sName,pHelper));
+                            aFind->second.streams.emplace(sName,pHelper);
                         }
                         catch(const Exception& e)
                         {
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index a22074963513..30eccc2b0ca9 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -450,7 +450,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
                     {
                         if ( sPrivs[j] == sColumnName )
                         {
-                            aColumnMatching.insert( std::map<sal_Int32,sal_Int32>::value_type(i,j+1) );
+                            aColumnMatching.emplace(i,j+1);
                             break;
                         }
                     }
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index ec9463e243dc..eac88ca27899 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -515,7 +515,7 @@ SQLHANDLE OConnection::createStatementHandle()
     N3SQLAllocHandle(SQL_HANDLE_STMT,pConnectionTemp->getConnection(),&aStatementHandle);
     ++m_nStatementCount;
     if(bNew)
-        m_aConnections.insert(std::map< SQLHANDLE,OConnection*>::value_type(aStatementHandle,pConnectionTemp));
+        m_aConnections.emplace(aStatementHandle,pConnectionTemp);
 
     return aStatementHandle;
 
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 796f34a786c2..e52999a2a007 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -1287,7 +1287,10 @@ SWORD ODatabaseMetaDataResultSet::impl_getColumnType_nothrow(sal_Int32 columnInd
 {
     std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
     if ( aFind == m_aODBCColumnTypes.end() )
-        aFind = m_aODBCColumnTypes.insert(std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pConnection.get(),m_aStatementHandle,*this,columnIndex))).first;
+        aFind = m_aODBCColumnTypes.emplace(
+                        columnIndex,
+                        OResultSetMetaData::getColumnODBCType(m_pConnection.get(),m_aStatementHandle,*this,columnIndex)
+                    ).first;
     return aFind->second;
 }
 
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index 2a27652aa9a6..dec1e86ef635 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -1814,7 +1814,10 @@ SWORD OResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
 {
     std::map<sal_Int32,SWORD>::const_iterator aFind = m_aODBCColumnTypes.find(columnIndex);
     if ( aFind == m_aODBCColumnTypes.end() )
-        aFind = m_aODBCColumnTypes.insert(std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
+        aFind = m_aODBCColumnTypes.emplace(
+                           columnIndex,
+                           OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex)
+                        ).first;
     return aFind->second;
 }
 
diff --git a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
index 709bfdb98f7b..225f2b5eb62b 100644
--- a/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
+++ b/connectivity/source/drivers/odbc/OResultSetMetaData.cxx
@@ -150,7 +150,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column )
         }
         else
             nType = OTools::MapOdbcType2Jdbc(getNumColAttrib(column,SQL_DESC_CONCISE_TYPE ));
-        aFind = m_aColumnTypes.insert(std::map<sal_Int32,sal_Int32>::value_type(column,nType)).first;
+        aFind = m_aColumnTypes.emplace(column,nType).first;
     }
 
 
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index aefadc80fdeb..94bb57271f87 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -951,8 +951,7 @@ inline void EnvironmentsData::registerEnvironment( uno_Environment ** ppEnv )
     {
         (*pEnv->acquireWeak)( pEnv );
         std::pair< OUString2EnvironmentMap::iterator, bool > insertion (
-            aName2EnvMap.insert(
-                OUString2EnvironmentMap::value_type( aKey, pEnv ) ) );
+            aName2EnvMap.emplace( aKey, pEnv ) );
         SAL_WARN_IF( !insertion.second, "cppu", "key " << aKey << " already in env map" );
     }
     else
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index 952ee693659c..8555feaef4c9 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -185,8 +185,8 @@ void ComponentContext::insertByName(
             name.startsWith( "/singletons/" ) &&
             !element.hasValue() ) );
     MutexGuard guard( m_mutex );
-    std::pair<t_map::iterator, bool> insertion( m_map.insert(
-        t_map::value_type( name, entry ) ) );
+    std::pair<t_map::iterator, bool> insertion( m_map.emplace(
+        name, entry ) );
     if (! insertion.second)
         throw container::ElementExistException(
             "element already exists: " + name,
diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx
index 111da6478601..32ede83068c0 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -242,8 +242,7 @@ void Data::initProperties(
                         "interface type has too many attributes");
                 }
                 rtl::OUString name(members[i]->getMemberName());
-                if (!properties.insert(
-                        PropertyMap::value_type(
+                if (!properties.emplace(
                             name,
                             PropertyData(
                                 css::beans::Property(
@@ -252,7 +251,7 @@ void Data::initProperties(
                                         t->getTypeClass(), t->getName()),
                                     attrAttribs),
                                 (std::find(absentBegin, absentEnd, name)
-                                 == absentEnd)))).
+                                 == absentEnd))).
                     second)
                 {
                     throw css::uno::RuntimeException(
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 5faee9a129b0..c77526de6441 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -384,9 +384,7 @@ void Parser::handleImplementation() {
         new cppuhelper::ServiceManager::Data::Implementation(
             attrName, attrLoader_, attrUri_, attrEnvironment_, attrConstructor,
             attrPrefix_, alienContext_, reader_.getUrl()));
-    if (!data_->namedImplementations.insert(
-            cppuhelper::ServiceManager::Data::NamedImplementations::value_type(
-                attrName, implementation_)).
+    if (!data_->namedImplementations.emplace(attrName, implementation_).
         second)
     {
         throw css::registry::InvalidRegistryException(
@@ -1445,9 +1443,7 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) {
                 name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"),
                 readLegacyRdbString(uri, implKey, "UNO/LOCATION"), "", "", "",
                 css::uno::Reference< css::uno::XComponentContext >(), uri));
-        if (!data_.namedImplementations.insert(
-                Data::NamedImplementations::value_type(name, impl)).
-            second)
+        if (!data_.namedImplementations.emplace(name, impl).second)
         {
             throw css::registry::InvalidRegistryException(
                 uri + ": duplicate <implementation name=\"" + name + "\">");
@@ -1580,11 +1576,9 @@ void cppuhelper::ServiceManager::insertLegacyFactory(
         new Data::Implementation(name, f1, f2, comp));
     Data extra;
     if (!name.isEmpty()) {
-        extra.namedImplementations.insert(
-            Data::NamedImplementations::value_type(name, impl));
+        extra.namedImplementations.emplace(name, impl);
     }
-    extra.dynamicImplementations.insert(
-        Data::DynamicImplementations::value_type(factoryInfo, impl));
+    extra.dynamicImplementations.emplace(factoryInfo, impl);
     css::uno::Sequence< rtl::OUString > services(
         factoryInfo->getSupportedServiceNames());
     for (sal_Int32 i = 0; i != services.getLength(); ++i) {
diff --git a/cppuhelper/source/unourl.cxx b/cppuhelper/source/unourl.cxx
index ce1249d4818a..cfd62ef23e6f 100644
--- a/cppuhelper/source/unourl.cxx
+++ b/cppuhelper/source/unourl.cxx
@@ -118,13 +118,12 @@ inline UnoUrlDescriptor::Impl::Impl(rtl::OUString const & rDescriptor)
         case STATE_VALUE:
             if (bEnd || c == 0x2C) // ','
             {
-                if (!m_aParameters.insert(
-                        Parameters::value_type(
+                if (!m_aParameters.emplace(
                             aKey,
                             rtl::Uri::decode(rDescriptor.copy(nStart,
                                                               i - nStart),
                                              rtl_UriDecodeWithCharset,
-                                             RTL_TEXTENCODING_UTF8))).second)
+                                             RTL_TEXTENCODING_UTF8)).second)
                     throw rtl::MalformedUriException(
                         "UNO URL contains duplicated parameter");
                 eState = STATE_KEY0;
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index f0dd27ebd7c5..f5e74a4c1b7f 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -646,11 +646,10 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s
                 Sequence<Any> aArgs(1);
                 Reference<XConnection> xMy(this);
                 aArgs[0] <<= NamedValue("ActiveConnection",makeAny(xMy));
-                aFind = m_aSupportServices.insert(
-                           TSupportServices::value_type(
+                aFind = m_aSupportServices.emplace(
                                _sServiceSpecifier,
                                m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceSpecifier, aArgs, m_aContext)
-                           )).first;
+                           ).first;
             }
             return aFind->second;
         }
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index c70e8d193714..131c183b6d06 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -104,8 +104,7 @@ ODefinitionContainer::ODefinitionContainer(   const Reference< XComponentContext
             ++aDefinition
         )
         m_aDocuments.push_back(
-            m_aDocumentMap.insert(
-                Documents::value_type( aDefinition->first, Documents::mapped_type() ) ).first );
+            m_aDocumentMap.emplace(aDefinition->first, Documents::mapped_type() ).first );
 
 }
 
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index d3a823b93a80..780db27d2a96 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -740,7 +740,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
 
         const sal_Int32 columnIndex = col - aColumns.begin();
         const OUString sRangeName = OUString::number( columnIndex );
-        m_aNumberFormats.insert( std::map< OUString, uno::Any >::value_type( sRangeName, aNumberFormat ) );
+        m_aNumberFormats.emplace( sRangeName, aNumberFormat );
     }
 
     std::vector< OUString > aRowLabels;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 7152811bb81f..5ca003866e32 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1008,7 +1008,7 @@ void OCopyTableWizard::insertColumn(sal_Int32 _nPos,OFieldDescription* _pField)
         }
 
         m_aDestVec.insert(m_aDestVec.begin() + _nPos,
-            m_vDestColumns.insert(ODatabaseExport::TColumns::value_type(_pField->GetName(),_pField)).first);
+            m_vDestColumns.emplace(_pField->GetName(),_pField).first);
         m_mNameMapping[_pField->GetName()] = _pField->GetName();
     }
 }
@@ -1021,8 +1021,7 @@ void OCopyTableWizard::replaceColumn(sal_Int32 _nPos,OFieldDescription* _pField,
         m_vDestColumns.erase(_sOldName);
         OSL_ENSURE( m_vDestColumns.find(_pField->GetName()) == m_vDestColumns.end(),"Column with that name already exist!");
 
-        m_aDestVec[_nPos] =
-            m_vDestColumns.insert(ODatabaseExport::TColumns::value_type(_pField->GetName(),_pField)).first;
+        m_aDestVec[_nPos] = m_vDestColumns.emplace(_pField->GetName(),_pField).first;
     }
 }
 
@@ -1066,7 +1065,7 @@ void OCopyTableWizard::loadData(  const ICopyTableSourceObject& _rSourceObject,
             pTypeInfo = m_pTypeInfo;
 
         pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false);
-        _rColVector.push_back(_rColumns.insert(ODatabaseExport::TColumns::value_type(pActFieldDescr->GetName(),pActFieldDescr)).first);
+        _rColVector.push_back(_rColumns.emplace(pActFieldDescr->GetName(),pActFieldDescr).first);
     }
 
     // determine which columns belong to the primary key
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index e67123ae18aa..63be1bcc2569 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1022,7 +1022,7 @@ namespace
             std::map<OTableWindow*,sal_Int32>::const_iterator aCountEnd = aConnectionCount.end();
             for(;aCountIter != aCountEnd;++aCountIter)
             {
-                aMulti.insert(std::multimap<sal_Int32 , OTableWindow*>::value_type(aCountIter->second,aCountIter->first));
+                aMulti.emplace(aCountIter->second,aCountIter->first);
             }
 
             const bool bUseEscape = ::dbtools::getBooleanDataSourceSetting( _xConnection, PROPERTY_OUTERJOINESCAPE );
@@ -1161,7 +1161,7 @@ namespace
                     }
                     if ( aGroupByNames.find(sGroupByPart) == aGroupByNames.end() )
                     {
-                        aGroupByNames.insert(std::map< OUString,bool>::value_type(sGroupByPart,true));
+                        aGroupByNames.emplace(sGroupByPart,true);
                         aGroupByStr += sGroupByPart + ",";
                     }
                 }
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index a3e0b4062534..9bde54bcad39 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -359,9 +359,8 @@ UpdateInfoMap getOnlineUpdateInfos(
             Reference<deployment::XPackage> extension = getExtensionWithHighestVersion(seqExt);
             OSL_ASSERT(extension.is());
 
-            std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert(
-                UpdateInfoMap::value_type(
-                    dp_misc::getIdentifier(extension), UpdateInfo(extension)));
+            std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.emplace(
+                    dp_misc::getIdentifier(extension), UpdateInfo(extension));
             OSL_ASSERT(insertRet.second);
         }
     }
@@ -371,9 +370,8 @@ UpdateInfoMap getOnlineUpdateInfos(
         for (CIT i = extensionList->begin(); i != extensionList->end(); ++i)
         {
             OSL_ASSERT(i->is());
-            std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert(
-                UpdateInfoMap::value_type(
-                    dp_misc::getIdentifier(*i), UpdateInfo(*i)));
+            std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.emplace(
+                    dp_misc::getIdentifier(*i), UpdateInfo(*i));
             OSL_ASSERT(insertRet.second);
         }
     }
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index c0a629f585cc..08859be1a91b 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -202,9 +202,7 @@ void PackageRegistryImpl::insertBackend(
             // add parameterless media-type, too:
             sal_Int32 semi = mediaType.indexOf( ';' );
             if (semi >= 0) {
-                m_mediaType2backend.insert(
-                    t_string2registry::value_type(
-                        mediaType.copy( 0, semi ), xBackend ) );
+                m_mediaType2backend.emplace( mediaType.copy( 0, semi ), xBackend );
             }
             const OUString fileFilter( xPackageType->getFileFilter() );
             //The package backend shall also be called to determine the mediatype
@@ -228,9 +226,8 @@ void PackageRegistryImpl::insertBackend(
                                   token.indexOf('?') >= 0);
                     if (! ambig) {
                         std::pair<t_string2string::iterator, bool> ins(
-                            m_filter2mediaType.insert(
-                                t_string2string::value_type(
-                                    token, mediaType ) ) );
+                            m_filter2mediaType.emplace(
+                                    token, mediaType ) );
                         ambig = !ins.second;
                         if (ambig) {
                             // filter has already been in: add previously
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx
index d24f66e28c1b..0ef10fb913b0 100644
--- a/extensions/source/config/ldap/ldapaccess.cxx
+++ b/extensions/source/config/ldap/ldapaccess.cxx
@@ -203,8 +203,7 @@ void LdapConnection::initConnection()
         if (values) {
             const OUString aAttr( reinterpret_cast<sal_Unicode*>( attr ) );
             const OUString aValues( reinterpret_cast<sal_Unicode*>( *values ) );
-            data->insert(
-                LdapData::value_type( aAttr, aValues ));
+            data->emplace( aAttr, aValues );
             ldap_value_freeW(values);
         }
         attr = ldap_next_attributeW(mConnection, result.msg, ptr);
@@ -213,10 +212,9 @@ void LdapConnection::initConnection()
     while (attr) {
         char ** values = ldap_get_values(mConnection, result.msg, attr);
         if (values) {
-            data->insert(
-                LdapData::value_type(
+            data->emplace(
                     OStringToOUString(attr, RTL_TEXTENCODING_ASCII_US),
-                    OStringToOUString(*values, RTL_TEXTENCODING_UTF8)));
+                    OStringToOUString(*values, RTL_TEXTENCODING_UTF8));
             ldap_value_free(values);
         }
         attr = ldap_next_attribute(mConnection, result.msg, ptr);
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index d7e4881d6b08..af24701eac77 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -590,7 +590,7 @@ namespace dbp
                     {
                         OSL_FAIL("OControlWizard::initContext: unexpected exception while gathering column information!");
                     }
-                    m_aContext.aTypes.insert(OControlWizardContext::TNameTypeMap::value_type(*pBegin,nFieldType));
+                    m_aContext.aTypes.emplace(*pBegin,nFieldType);
                 }
             }
         }
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 814184cbb628..90d48a97492a 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -826,7 +826,7 @@ void FormulaDlg_Impl::UpdateTokenArray( const OUString& rStrExp)
     {
         for (sal_Int32 nPos = 0; nPos < nLen; nPos++)
         {
-            m_aTokenMap.insert( ::std::map<FormulaToken*, sheet::FormulaToken>::value_type( pTokens[nPos], m_aTokenList[nPos]));
+            m_aTokenMap.emplace( pTokens[nPos], m_aTokenList[nPos] );
         }
     } // if ( pTokens && nLen == m_aTokenList.getLength() )
 
diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx
index 1171aebc87d7..ac579eeee802 100644
--- a/framework/source/services/ContextChangeEventMultiplexer.cxx
+++ b/framework/source/services/ContextChangeEventMultiplexer.cxx
@@ -284,10 +284,9 @@ ContextChangeEventMultiplexer::FocusDescriptor* ContextChangeEventMultiplexer::G
             xComponent->addEventListener(this);
 
         // Create a new listener container for the event focus.
-        iDescriptor = maListeners.insert(
-            ListenerMap::value_type(
+        iDescriptor = maListeners.emplace(
                 rxEventFocus,
-                FocusDescriptor())).first;
+                FocusDescriptor()).first;
     }
     if (iDescriptor != maListeners.end())
         return &iDescriptor->second;
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 856c3916f5d9..c5cf1738fdb2 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -798,9 +798,8 @@ void ToolBarManager::CreateControllers()
                 {
                     SubToolBarControllerVector aSubToolBarVector;
                     aSubToolBarVector.push_back( xSubToolBar );
-                    m_aSubToolBarControllerMap.insert(
-                        SubToolBarToSubToolBarControllerMap::value_type(
-                            aSubToolBarName, aSubToolBarVector ));
+                    m_aSubToolBarControllerMap.emplace(
+                            aSubToolBarName, aSubToolBarVector );
                 }
                 else
                     pIter->second.push_back( xSubToolBar );
diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx
index 90e5c060ece4..8fc4ed0f992c 100644
--- a/idlc/source/astinterface.cxx
+++ b/idlc/source/astinterface.cxx
@@ -80,9 +80,7 @@ AstInterface::DoubleMemberDeclarations AstInterface::checkMemberClashes(
 
 void AstInterface::addMember(AstDeclaration /*TODO: const*/ * member) {
     addDeclaration(member);
-    m_visibleMembers.insert(
-        VisibleMembers::value_type(
-            member->getLocalName(), VisibleMember(member)));
+    m_visibleMembers.emplace(member->getLocalName(), VisibleMember(member));
 }
 
 void AstInterface::forwardDefined(AstInterface const & def)
@@ -347,8 +345,7 @@ void AstInterface::addVisibleInterface(
         ? direct ? INTERFACE_DIRECT_OPTIONAL : INTERFACE_INDIRECT_OPTIONAL
         : direct ? INTERFACE_DIRECT_MANDATORY : INTERFACE_INDIRECT_MANDATORY;
     std::pair< VisibleInterfaces::iterator, bool > result(
-        m_visibleInterfaces.insert(
-            VisibleInterfaces::value_type(ifc->getScopedName(), kind)));
+        m_visibleInterfaces.emplace(ifc->getScopedName(), kind));
     bool seen = !result.second
         && result.first->second >= INTERFACE_INDIRECT_MANDATORY;
     if (!result.second && kind > result.first->second) {
@@ -358,9 +355,8 @@ void AstInterface::addVisibleInterface(
         for (DeclList::const_iterator i(ifc->getIteratorBegin());
               i != ifc->getIteratorEnd(); ++i)
         {
-            m_visibleMembers.insert(
-                VisibleMembers::value_type(
-                    (*i)->getLocalName(), VisibleMember(*i)));
+            m_visibleMembers.emplace(
+                    (*i)->getLocalName(), VisibleMember(*i));
         }
         for (InheritedInterfaces::const_iterator i(
                   ifc->m_inheritedInterfaces.begin());
@@ -378,13 +374,11 @@ void AstInterface::addOptionalVisibleMembers(AstInterface const * ifc) {
         VisibleMembers::iterator visible(
             m_visibleMembers.find((*i)->getLocalName()));
         if (visible == m_visibleMembers.end()) {
-            visible = m_visibleMembers.insert(
-                VisibleMembers::value_type(
-                    (*i)->getLocalName(), VisibleMember())).first;
+            visible = m_visibleMembers.emplace(
+                    (*i)->getLocalName(), VisibleMember()).first;
         }
         if (visible->second.mandatory == nullptr) {
-            visible->second.optionals.insert(
-                VisibleMember::Optionals::value_type(ifc->getScopedName(), *i));
+            visible->second.optionals.emplace(ifc->getScopedName(), *i);
         }
     }
     for (InheritedInterfaces::const_iterator i(
diff --git a/include/oox/core/relations.hxx b/include/oox/core/relations.hxx
index d3303bd4e063..d556d9c8cf93 100644
--- a/include/oox/core/relations.hxx
+++ b/include/oox/core/relations.hxx
@@ -78,9 +78,10 @@ public:
     {
         return maMap.end();
     }
-    void insert( const ::std::map< OUString, Relation >::value_type& rVal )
+    template<class... Args>
+    void emplace(Args&&... args)
     {
-        maMap.insert( rVal );
+        maMap.emplace(std::forward<Args>(args)...);
     }
 
     /** Returns the path of the fragment this relations collection is related to. */
diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx
index e5228313a690..74a2ab9146c4 100644
--- a/oox/source/core/relationshandler.cxx
+++ b/oox/source/core/relationshandler.cxx
@@ -78,7 +78,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
 
                 SAL_WARN_IF( mxRelations->count( aRelation.maId ) != 0, "oox",
                     "RelationsFragment::createFastChildContext - relation identifier exists already" );
-                mxRelations->insert( ::std::map< OUString, Relation >::value_type( aRelation.maId, aRelation ) );
+                mxRelations->emplace( aRelation.maId, aRelation );
             }
         }
         break;
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 5b11d671cbac..f7345aa0118f 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -566,11 +566,9 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
     ::std::sort(aRowPos.begin(),aRowPos.end(),::std::less<sal_Int32>());
     aRowPos.erase(::std::unique(aRowPos.begin(),aRowPos.end()),aRowPos.end());
 
-    TSectionsGrid::iterator aInsert = m_aSectionsGrid.insert(
-        TSectionsGrid::value_type(
+    TSectionsGrid::iterator aInsert = m_aSectionsGrid.emplace(
                                     _xProp.get(),
                                     TGrid(aRowPos.size() - 1,TGrid::value_type(false,TRow(aColumnPos.size() - 1)))
-                                  )
         ).first;
     lcl_calculate(aColumnPos,aRowPos,aInsert->second);
 
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index a3bbb277a448..bff86919e5bb 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -677,8 +677,7 @@ rtlBootstrapHandle SAL_CALL rtl_bootstrap_args_open(rtl_uString * pIniName)
         {
             ++that->_nRefCount;
             ::std::pair< bootstrap_map::t::iterator, bool > insertion(
-                p_bootstrap_map->insert(
-                    bootstrap_map::t::value_type(iniName, that)));
+                p_bootstrap_map->emplace(iniName, that));
             OSL_ASSERT(insertion.second);
         }
         else
diff --git a/sc/inc/reordermap.hxx b/sc/inc/reordermap.hxx
index b7bb5d5ae1c9..3f3622085e85 100644
--- a/sc/inc/reordermap.hxx
+++ b/sc/inc/reordermap.hxx
@@ -24,12 +24,12 @@ public:
     typedef DataType::const_iterator const_iterator;
     typedef DataType::iterator iterator;
 
-    const_iterator end() const;
+    const_iterator end() const { return maData.end(); }
 
-    std::pair<iterator, bool>
-        insert( DataType::value_type const& val );
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maData.emplace(std::forward<Args>(args)...); }
 
-    const_iterator find( DataType::key_type key ) const;
+    const_iterator find( DataType::key_type key ) const { return maData.find(key); }
 };
 
 }
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 01166bf43638..4c048076de40 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -189,8 +189,7 @@ void Test::testFormulaCreateStringFromTokens()
     aCxt.maExternalFileNames.push_back("file:///path/to/fake.file");
     std::vector<OUString> aExtTabNames;
     aExtTabNames.push_back("Sheet");
-    aCxt.maExternalCachedTabNames.insert(
-        sc::TokenStringContext::IndexNamesMapType::value_type(0, aExtTabNames));
+    aCxt.maExternalCachedTabNames.emplace(0, aExtTabNames);
 
     ScAddress aPos(0,0,0);
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 4b67c4a2f3b1..86a57b3ec1b8 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -866,8 +866,7 @@ void ScConditionEntry::FillCache() const
                     if (!lcl_GetCellContent(aCell, false, nVal, aStr, mpDoc))
                     {
                         std::pair<ScConditionEntryCache::StringCacheType::iterator, bool> aResult =
-                            mpCache->maStrings.insert(
-                                ScConditionEntryCache::StringCacheType::value_type(aStr, 1));
+                            mpCache->maStrings.emplace(aStr, 1);
 
                         if(!aResult.second)
                             aResult.first->second++;
@@ -875,8 +874,7 @@ void ScConditionEntry::FillCache() const
                     else
                     {
                         std::pair<ScConditionEntryCache::ValueCacheType::iterator, bool> aResult =
-                            mpCache->maValues.insert(
-                                ScConditionEntryCache::ValueCacheType::value_type(nVal, 1));
+                            mpCache->maValues.emplace(nVal, 1);
 
                         if(!aResult.second)
                             aResult.first->second++;
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index a2d06821e8ca..92370a719325 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -118,7 +118,7 @@ void ScDocument::GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rNames) const
             // ignore empty ones.
             continue;
 
-        aNames.insert(ScRangeName::TabNameCopyMap::value_type(i, p));
+        aNames.emplace(i, p);
     }
     rNames.swap(aNames);
 }
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 3e36951f3258..92443f7bef6a 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -657,8 +657,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio
         ScDPGroupDimensionVec::const_iterator itr = aGroups.begin(), itrEnd = aGroups.end();
         for (; itr != itrEnd; ++itr)
         {
-            aGroupFieldIds.insert(
-                GroupFieldMapType::value_type(itr->GetGroupDim(), &(*itr)));
+            aGroupFieldIds.emplace(itr->GetGroupDim(), &(*itr));
         }
     }
 
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index e70a695e7bd2..5ca9e8d4670f 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -856,8 +856,7 @@ public:
     void operator() (const ScDPSaveDimension* pDim)
     {
         size_t nRank = mrNames.size();
-        mrNames.insert(
-            ScDPSaveData::DimOrderType::value_type(pDim->GetName(), nRank));
+        mrNames.emplace(pDim->GetName(), nRank);
     }
 };
 
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 89996fa66984..cd7b483702a6 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -3897,8 +3897,8 @@ void ScDPResultVisibilityData::addVisibleMember(const OUString& rDimName, const
     DimMemberType::iterator itr = maDimensions.find(rDimName);
     if (itr == maDimensions.end())
     {
-        pair<DimMemberType::iterator, bool> r = maDimensions.insert(
-            DimMemberType::value_type(rDimName, VisibleMemberType()));
+        pair<DimMemberType::iterator, bool> r = maDimensions.emplace(
+            rDimName, VisibleMemberType());
 
         if (!r.second)
             // insertion failed.
@@ -3920,8 +3920,7 @@ void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criter
     long nColumnCount = pData->GetColumnCount();
     for (long i = 0; i < nColumnCount; ++i)
     {
-        aFieldNames.insert(
-            FieldNameMapType::value_type(pData->getDimensionName(i), i));
+        aFieldNames.emplace(pData->getDimensionName(i), i);
     }
 
     const ScDPDimensions* pDims = mpSource->GetDimensionsObject();
diff --git a/sc/source/core/data/mtvelements.cxx b/sc/source/core/data/mtvelements.cxx
index c8234922ed9e..25a39003cfbe 100644
--- a/sc/source/core/data/mtvelements.cxx
+++ b/sc/source/core/data/mtvelements.cxx
@@ -80,8 +80,7 @@ ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL
         return &it->second;
 
     std::pair<ColumnsType::iterator,bool> r =
-        rCols.insert(
-            ColumnsType::value_type(nCol, ColumnBlockPosition()));
+        rCols.emplace(nCol, ColumnBlockPosition());
 
     if (!r.second)
         // insertion failed.
@@ -140,8 +139,7 @@ ColumnBlockPosition* TableColumnBlockPositionSet::getBlockPosition( SCCOL nCol )
         return &it->second;
 
     std::pair<ColumnsType::iterator,bool> r =
-        mpImpl->maColumns.insert(
-            ColumnsType::value_type(nCol, ColumnBlockPosition()));
+        mpImpl->maColumns.emplace(nCol, ColumnBlockPosition());
 
     if (!r.second)
         // insertion failed.
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index cc1857cf9d33..04885f9d65db 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -974,7 +974,7 @@ void ScTable::SortReorderByColumn(
         {
             SCCOL nNew = i + nStart;
             SCCOL nOld = rOldIndices[i];
-            aColMap.insert(sc::ColRowReorderMapType::value_type(nOld, nNew));
+            aColMap.emplace(nOld, nNew);
         }
 
         // Collect all listeners within sorted range ahead of time.
@@ -1375,7 +1375,7 @@ void ScTable::SortReorderByRowRefUpdate(
     {
         SCROW nNew = i + nRow1;
         SCROW nOld = rOldIndices[i];
-        aRowMap.insert(sc::ColRowReorderMapType::value_type(nOld, nNew));
+        aRowMap.emplace(nOld, nNew);
     }
 
     // Collect all listeners within sorted range ahead of time.
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index f565d34a4264..ab75dd31687c 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -553,18 +553,15 @@ void ScUnoAddInCollection::ReadConfiguration()
 
                 ppFuncData[nFuncPos+nOld] = pData;
 
-                pExactHashMap->insert(
-                        ScAddInHashMap::value_type(
+                pExactHashMap->emplace(
                             pData->GetOriginalName(),
-                            pData ) );
-                pNameHashMap->insert(
-                        ScAddInHashMap::value_type(
+                            pData );
+                pNameHashMap->emplace(
                             pData->GetUpperName(),
-                            pData ) );
-                pLocalHashMap->insert(
-                        ScAddInHashMap::value_type(
+                            pData );
+                pLocalHashMap->emplace(
                             pData->GetUpperLocal(),
-                            pData ) );
+                            pData );
             }
         }
     }
@@ -942,18 +939,15 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
 
                                 const ScUnoAddInFuncData* pData =
                                     ppFuncData[nFuncPos+nOld];
-                                pExactHashMap->insert(
-                                        ScAddInHashMap::value_type(
+                                pExactHashMap->emplace(
                                             pData->GetOriginalName(),
-                                            pData ) );
-                                pNameHashMap->insert(
-                                        ScAddInHashMap::value_type(
+                                            pData );
+                                pNameHashMap->emplace(
                                             pData->GetUpperName(),
-                                            pData ) );
-                                pLocalHashMap->insert(
-                                        ScAddInHashMap::value_type(
+                                            pData );
+                                pLocalHashMap->emplace(
                                             pData->GetUpperLocal(),
-                                            pData ) );
+                                            pData );
                             }
                         }
                     }
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 859dd8dffae3..590215a2ad42 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -86,8 +86,7 @@ FormulaGroupContext::ColArray* FormulaGroupContext::setCachedColArray(
     if (it == maColArrays.end())
     {
         std::pair<ColArraysType::iterator,bool> r =
-            maColArrays.insert(
-                ColArraysType::value_type(ColKey(nTab, nCol), ColArray(pNumArray, pStrArray)));
+            maColArrays.emplace(ColKey(nTab, nCol), ColArray(pNumArray, pStrArray));
 
         if (!r.second)
             // Somehow the insertion failed.
diff --git a/sc/source/core/tool/reordermap.cxx b/sc/source/core/tool/reordermap.cxx
index b9754dfa30c1..b4da9aa021ee 100644
--- a/sc/source/core/tool/reordermap.cxx
+++ b/sc/source/core/tool/reordermap.cxx
@@ -9,25 +9,4 @@
 
 #include <reordermap.hxx>
 
-namespace sc {
-
-ColRowReorderMapType::const_iterator ColRowReorderMapType::end() const
-{
-    return maData.end();
-}
-
-std::pair<ColRowReorderMapType::iterator, bool>
-ColRowReorderMapType::insert( ColRowReorderMapType::value_type const& val )
-{
-    return maData.insert(val);
-}
-
-ColRowReorderMapType::const_iterator
-ColRowReorderMapType::find( DataType::key_type key ) const
-{
-    return maData.find(key);
-}
-
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/tokenstringcontext.cxx b/sc/source/core/tool/tokenstringcontext.cxx
index 7837fee5a670..f93717a3c6b1 100644
--- a/sc/source/core/tool/tokenstringcontext.cxx
+++ b/sc/source/core/tool/tokenstringcontext.cxx
@@ -25,8 +25,7 @@ void insertAllNames( TokenStringContext::IndexNameMapType& rMap, const ScRangeNa
     for (auto const& it : rNames)
     {
         const ScRangeData *const pData = it.second.get();
-        rMap.insert(
-            TokenStringContext::IndexNameMapType::value_type(pData->GetIndex(), pData->GetName()));
+        rMap.emplace(pData->GetIndex(), pData->GetName());
     }
 }
 
@@ -104,8 +103,7 @@ TokenStringContext::TokenStringContext( const ScDocument* pDoc, formula::Formula
             std::vector<OUString> aTabNames;
             pRefMgr->getAllCachedTableNames(nFileId, aTabNames);
             if (!aTabNames.empty())
-                maExternalCachedTabNames.insert(
-                    IndexNamesMapType::value_type(nFileId, aTabNames));
+                maExternalCachedTabNames.emplace(nFileId, aTabNames);
         }
     }
 }
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 154efd5e1102..7aaa59233038 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -166,8 +166,7 @@ void ImportExcel::SetLastFormula( SCCOL nCol, SCROW nRow, double fVal, sal_uInt1
     if (it == maLastFormulaCells.end())
     {
         std::pair<LastFormulaMapType::iterator, bool> r =
-            maLastFormulaCells.insert(
-                LastFormulaMapType::value_type(nCol, LastFormula()));
+            maLastFormulaCells.emplace(nCol, LastFormula());
         it = r.first;
     }
 
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 6e51af689c1a..941550bfb097 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -3529,8 +3529,7 @@ void XclImpChAxesSet::Finalize()
             XclImpChTypeGroupRef xTypeGroup = aIt->second;
             xTypeGroup->Finalize();
             if( xTypeGroup->IsValidGroup() )
-                aValidGroups.insert(
-                    XclImpChTypeGroupMap::value_type(aIt->first, xTypeGroup));
+                aValidGroups.emplace(aIt->first, xTypeGroup);
         }
         maTypeGroups.swap( aValidGroups );
     }
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 8b8aa079471d..4ef6a37fcd78 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -552,7 +552,7 @@ void OP_CreatePattern123(LotusContext& rContext, SvStream& r, sal_uInt16 n)
         r.ReadUChar( Ver_Align );
         OP_VerAlign123(rContext, Ver_Align, rItemSet );
 
-        rContext.aLotusPatternPool.insert( std::map<sal_uInt16, ScPatternAttr>::value_type( nPatternId, aPattern ) );
+        rContext.aLotusPatternPool.emplace( nPatternId, aPattern );
         n -= (n > 20) ? 20 : n;
     }
     r.SeekRel(n);
diff --git a/sc/source/filter/xml/editattributemap.cxx b/sc/source/filter/xml/editattributemap.cxx
index fa3e19eea4b3..6e6c3331d453 100644
--- a/sc/source/filter/xml/editattributemap.cxx
+++ b/sc/source/filter/xml/editattributemap.cxx
@@ -69,12 +69,10 @@ ScXMLEditAttributeMap::ScXMLEditAttributeMap()
 {
     for (size_t i = 0; i < SAL_N_ELEMENTS(aEntries); ++i)
     {
-        maAPIEntries.insert(
-            StrToEntriesType::value_type(
-                OUString::createFromAscii(aEntries[i].mpAPIName), &aEntries[i]));
+        maAPIEntries.emplace(
+                OUString::createFromAscii(aEntries[i].mpAPIName), &aEntries[i]);
 
-        maItemIDEntries.insert(
-            IndexToEntriesType::value_type(aEntries[i].mnItemID, &aEntries[i]));
+        maItemIDEntries.emplace(aEntries[i].mnItemID, &aEntries[i]);
     }
 }
 
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index e2950bab64a1..339b433dc919 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -823,9 +823,8 @@ ScXMLImport::ScXMLImport(
     };
     for (const auto & aCellTypePair : aCellTypePairs)
     {
-        aCellTypeMap.insert(
-            CellTypeMap::value_type(
-                GetXMLToken(aCellTypePair._token), aCellTypePair._type));
+        aCellTypeMap.emplace(
+                GetXMLToken(aCellTypePair._token), aCellTypePair._type);
     }
 }
 
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index ecd99a44dd6a..ad86c0eaef7c 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -278,8 +278,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
     for( ScDPLabelDataVector::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
     {
         mpLbBaseField->InsertEntry((*aIt)->getDisplayName());
-        maBaseFieldNameMap.insert(
-            NameMapType::value_type((*aIt)->getDisplayName(), (*aIt)->maName));
+        maBaseFieldNameMap.emplace((*aIt)->getDisplayName(), (*aIt)->maName);
         if ((*aIt)->maName == rFuncData.maFieldRef.ReferenceField)
             aSelectedEntry = (*aIt)->getDisplayName();
     }
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 402975e39693..8277b26c80c2 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -278,8 +278,8 @@ void ScExternalRefCache::Table::setCell(SCCOL nCol, SCROW nRow, TokenRef const &
     if (itrRow == maRows.end())
     {
         // This row does not exist yet.
-        pair<RowsDataType::iterator, bool> res = maRows.insert(
-            RowsDataType::value_type(nRow, RowDataType()));
+        pair<RowsDataType::iterator, bool> res = maRows.emplace(
+            nRow, RowDataType());
 
         if (!res.second)
             return;
@@ -1391,8 +1391,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
     TableTypeRef pTab(new Table);
     rDoc.maTables.push_back(pTab);
     rDoc.maTableNames.push_back(TableName(aTabNameUpper, rTabName));
-    rDoc.maTableNameIndex.insert(
-        TableNameIndexMap::value_type(aTabNameUpper, nIndex));
+    rDoc.maTableNameIndex.emplace(aTabNameUpper, nIndex);
     return pTab;
 }
 
@@ -1435,8 +1434,8 @@ ScExternalRefCache::DocItem* ScExternalRefCache::getDocItem(sal_uInt16 nFileId)
     if (itrDoc == maDocs.end())
     {
         // specified document is not cached.
-        pair<DocDataType::iterator, bool> res = maDocs.insert(
-                DocDataType::value_type(nFileId, DocItem()));
+        pair<DocDataType::iterator, bool> res = maDocs.emplace(
+                nFileId, DocItem());
 
         if (!res.second)
             // insertion failed.
@@ -2167,8 +2166,8 @@ void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rC
     if (itr == maRefCells.end())
     {
         RefCellSet aRefCells;
-        pair<RefCellMap::iterator, bool> r = maRefCells.insert(
-            RefCellMap::value_type(nFileId, aRefCells));
+        pair<RefCellMap::iterator, bool> r = maRefCells.emplace(
+            nFileId, aRefCells);
         if (!r.second)
             // insertion failed.
             return;
@@ -3065,8 +3064,8 @@ void ScExternalRefManager::addLinkListener(sal_uInt16 nFileId, LinkListener* pLi
     LinkListenerMap::iterator itr = maLinkListeners.find(nFileId);
     if (itr == maLinkListeners.end())
     {
-        pair<LinkListenerMap::iterator, bool> r = maLinkListeners.insert(
-            LinkListenerMap::value_type(nFileId, LinkListeners()));
+        pair<LinkListenerMap::iterator, bool> r = maLinkListeners.emplace(
+            nFileId, LinkListeners());
         if (!r.second)
         {
             OSL_FAIL("insertion of new link listener list failed");
@@ -3140,8 +3139,8 @@ sal_uInt32 ScExternalRefManager::getMappedNumberFormat(sal_uInt16 nFileId, sal_u
     if (itr == maNumFormatMap.end())
     {
         // Number formatter map is not initialized for this external document.
-        pair<NumFmtMap::iterator, bool> r = maNumFormatMap.insert(
-            NumFmtMap::value_type(nFileId, SvNumberFormatterMergeMap()));
+        pair<NumFmtMap::iterator, bool> r = maNumFormatMap.emplace(
+            nFileId, SvNumberFormatterMergeMap());
 
         if (!r.second)
             // insertion failed.
diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx
index f4001d9587b6..8ca7185a18c5 100644
--- a/sc/source/ui/docshell/macromgr.cxx
+++ b/sc/source/ui/docshell/macromgr.cxx
@@ -47,8 +47,8 @@ public:
         ModuleCellMap::iterator itr = maCells.find(rModuleName);
         if (itr == maCells.end())
         {
-            pair<ModuleCellMap::iterator, bool> r = maCells.insert(
-                ModuleCellMap::value_type(rModuleName, list<ScFormulaCell*>()));
+            pair<ModuleCellMap::iterator, bool> r = maCells.emplace(
+                rModuleName, list<ScFormulaCell*>());
 
             if (!r.second)
                 // insertion failed.
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e54bf486f7d8..3bcec4d4ac86 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5429,8 +5429,7 @@ bool ScGridWindow::ContinueOnlineSpelling()
                 if (!aRanges.empty())
                 {
                     sc::SpellCheckContext::CellPos aPos(nCol, nRow);
-                    mpSpellCheckCxt->maMisspellCells.insert(
-                        sc::SpellCheckContext::CellMapType::value_type(aPos, aRanges));
+                    mpSpellCheckCxt->maMisspellCells.emplace(aPos, aRanges);
                 }
 
                 // Broadcast for re-paint.
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index b22a8b09f389..4e175365e6a3 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -584,16 +584,12 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
                 // Translate the special empty name into an empty string.
                 aName.clear();
 
-            aResult.insert(
-                std::unordered_map<OUString, bool, OUStringHash>::value_type(
-                    aName, itr->bValid));
+            aResult.emplace(aName, itr->bValid);
         }
         else
         {
             // This is a layout name.  Get the original member name and use it.
-            aResult.insert(
-                std::unordered_map<OUString, bool, OUStringHash>::value_type(
-                    itrNameMap->second, itr->bValid));
+            aResult.emplace(itrNameMap->second, itr->bValid);
         }
     }
     pDim->UpdateMemberVisibility(aResult);
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
index b45c2ade3cd0..2a5b300410df 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
@@ -273,9 +273,9 @@ void BitmapCache::SetBitmap (
     }
     else
     {
-        iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type (
+        iEntry = mpBitmapContainer->emplace(
             rKey,
-            CacheEntry(rPreview, mnCurrentAccessTime++, bIsPrecious))
+            CacheEntry(rPreview, mnCurrentAccessTime++, bIsPrecious)
             ).first;
     }
 
@@ -315,9 +315,9 @@ void BitmapCache::SetPrecious (const CacheKey& rKey, bool bIsPrecious)
     }
     else if (bIsPrecious)
     {
-        iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type (
+        iEntry = mpBitmapContainer->emplace(
             rKey,
-            CacheEntry(Bitmap(), mnCurrentAccessTime++, bIsPrecious))
+            CacheEntry(Bitmap(), mnCurrentAccessTime++, bIsPrecious)
             ).first;
         UpdateCacheSize(iEntry->second, ADD);
     }
@@ -354,9 +354,9 @@ void BitmapCache::Recycle (const BitmapCache& rCache)
         CacheBitmapContainer::iterator iEntry (mpBitmapContainer->find(iOtherEntry->first));
         if (iEntry == mpBitmapContainer->end())
         {
-            iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type (
+            iEntry = mpBitmapContainer->emplace(
                 iOtherEntry->first,
-                CacheEntry(mnCurrentAccessTime++, true))
+                CacheEntry(mnCurrentAccessTime++, true)
                 ).first;
             UpdateCacheSize(iEntry->second, ADD);
         }
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
index fb733ce785b8..a2d93d23a48a 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
@@ -147,7 +147,8 @@ public:
     iterator end() { return maMap.end(); }
     void clear() { maMap.clear(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
 };
 
 class PageCacheManager::Deleter
@@ -414,8 +415,8 @@ void PageCacheManager::PutRecentlyUsedCache(
     // Look up the list of recently used caches for the given document.
     RecentlyUsedPageCaches::iterator iQueue (mpRecentlyUsedPageCaches->find(pDocument));
     if (iQueue == mpRecentlyUsedPageCaches->end())
-        iQueue = mpRecentlyUsedPageCaches->insert(
-            RecentlyUsedPageCaches::value_type(pDocument, RecentlyUsedQueue())
+        iQueue = mpRecentlyUsedPageCaches->emplace(
+            pDocument, RecentlyUsedQueue()
             ).first;
 
     if (iQueue != mpRecentlyUsedPageCaches->end())
diff --git a/sd/source/ui/tools/PropertySet.cxx b/sd/source/ui/tools/PropertySet.cxx
index 33b2d7485804..d4aa8bd223e1 100644
--- a/sd/source/ui/tools/PropertySet.cxx
+++ b/sd/source/ui/tools/PropertySet.cxx
@@ -86,10 +86,7 @@ void SAL_CALL PropertySet::addPropertyChangeListener (
     if (rBHelper.bDisposed || rBHelper.bInDispose)
         return;
 
-    mpChangeListeners->insert(
-        ChangeListenerContainer::value_type(
-            rsPropertyName,
-            rxListener));
+    mpChangeListeners->emplace(rsPropertyName, rxListener);
 }
 
 void SAL_CALL PropertySet::removePropertyChangeListener (
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index 137a51edc0b2..7fd7e6a8d438 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -529,8 +529,7 @@ void ViewShellManager::Implementation::ActivateSubShell (
     // Create the sub shell list if it does not yet exist.
     SubShellList::iterator iList (maActiveSubShells.find(&rParentShell));
     if (iList == maActiveSubShells.end())
-        iList = maActiveSubShells.insert(
-            SubShellList::value_type(&rParentShell,SubShellSubList())).first;
+        iList = maActiveSubShells.emplace(&rParentShell,SubShellSubList()).first;
 
     // Do not activate an object bar that is already active.  Requesting
     // this is not exactly an error but may be an indication of one.
diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
index 8aab1f8768e1..764c7dc0560c 100644
--- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx
+++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx
@@ -575,8 +575,7 @@ std::shared_ptr<RendererPaneStyle>
         // Create a new pane style object and initialize it with bitmaps.
         std::shared_ptr<RendererPaneStyle> pStyle (
             new RendererPaneStyle(mpTheme,sPaneStyleName));
-        iStyle = maRendererPaneStyles.insert(
-            RendererPaneStyleContainer::value_type(rsResourceURL, pStyle)).first;
+        iStyle = maRendererPaneStyles.emplace(rsResourceURL, pStyle).first;
     }
     if (iStyle != maRendererPaneStyles.end())
         return iStyle->second;
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index b9d1ff0d312d..01a5f47d6450 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -636,7 +636,7 @@ void IndexTabPage_Impl::InitializeIndex()
                         if ( aIndex != aTempString )
                         {
                             aIndex = aTempString;
-                            it = aInfo.insert(sfx2::KeywordInfo::value_type(aTempString, 0)).first;
+                            it = aInfo.emplace(aTempString, 0).first;
                             if ( (tmp = it->second++) != 0)
                                 m_pIndexCB->InsertEntry(aTempString + OUString(append, tmp));
                             else
@@ -646,7 +646,7 @@ void IndexTabPage_Impl::InitializeIndex()
                         aIndex.clear();
 
                     // Assume the token is trimmed
-                    it = aInfo.insert(sfx2::KeywordInfo::value_type(aKeywordPair, 0)).first;
+                    it = aInfo.emplace(aKeywordPair, 0).first;
                     if ((tmp = it->second++) != 0)
                         nPos = m_pIndexCB->InsertEntry(aKeywordPair + OUString(append, tmp));
                     else
@@ -678,7 +678,7 @@ void IndexTabPage_Impl::InitializeIndex()
                             .append( aTitleList[j] );
 
                         aTempString = aData.makeStringAndClear();
-                        it = aInfo.insert(sfx2::KeywordInfo::value_type(aTempString, 0)).first;
+                        it = aInfo.emplace(aTempString, 0).first;
                         if ( (tmp = it->second++) != 0 )
                             nPos = m_pIndexCB->InsertEntry(aTempString + OUString(append, tmp));
                         else
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index a75aa42c86b6..1f8fb2863d4f 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -190,9 +190,7 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
                                              && rDeckDescriptor.mbIsEnabled;
 
 
-        aOrderedIds.insert(::std::multimap<sal_Int32,DeckContextDescriptor>::value_type(
-                rDeckDescriptor.mnOrderIndex,
-                aDeckContextDescriptor));
+        aOrderedIds.emplace(rDeckDescriptor.mnOrderIndex, aDeckContextDescriptor);
     }
 
     std::multimap<sal_Int32,DeckContextDescriptor>::const_iterator iId;
@@ -233,9 +231,7 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc
         aPanelContextDescriptor.msMenuCommand = pEntry->msMenuCommand;
         aPanelContextDescriptor.mbIsInitiallyVisible = pEntry->mbIsInitiallyVisible;
         aPanelContextDescriptor.mbShowForReadOnlyDocuments = rPanelDescriptor.mbShowForReadOnlyDocuments;
-        aOrderedIds.insert(std::multimap<sal_Int32, PanelContextDescriptor>::value_type(
-                                                    rPanelDescriptor.mnOrderIndex,
-                                                    aPanelContextDescriptor));
+        aOrderedIds.emplace(rPanelDescriptor.mnOrderIndex, aPanelContextDescriptor);
     }
 
     std::multimap<sal_Int32,PanelContextDescriptor>::const_iterator iId;
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
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 65dc5d026710..063e868a1604 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1519,8 +1519,7 @@ public:
             }
             map_.erase(del);
         }
-        bool ins = map_.insert(typename Map::value_type(key, Data(access)))
-            .second;
+        bool ins = map_.emplace(key, Data(access)).second;
         assert(ins); (void)ins;
     }
 
diff --git a/stoc/source/security/lru_cache.h b/stoc/source/security/lru_cache.h
index 6677a95b843f..28c34fec9eda 100644
--- a/stoc/source/security/lru_cache.h
+++ b/stoc/source/security/lru_cache.h
@@ -193,7 +193,7 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::set(
             m_key2element.erase( entry->m_key );
             entry->m_key = key;
             ::std::pair< typename t_key2element::iterator, bool > insertion(
-                m_key2element.insert( typename t_key2element::value_type( key, entry ) ) );
+                m_key2element.emplace( key, entry ) );
             OSL_ENSURE( insertion.second, "### inserting new cache entry failed?!" );
         }
         else
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index 9748be9a6b76..8eff53f03fe0 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -58,7 +58,7 @@ namespace svt
                 nullptr,
                 _eType
             );
-            aFind = _raHeaderCells.insert( BrowseBoxImpl::THeaderCellMap::value_type( _nPos, xAccessible ) ).first;
+            aFind = _raHeaderCells.emplace( _nPos, xAccessible ).first;
         }
         if ( aFind != _raHeaderCells.end() )
             xRet = aFind->second;
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx
index ff22615f77fa..058fb5e2fddb 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -433,7 +433,7 @@ svx::SvxShowCharSetItem* SvxSearchCharSet::ImplGetItem( int _nPos )
         OSL_ENSURE(m_xAccessible.is(), "Who wants to create a child of my table without a parent?");
         std::shared_ptr<svx::SvxShowCharSetItem> xItem(new svx::SvxShowCharSetItem(*this,
             m_xAccessible->getTable(), sal::static_int_cast< sal_uInt16 >(_nPos)));
-        aFind = m_aItems.insert(ItemsMap::value_type(_nPos, xItem)).first;
+        aFind = m_aItems.emplace(_nPos, xItem).first;
         OUStringBuffer buf;
         std::unordered_map<sal_Int32,sal_UCS4>::const_iterator got = m_aItemList.find (_nPos);
         buf.appendUtf32( got->second );
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index e1408f8a604d..8bef3f5c52cb 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -639,7 +639,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt)
             }
 
             // insert the new entry
-            aPropertyPos = rPropInfos.insert(PropertySetInfo::AllProperties::value_type(evt.PropertyName,aNewEntry)).first;
+            aPropertyPos = rPropInfos.emplace(evt.PropertyName,aNewEntry).first;
             DBG_ASSERT(aPropertyPos != rPropInfos.end(), "FmXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
         }
 
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index fb63de35bd96..f54e6771cb16 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4065,8 +4065,8 @@ FormController::interceptedQueryDispatch( const URL& aURL,
             DispatcherContainer::const_iterator aDispatcherPos = m_aFeatureDispatchers.find( nFormFeature );
             if ( aDispatcherPos == m_aFeatureDispatchers.end() )
             {
-                aDispatcherPos = m_aFeatureDispatchers.insert(
-                    DispatcherContainer::value_type( nFormFeature, new svx::OSingleFeatureDispatcher( aURL, nFormFeature, m_xFormOperations, m_aMutex ) )
+                aDispatcherPos = m_aFeatureDispatchers.emplace(
+                    nFormFeature, new svx::OSingleFeatureDispatcher( aURL, nFormFeature, m_xFormOperations, m_aMutex )
                 ).first;
             }
 
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 11e6676eb484..858b97db244a 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -155,20 +155,17 @@ GalleryThemePopup::GalleryThemePopup(
     mpPopupMenu->SetPopupMenu(mpPopupMenu->GetItemId("background"), mpBackgroundPopup);
 
     // SID_GALLERY_ENABLE_ADDCOPY
-    m_aCommandInfo.insert(
-        CommandInfoMap::value_type(
+    m_aCommandInfo.emplace(
             SID_GALLERY_ENABLE_ADDCOPY,
-            CommandInfo( CMD_SID_GALLERY_ENABLE_ADDCOPY )));
+            CommandInfo( CMD_SID_GALLERY_ENABLE_ADDCOPY ));
     // SID_GALLERY_BG_BRUSH
-    m_aCommandInfo.insert(
-        CommandInfoMap::value_type(
+    m_aCommandInfo.emplace(
             SID_GALLERY_BG_BRUSH,
-            CommandInfo( CMD_SID_GALLERY_BG_BRUSH )));
+            CommandInfo( CMD_SID_GALLERY_BG_BRUSH ));
     // SID_GALLERY_FORMATS
-    m_aCommandInfo.insert(
-        CommandInfoMap::value_type(
+    m_aCommandInfo.emplace(
             SID_GALLERY_FORMATS,
-            CommandInfo( CMD_SID_GALLERY_FORMATS )));
+            CommandInfo( CMD_SID_GALLERY_FORMATS ));
 
 }
 
diff --git a/sw/source/core/access/accfrmobjmap.cxx b/sw/source/core/access/accfrmobjmap.cxx
index 43da30d7dbad..18bdd32421f3 100644
--- a/sw/source/core/access/accfrmobjmap.cxx
+++ b/sw/source/core/access/accfrmobjmap.cxx
@@ -126,8 +126,7 @@ std::pair< SwAccessibleChildMap::iterator, bool > SwAccessibleChildMap::insert(
                                                 const SwAccessibleChild& rLower )
 {
     SwAccessibleChildMapKey aKey( eLayerId, nPos );
-    value_type aEntry( aKey, rLower );
-    return insert( aEntry );
+    return emplace( aKey, rLower );
 }
 
 std::pair< SwAccessibleChildMap::iterator, bool > SwAccessibleChildMap::insert(
@@ -142,8 +141,7 @@ std::pair< SwAccessibleChildMap::iterator, bool > SwAccessibleChildMap::insert(
                         ? SwAccessibleChildMapKey::CONTROLS
                         : SwAccessibleChildMapKey::HEAVEN );
     SwAccessibleChildMapKey aKey( eLayerId, pObj->GetOrdNum() );
-    value_type aEntry( aKey, rLower );
-    return insert( aEntry );
+    return emplace( aKey, rLower );
 }
 
 bool SwAccessibleChildMap::IsSortingRequired( const SwFrame& rFrame )
diff --git a/sw/source/core/access/accfrmobjmap.hxx b/sw/source/core/access/accfrmobjmap.hxx
index 819c3313ce16..2376bde34175 100644
--- a/sw/source/core/access/accfrmobjmap.hxx
+++ b/sw/source/core/access/accfrmobjmap.hxx
@@ -117,7 +117,8 @@ public:
     const_reverse_iterator crbegin() const { return maMap.crbegin(); }
     const_reverse_iterator crend() const { return maMap.crend(); }
 
-    std::pair<iterator,bool> insert(const value_type& value) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
 };
 
 #endif
diff --git a/sw/source/core/access/acchypertextdata.hxx b/sw/source/core/access/acchypertextdata.hxx
index ea1d349371ee..7a0c5e775c8c 100644
--- a/sw/source/core/access/acchypertextdata.hxx
+++ b/sw/source/core/access/acchypertextdata.hxx
@@ -45,7 +45,8 @@ public:
     iterator begin() { return maMap.begin(); }
     iterator end() { return maMap.end(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value ) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
 };
 
 #endif
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index cf74ec6d9222..3ca56245b1b0 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -113,7 +113,8 @@ public:
     bool empty() const { return maMap.empty(); }
     void clear() { maMap.clear(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value ) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
     iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
 };
 
@@ -257,7 +258,8 @@ public:
     const_iterator cend() const { return maMap.cend(); }
     bool empty() const { return maMap.empty(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value ) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
     iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
 };
 
@@ -588,7 +590,8 @@ private:
 public:
     iterator end() { return maMap.end(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value ) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
     iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
 };
 
@@ -628,7 +631,8 @@ public:
     iterator begin() { return maMap.begin(); }
     iterator end() { return maMap.end(); }
     iterator find(const key_type& key) { return maMap.find(key); }
-    std::pair<iterator,bool> insert(const value_type& value ) { return maMap.insert(value); }
+    template<class... Args>
+    std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); }
     iterator erase(const_iterator const & pos) { return maMap.erase(pos); }
 };
 
@@ -1042,9 +1046,8 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
         }
         else if( SwAccessibleEvent_Impl::DISPOSE != rEvent.GetType() )
         {
-            SwAccessibleEventMap_Impl::value_type aEntry( rEvent.GetFrameOrObj(),
+            mpEventMap->emplace( rEvent.GetFrameOrObj(),
                     mpEvents->insert( mpEvents->end(), rEvent ) );
-            mpEventMap->insert( aEntry );
         }
     }
 }
@@ -1349,7 +1352,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection()
                                 vecAdd.push_back(static_cast< SwAccessibleContext * >(xAcc.get()));
                             }
 
-                            mapTemp.insert( SwAccessibleContextMap_Impl::value_type( pFrame, xAcc ) );
+                            mapTemp.emplace( pFrame, xAcc );
                         }
                     }
                     ++nStartIndex;
@@ -1379,7 +1382,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection()
         SwAccessibleContextMap_Impl::iterator aIter = mapTemp.begin();
         while( aIter != mapTemp.end() )
         {
-            mpSeletedFrameMap->insert( SwAccessibleContextMap_Impl::value_type( (*aIter).first, (*aIter).second ) );
+            mpSeletedFrameMap->emplace( (*aIter).first, (*aIter).second );
             ++aIter;
         }
         mapTemp.clear();
@@ -1760,8 +1763,7 @@ uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView_(
             }
             else
             {
-                SwAccessibleContextMap_Impl::value_type aEntry( pRootFrame, xAcc );
-                mpFrameMap->insert( aEntry );
+                mpFrameMap->emplace( pRootFrame, xAcc );
             }
         }
 
@@ -1889,8 +1891,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrame *pFrame,
                 }
                 else
                 {
-                    SwAccessibleContextMap_Impl::value_type aEntry( pFrame, xAcc );
-                    mpFrameMap->insert( aEntry );
+                    mpFrameMap->emplace( pFrame, xAcc );
                 }
 
                 if( pAcc->HasCursor() &&
@@ -1986,9 +1987,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
                 }
                 else
                 {
-                    SwAccessibleShapeMap_Impl::value_type aEntry( pObj,
-                                                                  xAcc );
-                    mpShapeMap->insert( aEntry );
+                    mpShapeMap->emplace( pObj, xAcc );
                 }
                 // TODO: focus!!!
                 AddGroupContext(pObj, xAcc);
@@ -2016,8 +2015,7 @@ void SwAccessibleMap::AddShapeContext(const SdrObject *pObj, uno::Reference < XA
 
     if( mpShapeMap )
     {
-        SwAccessibleShapeMap_Impl::value_type aEntry( pObj, xAccShape );
-        mpShapeMap->insert( aEntry );
+        mpShapeMap->emplace( pObj, xAccShape );
     }
 
 }
@@ -3147,8 +3145,7 @@ bool SwAccessibleMap::ReplaceChild (
             }
             else
             {
-                SwAccessibleShapeMap_Impl::value_type aEntry( pObj, xAcc );
-                mpShapeMap->insert( aEntry );
+                mpShapeMap->emplace( pObj, xAcc );
             }
         }
     }
@@ -3349,14 +3346,12 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::BuildSelectedParas()
                                     pTextNode == &(pEndPos->nNode.GetNode())
                                                 ? pEndPos->nContent.GetIndex()
                                                 : -1 );
-                                SwAccessibleSelectedParas_Impl::value_type
-                                                aEntry( xWeakAcc, aDataEntry );
                                 if ( !pRetSelectedParas )
                                 {
                                     pRetSelectedParas =
                                             new SwAccessibleSelectedParas_Impl;
                                 }
-                                pRetSelectedParas->insert( aEntry );
+                                pRetSelectedParas->emplace( xWeakAcc, aDataEntry );
                             }
                         }
                     }
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 44056b7ee190..1ec347554526 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -3088,8 +3088,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
                         }
                         else
                         {
-                            SwAccessibleHyperTextData::value_type aEntry( pHt, xRet );
-                            m_pHyperTextData->insert( aEntry );
+                            m_pHyperTextData->emplace( pHt, xRet );
                         }
                     }
                 }
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 689b032bb3c5..b6586595a32e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2347,8 +2347,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength,
     // no hints at the end (special case: no hints at all in i_rHints)
     if (nLastEnd != nLength && nLength != 0)
     {
-        o_rSpanMap.insert(
-            AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), nullptr));
+        o_rSpanMap.emplace(AttrSpan_t(nLastEnd, nLength), nullptr);
     }
 }
 
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 5e62ef00c3c5..82625c6f2864 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1477,7 +1477,7 @@ bool  SwContentTree::Expand( SvTreeListEntry* pParent )
                         assert(dynamic_cast<SwContent*>(static_cast<SwTypeNumber*>(pChild->GetUserData())));
                         long nPos = static_cast<SwContent*>(pChild->GetUserData())->GetYPos();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list