summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-07-06 18:05:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-07-06 18:05:06 +0200
commit7eaf8b17dd3020c54ab58ae513c1175c95d5ccce (patch)
treebdf66afe5dff12131d6369d0dcc6ce6b6b641c7c
parent0f92d79708118d99fca4c60c30cd5c63c24e02fb (diff)
clang-tidy performance-implicit-cast-in-loop
...where the first component of the pair returned by the iterator would be const, so an implicit conversion would be required. Change-Id: I62b6ddd799261e1dd63ea5c42a85d8b071f8b8b7
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx2
-rw-r--r--codemaker/source/cppumaker/includes.cxx4
-rw-r--r--codemaker/source/javamaker/javatype.cxx4
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx4
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
7 files changed, 11 insertions, 11 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 28411bafc228..7eac4f05d767 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -443,7 +443,7 @@ void CppuType::dumpDependedTypes(
if (!options.isValid("-nD")) {
codemaker::cppumaker::Dependencies::Map const & map
= m_dependencies.getMap();
- for (const std::pair<OUString,codemaker::cppumaker::Dependencies::Kind>& entry : map)
+ for (const auto& entry : map)
{
produce(entry.first, m_typeMgr, generated, options);
}
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx
index 0b5bc23f555c..d699996a0df3 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -136,7 +136,7 @@ void dumpEmptyLineBeforeFirst(FileStream & out, bool * first) {
void Includes::dump(FileStream & out, OUString const * companionHdl) {
OSL_ASSERT(companionHdl == nullptr || m_hpp);
if (!m_includeReference) {
- for (const std::pair<OUString, codemaker::cppumaker::Dependencies::Kind>& pair : m_map)
+ for (const auto& pair : m_map)
{
if (isInterfaceType(u2b(pair.first))) {
m_includeReference = true;
@@ -159,7 +159,7 @@ void Includes::dump(FileStream & out, OUString const * companionHdl) {
dumpInclude(out, u2b(*companionHdl), false);
}
bool first = true;
- for (const std::pair<OUString, codemaker::cppumaker::Dependencies::Kind>& pair : m_map)
+ for (const auto& pair : m_map)
{
dumpEmptyLineBeforeFirst(out, &first);
if (m_hpp || pair.second == Dependencies::KIND_BASE
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 038cd328b7bd..06328a92b0cf 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -757,7 +757,7 @@ void handleEnumType(
std::list< ClassFile::Code * > blocks;
//FIXME: pointers contained in blocks may leak
sal_Int32 last = SAL_MAX_INT32;
- for (const std::pair< sal_Int32, OString >& pair : map)
+ for (const auto& pair : map)
{
sal_Int32 value = pair.first;
if (last != SAL_MAX_INT32) {
@@ -783,7 +783,7 @@ void handleEnumType(
defCode->instrAreturn();
std::list< std::pair< sal_Int32, ClassFile::Code * > > blocks;
//FIXME: pointers contained in blocks may leak
- for (const std::pair< sal_Int32, OString >& pair : map )
+ for (const auto& pair : map )
{
std::unique_ptr< ClassFile::Code > blockCode(cf->newCode());
blockCode->instrGetstatic(className, pair.second, classDescriptor);
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index efe8601b378c..3304600b64d2 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -247,7 +247,7 @@ void DesktopLOKTest::testGetStyles()
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
CPPUNIT_ASSERT( aValues.size() > 0 );
- for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues)
+ for (const auto& rPair : aValues)
{
if( rPair.first != "ClearStyle")
{
@@ -281,7 +281,7 @@ void DesktopLOKTest::testGetFonts()
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
CPPUNIT_ASSERT( aValues.size() > 0 );
- for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues)
+ for (const auto& rPair : aValues)
{
// check that we have font sizes available for each font
CPPUNIT_ASSERT( rPair.second.size() > 0);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a6640d078b17..352ccd595a99 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -269,7 +269,7 @@ static std::vector<beans::PropertyValue> jsonToPropertyValuesVector(const char*
std::stringstream aStream(pJSON);
boost::property_tree::read_json(aStream, aTree);
- for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree)
+ for (const auto& rPair : aTree)
{
const std::string& rType = rPair.second.get<std::string>("type");
const std::string& rValue = rPair.second.get<std::string>("value");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index ff44d436dc74..4e55c49055fe 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1046,7 +1046,7 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
FSNS(XML_w, XML_element), "RDF",
FSEND);
m_pSerializer->startElementNS(XML_w, XML_smartTagPr, FSEND);
- for (const std::pair<OUString, OUString>& rStatement : aStatements)
+ for (const auto& rStatement : aStatements)
m_pSerializer->singleElementNS(XML_w, XML_attr,
FSNS(XML_w, XML_name), rStatement.first.toUtf8(),
FSNS(XML_w, XML_val), rStatement.second.toUtf8(),
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c726accae3c9..e7753fd4e83d 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -416,7 +416,7 @@ void WW8_WrtFactoids::Write(WW8Export& rExport)
for (const std::map<OUString, OUString>& rStatements : m_aStatements)
{
// Statements for a single text node.
- for (const std::pair<OUString, OUString>& rPair : rStatements)
+ for (const auto& rPair : rStatements)
{
aSet.insert(rPair.first);
aSet.insert(rPair.second);
@@ -427,7 +427,7 @@ void WW8_WrtFactoids::Write(WW8Export& rExport)
{
MSOPropertyBag aPropertyBag;
aPropertyBag.m_nId = 1;
- for (const std::pair<OUString, OUString>& rPair : rStatements)
+ for (const auto& rPair : rStatements)
{
MSOProperty aProperty;
aProperty.m_nKey = std::distance(aSet.begin(), aSet.find(rPair.first));