INTEGRATION: CWS dba30c (1.5.20); FILE MERGED

2008/05/13 06:53:56 fs 1.5.20.1: joining changes from CWS odbmacros3 to CWS dba30c
2008/04/16 20:54:43 fs 1.5.8.1: searchAndReplaceAllAsciiWithAscii
This commit is contained in:
Rüdiger Timm 2008-06-06 13:36:31 +00:00
parent 9f32a7e47b
commit 3b36ae1376

View file

@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: string.cxx,v $
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* This file is part of OpenOffice.org.
*
@ -55,7 +55,28 @@ rtl::OUString searchAndReplaceAsciiL(
return n == -1 ? source : source.replaceAt(n, fromLength, to);
}
COMPHELPER_DLLPUBLIC ::rtl::OUString& searchAndReplaceAsciiI(
::rtl::OUString searchAndReplaceAllAsciiWithAscii(
const ::rtl::OUString& _source, const sal_Char* _from, const sal_Char* _to,
const sal_Int32 _beginAt )
{
sal_Int32 fromLength = strlen( _from );
sal_Int32 n = _source.indexOfAsciiL( _from, fromLength, _beginAt );
if ( n == -1 )
return _source;
::rtl::OUString dest( _source );
::rtl::OUString to( ::rtl::OUString::createFromAscii( _to ) );
do
{
dest = dest.replaceAt( n, fromLength, to );
n = dest.indexOfAsciiL( _from, fromLength, n + to.getLength() );
}
while ( n != -1 );
return dest;
}
::rtl::OUString& searchAndReplaceAsciiI(
::rtl::OUString & _source, sal_Char const * _asciiPattern, ::rtl::OUString const & _replace,
sal_Int32 _beginAt, sal_Int32 * _replacedAt )
{