diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-24 23:40:25 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-25 09:08:14 +0100 |
commit | 794d71c4e990a24539a8dad3d960169538a4b0d4 (patch) | |
tree | 9c68d989ae4c0ddbb8cc7dbe73a1aa2ea3bd22aa /sw | |
parent | 325ecb1d0511c6c02d863eb760c2d0521f0b6c19 (diff) |
Use isEmpty and endsWith
The isEmpty could be redundant, since the first test for length in
the old code seemed to be just a pre-condition for evaluating the
expressions in the second one.
Change-Id: I0d1838d5eb143196a0d7be0cbadf9f0a59cff71b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/uibase/uno/unomailmerge.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/uibase/uno/unomailmerge.cxx b/sw/source/core/uibase/uno/unomailmerge.cxx index 63d819951572..e72c80a190d9 100644 --- a/sw/source/core/uibase/uno/unomailmerge.cxx +++ b/sw/source/core/uibase/uno/unomailmerge.cxx @@ -723,9 +723,8 @@ uno::Any SAL_CALL SwXMailMerge::execute( aURLObj.SetSmartURL( aCurOutputURL ); OUString aPath = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); - OUString aDelim = OUString(INET_PATH_TOKEN); - if (aPath.getLength() >= aDelim.getLength() && - aPath.copy( aPath.getLength() - aDelim.getLength() ) != aDelim) + const OUString aDelim = OUString(INET_PATH_TOKEN); + if (!aPath.isEmpty() && !aPath.endsWith(aDelim)) aPath += aDelim; if (bCurFileNameFromColumn) pMgr->SetEMailColumn( aCurFileNamePrefix ); |