summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMatthew Pottage <matthewpottage@invincitech.com>2014-12-22 09:20:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-07 15:34:46 +0000
commit1079ccf05b1441649a8232e2ed112e4fceed5943 (patch)
tree97d40adcbc59565f28b2e0eda8db137d47a7fa02 /sfx2
parent874734c95c087dcc5373599c6f0d8fe71008b00c (diff)
Completed TODO: simplify appending to sequence.
File sfx2/source/appl/appopen.cxx. Fixed by using std::vector instead of Sequence; Simplifying the code. Change-Id: Iecb45ba3429be86d03fad5275d0f0a92b659a542 Reviewed-on: https://gerrit.libreoffice.org/13605 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index b76bbb45e8da..27fefa9f6dc6 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -862,7 +862,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
else
{
// check for "internal" protocols that should not be forwarded to the system
- Sequence < OUString > aProtocols(2);
+ std::vector < OUString > aProtocols(2);
// add special protocols that always should be treated as internal
aProtocols[0] = "private:*";
@@ -883,16 +883,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
Sequence < OUString > aTmp;
aRet >>= aTmp;
- // todo: add operator+= to SequenceAsVector class and use SequenceAsVector for aProtocols
- sal_Int32 nLength = aProtocols.getLength();
- aProtocols.realloc( nLength+aTmp.getLength() );
- for ( sal_Int32 n=0; n<aTmp.getLength(); n++ )
- aProtocols[(++nLength)-1] = aTmp[n];
+ aProtocols.insert(aProtocols.end(),aTmp.begin(),aTmp.end());
}
}
bool bFound = false;
- for ( sal_Int32 nProt=0; nProt<aProtocols.getLength(); nProt++ )
+ for ( size_t nProt=0; nProt<aProtocols.size(); nProt++ )
{
WildCard aPattern(aProtocols[nProt]);
if ( aPattern.Matches( aURL.Complete ) )