diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-20 20:03:15 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-22 18:42:35 +0200 |
commit | 6ffdc88e79904882e319bdd0b901e7491abae0b3 (patch) | |
tree | 5cb0257a03987f962668655af536a05ad72f8882 /shell | |
parent | 803a6ccb774ff6dc67ca697459d6679e4bc9604f (diff) |
Simplify Sequence iterations in shell..svgio
Use range-based loops, STL and comphelper functions
Change-Id: I612d36abcc09a91c60f7212de6747a1a1bdcfc69
Reviewed-on: https://gerrit.libreoffice.org/76056
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/cmdmail/cmdmailsuppl.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index 6a076a632806..b4e4322a2ff2 100644 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -237,20 +237,18 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM // Append carbon copy recipients set in the message Sequence< OUString > aStringList = xSimpleMailMessage->getCcRecipient(); - sal_Int32 n, nmax = aStringList.getLength(); - for ( n = 0; n < nmax; n++ ) + for ( const auto& rString : aStringList ) { aBuffer.append(" --cc "); - appendShellWord(aBuffer, aStringList[n], false); + appendShellWord(aBuffer, rString, false); } // Append blind carbon copy recipients set in the message aStringList = xSimpleMailMessage->getBccRecipient(); - nmax = aStringList.getLength(); - for ( n = 0; n < nmax; n++ ) + for ( const auto& rString : aStringList ) { aBuffer.append(" --bcc "); - appendShellWord(aBuffer, aStringList[n], false); + appendShellWord(aBuffer, rString, false); } // Append subject if set in the message @@ -262,11 +260,10 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM // Append attachments set in the message aStringList = xSimpleMailMessage->getAttachement(); - nmax = aStringList.getLength(); - for ( n = 0; n < nmax; n++ ) + for ( const auto& rString : aStringList ) { OUString aSystemPath; - if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(aStringList[n], aSystemPath) ) + if ( FileBase::E_None == FileBase::getSystemPathFromFileURL(rString, aSystemPath) ) { aBuffer.append(" --attach "); appendShellWord(aBuffer, aSystemPath, true); |