[Libreoffice-commits] core.git: i18npool/source libreofficekit/qa libreofficekit/source linguistic/source oox/source opencl/inc opencl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 20 10:05:55 UTC 2019


 i18npool/source/breakiterator/breakiteratorImpl.cxx                     |    4 +--
 i18npool/source/breakiterator/xdictionary.cxx                           |    4 +--
 i18npool/source/characterclassification/characterclassificationImpl.cxx |    2 -
 i18npool/source/collator/collatorImpl.cxx                               |    2 -
 i18npool/source/inputchecker/inputsequencechecker.cxx                   |    2 -
 i18npool/source/localedata/localedata.cxx                               |    4 +--
 libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx                |    2 -
 libreofficekit/qa/gtktiledviewer/gtv-comments-sidebar.cxx               |    2 -
 libreofficekit/source/gtk/lokdocview.cxx                                |   12 +++++-----
 linguistic/source/dicimp.cxx                                            |    2 -
 linguistic/source/dlistimp.cxx                                          |    2 -
 oox/source/drawingml/diagram/diagram.cxx                                |    2 -
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx                     |    8 +++---
 oox/source/drawingml/shape.cxx                                          |    2 -
 oox/source/vml/vmldrawing.cxx                                           |    2 -
 opencl/inc/opencl_device_selection.h                                    |    2 -
 opencl/source/opencl_device.cxx                                         |    2 -
 17 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 07f9223daae92ac11be2382ecd0095e744f5695f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Aug 20 09:32:35 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 20 12:04:41 2019 +0200

    loplugin:constvars in i18npool..opencl
    
    Change-Id: I82738a18ff116fdc78f07b453c93b1b631632caf
    Reviewed-on: https://gerrit.libreoffice.org/77775
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index bc52262b1d08..21cdfce9c499 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -531,7 +531,7 @@ sal_Int16  BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
 bool BreakIteratorImpl::createLocaleSpecificBreakIterator(const OUString& aLocaleName)
 {
     // to share service between same Language but different Country code, like zh_CN and zh_TW
-    for (lookupTableItem& listItem : lookupTable) {
+    for (const lookupTableItem& listItem : lookupTable) {
         if (aLocaleName == listItem.aLocale.Language) {
             xBI = listItem.xBI;
             return true;
@@ -576,7 +576,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale)
     else if (m_xContext.is()) {
         aLocale = rLocale;
 
-        for (lookupTableItem& listItem : lookupTable) {
+        for (const lookupTableItem& listItem : lookupTable) {
             if (rLocale == listItem.aLocale)
                 return xBI = listItem.xBI;
         }
diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx
index c905f67d4685..f21e377c68c0 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -127,7 +127,7 @@ xdictionary::xdictionary(const sal_Char *lang) :
 
 xdictionary::~xdictionary()
 {
-    for (WordBreakCache & i : cache) {
+    for (const WordBreakCache & i : cache) {
         if (i.size > 0) {
             delete [] i.contents;
             delete [] i.wordboundary;
@@ -151,7 +151,7 @@ void xdictionary::initDictionaryData(const sal_Char *pLang)
     static std::vector< datacache > aLoadedCache;
 
     osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() );
-    for(datacache & i : aLoadedCache)
+    for(const datacache & i : aLoadedCache)
     {
         if( i.maLang != pLang )
         {
diff --git a/i18npool/source/characterclassification/characterclassificationImpl.cxx b/i18npool/source/characterclassification/characterclassificationImpl.cxx
index f66a4b26085d..721c82bf9304 100644
--- a/i18npool/source/characterclassification/characterclassificationImpl.cxx
+++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx
@@ -155,7 +155,7 @@ CharacterClassificationImpl::getLocaleSpecificCharacterClassification(const Loca
     if (cachedItem && cachedItem->equals(rLocale))
         return cachedItem->xCI;
     else {
-        for (auto & i : lookupTable) {
+        for (const auto & i : lookupTable) {
             cachedItem = i.get();
             if (cachedItem->equals(rLocale))
                 return cachedItem->xCI;
diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx
index f072adbb192a..155b271b1b46 100644
--- a/i18npool/source/collator/collatorImpl.cxx
+++ b/i18npool/source/collator/collatorImpl.cxx
@@ -164,7 +164,7 @@ CollatorImpl::createCollator(const lang::Locale& rLocale, const OUString& servic
 void
 CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rSortAlgorithm)
 {
-    for (auto& i : lookupTable) {
+    for (const auto& i : lookupTable) {
         cachedItem = i.get();
         if (cachedItem->equals(rLocale, rSortAlgorithm)) {
             return;
diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx
index 3989cb74c9ad..46e7f9def6fc 100644
--- a/i18npool/source/inputchecker/inputsequencechecker.cxx
+++ b/i18npool/source/inputchecker/inputsequencechecker.cxx
@@ -108,7 +108,7 @@ InputSequenceCheckerImpl::getInputSequenceChecker(sal_Char const * rLanguage)
         return cachedItem->xISC;
     }
     else {
-        for (auto& l : lookupTable) {
+        for (const auto& l : lookupTable) {
             cachedItem = l.get();
             if (cachedItem->aLanguage == rLanguage)
                 return cachedItem->xISC;
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 433b34c72de3..4a46025aa2f0 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -509,7 +509,7 @@ lcl_LookupTableHelper::lcl_LookupTableHelper()
 
 lcl_LookupTableHelper::~lcl_LookupTableHelper()
 {
-    for ( LocaleDataLookupTableItem& item : maLookupTable ) {
+    for ( const LocaleDataLookupTableItem& item : maLookupTable ) {
         delete item.module;
     }
 }
@@ -879,7 +879,7 @@ LocaleDataImpl::getAllFormats( const Locale& rLocale )
 
     Sequence< FormatElement > seq(formatCount);
     sal_Int32 f = 0;
-    for (FormatSection & s : section)
+    for (const FormatSection & s : section)
     {
         sal_Unicode const * const * const formatArray = s.formatArray;
         if ( formatArray )
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
index 1987bdc909cf..57eba3e0efb3 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
@@ -177,7 +177,7 @@ void gtv_calc_header_bar_configure(GtvCalcHeaderBar* bar, const boost::property_
         boost::property_tree::ptree val = *values;
         try
         {
-            for (boost::property_tree::ptree::value_type& rValue : val)
+            for (const boost::property_tree::ptree::value_type& rValue : val)
             {
                 int nSize = std::round(lok_doc_view_twip_to_pixel(LOK_DOC_VIEW(window->lokdocview), std::atof(rValue.second.get<std::string>("size").c_str())));
                 if (nSize >= bar->m_nPositionPixel)
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-comments-sidebar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-comments-sidebar.cxx
index ab8f9c4cef8a..e28326ab3ffb 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-comments-sidebar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-comments-sidebar.cxx
@@ -53,7 +53,7 @@ gtv_comments_sidebar_view_annotations(GtvCommentsSidebar* sidebar)
     boost::property_tree::read_json(aStream, aTree);
     try
     {
-        for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("comments"))
+        for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("comments"))
         {
             GtkWidget* pCommentBox = GtvHelpers::createCommentBox(rValue.second);
             gtk_container_add(GTK_CONTAINER(sidebar->commentsgrid), pCommentBox);
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index fd6ca8449327..60ec5afbc8c5 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1709,7 +1709,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
 
     if (!priv->m_aTextSelectionRectangles.empty())
     {
-        for (GdkRectangle& rRectangle : priv->m_aTextSelectionRectangles)
+        for (const GdkRectangle& rRectangle : priv->m_aTextSelectionRectangles)
         {
             // Blue with 75% transparency.
             cairo_set_source_rgba(pCairo, (double(0x43))/255, (double(0xac))/255, (double(0xe8))/255, 0.25);
@@ -1749,12 +1749,12 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
     }
 
     // Selections of other views.
-    for (auto& rPair : priv->m_aTextViewSelectionRectangles)
+    for (const auto& rPair : priv->m_aTextViewSelectionRectangles)
     {
         if (rPair.second.m_nPart != priv->m_nPartId && priv->m_eDocumentType != LOK_DOCTYPE_TEXT)
             continue;
 
-        for (GdkRectangle& rRectangle : rPair.second.m_aRectangles)
+        for (const GdkRectangle& rRectangle : rPair.second.m_aRectangles)
         {
             const GdkRGBA& rDark = getDarkColor(rPair.first, priv);
             // 75% transparency.
@@ -1775,7 +1775,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
     }
 
     // Graphic selections of other views.
-    for (auto& rPair : priv->m_aGraphicViewSelections)
+    for (const auto& rPair : priv->m_aGraphicViewSelections)
     {
         const ViewRectangle& rRectangle = rPair.second;
         if (rRectangle.m_nPart != priv->m_nPartId && priv->m_eDocumentType != LOK_DOCTYPE_TEXT)
@@ -1799,7 +1799,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
     }
 
     // Cell view cursors: they are colored.
-    for (auto& rPair : priv->m_aCellViewCursors)
+    for (const auto& rPair : priv->m_aCellViewCursors)
     {
         const ViewRectangle& rCursor = rPair.second;
         if (rCursor.m_nPart != priv->m_nPartId)
@@ -1817,7 +1817,7 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
     }
 
     // View locks: they are colored.
-    for (auto& rPair : priv->m_aViewLockRectangles)
+    for (const auto& rPair : priv->m_aViewLockRectangles)
     {
         const ViewRectangle& rRectangle = rPair.second;
         if (rRectangle.m_nPart != priv->m_nPartId)
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index f6a976679641..423923a0ba0a 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -464,7 +464,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
     pStream->WriteLine("---");
     if (ERRCODE_NONE != (nErr = pStream->GetError()))
         return nErr;
-    for (Reference<XDictionaryEntry> & aEntrie : aEntries)
+    for (const Reference<XDictionaryEntry> & aEntrie : aEntries)
     {
         OString aOutStr = formatForSave(aEntrie, eEnc);
         pStream->WriteLine (aOutStr);
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 062e2ad0b017..34eb79294ec2 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -596,7 +596,7 @@ void DicList::CreateDicList()
     // look for dictionaries
     const OUString aWriteablePath( GetDictionaryWriteablePath() );
     std::vector< OUString > aPaths( GetDictionaryPaths() );
-    for (OUString & aPath : aPaths)
+    for (const OUString & aPath : aPaths)
     {
         const bool bIsWriteablePath = (aPath == aWriteablePath);
         SearchForDictionaries( aDicList, aPath, bIsWriteablePath );
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index fb1fc916c349..678299ea3abd 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -214,7 +214,7 @@ static void sortChildrenByZOrder(const ShapePtr& pShape)
               [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); });
 
     // Apply also for children.
-    for (auto& rChild : rChildren)
+    for (const auto& rChild : rChildren)
         sortChildrenByZOrder(rChild);
 }
 
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 12dcae71663c..14af84da6ac4 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -412,18 +412,18 @@ sal_Int32 AlgAtom::getVerticalShapesCount(const ShapePtr& rShape)
     sal_Int32 nCount = 0;
     if (nDir == XML_fromT || nDir == XML_fromB)
     {
-        for (ShapePtr& pChild : rShape->getChildren())
+        for (const ShapePtr& pChild : rShape->getChildren())
             nCount += pChild->getVerticalShapesCount();
     }
     else if ((nDir == XML_fromL || nDir == XML_fromR) && nSecDir == XML_fromT)
     {
-        for (ShapePtr& pChild : rShape->getChildren())
+        for (const ShapePtr& pChild : rShape->getChildren())
             nCount += pChild->getVerticalShapesCount();
         nCount = (nCount + 1) / 2;
     }
     else
     {
-        for (ShapePtr& pChild : rShape->getChildren())
+        for (const ShapePtr& pChild : rShape->getChildren())
             nCount = std::max(nCount, pChild->getVerticalShapesCount());
     }
 
@@ -828,7 +828,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             // See if children requested more than 100% space in total: scale
             // down in that case.
             awt::Size aTotalSize;
-            for (auto & aCurrShape : rShape->getChildren())
+            for (const auto & aCurrShape : rShape->getChildren())
             {
                 oox::OptValue<sal_Int32> oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w);
                 oox::OptValue<sal_Int32> oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h);
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 960b63297902..b14cbef6ac15 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -468,7 +468,7 @@ static void lcl_createPresetShape(const uno::Reference<drawing::XShape>& xShape,
         !aAdjGdList.empty() ? aAdjGdList.size() : 1 );
 
     int nIndex = 0;
-    for (auto& aEntry : aAdjGdList)
+    for (const auto& aEntry : aAdjGdList)
     {
         double fValue = aEntry.maFormula.toDouble();
         // then: polar-handle, else: XY-handle
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 2c5ce3887299..16e08c0e15a2 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -185,7 +185,7 @@ void Drawing::convertAndInsert() const
             DBG_UNHANDLED_EXCEPTION("oox.vml");
         }
     }
-    for ( auto& BoxItr : GroupBoxMap )
+    for ( const auto& BoxItr : GroupBoxMap )
     {
         const uno::Any aGroup( OUString("autoGroup_").concat(BoxItr.first) );
         for ( auto RadioItr = RadioButtonMap.begin(); RadioItr != RadioButtonMap.end(); )
diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h
index 9388f5607fcb..4fa8cf4a55de 100644
--- a/opencl/inc/opencl_device_selection.h
+++ b/opencl/inc/opencl_device_selection.h
@@ -254,7 +254,7 @@ inline ds_status writeProfile(const OUString& rStreamName, std::unique_ptr<ds_pr
     aXmlWriter.content(pProfile->version);
     aXmlWriter.endElement();
 
-    for (ds_device& rDevice : pProfile->devices)
+    for (const ds_device& rDevice : pProfile->devices)
     {
         aXmlWriter.startElement("device");
 
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index 5350d737f9fb..85a5b3ef6ec9 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -460,7 +460,7 @@ void writeDevicesLog(std::unique_ptr<ds_profile> const & rProfile, OUString cons
 
     int nIndex = 0;
 
-    for (ds_device& rDevice : rProfile->devices)
+    for (const ds_device& rDevice : rProfile->devices)
     {
         if (rDevice.eType == DeviceType::OpenCLDevice)
         {


More information about the Libreoffice-commits mailing list