summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-10 09:51:45 +0200
committerNoel Grandin <noel@peralex.com>2013-09-11 09:45:37 +0200
commiteaef61939bbefa059749ad7605dbe515d12cc265 (patch)
treea6eea155de40b1e049905398af02a11b903f9a3f /editeng
parent94be56921f5bb80a1f90cc24ee87268754e8d508 (diff)
convert editeng/source/uno/*.cxx from String to OUString
Change-Id: If709d2ce0aea90133b2b243bb9ecb77d64ca065b
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/uno/unoedprx.cxx31
-rw-r--r--editeng/source/uno/unofield.cxx6
-rw-r--r--editeng/source/uno/unotext.cxx6
3 files changed, 21 insertions, 22 deletions
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 722c6b555312..c8c5398b44ed 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -472,7 +472,7 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
::std::swap( aStartIndex, aEndIndex );
}
- String sStr = mrTextForwarder->GetText( MakeEESelection(aStartIndex, aEndIndex) );
+ OUString sStr = mrTextForwarder->GetText( MakeEESelection(aStartIndex, aEndIndex) );
// trim field text, if necessary
if( aStartIndex.InField() )
@@ -481,15 +481,15 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
aStartIndex.GetFieldOffset() <= USHRT_MAX,
"SvxAccessibleTextIndex::GetText: index value overflow");
- sStr.Erase(0, static_cast< sal_uInt16 > (aStartIndex.GetFieldOffset()) );
+ sStr = sStr.copy( aStartIndex.GetFieldOffset() );
}
if( aEndIndex.InField() && aEndIndex.GetFieldOffset() )
{
- DBG_ASSERT(sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) >= 0 &&
- sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) <= USHRT_MAX,
+ DBG_ASSERT(sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) >= 0 &&
+ sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) <= USHRT_MAX,
"SvxAccessibleTextIndex::GetText: index value overflow");
- sStr = sStr.Copy(0, static_cast< sal_uInt16 > (sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset())) );
+ sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) );
}
EBulletInfo aBulletInfo1 = GetBulletInfo( aStartIndex.GetParagraph() );
@@ -498,13 +498,13 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
if( aStartIndex.InBullet() )
{
// prepend leading bullet
- String sBullet = aBulletInfo1.aText;
+ OUString sBullet = aBulletInfo1.aText;
DBG_ASSERT(aStartIndex.GetBulletOffset() >= 0 &&
aStartIndex.GetBulletOffset() <= USHRT_MAX,
"SvxAccessibleTextIndex::GetText: index value overflow");
- sBullet.Erase(0, static_cast< sal_uInt16 > (aStartIndex.GetBulletOffset()) );
+ sBullet = sBullet.copy( aStartIndex.GetBulletOffset() );
sBullet += sStr;
sStr = sBullet;
@@ -515,26 +515,25 @@ OUString SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
// append trailing bullet
sStr += aBulletInfo2.aText;
- DBG_ASSERT(sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
- sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
+ DBG_ASSERT(sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
+ sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
"SvxAccessibleTextIndex::GetText: index value overflow");
- sStr = sStr.Copy(0, static_cast< sal_uInt16 > (sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) );
+ sStr = sStr.copy(0, sStr.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) );
}
else if( aStartIndex.GetParagraph() != aEndIndex.GetParagraph() &&
HaveTextBullet( aEndIndex.GetParagraph() ) )
{
- String sBullet = aBulletInfo2.aText;
+ OUString sBullet = aBulletInfo2.aText;
- DBG_ASSERT(sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
- sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
+ DBG_ASSERT(sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) >= 0 &&
+ sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX,
"SvxAccessibleTextIndex::GetText: index value overflow");
- sBullet = sBullet.Copy(0, static_cast< sal_uInt16 > (sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) );
+ sBullet = sBullet.copy(0, sBullet.getLength() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) );
// insert bullet
- sStr.Insert( sBullet,
- static_cast< sal_uInt16 > (GetTextLen(aStartIndex.GetParagraph()) - aStartIndex.GetIndex()) );
+ sStr = sStr.replaceAt( GetTextLen(aStartIndex.GetParagraph()) - aStartIndex.GetIndex(), 0, sBullet );
}
return sStr;
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index aef8c65a28a9..f68419d7a7c2 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -448,9 +448,9 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw()
case text::textfield::Type::AUTHOR:
{
OUString aContent;
- String aFirstName;
- String aLastName;
- String aEmpty;
+ OUString aFirstName;
+ OUString aLastName;
+ OUString aEmpty;
// do we have CurrentPresentation given?
// mimic behaviour of writer, which means:
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index f04fa5565b3e..eb906110d4c1 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -392,7 +392,7 @@ void SAL_CALL SvxUnoTextRangeBase::setString(const OUString& aString)
{
CheckSelection( maSelection, pForwarder );
- String aConverted(convertLineEnd(aString, LINEEND_LF)); // Simply count the number of line endings
+ OUString aConverted(convertLineEnd(aString, LINEEND_LF)); // Simply count the number of line endings
pForwarder->QuickInsertText( aConverted, maSelection );
mpEditSource->UpdateData();
@@ -402,7 +402,7 @@ void SAL_CALL SvxUnoTextRangeBase::setString(const OUString& aString)
//! on QuickInsertText...
CollapseToStart();
- sal_uInt16 nLen = aConverted.Len();
+ sal_uInt16 nLen = aConverted.getLength();
if (nLen)
GoRight( nLen, sal_True );
}
@@ -1891,7 +1891,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text
if( bAbsorb )
{
- const String aEmpty;
+ const OUString aEmpty;
pForwarder->QuickInsertText( aEmpty, aRange );
aRange.nEndPos = aRange.nStartPos;