From dd18372f7e4d9d6e5bd571394123a3de3d40cb94 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Sep 2013 09:19:23 +0100 Subject: XubString->OUString Change-Id: I9ce007261555008a438b90b36a888a8d4cb4f140 --- sw/source/core/text/inftxt.hxx | 2 +- sw/source/core/text/porfld.cxx | 2 +- sw/source/core/text/porftn.hxx | 18 +++++++++--------- sw/source/core/text/porhyph.hxx | 23 ++++++++++++----------- sw/source/core/text/porlay.hxx | 4 ++-- sw/source/core/text/txtftn.cxx | 22 ++++++++++++---------- sw/source/core/text/txthyph.cxx | 14 +++++++------- 7 files changed, 44 insertions(+), 41 deletions(-) (limited to 'sw') diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index f9963d598bac..544f56fff33b 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -700,7 +700,7 @@ public: // Calls HyphenateWord() of Hyphenator ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > - HyphWord( const String &rTxt, const sal_uInt16 nMinTrail ); + HyphWord( const OUString &rTxt, const sal_uInt16 nMinTrail ); const com::sun::star::beans::PropertyValues & GetHyphValues() const; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 09f75bd5dc5e..c6e49c6eadce 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -372,7 +372,7 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf ) sal_Int32 nNextOfst = aExpand.getLength() - nRest; if ( IsQuoVadisPortion() ) - nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().Len(); + nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().getLength(); XubString aNew( aExpand, nNextOfst, STRING_LEN ); aExpand = aExpand.copy( 0, nNextOfst ); diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx index f45a8b03672f..a3c80c286e5f 100644 --- a/sw/source/core/text/porftn.hxx +++ b/sw/source/core/text/porftn.hxx @@ -36,9 +36,9 @@ class SwFtnPortion : public SwFldPortion bool mbPreferredScriptTypeSet; sal_uInt8 mnPreferredScriptType; public: - SwFtnPortion( const XubString &rExpand, SwTxtFtn *pFtn, + SwFtnPortion( const OUString &rExpand, SwTxtFtn *pFtn, KSHORT nOrig = KSHRT_MAX ); - inline KSHORT& Orig() { return nOrigHeight; } + KSHORT& Orig() { return nOrigHeight; } virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const; @@ -59,7 +59,7 @@ public: class SwFtnNumPortion : public SwNumberPortion { public: - inline SwFtnNumPortion( const XubString &rExpand, SwFont *pFntL ) + SwFtnNumPortion( const OUString &rExpand, SwFont *pFntL ) : SwNumberPortion( rExpand, pFntL, sal_True, sal_False, 0, false ) { SetWhichPor( POR_FTNNUM ); } @@ -72,16 +72,16 @@ public: class SwQuoVadisPortion : public SwFldPortion { - XubString aErgo; + OUString aErgo; public: - SwQuoVadisPortion( const XubString &rExp, const XubString& rStr ); + SwQuoVadisPortion( const OUString &rExp, const OUString& rStr ); virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const; - inline void SetNumber( const XubString& rStr ) { aErgo = rStr; } - inline const OUString GetQuoTxt() const { return aExpand; } - inline const XubString &GetContTxt() const { return aErgo; } + void SetNumber( const OUString& rStr ) { aErgo = rStr; } + const OUString GetQuoTxt() const { return aExpand; } + const OUString &GetContTxt() const { return aErgo; } // Field cloner for SplitGlue virtual SwFldPortion *Clone( const OUString &rExpand ) const; @@ -99,7 +99,7 @@ public: class SwErgoSumPortion : public SwFldPortion { public: - SwErgoSumPortion( const XubString &rExp, const XubString& rStr ); + SwErgoSumPortion( const OUString &rExp, const OUString& rStr ); virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx index 8e68bc370a13..9da53953a993 100644 --- a/sw/source/core/text/porhyph.hxx +++ b/sw/source/core/text/porhyph.hxx @@ -28,7 +28,10 @@ class SwHyphPortion : public SwExpandPortion { public: - inline SwHyphPortion( ) { SetWhichPor( POR_HYPH ); } + SwHyphPortion() + { + SetWhichPor( POR_HYPH ); + } virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); @@ -44,9 +47,14 @@ public: class SwHyphStrPortion : public SwHyphPortion { - XubString aExpand; + OUString aExpand; public: - inline SwHyphStrPortion( const XubString &rStr ); + SwHyphStrPortion(const OUString &rStr) + : aExpand(rStr + "-") + { + SetWhichPor( POR_HYPHSTR ); + } + virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const; // Accessibility: pass information about this portion to the PortionHandler @@ -90,18 +98,11 @@ public: class SwSoftHyphStrPortion : public SwHyphStrPortion { public: - SwSoftHyphStrPortion( const XubString &rStr ); + SwSoftHyphStrPortion( const OUString &rStr ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; OUTPUT_OPERATOR }; -inline SwHyphStrPortion::SwHyphStrPortion( const XubString &rStr ) - : aExpand( rStr ) -{ - aExpand += '-'; - SetWhichPor( POR_HYPHSTR ); -} - CLASSIO( SwHyphPortion ) CLASSIO( SwHyphStrPortion ) CLASSIO( SwSoftHyphPortion ) diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx index 83ac09beca7f..1d6e252c9b3e 100644 --- a/sw/source/core/text/porlay.hxx +++ b/sw/source/core/text/porlay.hxx @@ -305,7 +305,7 @@ public: xub_StrLen GetParLen() const; // For Prepare() - sal_Bool UpdateQuoVadis( const XubString &rQuo ); + sal_Bool UpdateQuoVadis( const OUString &rQuo ); // Flags inline void SetFly( const sal_Bool bNew = sal_True ) { bFlys = bNew; } @@ -349,7 +349,7 @@ public: SvStream &WriteSwg( SvStream& rStream ); //$ ostream // Set nErgo in the QuoVadisPortion - void SetErgoSumNum( const XubString &rErgo ); + void SetErgoSumNum( const OUString &rErgo ); const SwDropPortion *FindDropPortion() const; diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 7293b43fa6af..4bfe9d2829bd 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -999,7 +999,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const SwFmtFtn& rFtn = (SwFmtFtn&)pFtn->GetFtn(); SwDoc *pDoc = pFrm->GetNode()->GetDoc(); - XubString aFtnTxt( rFtn.GetViewNumStr( *pDoc, sal_True )); + OUString aFtnTxt( rFtn.GetViewNumStr( *pDoc, sal_True )); const SwEndNoteInfo* pInfo; if( rFtn.IsEndNote() ) @@ -1039,7 +1039,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const * SwTxtFormatter::NewErgoSumPortion() *************************************************************************/ -XubString lcl_GetPageNumber( const SwPageFrm* pPage ) +OUString lcl_GetPageNumber( const SwPageFrm* pPage ) { OSL_ENSURE( pPage, "GetPageNumber: Homeless TxtFrm" ); MSHORT nVirtNum = pPage->GetVirtPageNum(); @@ -1065,7 +1065,7 @@ SwErgoSumPortion *SwTxtFormatter::NewErgoSumPortion( SwTxtFormatInfo &rInf ) con const SwPageFrm* pQuoPage = pQuoFrm->FindPageFrm(); if( pPage == pQuoFrm->FindPageFrm() ) return 0; // Wenn der QuoVadis auf der selben (spaltigen) Seite steht - const XubString aPage = lcl_GetPageNumber( pPage ); + const OUString aPage = lcl_GetPageNumber( pPage ); SwParaPortion *pPara = pQuoFrm->GetPara(); if( pPara ) pPara->SetErgoSumNum( aPage ); @@ -1142,7 +1142,7 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset ) const KSHORT nOldRealWidth = rInf.RealWidth(); rInf.RealWidth( nOldRealWidth - nLastLeft ); - XubString aErgo = lcl_GetPageNumber( pErgoFrm->FindPageFrm() ); + OUString aErgo = lcl_GetPageNumber( pErgoFrm->FindPageFrm() ); SwQuoVadisPortion *pQuo = new SwQuoVadisPortion(rFtnInfo.aQuoVadis, aErgo ); pQuo->SetAscent( rInf.GetAscent() ); pQuo->Height( rInf.GetTxtHeight() ); @@ -1401,7 +1401,7 @@ SwFtnSave::~SwFtnSave() * SwFtnPortion::SwFtnPortion() *************************************************************************/ -SwFtnPortion::SwFtnPortion( const XubString &rExpand, +SwFtnPortion::SwFtnPortion( const OUString &rExpand, SwTxtFtn *pFootn, KSHORT nReal ) : SwFldPortion( rExpand, 0 ) , pFtn(pFootn) @@ -1484,9 +1484,11 @@ void SwFtnPortion::SetPreferredScriptType( sal_uInt8 nPreferredScriptType ) *************************************************************************/ SwFldPortion *SwQuoVadisPortion::Clone( const OUString &rExpand ) const -{ return new SwQuoVadisPortion( rExpand, aErgo ); } +{ + return new SwQuoVadisPortion( rExpand, aErgo ); +} -SwQuoVadisPortion::SwQuoVadisPortion( const XubString &rExp, const XubString& rStr ) +SwQuoVadisPortion::SwQuoVadisPortion( const OUString &rExp, const OUString& rStr ) : SwFldPortion( rExp ), aErgo(rStr) { SetLen(0); @@ -1575,7 +1577,7 @@ SwFldPortion *SwErgoSumPortion::Clone( const OUString &rExpand ) const return new SwErgoSumPortion( rExpand, OUString() ); } -SwErgoSumPortion::SwErgoSumPortion( const XubString &rExp, const XubString& rStr ) +SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, const OUString& rStr) : SwFldPortion( rExp ) { SetLen(0); @@ -1618,7 +1620,7 @@ sal_Bool SwErgoSumPortion::Format( SwTxtFormatInfo &rInf ) * SwParaPortion::SetErgoSumNum() *************************************************************************/ -void SwParaPortion::SetErgoSumNum( const XubString& rErgo ) +void SwParaPortion::SetErgoSumNum( const OUString& rErgo ) { SwLineLayout *pLay = this; while( pLay->GetNext() ) @@ -1643,7 +1645,7 @@ void SwParaPortion::SetErgoSumNum( const XubString& rErgo ) * Wird im SwTxtFrm::Prepare() gerufen *************************************************************************/ -sal_Bool SwParaPortion::UpdateQuoVadis( const XubString &rQuo ) +sal_Bool SwParaPortion::UpdateQuoVadis( const OUString &rQuo ) { SwLineLayout *pLay = this; while( pLay->GetNext() ) diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 62b3ad4fec67..a234dcfbef5c 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -41,9 +41,9 @@ using namespace ::com::sun::star::i18n; *************************************************************************/ Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord( - const XubString &rTxt, const MSHORT nMinTrail ) + const OUString &rTxt, const MSHORT nMinTrail ) { - if( rTxt.Len() < 4 || m_pFnt->IsSymbol(m_pVsh) ) + if( rTxt.getLength() < 4 || m_pFnt->IsSymbol(m_pVsh) ) return 0; Reference< XHyphenator > xHyph = ::GetHyphenator(); Reference< XHyphenatedWord > xHyphWord; @@ -51,7 +51,7 @@ Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord( if( xHyph.is() ) xHyphWord = xHyph->hyphenate( OUString(rTxt), g_pBreakIt->GetLocale( m_pFnt->GetLanguage() ), - rTxt.Len() - nMinTrail, GetHyphValues() ); + rTxt.getLength() - nMinTrail, GetHyphValues() ); return xHyphWord; } @@ -237,7 +237,7 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf ) bRet = 0 != nLen; if( bRet ) { - XubString aSelTxt( rInf.GetTxt().copy(nWrdStart, nLen) ); + OUString aSelTxt( rInf.GetTxt().copy(nWrdStart, nLen) ); { MSHORT nMinTrail = 0; @@ -293,7 +293,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) aAltSpell = SvxGetAltSpelling( xHyphWord ); OSL_ENSURE( aAltSpell.bIsAltSpelling, "no alternatve spelling" ); - XubString aAltTxt = aAltSpell.aReplacement; + OUString aAltTxt = aAltSpell.aReplacement; nPorEnd = aAltSpell.nChangedPos + rGuess.BreakStart() - rGuess.FieldDiff(); xub_StrLen nTmpLen = 0; @@ -308,7 +308,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) } // length of pHyphPor is adjusted - pHyphPor->SetLen( aAltTxt.Len() + 1 ); + pHyphPor->SetLen( aAltTxt.getLength() + 1 ); (SwPosSize&)(*pHyphPor) = pHyphPor->GetTxtSize( rInf ); pHyphPor->SetLen( aAltSpell.nChangedLength + nTmpLen ); } @@ -635,7 +635,7 @@ void SwSoftHyphStrPortion::Paint( const SwTxtPaintInfo &rInf ) const SwHyphStrPortion::Paint( rInf ); } -SwSoftHyphStrPortion::SwSoftHyphStrPortion( const XubString &rStr ) +SwSoftHyphStrPortion::SwSoftHyphStrPortion( const OUString &rStr ) : SwHyphStrPortion( rStr ) { SetLen( 1 ); -- cgit