summaryrefslogtreecommitdiff
path: root/desktop/source/app
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-05 22:29:17 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-05 23:58:20 +0100
commitcbc58ebf14bd77a5f9297b7f2948952ed22460e7 (patch)
tree41a7966a0c92a6556de12bbd7a1914c6037801dd /desktop/source/app
parentba490001c2d82c1172854ca16d7099b19e29cb60 (diff)
Use for-range loops in desktop (part1)
+ remove some useless typedef + some reindent Change-Id: Ic1e445a7096b1663ca8cbc58c40bb8f7af0c70e1 Reviewed-on: https://gerrit.libreoffice.org/50787 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'desktop/source/app')
-rw-r--r--desktop/source/app/app.cxx5
-rw-r--r--desktop/source/app/appinit.cxx5
-rw-r--r--desktop/source/app/cmdlineargs.cxx5
-rw-r--r--desktop/source/app/officeipcthread.cxx20
-rw-r--r--desktop/source/app/updater.cxx6
5 files changed, 17 insertions, 24 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 77152718287e..175a12304b26 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1090,10 +1090,9 @@ void restartOnMac(bool passArguments) {
}
}
std::vector< char const * > argPtrs;
- for (std::vector< OString >::iterator i(args.begin()); i != args.end();
- ++i)
+ for (auto const& elem : args)
{
- argPtrs.push_back(i->getStr());
+ argPtrs.push_back(elem.getStr());
}
argPtrs.push_back(nullptr);
execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0]));
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 2e302be587a3..2363b36722f0 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -116,10 +116,9 @@ void Desktop::RegisterServices(Reference< XComponentContext > const & context)
}
std::vector< OUString > const & conDcp = rCmdLine.GetAccept();
- for (std::vector< OUString >::const_iterator i(conDcp.begin());
- i != conDcp.end(); ++i)
+ for (auto const& elem : conDcp)
{
- createAcceptor(*i);
+ createAcceptor(elem);
}
configureUcb();
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 3317189531b0..e67f204866e9 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -62,10 +62,9 @@ std::vector< OUString > translateExternalUris(
std::vector< OUString > const & input)
{
std::vector< OUString > t;
- for (std::vector< OUString >::const_iterator i(input.begin());
- i != input.end(); ++i)
+ for (auto const& elem : input)
{
- t.push_back(translateExternalUris(*i));
+ t.push_back(translateExternalUris(elem));
}
return t;
}
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 72aba80344ec..b70e3d5396c0 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -974,20 +974,18 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
// handle request for acceptor
std::vector< OUString > const & accept = aCmdLineArgs->GetAccept();
- for (std::vector< OUString >::const_iterator i(accept.begin());
- i != accept.end(); ++i)
+ for (auto const& elem : accept)
{
ApplicationEvent* pAppEvent = new ApplicationEvent(
- ApplicationEvent::Type::Accept, *i);
+ ApplicationEvent::Type::Accept, elem);
ImplPostForeignAppEvent( pAppEvent );
}
// handle acceptor removal
std::vector< OUString > const & unaccept = aCmdLineArgs->GetUnaccept();
- for (std::vector< OUString >::const_iterator i(unaccept.begin());
- i != unaccept.end(); ++i)
+ for (auto const& elem : unaccept)
{
ApplicationEvent* pAppEvent = new ApplicationEvent(
- ApplicationEvent::Type::Unaccept, *i);
+ ApplicationEvent::Type::Unaccept, elem);
ImplPostForeignAppEvent( pAppEvent );
}
@@ -1233,10 +1231,9 @@ static void AddToDispatchList(
const OUString& aParam,
const OUString& aFactory )
{
- for (std::vector< OUString >::const_iterator i(aRequestList.begin());
- i != aRequestList.end(); ++i)
+ for (auto const& request : aRequestList)
{
- rDispatchList.push_back({nType, *i, cwdUrl, aParam, aFactory});
+ rDispatchList.push_back({nType, request, cwdUrl, aParam, aFactory});
}
}
@@ -1303,10 +1300,9 @@ static void AddConversionsToDispatchList(
if( !rImgOut.trim().isEmpty() )
aParam += "|" + aImgOut;
- for (std::vector< OUString >::const_iterator i(rRequestList.begin());
- i != rRequestList.end(); ++i)
+ for (auto const& request : rRequestList)
{
- rDispatchList.push_back({nType, *i, cwdUrl, aParam, rFactory});
+ rDispatchList.push_back({nType, request, cwdUrl, aParam, rFactory});
}
}
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 867b5f737329..e90cf3bd1991 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -478,11 +478,11 @@ update_info parse_response(const std::string& rResponse)
aUpdateInfo.aUpdateFile = parse_update_file(aUpdateNode);
std::vector<orcus::pstring> aLanguages = aLanguageNode.keys();
- for (auto itr = aLanguages.begin(), itrEnd = aLanguages.end(); itr != itrEnd; ++itr)
+ for (auto const& language : aLanguages)
{
language_file aLanguageFile;
- auto aLangEntry = aLanguageNode.child(*itr);
- aLanguageFile.aLangCode = toOUString(itr->str());
+ auto aLangEntry = aLanguageNode.child(language);
+ aLanguageFile.aLangCode = toOUString(language.str());
aLanguageFile.aUpdateFile = parse_update_file(aLangEntry);
aUpdateInfo.aLanguageFiles.push_back(aLanguageFile);
}