[Libreoffice-commits] core.git: cppuhelper/source cui/source dbaccess/source desktop/qa desktop/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 19 17:29:11 UTC 2019


 cppuhelper/source/propertysetmixin.cxx                      |    4 ++--
 cui/source/dialogs/FontFeaturesDialog.cxx                   |    2 +-
 cui/source/dialogs/cuigaldlg.cxx                            |    4 ++--
 cui/source/dialogs/iconcdlg.cxx                             |    2 +-
 cui/source/dialogs/thesdlg.cxx                              |    2 +-
 cui/source/options/optupdt.cxx                              |    4 ++--
 cui/source/tabpages/autocdlg.cxx                            |    4 ++--
 cui/source/tabpages/numpages.cxx                            |    2 +-
 dbaccess/source/filter/hsqldb/createparser.cxx              |    6 +++---
 dbaccess/source/filter/hsqldb/hsqlimport.cxx                |    2 +-
 desktop/qa/desktop_lib/test_desktop_lib.cxx                 |   12 ++++++------
 desktop/source/app/dispatchwatcher.cxx                      |    2 +-
 desktop/source/deployment/manager/dp_manager.cxx            |    2 +-
 desktop/source/deployment/registry/dp_backend.cxx           |    2 +-
 desktop/source/lib/init.cxx                                 |   10 +++++-----
 desktop/source/migration/services/oo3extensionmigration.cxx |    4 ++--
 desktop/source/pkgchk/unopkg/unopkg_app.cxx                 |    6 +++---
 17 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit 8efd46ed867b66f9fbc31dbaa1d46bc91ea29ae2
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Aug 19 15:11:27 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 19 19:28:11 2019 +0200

    loplugin:constvars in cppuhelper..desktop
    
    Change-Id: Iaf42114ab98875c4bc1545684f1893540b998ef2
    Reviewed-on: https://gerrit.libreoffice.org/77723
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cppuhelper/source/propertysetmixin.cxx b/cppuhelper/source/propertysetmixin.cxx
index 7201d49def1a..a37185e76686 100644
--- a/cppuhelper/source/propertysetmixin.cxx
+++ b/cppuhelper/source/propertysetmixin.cxx
@@ -928,14 +928,14 @@ void PropertySetMixinImpl::dispose() {
     }
     css::lang::EventObject event(
         static_cast< css::beans::XPropertySet * >(this));
-    for (auto& rEntry : boundListeners)
+    for (const auto& rEntry : boundListeners)
     {
         for (auto& rxBoundListener : rEntry.second)
         {
             rxBoundListener->disposing(event);
         }
     }
-    for (auto& rEntry : vetoListeners)
+    for (const auto& rEntry : vetoListeners)
     {
         for (auto& rxVetoListener : rEntry.second)
         {
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx
index 21f962ee4b07..957a2c8e1228 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -172,7 +172,7 @@ OUString FontFeaturesDialog::createFontNameWithFeatures()
     OUStringBuffer sNameSuffix;
     bool bFirst = true;
 
-    for (FontFeatureItem& rItem : m_aFeatureItems)
+    for (const FontFeatureItem& rItem : m_aFeatureItems)
     {
         if (rItem.m_xCheck->get_visible())
         {
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 4b220800d33c..a90ef52b916a 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -720,7 +720,7 @@ void TPGalleryThemeProperties::FillFilterList()
     ::avmedia::FilterNameVector     aFilters;
     ::avmedia::MediaWindow::getMediaFilters( aFilters );
 
-    for(std::pair<OUString,OUString> & aFilter : aFilters)
+    for(const std::pair<OUString,OUString> & aFilter : aFilters)
     {
         for( sal_Int32 nIndex = 0; nIndex >= 0; )
         {
@@ -760,7 +760,7 @@ void TPGalleryThemeProperties::FillFilterList()
 
 #if HAVE_FEATURE_AVMEDIA
     // media filters
-    for(std::pair<OUString,OUString> & aFilter : aFilters)
+    for(const std::pair<OUString,OUString> & aFilter : aFilters)
     {
         for( sal_Int32 nIndex = 0; nIndex >= 0; )
         {
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 06c4a37a5397..39864c3a3d3b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -292,7 +292,7 @@ void SvxHpLinkDlg::Start_Impl()
 IconChoicePageData* SvxHpLinkDlg::GetPageData ( const OString& rId )
 {
     IconChoicePageData *pRet = nullptr;
-    for (auto & pData : maPageList)
+    for (const auto & pData : maPageList)
     {
         if ( pData->sId == rId )
         {
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 2a5f73c43175..1ed20384016c 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -294,7 +294,7 @@ SvxThesaurusDialog::SvxThesaurusDialog(
     }
     std::sort( aLangVec.begin(), aLangVec.end() );
     m_xLangLB->freeze();
-    for (OUString & i : aLangVec)
+    for (const OUString & i : aLangVec)
         m_xLangLB->append_text(i);
     m_xLangLB->thaw();
 
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 6f308bd6455d..4621ac787d95 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -158,10 +158,10 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
         OUString aPseudoURL = "useragent:normal";
         if( m_xExtrasCheckBox->get_active() )
             aPseudoURL = "useragent:extended";
-        uno::Sequence< beans::StringPair > aHeaders
+        const uno::Sequence< beans::StringPair > aHeaders
             = xDav->getUserRequestHeaders( aPseudoURL, ucb::WebDAVHTTPMethod(0) );
 
-        for (css::beans::StringPair & aHeader : aHeaders)
+        for (const css::beans::StringPair & aHeader : aHeaders)
         {
             if ( aHeader.First == "User-Agent" )
             {
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 8edc8430f751..b2b38f74f852 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -751,13 +751,13 @@ bool OfaAutocorrReplacePage::FillItemSet( SfxItemSet* )
         std::vector<SvxAutocorrWord> aDeleteWords;
         std::vector<SvxAutocorrWord> aNewWords;
 
-        for (DoubleString & deleteEntry : rStringChangeList.aDeletedEntries)
+        for (const DoubleString & deleteEntry : rStringChangeList.aDeletedEntries)
         {
             SvxAutocorrWord aDeleteWord( deleteEntry.sShort, deleteEntry.sLong );
             aDeleteWords.push_back( aDeleteWord );
         }
 
-        for (DoubleString & newEntry : rStringChangeList.aNewEntries)
+        for (const DoubleString & newEntry : rStringChangeList.aNewEntries)
         {
             //fdo#67697 if the user data is set then we want to retain the
             //source formatting of the entry, so don't use the optimized
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 89c43731389a..d366fb1a90bc 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1914,7 +1914,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, weld::ToggleButton&
             OUString sGrfName;
             ScopedVclPtrInstance< VirtualDevice > pVD;
             size_t i = 0;
-            for (auto & grfName : aGrfNames)
+            for (const auto & grfName : aGrfNames)
             {
                 sGrfName = grfName;
                 OUString sItemId = "gallery" + OUString::number(i);
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx
index e81de3e07654..56f3f7fdb721 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -170,7 +170,7 @@ ColumnTypeParts lcl_getColumnTypeParts(const OUString& sFullTypeName)
         OUString sParamStr
             = sFullTypeName.copy(nParenPos + 1, sFullTypeName.indexOf(")") - nParenPos - 1);
         auto sParams = string::split(sParamStr, sal_Unicode(u','));
-        for (auto& sParam : sParams)
+        for (const auto& sParam : sParams)
         {
             parts.params.push_back(sParam.toInt32());
         }
@@ -197,7 +197,7 @@ void CreateStmtParser::parsePrimaryKeys(const OUString& sPrimaryPart)
         OUString sParamStr
             = sPrimaryPart.copy(nParenPos + 1, sPrimaryPart.lastIndexOf(")") - nParenPos - 1);
         auto sParams = string::split(sParamStr, sal_Unicode(u','));
-        for (auto& sParam : sParams)
+        for (const auto& sParam : sParams)
         {
             m_PrimaryKeys.push_back(sParam);
         }
@@ -207,7 +207,7 @@ void CreateStmtParser::parsePrimaryKeys(const OUString& sPrimaryPart)
 void CreateStmtParser::parseColumnPart(const OUString& sColumnPart)
 {
     auto sColumns = lcl_splitColumnPart(sColumnPart);
-    for (OUString& sColumn : sColumns)
+    for (const OUString& sColumn : sColumns)
     {
         if (sColumn.startsWithIgnoreAsciiCase("PRIMARY KEY"))
         {
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index dc5b51cc07ce..8c7a3e82778b 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -316,7 +316,7 @@ void HsqlImporter::importHsqlDatabase(weld::Window* pParent)
     }
 
     // schema
-    for (auto& sSql : statements)
+    for (const auto& sSql : statements)
     {
         Reference<XStatement> statement = m_rConnection->createStatement();
         try
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 8ccb6b01335f..93e81b595f65 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -310,7 +310,7 @@ void DesktopLOKTest::callbackImpl(int nType, const char* pPayload)
         boost::property_tree::ptree aTree;
         std::stringstream aStream(pPayload);
         boost::property_tree::read_json(aStream, aTree);
-        for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection"))
+        for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection"))
         {
             m_aSearchResultSelection.emplace_back(rValue.second.get<std::string>("rectangles").c_str());
             m_aSearchResultPart.push_back(std::atoi(rValue.second.get<std::string>("part").c_str()));
@@ -724,7 +724,7 @@ void DesktopLOKTest::testRowColumnHeaders()
     sal_Int32 nPrevious = 0;
     bool bFirstHeader = true;
     bool bNotEnoughHeaders = true;
-    for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
+    for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
     {
         sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
         OString aText(rValue.second.get<std::string>("text").c_str());
@@ -752,7 +752,7 @@ void DesktopLOKTest::testRowColumnHeaders()
     nPrevious = 0;
     bFirstHeader = true;
     bNotEnoughHeaders = true;
-    for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("columns"))
+    for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("columns"))
     {
         sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
         OString aText(rValue.second.get<std::string>("text").c_str());
@@ -803,7 +803,7 @@ void DesktopLOKTest::testHiddenRowHeaders()
     boost::property_tree::read_json(aStream, aTree);
     sal_Int32 nPrevious = 0;
     sal_Int32 nIndex = 0;
-    for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
+    for (const boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows"))
     {
         sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32();
 
@@ -1767,7 +1767,7 @@ void DesktopLOKTest::testRedlineWriter()
     // Make sure that pressing a key creates exactly one redline.
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("redlines").size());
 
-    for (boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines"))
+    for (const boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines"))
         // This failed with boost::property_tree::ptree_bad_path, as there were no description field.
         CPPUNIT_ASSERT_EQUAL(std::string("Insert \xE2\x80\x9Ct\xE2\x80\x9D"), rRedline.second.get<std::string>("description"));
             // U+201C LEFT DOUBLE QUOTATION MARK, U+201D RIGHT DOUBLE QUOTATION
@@ -1798,7 +1798,7 @@ void DesktopLOKTest::testRedlineCalc()
     // Make sure that pressing a key creates exactly one redline.
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("redlines").size());
 
-    for (boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines"))
+    for (const boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines"))
         // This failed with boost::property_tree::ptree_bad_path, as there were no description field.
         CPPUNIT_ASSERT_EQUAL(std::string("Cell B4 changed from '5' to 't'"), rRedline.second.get<std::string>("description"));
 }
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index af0a6d9ffd93..f3857d8cff57 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -744,7 +744,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
         aArgs[1].Name = "SynchronMode";
         aArgs[1].Value <<= true;
 
-        for (DispatchHolder & aDispatche : aDispatches)
+        for (const DispatchHolder & aDispatche : aDispatches)
         {
             Reference< XDispatch > xDispatch = aDispatche.xDispatch;
             Reference < XNotifyingDispatch > xDisp( xDispatch, UNO_QUERY );
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 1f5475f0c937..a0db3f4daaca 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -226,7 +226,7 @@ void PackageManagerImpl::initActivationLayer(
             }
 
             bool bShared = (m_context == "shared");
-            for (OUString & tempEntry : tempEntries)
+            for (const OUString & tempEntry : tempEntries)
             {
                 const MatchTempDir match( tempEntry );
                 if (std::none_of( id2temp.begin(), id2temp.end(), match ))
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 23b61e3cf1e1..5c7b9bd1f2e3 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -275,7 +275,7 @@ void PackageRegistryBackend::deleteUnusedFolders(
                     makeURLAppendSysPathSegment(sDataFolder, title));
         }
 
-        for (OUString & tempEntrie : tempEntries)
+        for (const OUString & tempEntrie : tempEntries)
         {
             if (std::find( usedFolders.begin(), usedFolders.end(), tempEntrie ) ==
                 usedFolders.end())
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c04f5c461dea..4b059576da9c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3698,13 +3698,13 @@ static int doc_getClipboard(LibreOfficeKitDocument* pThis,
     std::vector<OString> aMimeTypes;
     if (!pMimeTypes) // everything
     {
-        uno::Sequence< css::datatransfer::DataFlavor > flavors = xTransferable->getTransferDataFlavors();
+        const uno::Sequence< css::datatransfer::DataFlavor > flavors = xTransferable->getTransferDataFlavors();
         if (!flavors.getLength())
         {
             SetLastExceptionMsg("Flavourless selection");
             return 0;
         }
-        for (auto &it : flavors)
+        for (const auto &it : flavors)
             aMimeTypes.push_back(OUStringToOString(it.MimeType, RTL_TEXTENCODING_UTF8));
     }
     else
@@ -5256,10 +5256,10 @@ public:
     }
     virtual void Invoke() override
     {
-        css::uno::Sequence<OUString> aEvents =
+        const css::uno::Sequence<OUString> aEvents =
             comphelper::ProfileRecording::getRecordingAndClear();
         OStringBuffer aOutput;
-        for (auto &s : aEvents)
+        for (const auto &s : aEvents)
         {
             aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8));
             aOutput.append("\n");
@@ -5290,7 +5290,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
         const char *pOptions = getenv("SAL_LOK_OPTIONS");
         if (pOptions)
             aOpts = comphelper::string::split(OUString(pOptions, strlen(pOptions), RTL_TEXTENCODING_UTF8), ':');
-        for (auto &it : aOpts)
+        for (const auto &it : aOpts)
         {
             if (it == "unipoll")
                 bUnipoll = true;
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index d90d4e1c0f41..9d90e0c71b40 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -214,7 +214,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU
         if ( !aExtIdentifier.isEmpty() )
         {
             // scan extension identifier and try to match with our black list entries
-            for (OUString & i : m_aBlackList)
+            for (const OUString & i : m_aBlackList)
             {
                 utl::SearchParam param(i, utl::SearchParam::SearchType::Regexp);
                 utl::TextSearch  ts(param, LANGUAGE_DONTKNOW);
@@ -239,7 +239,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU
         // Try to use the folder name to match our black list
         // as some extensions don't provide an identifier in the
         // description.xml!
-        for (OUString & i : m_aBlackList)
+        for (const OUString & i : m_aBlackList)
         {
             utl::SearchParam param(i, utl::SearchParam::SearchType::Regexp);
             utl::TextSearch  ts(param, LANGUAGE_DONTKNOW);
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index f6e4d0c19b7c..5600de4619e9 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -399,7 +399,7 @@ extern "C" int unopkg_main()
 
         if ( subcmd_add || subCommand == "remove" )
         {
-            for (OUString & cmdPackage : cmdPackages)
+            for (const OUString & cmdPackage : cmdPackages)
             {
                 if (subcmd_add)
                 {
@@ -483,7 +483,7 @@ extern "C" int unopkg_main()
             {
                 //The user provided the names (ids or file names) of the extensions
                 //which shall be listed
-                for (OUString & cmdPackage : cmdPackages)
+                for (const OUString & cmdPackage : cmdPackages)
                 {
                     Reference<deployment::XPackage> extension;
                     try
@@ -531,7 +531,7 @@ extern "C" int unopkg_main()
                 vecExtUnaccepted, xExtensionManager->getExtensionsWithUnacceptedLicenses(
                     repository, xCmdEnv));
 
-            for (OUString & cmdPackage : cmdPackages)
+            for (const OUString & cmdPackage : cmdPackages)
             {
                 Reference<deployment::XPackage> extension;
                 try


More information about the Libreoffice-commits mailing list