diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-04 15:26:46 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-10 22:03:32 +0200 |
commit | aa116a17dc92c722a39cd434f63c9aafa08886db (patch) | |
tree | 60dde7f42a03ed096db7b2463be9ce872ae4cc94 /sfx2 | |
parent | f13a7100cfa1d76a1a27ffb9e986d627df20d4c0 (diff) |
Avoid getTokenCount/getToken to get last token
Change-Id: I19de49e64746a6632c56c0ddb0a0c455c97be414
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 432db5e18ebb..f76248fdced3 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -43,7 +43,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> -#include <comphelper/string.hxx> #include <comphelper/synchronousdispatch.hxx> #include <vcl/wrkwin.hxx> @@ -609,8 +608,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) else if ( nSID == SID_OPENTEMPLATE ) { aPath = SvtPathOptions().GetTemplatePath(); - sal_Int32 nTokenCount = comphelper::string::getTokenCount(aPath, ';'); - aPath = aPath.getToken( nTokenCount ? ( nTokenCount - 1 ) : 0 , ';' ); + if (!aPath.isEmpty()) // if not empty then get last token + aPath = aPath.copy(aPath.lastIndexOf(';')+1); // lastIndexOf+copy works whether separator (';') is there or not } sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG; |