diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-19 15:11:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-19 19:28:11 +0200 |
commit | 8efd46ed867b66f9fbc31dbaa1d46bc91ea29ae2 (patch) | |
tree | eafc8ade307c5fe797fdddddfa6d9dc39c935b8a /desktop | |
parent | 9c10e29287740f473fa4f33ac6188b8c8543bfbb (diff) |
loplugin:constvars in cppuhelper..desktop
Change-Id: Iaf42114ab98875c4bc1545684f1893540b998ef2
Reviewed-on: https://gerrit.libreoffice.org/77723
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 12 | ||||
-rw-r--r-- | desktop/source/app/dispatchwatcher.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 2 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_backend.cxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 10 | ||||
-rw-r--r-- | desktop/source/migration/services/oo3extensionmigration.cxx | 4 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_app.cxx | 6 |
7 files changed, 19 insertions, 19 deletions
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 |