Kaydet (Commit) 96ed67aa authored tarafından gerhard oettl's avatar gerhard oettl Kaydeden (comit) Caolán McNamara

rtl::OUString to OUString clean up

unsing rtl::OUString, etc clauses had to be reinserted in
sw/qa/extras/rtfexport/rtfexport.cxx to pass the test

Change-Id: I3767ea89c8cfd9afe2dc8a80e5c7284be9d1cf57
Reviewed-on: https://gerrit.libreoffice.org/926Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3149d338
......@@ -37,6 +37,10 @@
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
using rtl::OString;
using rtl::OUString;
using rtl::OUStringBuffer;
class Test : public SwModelTestBase
{
public:
......
......@@ -551,7 +551,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
// Don't show the paragraph mark for collapsed paragraphs, when they are hidden
if ( EmptyHeight( ) > 1 )
{
const rtl::OUString aTmp( CH_PAR );
const OUString aTmp( CH_PAR );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
aDrawInf.SetLeft( rRect.Left() );
aDrawInf.SetRight( rRect.Right() );
......
......@@ -823,7 +823,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
}
// check if char fits into rectangle
const rtl::OUString aTmp( cChar );
const OUString aTmp( cChar );
aFontSize = rInf.GetTxtSize( aTmp ).SvLSize();
while ( aFontSize.Width() > nMaxWidth )
{
......@@ -1100,7 +1100,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
if(pFieldmark) {
OSL_TRACE("Found Fieldmark");
#if OSL_DEBUG_LEVEL > 1
rtl::OUString str = pFieldmark->ToString( );
OUString str = pFieldmark->ToString( );
fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) );
#endif
}
......@@ -1123,7 +1123,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
SwTxtAttr* pTxtAttr = pNd->GetTxtAttrForCharAt(nEndIdx, RES_TXTATR_FIELD);
const SwFmtFld& rPostItField = pTxtAttr->GetFld();
// Look up the author name
const rtl::OUString& rAuthor = rPostItField.GetFld()->GetPar1();
const OUString& rAuthor = rPostItField.GetFld()->GetPar1();
sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor);
pOutDev->SetFillColor( SwPostItMgr::GetColorLight(nIndex) );
pOutDev->SetLineColor( SwPostItMgr::GetColorAnchor(nIndex) );
......@@ -1636,7 +1636,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
else if( !pTempList && nPos < pOldSmartTagList->Count() && nListPos < nIdx && aTxt.Len() )
{
pTempList = new SwWrongList( WRONGLIST_SMARTTAG );
pTempList->Insert( rtl::OUString(), 0, 0, aTxt.Len(), 0 );
pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 );
((SwTxtPaintInfo*)pInf)->SetSmartTags( pTempList );
}
else
......@@ -1652,7 +1652,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
else if( !pTempList && nPos < pOldGrammarCheckList->Count() && nListPos < nIdx && aTxt.Len() )
{
pTempList = new SwWrongList( WRONGLIST_GRAMMAR );
pTempList->Insert( rtl::OUString(), 0, 0, aTxt.Len(), 0 );
pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 );
((SwTxtPaintInfo*)pInf)->SetGrammarCheckList( pTempList );
}
else
......
......@@ -684,7 +684,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
case CHAR_HARDBLANK:
case CHAR_HARDHYPHEN:
{
rtl::OUString sTmp( cChar );
OUString sTmp( cChar );
SwDrawTextInfo aDrawInf( const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()),
*pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311
nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
......@@ -934,7 +934,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
else if ( cChar == CH_TAB )
{
// tab receives width of one space
rtl::OUString sTmp( CH_BLANK );
OUString sTmp( CH_BLANK );
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 );
nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
nIdx++;
......@@ -943,7 +943,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
++nIdx;
else if ( cChar == CHAR_HARDBLANK || cChar == CHAR_HARDHYPHEN )
{
rtl::OUString sTmp( cChar );
OUString sTmp( cChar );
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 );
nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
nIdx++;
......
......@@ -243,7 +243,7 @@ sal_Bool SwBlankPortion::GetExpTxt( const SwTxtSizeInfo&, XubString &rTxt ) cons
void SwBlankPortion::HandlePortion( SwPortionHandler& rPH ) const
{
rtl::OUString aString( cChar );
OUString aString( cChar );
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......
......@@ -133,7 +133,7 @@ KSHORT SwFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
!rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() )
{
if( !nViewWidth )
pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width();
pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width();
}
else
pThis->nViewWidth = 0;
......
......@@ -92,7 +92,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf )
&& ' ' != rInf.GetChar( rInf.GetIdx() - 1 )
&& ( !rInf.GetLast() || !rInf.GetLast()->IsBreakPortion() ) )
{
SetBlankWidth( rInf.GetTxtSize(rtl::OUString(' ')).Width() );
SetBlankWidth( rInf.GetTxtSize(OUString(' ')).Width() );
SetLen( 1 );
}
......
......@@ -112,7 +112,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const
#endif
if( 1 == GetLen() )
{
rtl::OUString aBullet( CH_BULLET );
OUString aBullet( CH_BULLET );
SwPosSize aBulletSize( rInf.GetTxtSize( aBullet ) );
Point aPos( rInf.GetPos() );
aPos.X() += (Width()/2) - (aBulletSize.Width()/2);
......
......@@ -1821,7 +1821,7 @@ sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
* character has to be checked because a ctl portion only contains one
* script, see NewTxtPortion
*************************************************************************/
bool SwScriptInfo::IsArabicText( const rtl::OUString& rTxt, sal_Int32 nStt, sal_Int32 nLen )
bool SwScriptInfo::IsArabicText( const OUString& rTxt, sal_Int32 nStt, sal_Int32 nLen )
{
using namespace ::com::sun::star::i18n;
static ScriptTypeList typeList[] = {
......@@ -2034,7 +2034,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo
return true;
}
sal_Int32 SwScriptInfo::ThaiJustify( const rtl::OUString& rTxt, sal_Int32* pKernArray,
sal_Int32 SwScriptInfo::ThaiJustify( const OUString& rTxt, sal_Int32* pKernArray,
sal_Int32* pScrArray, sal_Int32 nStt,
sal_Int32 nLen, sal_Int32 nNumberOfBlanks,
long nSpaceAdd )
......
......@@ -328,14 +328,14 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
sal_uInt8 nTmp = SW_SCRIPTS;
if( pBracket->cPre > 255 )
{
String aTxt = rtl::OUString(pBracket->cPre);
String aTxt = OUString(pBracket->cPre);
nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
}
pBracket->nPreScript = nTmp;
nTmp = SW_SCRIPTS;
if( pBracket->cPost > 255 )
{
String aTxt = rtl::OUString(pBracket->cPost);
String aTxt = OUString(pBracket->cPost);
nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
}
pBracket->nPostScript = nTmp;
......@@ -428,7 +428,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi
pBracket->nHeight = 0;
if( pBracket->cPre )
{
rtl::OUString aStr( pBracket->cPre );
OUString aStr( pBracket->cPre );
sal_uInt8 nActualScr = pTmpFnt->GetActual();
if( SW_SCRIPTS > pBracket->nPreScript )
pTmpFnt->SetActual( pBracket->nPreScript );
......@@ -453,7 +453,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi
pBracket->nPreWidth = 0;
if( pBracket->cPost )
{
rtl::OUString aStr( pBracket->cPost );
OUString aStr( pBracket->cPost );
if( SW_SCRIPTS > pBracket->nPostScript )
pTmpFnt->SetActual( pBracket->nPostScript );
SwFontSave aSave( rInf, pTmpFnt );
......
......@@ -70,7 +70,7 @@ KSHORT SwIsoRefPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
!rInf.GetOpt().IsReadonly() && !rInf.GetOpt().IsPagePreview() )
{
if( !nViewWidth )
pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width();
pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width();
}
else
pThis->nViewWidth = 0;
......
......@@ -79,7 +79,7 @@ void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.OnWin() && rInf.GetOpt().IsParagraph() )
{
SwDefFontSave aSave( rInf );
const rtl::OUString aTmp( CH_PAR );
const OUString aTmp( CH_PAR );
rInf.DrawText( aTmp, *this );
}
}
......@@ -588,7 +588,7 @@ sal_Bool SwControlCharPortion::Format( SwTxtFormatInfo &rInf )
KSHORT SwControlCharPortion::GetViewWidth( const SwTxtSizeInfo& rInf ) const
{
if( !mnViewWidth )
mnViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width();
mnViewWidth = rInf.GetTxtSize(OUString(' ')).Width();
return mnViewWidth;
}
......
......@@ -72,7 +72,7 @@ KSHORT SwIsoToxPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
!rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() )
{
if( !nViewWidth )
pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width();
pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width();
}
else
pThis->nViewWidth = 0;
......
......@@ -298,7 +298,7 @@ static SwFldPortion * lcl_NewMetaPortion(SwTxtAttr & rHint, const bool bPrefix)
{
::sw::Meta *const pMeta(
static_cast<SwFmtMeta &>(rHint.GetAttr()).GetMeta() );
::rtl::OUString fix;
OUString fix;
::sw::MetaField *const pField( dynamic_cast< ::sw::MetaField * >(pMeta) );
OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?");
if (pField)
......
......@@ -1517,7 +1517,7 @@ sal_Bool SwQuoVadisPortion::Format( SwTxtFormatInfo &rInf )
if( bFull )
{
// zweiter Versuch, wir kuerzen den String:
aExpand = rtl::OUString("...");
aExpand = OUString("...");
bFull = SwFldPortion::Format( rInf );
SetLen( 0 );
if( bFull )
......@@ -1582,7 +1582,7 @@ void SwQuoVadisPortion::Paint( const SwTxtPaintInfo &rInf ) const
SwFldPortion *SwErgoSumPortion::Clone( const XubString &rExpand ) const
{
return new SwErgoSumPortion( rExpand, rtl::OUString() );
return new SwErgoSumPortion( rExpand, OUString() );
}
SwErgoSumPortion::SwErgoSumPortion( const XubString &rExp, const XubString& rStr )
......
......@@ -399,7 +399,7 @@ sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt )
void SwHyphPortion::HandlePortion( SwPortionHandler& rPH ) const
{
rtl::OUString aString( '-' );
OUString aString( '-' );
rPH.Special( GetLen(), aString, GetWhichPor() );
}
......@@ -467,7 +467,7 @@ KSHORT SwSoftHyphPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
{
if( !nViewWidth )
((SwSoftHyphPortion*)this)->nViewWidth
= rInf.GetTxtSize(rtl::OUString('-')).Width();
= rInf.GetTxtSize(OUString('-')).Width();
}
else
((SwSoftHyphPortion*)this)->nViewWidth = 0;
......@@ -626,7 +626,7 @@ sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTx
void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const
{
const rtl::OUString aString( '-' );
const OUString aString( '-' );
const sal_uInt16 nWhich = ! Width() ?
POR_SOFTHYPH_COMP :
GetWhichPor();
......
......@@ -401,7 +401,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
static_cast<SwNumberPortion*>(rInf.GetLast())->GetFont();
pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) );
}
rtl::OUString aTmp( ' ' );
OUString aTmp( ' ' );
SwTxtSizeInfo aInf( rInf, aTmp );
nMinimumTabWidth = aInf.GetTxtSize().Width();
}
......@@ -617,7 +617,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.GetFont()->IsPaintBlank() )
{
// tabs with filling / filled tabs
UniString aTxt = rtl::OUString(' ');
UniString aTxt = OUString(' ');
const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width();
// robust:
if( nCharWidth )
......@@ -632,7 +632,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( IsFilled() )
{
// tabs with filling / filled tabs
UniString aTxt = rtl::OUString(cFill);
UniString aTxt = OUString(cFill);
const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width();
OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
// robust:
......
......@@ -504,7 +504,7 @@ void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uIn
i = maList.end(); // robust
else
i += nWhere;
maList.insert(i, SwWrongArea( rtl::OUString(), 0, nNewPos, nNewLen, pSubList ) );
maList.insert(i, SwWrongArea( OUString(), 0, nNewPos, nNewLen, pSubList ) );
}
......@@ -597,7 +597,7 @@ bool SwWrongList::LookForEntry( xub_StrLen nBegin, xub_StrLen nEnd ) {
return false;
}
void SwWrongList::Insert( const rtl::OUString& rType,
void SwWrongList::Insert( const OUString& rType,
com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
xub_StrLen nNewPos, xub_StrLen nNewLen )
{
......
......@@ -177,8 +177,8 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
"%s", getTypeName( nType ) );
rtl::OUString sText( rText );
rtl::OString sText8 =::rtl::OUStringToOString( sText,
OUString sText( rText );
OString sText8 =::rtl::OUStringToOString( sText,
RTL_TEXTENCODING_UTF8 );
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
"%s", sText8.getStr( ) );
......@@ -326,12 +326,12 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
if ( IsTxtFrm( ) )
{
SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
rtl::OUString aTxt = pTxtFrm->GetTxt( );
OUString aTxt = pTxtFrm->GetTxt( );
for ( int i = 0; i < 32; i++ )
{
aTxt = aTxt.replace( i, '*' );
}
rtl::OString aTxt8 =::rtl::OUStringToOString( aTxt,
OString aTxt8 =::rtl::OUStringToOString( aTxt,
RTL_TEXTENCODING_UTF8 );
xmlTextWriterWriteString( writer,
( const xmlChar * ) aTxt8.getStr( ) );
......@@ -382,7 +382,7 @@ void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
if (IsHeaderFrm() || IsFooterFrm())
{
SwHeadFootFrm *pHeadFootFrm = (SwHeadFootFrm*)this;
rtl::OUString aFmtName = pHeadFootFrm->GetFmt()->GetName();
OUString aFmtName = pHeadFootFrm->GetFmt()->GetName();
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtName" ), "%s", BAD_CAST(rtl::OUStringToOString(aFmtName, RTL_TEXTENCODING_UTF8).getStr()));
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtPtr" ), "%p", pHeadFootFrm->GetFmt());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment