diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-18 21:03:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-19 21:11:02 +0000 |
commit | ca02d728082a86780d68ede7b9d565128dbc0434 (patch) | |
tree | 8c0a857ad73f89d592295f99e5f72a0c96e55e57 /basic/source/runtime | |
parent | e4ff699291ddab16d70aa9b11c717e34dfbe5414 (diff) |
remove [Byte]String::EraseAllChars
Diffstat (limited to 'basic/source/runtime')
-rw-r--r-- | basic/source/runtime/methods.cxx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 2123d940fd34..c67638839588 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -48,6 +48,7 @@ #include <tools/wldcrd.hxx> #include <i18npool/lang.h> #include <rtl/string.hxx> +#include <rtl/strbuf.hxx> #include "runtime.hxx" #include "sbunoobj.hxx" @@ -81,6 +82,8 @@ using namespace com::sun::star::io; using namespace com::sun::star::script; using namespace com::sun::star::frame; +#include <comphelper/string.hxx> + #include "stdobj.hxx" #include <basic/sbstdobj.hxx> #include "rtlproto.hxx" @@ -124,10 +127,22 @@ Reference< XModel > getDocumentModel( StarBASIC* ); static void FilterWhiteSpace( String& rStr ) { - rStr.EraseAllChars( ' ' ); - rStr.EraseAllChars( '\t' ); - rStr.EraseAllChars( '\n' ); - rStr.EraseAllChars( '\r' ); + if (!rStr.Len()) + return; + + rtl::OUStringBuffer aRet(rStr); + + for (xub_StrLen i = 0; i < rStr.Len(); ++i) + { + sal_Unicode cChar = rStr.GetChar(i); + if ((cChar != ' ') && (cChar != '\t') && + (cChar != '\n') && (cChar != '\r')) + { + aRet.append(cChar); + } + } + + rStr = aRet.makeStringAndClear(); } static long GetDayDiff( const Date& rDate ) |