summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-02 10:55:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-05 09:18:19 +0000
commitbacfd2dc4cea1a5d87658ed8592116acd931e000 (patch)
treed22172a33fdd13a440b6882a28c23ea2d639bbad /extensions
parent6281eb0e0792da0194c07da18296e94dd944b8e5 (diff)
add a comphelper::string::getTokenCount
suitable for conversion from [Byte]String::GetTokenCount converted low-hanging variants to rtl::O[UString]::getToken loops added unit test
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/plugin/base/manager.cxx6
-rw-r--r--extensions/source/plugin/util/makefile.mk1
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx5
3 files changed, 8 insertions, 4 deletions
diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx
index ce330feea025..9d1b8fbc1258 100644
--- a/extensions/source/plugin/base/manager.cxx
+++ b/extensions/source/plugin/base/manager.cxx
@@ -41,6 +41,8 @@
#include <cstdarg>
+#include <comphelper/string.hxx>
+
#include "plugin/impl.hxx"
#include "osl/mutex.hxx"
@@ -85,10 +87,10 @@ const Sequence< ::rtl::OUString >& PluginManager::getAdditionalSearchPaths()
String aPluginPath( aOptions.GetPluginPath() );
if( aPluginPath.Len() )
{
- sal_uInt16 nPaths = aPluginPath.GetTokenCount( ';' );
+ sal_Int32 nPaths = comphelper::string::getTokenCount(aPluginPath, ';');
aPaths.realloc( nPaths );
for( sal_uInt16 i = 0; i < nPaths; i++ )
- aPaths.getArray()[i] = aPluginPath.GetToken( i, ';' );
+ aPaths.getArray()[i] = comphelper::string::getToken(aPluginPath, i, ';');
}
}
diff --git a/extensions/source/plugin/util/makefile.mk b/extensions/source/plugin/util/makefile.mk
index 7b7d047a1779..1e6dda1e5ca0 100644
--- a/extensions/source/plugin/util/makefile.mk
+++ b/extensions/source/plugin/util/makefile.mk
@@ -80,6 +80,7 @@ SHL1STDLIBS+= \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
+ $(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB) \
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index e87599c1ceb5..9fe02ca543a9 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/inspection/PropertyControlType.hpp>
/** === end UNO includes === **/
+#include <comphelper/string.hxx>
#include <rtl/math.hxx>
#include <sfx2/objsh.hxx>
@@ -1172,7 +1173,7 @@ namespace pcr
//..............................................................
StlSyntaxSequence< ::rtl::OUString > lcl_convertMultiLineToList( const String& _rCompsedTextWithLineBreaks )
{
- xub_StrLen nLines( _rCompsedTextWithLineBreaks.GetTokenCount( '\n' ) );
+ xub_StrLen nLines( comphelper::string::getTokenCount(_rCompsedTextWithLineBreaks, '\n') );
StlSyntaxSequence< ::rtl::OUString > aStrings( nLines );
StlSyntaxSequence< ::rtl::OUString >::iterator stringItem = aStrings.begin();
for ( xub_StrLen token = 0; token < nLines; ++token, ++stringItem )
@@ -1271,7 +1272,7 @@ namespace pcr
if (aStr.Len()>0)
{
long nDiff=0;
- sal_Int32 nCount = aStr.GetTokenCount('\n');
+ sal_Int32 nCount = comphelper::string::getTokenCount(aStr, '\n');
String aInput = aStr.GetToken(0,'\n' );