[Libreoffice-commits] core.git: connectivity/source dbaccess/source editeng/source libreofficekit/source oox/source solenv/gbuild ucb/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 7 07:42:58 UTC 2019


 connectivity/source/drivers/mork/MQueryHelper.cxx |    6 +++---
 dbaccess/source/core/api/RowSet.cxx               |    4 ++--
 editeng/source/outliner/outlobj.cxx               |    4 ++--
 libreofficekit/source/gtk/lokdocview.cxx          |    2 +-
 oox/source/ppt/presentationfragmenthandler.cxx    |    2 +-
 solenv/gbuild/platform/com_GCC_defs.mk            |    3 ++-
 ucb/source/ucp/cmis/cmis_content.cxx              |    4 ++--
 7 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 439004122498b34433e2394d1d9c55c7d3666ab5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Oct 4 10:20:26 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 7 09:42:23 2019 +0200

    enable -Wrange-loop-analysis on clang
    
    Change-Id: I2095308943c94ad16c110d5fac47715398eb5d39
    Reviewed-on: https://gerrit.libreoffice.org/80187
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx
index 4e64e08f2ad9..9077f49f7cc1 100644
--- a/connectivity/source/drivers/mork/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mork/MQueryHelper.cxx
@@ -218,7 +218,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression
                     entry->setValue(key, valueOUString);
                 }
                 bool result = true;
-                for (auto const& elem : entryMatchedByExpression(this, &expr, entry.get()))
+                for (bool elem : entryMatchedByExpression(this, &expr, entry.get()))
                 {
                     result = result && elem;
                 }
@@ -296,7 +296,7 @@ std::vector<bool> entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpressi
             MQueryExpression::bool_cond condition = queryExpression->getExpressionCondition();
             if (condition == MQueryExpression::OR) {
                 bool result = false;
-                for (auto const& elem : subquery_result)
+                for (bool elem : subquery_result)
                 {
                     result = result || elem;
                 }
@@ -304,7 +304,7 @@ std::vector<bool> entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpressi
             } else {
                 assert(condition == MQueryExpression::AND && "only OR or AND should exist");
                 bool result = true;
-                for (auto const& elem : subquery_result)
+                for (bool elem : subquery_result)
                 {
                     result = result && elem;
                 }
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 2130d6b4acf4..955dbc54cf50 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1234,9 +1234,9 @@ void ORowSet::impl_restoreDataColumnsWriteable_throw()
 {
     assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.size() == 0 );
     TDataColumns::const_iterator aIter = m_aDataColumns.begin();
-    for (auto const& readOnlyDataColumn : m_aReadOnlyDataColumns)
+    for (bool readOnlyDataColumn : m_aReadOnlyDataColumns)
     {
-        (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny( static_cast<bool>(readOnlyDataColumn)) );
+        (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny(readOnlyDataColumn) );
         ++aIter;
     }
     m_aReadOnlyDataColumns.clear();
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index 396e948f6595..23206122b1df 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -233,8 +233,8 @@ void OutlinerParaObject::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterStartElement(pWriter, BAD_CAST("OutlinerParaObject"));
     xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
     mpImpl->mpEditTextObject->dumpAsXml(pWriter);
-    for (Paragraph const & p : mpImpl->maParagraphDataVector)
-        p.dumpAsXml(pWriter);
+    for (ParagraphData const & p : mpImpl->maParagraphDataVector)
+        Paragraph(p).dumpAsXml(pWriter);
     xmlTextWriterEndElement(pWriter);
 }
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 96e2c12b17ba..9ece7eb4192e 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -848,7 +848,7 @@ static std::string getAuthorRenderingArgument(LOKDocViewPrivate& priv)
     boost::property_tree::ptree aTree;
     boost::property_tree::read_json(aStream, aTree);
     std::string aRet;
-    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree)
+    for (const auto& rPair : aTree)
     {
         if (rPair.first == ".uno:Author")
         {
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 776514612b70..7f04c9b57e89 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -496,7 +496,7 @@ void PresentationFragmentHandler::finalizeImport()
         try
         {
             int nPagesImported = 0;
-            for (auto const& elem : aRangeEnumerator)
+            for (sal_Int32 elem : aRangeEnumerator)
             {
                 if ( rxStatusIndicator.is() )
                     rxStatusIndicator->setValue((nPagesImported * 10000) / aRangeEnumerator.size());
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index fc3ba6958321..2c3d5f1a98f3 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -106,7 +106,8 @@ endif
 ifeq ($(COM_IS_CLANG),TRUE)
 gb_CXXFLAGS_COMMON += \
 	-Wimplicit-fallthrough \
-	-Wunused-exception-parameter
+	-Wunused-exception-parameter \
+	-Wrange-loop-analysis
 else
 gb_CFLAGS_COMMON += \
     -Wduplicated-cond \
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 17499d4c9920..9f0607248c66 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -142,9 +142,9 @@ namespace
                     uno::Sequence< sal_Bool > aBools( aCmisBools.size( ) );
                     sal_Bool* aBoolsArr = aBools.getArray( );
                     sal_Int32 i = 0;
-                    for ( const auto& rCmisBool : aCmisBools )
+                    for ( bool bCmisBool : aCmisBools )
                     {
-                        aBoolsArr[i++] = rCmisBool;
+                        aBoolsArr[i++] = bCmisBool;
                     }
                     aValue <<= aBools;
                 }


More information about the Libreoffice-commits mailing list