diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-09 14:02:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-11 14:46:44 +0100 |
commit | 38fea22431aeddbaf286a27c228be570938579af (patch) | |
tree | 98125f517563d28ad69a02c881f64082865575fa | |
parent | b3473b9d227df79a383d09c2f2ebf6d6eebf3697 (diff) |
removeTrailingChars is the same as stripEnd
Change-Id: I3fc618f886082e08e9baae3ae09017f653e729bd
-rw-r--r-- | comphelper/inc/comphelper/string.hxx | 3 | ||||
-rw-r--r-- | comphelper/source/misc/string.cxx | 12 | ||||
-rw-r--r-- | sc/source/core/data/dputil.cxx | 2 |
3 files changed, 1 insertions, 16 deletions
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx index 499e8504dd09..8a763e85e2f8 100644 --- a/comphelper/inc/comphelper/string.hxx +++ b/comphelper/inc/comphelper/string.hxx @@ -318,9 +318,6 @@ COMPHELPER_DLLPUBLIC inline rtl::OUStringBuffer& padToLength( return detail::padToLength(rBuffer, nLength, cFill); } -COMPHELPER_DLLPUBLIC rtl::OUString removeTrailingChars( - const rtl::OUString& rStr, sal_Unicode cChar); - /** Convert a sequence of strings to a single comma separated string. Note that no escaping of commas or anything fancy is done. diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 08aa392dcd82..84a5c9c86c19 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -246,18 +246,6 @@ sal_uInt32 decimalStringToNumber( return result; } -rtl::OUString removeTrailingChars(const rtl::OUString& rStr, sal_Unicode cChar) -{ - sal_Int32 n = rStr.getLength(); - const sal_Unicode* p = &rStr.getStr()[n-1]; // last char - while (n > 0 && *p == cChar) - { - --p; - --n; - } - return rStr.copy(0, n); -} - using namespace ::com::sun::star; // convert between sequence of string and comma separated string diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx index 0e1803d64bc2..269148b20061 100644 --- a/sc/source/core/data/dputil.cxx +++ b/sc/source/core/data/dputil.cxx @@ -85,7 +85,7 @@ bool ScDPUtil::isDuplicateDimension(const rtl::OUString& rName) rtl::OUString ScDPUtil::getSourceDimensionName(const rtl::OUString& rName) { - return comphelper::string::removeTrailingChars(rName, sal_Unicode('*')); + return comphelper::string::stripEnd(rName, '*'); } rtl::OUString ScDPUtil::createDuplicateDimensionName(const rtl::OUString& rOriginal, size_t nDupCount) |