diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-02 10:55:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-05 09:18:19 +0000 |
commit | bacfd2dc4cea1a5d87658ed8592116acd931e000 (patch) | |
tree | d22172a33fdd13a440b6882a28c23ea2d639bbad /sw/source/core/unocore/unochart.cxx | |
parent | 6281eb0e0792da0194c07da18296e94dd944b8e5 (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 'sw/source/core/unocore/unochart.cxx')
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 6aa5247a8c29..0960456b2f7d 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -56,6 +56,7 @@ #include <unocore.hrc> #include <docary.hxx> #include <comphelper/servicehelper.hxx> +#include <comphelper/string.hxx> #define SN_DATA_PROVIDER "com.sun.star.chart2.data.DataProvider" #define SN_DATA_SOURCE "com.sun.star.chart2.data.DataSource" @@ -475,7 +476,7 @@ static sal_Bool GetSubranges( const OUString &rRangeRepresentation, { sal_Bool bRes = sal_True; String aRangesStr( rRangeRepresentation ); - xub_StrLen nLen = aRangesStr.GetTokenCount( ';' ); + xub_StrLen nLen = comphelper::string::getTokenCount(aRangesStr, ';'); uno::Sequence< OUString > aRanges( nLen ); sal_Int32 nCnt = 0; @@ -1779,7 +1780,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const rtl::OUStri // multiple ranges are delimeted by a ';' like in // "Table1.A1:A4;Table1.C2:C5" the same table must be used in all ranges! - xub_StrLen nNumRanges = aRangeRepresentation.GetTokenCount( ';' ); + xub_StrLen nNumRanges = comphelper::string::getTokenCount(aRangeRepresentation, ';'); SwTable* pFirstFoundTable = 0; // to check that only one table will be used for (sal_uInt16 i = 0; i < nNumRanges; ++i) { @@ -1847,7 +1848,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const rtl::OUSt // multiple ranges are delimeted by a ' ' like in // "Table1.$A$1:.$A$4 Table1.$C$2:.$C$5" the same table must be used in all ranges! - xub_StrLen nNumRanges = aXMLRange.GetTokenCount( ' ' ); + xub_StrLen nNumRanges = comphelper::string::getTokenCount(aXMLRange, ' '); rtl::OUString aFirstFoundTable; // to check that only one table will be used for (sal_uInt16 i = 0; i < nNumRanges; ++i) { |