diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-06-24 11:54:40 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-06-30 23:00:12 +0200 |
commit | 4db69a8343ae7a26a827ec43225922c01ac2b5ef (patch) | |
tree | 4fa8ca655e0099e649048230da39739d0953f017 /sw | |
parent | 21c839d6f69fbddb7850444187eecec1f4f2f27f (diff) |
Avoid getTokenCount()
Change-Id: I2a1b034ba6b587664ce94560e88af5acb860788d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 710846dc9f7c..97636e64efff 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/awt/XTextLayoutConstrains.hpp> -#include <comphelper/string.hxx> #include <hintids.hxx> #include <o3tl/any.hxx> #include <vcl/svapp.hxx> @@ -144,9 +143,21 @@ static void lcl_html_outEvents( SvStream& rStrm, continue; OUString sListener( pDescs[i].ListenerType ); - sal_Int32 nTok = comphelper::string::getTokenCount(sListener, '.'); - if( nTok ) - sListener = sListener.getToken( nTok-1, '.' ); + if (!sListener.isEmpty()) + { + const sal_Int32 nIdx { sListener.lastIndexOf('.')+1 }; + if (nIdx>0) + { + if (nIdx<sListener.getLength()) + { + sListener = sListener.copy(nIdx); + } + else + { + sListener.clear(); + } + } + } OUString sMethod( pDescs[i].EventMethod ); const sal_Char *pOpt = nullptr; |