summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/uibase/uno/unomailmerge.cxx5
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 );