From eaef61939bbefa059749ad7605dbe515d12cc265 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 10 Sep 2013 09:51:45 +0200 Subject: convert editeng/source/uno/*.cxx from String to OUString Change-Id: If709d2ce0aea90133b2b243bb9ecb77d64ca065b --- editeng/source/uno/unoedprx.cxx | 31 +++++++++++++++---------------- editeng/source/uno/unofield.cxx | 6 +++--- editeng/source/uno/unotext.cxx | 6 +++--- 3 files changed, 21 insertions(+), 22 deletions(-) (limited to 'editeng') 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; -- cgit