Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3266
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/66/3266/1
Use OUString and sal_Int32 in sw
source/core/text
Change-Id: I29cce32f8f6ae760397ae0633ebfa56942a7cd6d
---
M sw/source/core/inc/scriptinfo.hxx
M sw/source/core/text/frmcrsr.cxx
M sw/source/core/text/frmform.cxx
M sw/source/core/text/frmpaint.cxx
M sw/source/core/text/guess.cxx
M sw/source/core/text/inftxt.cxx
M sw/source/core/text/inftxt.hxx
M sw/source/core/text/itradj.cxx
M sw/source/core/text/itrcrsr.cxx
M sw/source/core/text/itrform2.cxx
M sw/source/core/text/itrpaint.cxx
M sw/source/core/text/porexp.cxx
M sw/source/core/text/porexp.hxx
M sw/source/core/text/porfld.cxx
M sw/source/core/text/porfld.hxx
M sw/source/core/text/porfly.cxx
M sw/source/core/text/porftn.hxx
M sw/source/core/text/porglue.cxx
M sw/source/core/text/porglue.hxx
M sw/source/core/text/porhyph.hxx
M sw/source/core/text/porlay.cxx
M sw/source/core/text/porlin.cxx
M sw/source/core/text/porlin.hxx
M sw/source/core/text/pormulti.cxx
M sw/source/core/text/porrst.cxx
M sw/source/core/text/portxt.cxx
M sw/source/core/text/portxt.hxx
M sw/source/core/text/txtdrop.cxx
M sw/source/core/text/txtftn.cxx
M sw/source/core/text/txthyph.cxx
M sw/source/core/text/txttab.cxx
31 files changed, 232 insertions(+), 238 deletions(-)
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index bb05d1d..4d6768e 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -316,7 +316,7 @@
static SwScriptInfo* GetScriptInfo( const SwTxtNode& rNode,
sal_Bool bAllowInvalid = sal_False );
- static sal_uInt8 WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI );
+ static sal_uInt8 WhichFont( xub_StrLen nIdx, const OUString* pTxt, const SwScriptInfo* pSI );
};
inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index d6146ad..46a064e 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -757,12 +757,12 @@
// We skip hard line brakes
if( aLine.GetCurr()->GetLen() &&
- CH_BREAK == aInf.GetTxt().GetChar(nRightMargin - 1))
+ CH_BREAK == aInf.GetTxt()[nRightMargin - 1])
--nRightMargin;
else if( !bAPI && (aLine.GetNext() || pFrm->GetFollow()) )
{
while( nRightMargin > aLine.GetStart() &&
- ' ' == aInf.GetTxt().GetChar(nRightMargin - 1))
+ ' ' == aInf.GetTxt()[nRightMargin - 1])
--nRightMargin;
}
}
@@ -1278,13 +1278,13 @@
}
else if( !IsFollow() )
{
- xub_StrLen nTmpLen = aInf.GetTxt().Len();
+ sal_Int32 nTmpLen = aInf.GetTxt().getLength();
if( aLine.GetEnd() < nTmpLen )
{
if( nFormat <= GetOfst() )
{
nFormat = Min( xub_StrLen( GetOfst() + MIN_OFFSET_STEP ),
- nTmpLen );
+ static_cast<xub_StrLen>(nTmpLen) );
if( nFormat <= GetOfst() )
break;
}
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 35b4253..1b10816 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -867,14 +867,14 @@
// Let's see if it works ...
aLine.TruncLines();
aFrmBreak.SetRstHeight( aLine );
- FormatAdjust( aLine, aFrmBreak, aInf.GetTxt().Len(), aInf.IsStop() );
+ FormatAdjust( aLine, aFrmBreak, aInf.GetTxt().getLength(), aInf.IsStop() );
}
else
{
if( !GetFollow() )
{
FormatAdjust( aLine, aFrmBreak,
- aInf.GetTxt().Len(), aInf.IsStop() );
+ aInf.GetTxt().getLength(), aInf.IsStop() );
}
else if ( !aFrmBreak.IsKeepAlways() )
{
@@ -1578,7 +1578,7 @@
rLine.Top();
if( !rLine.GetDropFmt() )
rLine.SetOnceMore( sal_False );
- SwCharRange aRange( 0, rInf.GetTxt().Len() );
+ SwCharRange aRange( 0, rInf.GetTxt().getLength() );
*(pPara->GetReformat()) = aRange;
_Format( rLine, rInf );
@@ -1608,7 +1608,7 @@
rLine.CtorInitTxtFormatter( this, &rInf );
rLine.SetDropLines( 1 );
rLine.CalcDropHeight( 1 );
- SwCharRange aTmpRange( 0, rInf.GetTxt().Len() );
+ SwCharRange aTmpRange( 0, rInf.GetTxt().getLength() );
*(pPara->GetReformat()) = aTmpRange;
_Format( rLine, rInf, sal_True );
// We paint everything ...
@@ -1906,7 +1906,7 @@
xub_StrLen nStart = GetOfst();
const xub_StrLen nEnd = GetFollow()
- ? GetFollow()->GetOfst() : aInf.GetTxt().Len();
+ ? GetFollow()->GetOfst() : aInf.GetTxt().getLength();
do
{
nStart = aLine.FormatLine( nStart );
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 4456035..f3a0da9 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -186,13 +186,13 @@
void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed )
{
// Line number is stronger than the divider
- const XubString aTmp( HasNumber() ? rLineInf.GetNumType().GetNumStr( nLineNr )
+ const OUString aTmp( HasNumber() ? rLineInf.GetNumType().GetNumStr( nLineNr )
: rLineInf.GetDivider() );
// Get script type of line numbering:
pFnt->SetActual( SwScriptInfo::WhichFont( 0, &aTmp, 0 ) );
- SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, aTmp.Len() );
+ SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, aTmp.getLength() );
aDrawInf.SetSpace( 0 );
aDrawInf.SetWrong( NULL );
aDrawInf.SetGrammarCheck( NULL );
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 4f95ae0..11698e4 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -56,10 +56,10 @@
nCutPos = rInf.GetIdx();
// Empty strings are always 0
- if( !rInf.GetLen() || !rInf.GetTxt().Len() )
+ if( !rInf.GetLen() || rInf.GetTxt().isEmpty() )
return sal_False;
- OSL_ENSURE( rInf.GetIdx() < rInf.GetTxt().Len(),
+ OSL_ENSURE( rInf.GetIdx() < rInf.GetTxt().getLength(),
"+SwTxtGuess::Guess: invalid SwTxtFormatInfo" );
OSL_ENSURE( nPorHeight, "+SwTxtGuess::Guess: no height" );
@@ -79,7 +79,7 @@
0 ;
SwTwips nLineWidth = rInf.Width() - rInf.X();
- xub_StrLen nMaxLen = rInf.GetTxt().Len() - rInf.GetIdx();
+ sal_Int32 nMaxLen = rInf.GetTxt().getLength() - rInf.GetIdx();
if ( rInf.GetLen() < nMaxLen )
nMaxLen = rInf.GetLen();
@@ -101,7 +101,7 @@
// do not add extra italic value for an isolated blank:
if ( 1 == rInf.GetLen() &&
- CH_BLANK == rInf.GetTxt().GetChar( rInf.GetIdx() ) )
+ CH_BLANK == rInf.GetTxt()[ rInf.GetIdx() ] )
bAddItalic = false;
nItalic = bAddItalic ? nPorHeight / 12 : 0;
@@ -130,10 +130,10 @@
// portion fits to line
nCutPos = rInf.GetIdx() + nMaxLen;
if( nItalic &&
- ( nCutPos >= rInf.GetTxt().Len() ||
+ ( nCutPos >= rInf.GetTxt().getLength() ||
// #i48035# Needed for CalcFitToContent
// if first line ends with a manual line break
- rInf.GetTxt().GetChar( nCutPos ) == CH_BREAK ) )
+ rInf.GetTxt()[ nCutPos ] == CH_BREAK ) )
nBreakWidth = nBreakWidth + nItalic;
// save maximum width for later use
@@ -184,7 +184,7 @@
// there likely has been a pixel rounding error in GetTxtBreak
if ( nBreakWidth <= nLineWidth )
{
- if( nItalic && ( nBreakPos + 1 ) >= rInf.GetTxt().Len() )
+ if( nItalic && ( nBreakPos + 1 ) >= rInf.GetTxt().getLength() )
nBreakWidth = nBreakWidth + nItalic;
// save maximum width for later use
@@ -206,7 +206,7 @@
xub_StrLen nPorLen = 0;
// do not call the break iterator nCutPos is a blank
- sal_Unicode cCutChar = rInf.GetTxt().GetChar( nCutPos );
+ sal_Unicode cCutChar = rInf.GetTxt()[ nCutPos ];
if( CH_BLANK == cCutChar || CH_FULL_BLANK == cCutChar )
{
nBreakPos = nCutPos;
@@ -217,7 +217,7 @@
{
// we step back until a non blank character has been found
// or there is only one more character left
- while( nX && nBreakPos > rInf.GetTxt().Len() &&
+ while( nX && nBreakPos > rInf.GetTxt().getLength() &&
( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) ||
CH_FULL_BLANK == cCutChar ) )
--nBreakPos;
@@ -232,7 +232,7 @@
if( nBreakPos > rInf.GetIdx() )
nPorLen = nBreakPos - rInf.GetIdx();
- while( ++nCutPos < rInf.GetTxt().Len() &&
+ while( ++nCutPos < rInf.GetTxt().getLength() &&
( CH_BLANK == ( cCutChar = rInf.GetChar( nCutPos ) ) ||
CH_FULL_BLANK == cCutChar ) )
; // nothing
@@ -259,15 +259,15 @@
! rInf.GetLast()->IsFtnPortion() &&
rInf.GetIdx() > rInf.GetLineStart() &&
CH_TXTATR_BREAKWORD ==
- ( cFldChr = rInf.GetTxt().GetChar( rInf.GetIdx() - 1 ) ) )
+ ( cFldChr = rInf.GetTxt()[ rInf.GetIdx() - 1 ] ) )
{
SwFldPortion* pFld = (SwFldPortion*)rInf.GetLast();
- XubString aTxt;
+ OUString aTxt;
pFld->GetExpTxt( rInf, aTxt );
- if ( aTxt.Len() )
+ if ( !aTxt.isEmpty() )
{
- nFieldDiff = aTxt.Len() - 1;
+ nFieldDiff = aTxt.getLength() - 1;
nCutPos = nCutPos + nFieldDiff;
nHyphPos = nHyphPos + nFieldDiff;
@@ -275,9 +275,8 @@
aDebugString = rInf.GetTxt();
#endif
- XubString& rOldTxt = (XubString&)rInf.GetTxt();
- rOldTxt.Erase( rInf.GetIdx() - 1, 1 );
- rOldTxt.Insert( aTxt, rInf.GetIdx() - 1 );
+ OUString rOldTxt = rInf.GetTxt();
+ rOldTxt = rOldTxt.replaceAt( rInf.GetIdx() - 1, 1, aTxt );
rInf.SetIdx( rInf.GetIdx() + nFieldDiff );
}
else
@@ -300,7 +299,7 @@
// NEVER call GetLang if the string has been modified!!!
LanguageType aLang = rInf.GetFont()->GetLanguage();
- // If we are inside a field portion, we use a temporar string which
+ // If we are inside a field portion, we use a temporary string which
// differs from the string at the textnode. Therefore we are not allowed
// to call the GetLang function.
if ( nCutPos && ! rPor.InFldGrp() )
@@ -415,7 +414,7 @@
if( nBreakPos >= rInf.GetIdx() )
{
nPorLen = nBreakPos - rInf.GetIdx();
- if( '-' == rInf.GetTxt().GetChar( nBreakPos - 1 ) )
+ if( '-' == rInf.GetTxt()[ nBreakPos - 1 ] )
xHyphWord = NULL;
}
}
@@ -429,7 +428,7 @@
// check, if break position is soft hyphen and an underflow
// has to be triggered
if( nBreakPos > rInf.GetLineStart() && rInf.GetIdx() &&
- CHAR_SOFTHYPHEN == rInf.GetTxt().GetChar( nBreakPos - 1 ) )
+ CHAR_SOFTHYPHEN == rInf.GetTxt()[ nBreakPos - 1 ] )
nBreakPos = rInf.GetIdx() - 1;
const SvxAdjust& rAdjust =
rInf.GetTxtFrm()->GetTxtNode()->GetSwAttrSet().GetAdjust().GetAdjust();
@@ -543,7 +542,7 @@
// if everything else fails, we want to cut at nPos
nCutPos = nPos;
- XubString aTxt( rInf.GetTxt().Copy( nBreakStart, nWordLen ) );
+ XubString aTxt( rInf.GetTxt().copy( nBreakStart, nWordLen ) );
// check, if word has alternative spelling
Reference< XHyphenator > xHyph( ::GetHyphenator() );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 8b51fc9..ef9225f 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -194,10 +194,10 @@
#endif
-inline xub_StrLen GetMinLen( const SwTxtSizeInfo &rInf )
+inline sal_Int32 GetMinLen( const SwTxtSizeInfo &rInf )
{
- const xub_StrLen nInfLen = rInf.GetIdx() + rInf.GetLen();
- return Min( rInf.GetTxt().Len(), nInfLen );
+ const sal_Int32 nInfLen = rInf.GetIdx() + rInf.GetLen();
+ return Min( rInf.GetTxt().getLength(), nInfLen );
}
@@ -300,7 +300,7 @@
pFnt = pNewFnt;
pUnderFnt = 0;
- pTxt = reinterpret_cast<String const*>(&pNd->GetTxt()); //FIXME
+ pTxt = &pNd->GetTxt();
nIdx = nNewIdx;
nLen = nNewLen;
@@ -312,8 +312,8 @@
SetLen( GetMinLen( *this ) );
}
-SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt,
- const xub_StrLen nIndex, const xub_StrLen nLength )
+SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const OUString &rTxt,
+ const sal_Int32 nIndex, const xub_StrLen nLength )
: SwTxtInfo( rNew ),
pKanaComp(((SwTxtSizeInfo&)rNew).GetpKanaComp()),
pVsh(((SwTxtSizeInfo&)rNew).GetVsh()),
@@ -618,7 +618,7 @@
rPor.InNumberGrp() ) ? 0 : GetSpaceAdd();
if ( nSpaceAdd )
{
- xub_StrLen nCharCnt = 0;
+ sal_Int32 nCharCnt = 0;
// #i41860# Thai justified alignment needs some
// additional information:
aDrawInf.SetNumberOfBlanks( rPor.InTxtGrp() ?
@@ -1090,7 +1090,7 @@
pFieldmark=doc->getIDocumentMarkAccess()->getFieldmarkFor(aPosition);
}
}
- bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx()));
+ bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt()[GetIdx()]);
if(pFieldmark) {
OSL_TRACE("Found Fieldmark");
#if OSL_DEBUG_LEVEL > 1
@@ -1374,7 +1374,7 @@
nUnderScorePos = STRING_LEN;
cHookChar = 0;
SetIdx(0);
- SetLen( GetTxt().Len() );
+ SetLen( GetTxt().getLength() );
SetPaintOfst(0);
}
@@ -1544,7 +1544,7 @@
// Check if character *behind* the portion has
// to become the hook:
- if ( i == nEnd && i < GetTxt().Len() && bNumFound )
+ if ( i == nEnd && i < GetTxt().getLength() && bNumFound )
{
const sal_Unicode cPos = GetChar( i );
if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos ||
cPos >= 0x3A ) )
@@ -1609,7 +1609,7 @@
pOldTxt = &(pInf->GetTxt());
pInf->SetTxt( aTxt );
pInf->SetIdx( 0 );
- pInf->SetLen( bTxtLen ? pInf->GetTxt().Len() : pPor->GetLen() );
+ pInf->SetLen( bTxtLen ? pInf->GetTxt().getLength() : pPor->GetLen() );
// ST2
if ( bExgLists )
@@ -1621,10 +1621,10 @@
const xub_StrLen nListPos = pOldSmartTagList->Pos(nPos);
if( nListPos == nIdx )
((SwTxtPaintInfo*)pInf)->SetSmartTags( pOldSmartTagList->SubList( nPos ) );
- else if( !pTempList && nPos < pOldSmartTagList->Count() && nListPos < nIdx &&
aTxt.Len() )
+ else if( !pTempList && nPos < pOldSmartTagList->Count() && nListPos < nIdx &&
!aTxt.isEmpty() )
{
pTempList = new SwWrongList( WRONGLIST_SMARTTAG );
- pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 );
+ pTempList->Insert( OUString(), 0, 0, aTxt.getLength(), 0 );
((SwTxtPaintInfo*)pInf)->SetSmartTags( pTempList );
}
else
@@ -1637,10 +1637,10 @@
const xub_StrLen nListPos = pOldGrammarCheckList->Pos(nPos);
if( nListPos == nIdx )
((SwTxtPaintInfo*)pInf)->SetGrammarCheckList( pOldGrammarCheckList->SubList(
nPos ) );
- else if( !pTempList && nPos < pOldGrammarCheckList->Count() && nListPos < nIdx &&
aTxt.Len() )
+ else if( !pTempList && nPos < pOldGrammarCheckList->Count() && nListPos < nIdx &&
!aTxt.isEmpty() )
{
pTempList = new SwWrongList( WRONGLIST_GRAMMAR );
- pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 );
+ pTempList->Insert( OUString(), 0, 0, aTxt.getLength(), 0 );
((SwTxtPaintInfo*)pInf)->SetGrammarCheckList( pTempList );
}
else
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 72c9c7b..e34aca8 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -172,8 +172,8 @@
SwUnderlineFont *pUnderFnt; // Font for underlining
SwTxtFrm *pFrm;
const SwViewOption *pOpt;
- const XubString *pTxt;
- xub_StrLen nIdx, nLen;
+ const OUString *pTxt;
+ sal_Int32 nIdx, nLen;
sal_uInt16 nKanaIdx;
bool bOnWin : 1;
bool bNotEOL : 1;
@@ -201,12 +201,12 @@
SwTxtSizeInfo() : pKanaComp(0), pVsh(0), pOut(0), pRef(0), pFnt(0), pUnderFnt(0), pFrm(0),
pOpt(0), pTxt(0) {}
public:
SwTxtSizeInfo( const SwTxtSizeInfo &rInf );
- SwTxtSizeInfo( const SwTxtSizeInfo &rInf, const XubString &rTxt,
- const xub_StrLen nIdx = 0,
+ SwTxtSizeInfo( const SwTxtSizeInfo &rInf, const OUString &rTxt,
+ const sal_Int32 nIdx = 0,
const xub_StrLen nLen = STRING_LEN );
inline SwTxtSizeInfo( SwTxtFrm *pTxtFrm, SwFont *pTxtFnt = 0,
- const xub_StrLen nIndex = 0,
+ const sal_Int32 nIndex = 0,
const xub_StrLen nLength = STRING_LEN )
{ CtorInitTxtSizeInfo( pTxtFrm, pTxtFnt, nIndex, nLength ); }
@@ -263,9 +263,9 @@
inline SwUnderlineFont* GetUnderFnt() const { return pUnderFnt; }
inline const SwViewOption &GetOpt() const { return *pOpt; }
- inline const XubString &GetTxt() const { return *pTxt; }
- inline sal_Unicode GetChar( const xub_StrLen nPos ) const
- { return pTxt->GetChar( nPos ); }
+ inline const OUString &GetTxt() const { return *pTxt; }
+ inline sal_Unicode GetChar( const sal_Int32 nPos ) const
+ { return (*pTxt)[ nPos ]; }
inline KSHORT GetTxtHeight() const;
@@ -296,11 +296,11 @@
inline KSHORT GetAscent() const;
- inline xub_StrLen GetIdx() const { return nIdx; }
- inline void SetIdx( const xub_StrLen nNew ) { nIdx = nNew; }
- inline xub_StrLen GetLen() const { return nLen; }
- inline void SetLen( const xub_StrLen nNew ) { nLen = nNew; }
- inline void SetTxt( const XubString &rNew ){ pTxt = &rNew; }
+ inline sal_Int32 GetIdx() const { return nIdx; }
+ inline void SetIdx( const sal_Int32 nNew ) { nIdx = nNew; }
+ inline sal_Int32 GetLen() const { return nLen; }
+ inline void SetLen( const sal_Int32 nNew ) { nLen = nNew; }
+ inline void SetTxt( const OUString &rNew ){ pTxt = &rNew; }
friend SvStream &operator<<( SvStream &rOS, const SwTxtSizeInfo &rInf );
@@ -727,8 +727,8 @@
*************************************************************************/
class SwTxtSlot
{
- XubString aTxt;
- const XubString *pOldTxt;
+ OUString aTxt;
+ const OUString *pOldTxt;
const SwWrongList* pOldSmartTagList;
const SwWrongList* pOldGrammarCheckList;
SwWrongList* pTempList;
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index d792868..1dcb603 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -48,7 +48,7 @@
const SwLinePortion *pFly = 0;
sal_Bool bSkip = !IsLastBlock() &&
- nStart + pCurr->GetLen() >= GetInfo().GetTxt().Len();
+ nStart + pCurr->GetLen() >= GetInfo().GetTxt().getLength();
// Multi-line fields are tricky, because we need to check whether there are
// any other text portions in the paragraph.
@@ -272,7 +272,7 @@
pCurrent->InitSpaceAdd();
xub_StrLen nGluePortion = 0;
- xub_StrLen nCharCnt = 0;
+ sal_Int32 nCharCnt = 0;
MSHORT nSpaceIdx = 0;
// i60591: hennerdrews
@@ -652,7 +652,7 @@
// to left-aligned.
// The first text portion gets the whole Glue, but only if we have
// more than one line.
- if( bComplete && GetInfo().GetTxt().Len() == nLen )
+ if( bComplete && GetInfo().GetTxt().getLength() == nLen )
((SwGluePortion*)pPos)->MoveHalfGlue( pGlue );
else
{
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 54a9be5..1a4660e 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -66,20 +66,20 @@
{
OSL_ENSURE( rCMS.pSpecialPos, "Information about special pos missing" );
- if ( rPor.InFldGrp() && ((SwFldPortion&)rPor).GetExp().Len() )
+ if ( rPor.InFldGrp() && !((SwFldPortion&)rPor).GetExp().isEmpty() )
{
const sal_uInt16 nCharOfst = rCMS.pSpecialPos->nCharOfst;
- sal_uInt16 nFldIdx = 0;
- sal_uInt16 nFldLen = 0;
+ sal_Int32 nFldIdx = 0;
+ sal_Int32 nFldLen = 0;
- const XubString* pString = 0;
+ const OUString* pString = 0;
const SwLinePortion* pPor = &rPor;
do
{
if ( pPor->InFldGrp() )
{
pString = &((SwFldPortion*)pPor)->GetExp();
- nFldLen = pString->Len();
+ nFldLen = pString->getLength();
}
else
{
@@ -97,14 +97,14 @@
} while ( true );
OSL_ENSURE( nCharOfst >= nFldIdx, "Request of position inside field failed" );
- sal_uInt16 nLen = nCharOfst - nFldIdx + 1;
+ sal_Int32 nLen = nCharOfst - nFldIdx + 1;
if ( pString )
{
// get script for field portion
rInf.GetFont()->SetActual( SwScriptInfo::WhichFont( 0, pString, 0 ) );
- xub_StrLen nOldLen = pPor->GetLen();
+ sal_Int32 nOldLen = pPor->GetLen();
((SwLinePortion*)pPor)->SetLen( nLen - 1 );
const SwTwips nX1 = pPor->GetLen() ?
pPor->GetTxtSize( rInf ).Width() :
@@ -422,7 +422,7 @@
{
// 8810: Masterzeile RightMargin, danach LeftMargin
const sal_Bool bRet = GetCharRect( pOrig, nOfst, pCMS, nMax );
- bRightMargin = nOfst >= GetEnd() && nOfst < GetInfo().GetTxt().Len();
+ bRightMargin = nOfst >= GetEnd() && nOfst < GetInfo().GetTxt().getLength();
return bRet;
}
@@ -937,7 +937,7 @@
if( pPor->InFldGrp() && pPor->GetLen() )
{
SwFldPortion *pTmp = (SwFldPortion*)pPor;
- while( pTmp->HasFollow() && !pTmp->GetExp().Len() )
+ while( pTmp->HasFollow() && pTmp->GetExp().isEmpty() )
{
KSHORT nAddX = pTmp->Width();
SwLinePortion *pNext = pTmp->GetPortion();
@@ -1612,7 +1612,7 @@
if ( nSpaceAdd )
{
- xub_StrLen nCharCnt;
+ sal_Int32 nCharCnt;
// #i41860# Thai justified alignemt needs some
// additional information:
aDrawInf.SetNumberOfBlanks( pPor->InTxtGrp() ?
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 0e53b21..ff8332c 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -103,10 +103,10 @@
nRightScanIdx = 0;
m_nHintEndIndex = 0;
- if( nStart > GetInfo().GetTxt().Len() )
+ if( nStart > GetInfo().GetTxt().getLength() )
{
OSL_ENSURE( !this, "+SwTxtFormatter::CTOR: bad offset" );
- nStart = GetInfo().GetTxt().Len();
+ nStart = GetInfo().GetTxt().getLength();
}
}
@@ -373,7 +373,7 @@
void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
{
- OSL_ENSURE( rInf.GetTxt().Len() < STRING_LEN,
+ OSL_ENSURE( rInf.GetTxt().getLength() < STRING_LEN,
"SwTxtFormatter::BuildPortions: bad text length in info" );
rInf.ChkNoHyph( CntEndHyph(), CntMidHyph() );
@@ -426,7 +426,7 @@
while( pPor && !rInf.IsStop() )
{
OSL_ENSURE( rInf.GetLen() < STRING_LEN &&
- rInf.GetIdx() <= rInf.GetTxt().Len(),
+ rInf.GetIdx() <= rInf.GetTxt().getLength(),
"SwTxtFormatter::BuildPortions: bad length in info" );
// We have to check the script for fields in order to set the
@@ -449,9 +449,9 @@
// of the kerning portion?
if ( pPor->InFldGrp() )
{
- XubString aAltTxt;
+ OUString aAltTxt;
if ( ((SwFldPortion*)pPor)->GetExpTxt( rInf, aAltTxt ) &&
- aAltTxt.Len() )
+ !aAltTxt.isEmpty() )
{
bAllowBehind = rCC.isLetterNumeric( aAltTxt, 0 );
@@ -468,11 +468,11 @@
{
if ( pLast->InFldGrp() )
{
- XubString aAltTxt;
+ OUString aAltTxt;
if ( ((SwFldPortion*)pLast)->GetExpTxt( rInf, aAltTxt ) &&
- aAltTxt.Len() )
+ !aAltTxt.isEmpty() )
{
- bAllowBefore = rCC.isLetterNumeric( aAltTxt, aAltTxt.Len() - 1 );
+ bAllowBefore = rCC.isLetterNumeric( aAltTxt, aAltTxt.getLength() - 1 );
const SwFont* pTmpFnt = ((SwFldPortion*)pLast)->GetFont();
if ( pTmpFnt )
@@ -619,7 +619,7 @@
// to 20% of the fontheight.
xub_StrLen nTmp = rInf.GetIdx() + pPor->GetLen();
if( nTmp == pScriptInfo->NextScriptChg( nTmp - 1 ) &&
- nTmp != rInf.GetTxt().Len() )
+ nTmp != rInf.GetTxt().getLength() )
{
sal_uInt16 nDist = (sal_uInt16)(rInf.GetFont()->GetHeight()/5);
@@ -648,7 +648,7 @@
const SwTwips nRestWidth = rInf.Width() - rInf.X() - pPor->Width();
const sal_uInt8 nCurrScript = pFnt->GetActual(); // pScriptInfo->ScriptType(
rInf.GetIdx() );
- const sal_uInt8 nNextScript = nTmp >= rInf.GetTxt().Len() ?
+ const sal_uInt8 nNextScript = nTmp >= rInf.GetTxt().getLength() ?
SW_CJK :
SwScriptInfo::WhichFont( nTmp, 0, pScriptInfo );
@@ -787,7 +787,7 @@
{
if( bFirstPor )
{
- if( rInf.GetTxt().Len() )
+ if( !rInf.GetTxt().isEmpty() )
{
if ( pPor->GetLen() || !rInf.GetIdx()
|| ( pCurr != pLast && !pLast->IsFlyPortion() )
@@ -875,11 +875,11 @@
// E.g. for non-displayable characters
if( rInf.GetLen() > 0 )
{
- if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDSTART )
+ if( rInf.GetTxt()[rInf.GetIdx()]==CH_TXT_ATR_FIELDSTART )
pPor = new SwFieldMarkPortion();
- else if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FIELDEND )
+ else if( rInf.GetTxt()[rInf.GetIdx()]==CH_TXT_ATR_FIELDEND )
pPor = new SwFieldMarkPortion();
- else if( rInf.GetTxt().GetChar(rInf.GetIdx())==CH_TXT_ATR_FORMELEMENT )
+ else if( rInf.GetTxt()[rInf.GetIdx()]==CH_TXT_ATR_FORMELEMENT )
pPor = new SwFieldFormPortion();
}
if( !pPor )
@@ -915,15 +915,15 @@
SwTxtPortion *pPor = WhichTxtPor( rInf );
// until next attribute change:
- const xub_StrLen nNextAttr = GetNextAttr();
- xub_StrLen nNextChg = Min( nNextAttr, rInf.GetTxt().Len() );
+ const sal_Int32 nNextAttr = GetNextAttr();
+ sal_Int32 nNextChg = Min( nNextAttr, rInf.GetTxt().getLength() );
// end of script type:
- const xub_StrLen nNextScript = pScriptInfo->NextScriptChg( rInf.GetIdx() );
+ const sal_Int32 nNextScript = pScriptInfo->NextScriptChg( rInf.GetIdx() );
nNextChg = Min( nNextChg, nNextScript );
// end of direction:
- const xub_StrLen nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() );
+ const sal_Int32 nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() );
nNextChg = Min( nNextChg, nNextDir );
// Turbo boost:
@@ -943,13 +943,13 @@
CalcAscent( rInf, pPor );
const SwFont* pTmpFnt = rInf.GetFont();
- KSHORT nExpect = Min( KSHORT( ((Font *)pTmpFnt)->GetSize().Height() ),
- KSHORT( pPor->GetAscent() ) ) / 8;
+ sal_Int32 nExpect = Min( sal_Int32( ((Font *)pTmpFnt)->GetSize().Height() ),
+ sal_Int32( pPor->GetAscent() ) ) / 8;
if ( !nExpect )
nExpect = 1;
- nExpect = (sal_uInt16)(rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect));
+ nExpect = rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect);
if( nExpect > rInf.GetIdx() && nNextChg > nExpect )
- nNextChg = Min( nExpect, rInf.GetTxt().Len() );
+ nNextChg = Min( nExpect, rInf.GetTxt().getLength() );
// we keep an invariant during method calls:
// there are no portion ending characters like hard spaces
@@ -1281,7 +1281,7 @@
}
else
{
- if( rInf.GetIdx() >= rInf.GetTxt().Len() )
+ if( rInf.GetIdx() >= rInf.GetTxt().getLength() )
{
rInf.SetFull(sal_True);
CalcFlyWidth( rInf );
@@ -1470,8 +1470,8 @@
// For the formatting routines, we set pOut to the reference device.
SwHookOut aHook( GetInfo() );
- if( GetInfo().GetLen() < GetInfo().GetTxt().Len() )
- GetInfo().SetLen( GetInfo().GetTxt().Len() );
+ if( GetInfo().GetLen() < GetInfo().GetTxt().getLength() )
+ GetInfo().SetLen( GetInfo().GetTxt().getLength() );
sal_Bool bBuild = sal_True;
SetFlyInCntBase( sal_False );
@@ -2001,7 +2001,7 @@
const xub_StrLen nReformat = GetInfo().GetReformatStart();
if( bOptimizeRepaint && STRING_LEN != nReformat )
{
- const sal_Unicode cCh = GetInfo().GetTxt().GetChar( nReformat );
+ const sal_Unicode cCh = GetInfo().GetTxt()[ nReformat ];
bOptimizeRepaint = ( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh )
|| ! GetInfo().HasHint( nReformat );
}
@@ -2378,7 +2378,7 @@
// Although no text is left, we need to format another line,
// because also empty lines need to avoid a Fly with no wrapping.
- if( bFullLine && rInf.GetIdx() == rInf.GetTxt().Len() )
+ if( bFullLine && rInf.GetIdx() == rInf.GetTxt().getLength() )
{
rInf.SetNewLine( sal_True );
// 8221: We know that for dummies, it holds ascent == height
@@ -2429,7 +2429,7 @@
}
else
{
- if( rInf.GetIdx() == rInf.GetTxt().Len() )
+ if( rInf.GetIdx() == rInf.GetTxt().getLength() )
{
// Don't use nHeight, or we have a huge descent
pFly->Height( pLast->Height() );
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 981c2df..3354c41 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -174,7 +174,7 @@
const bool bDrawInWindow = GetInfo().OnWin();
// 6882: Leerzeilen duerfen nicht wegoptimiert werden bei Paragraphzeichen.
- const sal_Bool bEndPor = GetInfo().GetOpt().IsParagraph() && !GetInfo().GetTxt().Len();
+ const sal_Bool bEndPor = GetInfo().GetOpt().IsParagraph() && GetInfo().GetTxt().isEmpty();
SwLinePortion *pPor = bEndPor ? pCurr->GetFirstPortion() : CalcPaintOfst( rPaint );
@@ -434,7 +434,7 @@
if( !GetNextLine() &&
GetInfo().GetVsh() && !GetInfo().GetVsh()->IsPreView() &&
GetInfo().GetOpt().IsParagraph() && !GetTxtFrm()->GetFollow() &&
- GetInfo().GetIdx() >= GetInfo().GetTxt().Len() )
+ GetInfo().GetIdx() >= GetInfo().GetTxt().getLength() )
{
const SwTmpEndPortion aEnd( *pEndTempl );
GetFnt()->ChgPhysFnt( GetInfo().GetVsh(), *pOut );
@@ -465,7 +465,7 @@
// GetInfo().Y() must be current baseline.
SwTwips nDiff = GetInfo().Y() + nTmpHeight - nTmpAscent -
GetTxtFrm()->Frm().Bottom();
if( ( nDiff > 0 &&
- ( GetEnd() < GetInfo().GetTxt().Len() ||
+ ( GetEnd() < GetInfo().GetTxt().getLength() ||
( nDiff > nTmpHeight/2 && GetPrevLine() ) ) ) ||
(nDiff >= 0 && bNextUndersized) )
@@ -506,7 +506,7 @@
SwFont* pUnderlineFnt = 0;
Point aCommonBaseLine;
- Range aRange( 0, GetInfo().GetTxt().Len() );
+ Range aRange( 0, GetInfo().GetTxt().getLength() );
MultiSelection aUnderMulti( aRange );
OSL_ENSURE( GetFnt() && UNDERLINE_NONE != GetFnt()->GetUnderline(),
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index b5aa30f..c030373 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -33,10 +33,9 @@
* virtual SwExpandPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwExpandPortion::GetExpTxt( const SwTxtSizeInfo&,
- XubString &rTxt ) const
+sal_Bool SwExpandPortion::GetExpTxt( const SwTxtSizeInfo&, OUString &rTxt ) const
{
- rTxt.Erase();
+ rTxt = OUString();
// Nicht etwa: return 0 != rTxt.Len();
// Weil: leere Felder ersetzen CH_TXTATR gegen einen Leerstring
return sal_True;
@@ -142,7 +141,7 @@
return 0; // Nur noch BlankPortions unterwegs
// Wenn vor uns ein Blank ist, brauchen wir kein Underflow ausloesen,
// wenn hinter uns ein Blank ist, brauchen wir kein Underflow weiterreichen
- if( bUnderFlow && CH_BLANK == rInf.GetTxt().GetChar( nIdx + 1) )
+ if( bUnderFlow && CH_BLANK == rInf.GetTxt()[ nIdx + 1] )
return 0;
if( nIdx && !((SwTxtFormatInfo&)rInf).GetFly() )
{
@@ -231,9 +230,9 @@
* virtual SwBlankPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwBlankPortion::GetExpTxt( const SwTxtSizeInfo&, XubString &rTxt ) const
+sal_Bool SwBlankPortion::GetExpTxt( const SwTxtSizeInfo&, OUString &rTxt ) const
{
- rTxt = cChar;
+ rTxt = OUString(cChar);
return sal_True;
}
@@ -288,13 +287,12 @@
* virtual SwPostItsPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwPostItsPortion::GetExpTxt( const SwTxtSizeInfo &rInf,
- XubString &rTxt ) const
+sal_Bool SwPostItsPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
if( rInf.OnWin() && rInf.GetOpt().IsPostIts() )
- rTxt = ' ';
+ rTxt = OUString(' ');
else
- rTxt.Erase();
+ rTxt = OUString();
return sal_True;
}
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index cb7aa02..fc99428 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -32,7 +32,7 @@
inline SwExpandPortion() { SetWhichPor( POR_EXP ); }
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
@@ -60,7 +60,7 @@
void SetMulti( bool bNew ) { bMulti = bNew; }
virtual SwLinePortion *Compress();
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual void FormatEOL( SwTxtFormatInfo &rInf );
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
@@ -85,7 +85,7 @@
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
sal_Bool IsScript() const { return bScript; }
OUTPUT_OPERATOR
};
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 619e218..20846b3 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -50,9 +50,9 @@
*************************************************************************/
SwLinePortion *SwFldPortion::Compress()
-{ return (GetLen() || aExpand.Len() || SwLinePortion::Compress()) ? this : 0; }
+{ return (GetLen() || !aExpand.isEmpty() || SwLinePortion::Compress()) ? this : 0; }
-SwFldPortion *SwFldPortion::Clone( const XubString &rExpand ) const
+SwFldPortion *SwFldPortion::Clone( const OUString &rExpand ) const
{
SwFont *pNewFnt;
if( 0 != ( pNewFnt = pFnt ) )
@@ -71,11 +71,11 @@
{
OSL_ENSURE( pFld, "TakeNextOffset: Missing Source" );
nNextOffset = pFld->GetNextOffset();
- aExpand.Erase( 0, nNextOffset );
+ aExpand = aExpand.replaceAt( 0, nNextOffset, "" );
bFollow = sal_True;
}
-SwFldPortion::SwFldPortion( const XubString &rExpand, SwFont *pFont, bool bPlaceHold )
+SwFldPortion::SwFldPortion( const OUString &rExpand, SwFont *pFont, bool bPlaceHold )
: aExpand(rExpand), pFnt(pFont), nNextOffset(0), nNextScriptChg(STRING_LEN), nViewWidth(0),
bFollow( sal_False ), bHasFollow( sal_False ), bPlaceHolder( bPlaceHold )
, m_bNoLength( sal_False )
@@ -143,10 +143,10 @@
class SwFldSlot
{
- const XubString *pOldTxt;
- XubString aTxt;
- xub_StrLen nIdx;
- xub_StrLen nLen;
+ const OUString *pOldTxt;
+ OUString aTxt;
+ sal_Int32 nIdx;
+ sal_Int32 nLen;
sal_Bool bOn;
SwTxtFormatInfo *pInf;
public:
@@ -165,7 +165,7 @@
nIdx = pInf->GetIdx();
nLen = pInf->GetLen();
pOldTxt = &(pInf->GetTxt());
- pInf->SetLen( aTxt.Len() );
+ pInf->SetLen( aTxt.getLength() );
if( pPor->IsFollow() )
{
pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() );
@@ -173,10 +173,7 @@
}
else
{
- XubString aTmp( aTxt );
- aTxt = *pOldTxt;
- aTxt.Erase( nIdx, 1 );
- aTxt.Insert( aTmp, nIdx );
+ aTxt = (*pOldTxt).replaceAt(nIdx, 1, aTxt);
}
pInf->SetTxt( aTxt );
}
@@ -195,8 +192,8 @@
void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
{
- String aTxt;
- if( GetExpTxt( rInf, aTxt ) && aTxt.Len() && pBreakIt->GetBreakIter().is() )
+ OUString aTxt;
+ if( GetExpTxt( rInf, aTxt ) && !aTxt.isEmpty() && pBreakIt->GetBreakIter().is() )
{
sal_uInt8 nActual = pFnt ? pFnt->GetActual() : rInf.GetFont()->GetActual();
sal_uInt16 nScript;
@@ -206,17 +203,17 @@
if( i18n::ScriptType::WEAK == nScript )
{
nChg =(xub_StrLen)pBreakIt->GetBreakIter()->endOfScript(aTxt,0,nScript);
- if( nChg < aTxt.Len() )
+ if( nChg < aTxt.getLength() )
nScript = pBreakIt->GetBreakIter()->getScriptType( aTxt, nChg );
}
//
// nNextScriptChg will be evaluated during SwFldPortion::Format()
//
- if ( nChg < aTxt.Len() )
+ if ( nChg < aTxt.getLength() )
nNextScriptChg = (xub_StrLen)pBreakIt->GetBreakIter()->endOfScript( aTxt, nChg,
nScript );
else
- nNextScriptChg = aTxt.Len();
+ nNextScriptChg = aTxt.getLength();
}
sal_uInt8 nTmp;
@@ -238,8 +235,8 @@
if (bPerformUBA)
{
UErrorCode nError = U_ZERO_ERROR;
- UBiDi* pBidi = ubidi_openSized( aTxt.Len(), 0, &nError );
- ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aTxt.GetBuffer()), aTxt.Len(),
nFldDir, NULL, &nError );
+ UBiDi* pBidi = ubidi_openSized( aTxt.getLength(), 0, &nError );
+ ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aTxt.getStr()),
aTxt.getLength(), nFldDir, NULL, &nError );
int32_t nEnd;
UBiDiLevel nCurrDir;
ubidi_getLogicalRun( pBidi, 0, &nEnd, &nCurrDir );
@@ -254,7 +251,7 @@
nCurrDir = UBIDI_RTL;
for ( xub_StrLen nCharIdx = 0; nCharIdx < nEnd; ++nCharIdx )
{
- UCharDirection nCharDir = u_charDirection ( aTxt.GetChar ( nCharIdx ));
+ UCharDirection nCharDir = u_charDirection ( aTxt[ nCharIdx ]);
if ( nCharDir == U_LEFT_TO_RIGHT ||
nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
@@ -300,7 +297,7 @@
xub_StrLen nRest;
sal_Bool bFull;
bool bEOL = false;
- long nTxtRest = rInf.GetTxt().Len() - rInf.GetIdx();
+ long nTxtRest = rInf.GetTxt().getLength() - rInf.GetIdx();
{
SwFldSlot aDiffTxt( &rInf, this );
SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
@@ -371,13 +368,13 @@
{
// aExpand ist noch nicht gekuerzt worden, der neue Ofst
// ergibt sich durch nRest.
- xub_StrLen nNextOfst = aExpand.Len() - nRest;
+ sal_Int32 nNextOfst = aExpand.getLength() - nRest;
if ( IsQuoVadisPortion() )
nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().Len();
XubString aNew( aExpand, nNextOfst, STRING_LEN );
- aExpand.Erase( nNextOfst, STRING_LEN );
+ aExpand = aExpand.copy( 0, nNextOfst );
// These characters should not be contained in the follow
// field portion. They are handled via the HookChar mechanism.
@@ -455,14 +452,14 @@
* virtual SwFldPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwFldPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+sal_Bool SwFldPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
rTxt = aExpand;
- if( !rTxt.Len() && rInf.OnWin() &&
+ if( rTxt.isEmpty() && rInf.OnWin() &&
!rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() &&
SwViewOption::IsFieldShadings() &&
!HasFollow() )
- rTxt = ' ';
+ rTxt = OUString(' ');
return sal_True;
}
@@ -493,7 +490,7 @@
* class SwHiddenPortion
*************************************************************************/
-SwFldPortion *SwHiddenPortion::Clone(const XubString &rExpand ) const
+SwFldPortion *SwHiddenPortion::Clone(const OUString &rExpand ) const
{
SwFont *pNewFnt;
if( 0 != ( pNewFnt = pFnt ) )
@@ -519,7 +516,7 @@
* virtual SwHiddenPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwHiddenPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+sal_Bool SwHiddenPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
// Nicht auf IsHidden() abfragen !
return SwFldPortion::GetExpTxt( rInf, rTxt );
@@ -551,7 +548,7 @@
return 0;
}
-SwFldPortion *SwNumberPortion::Clone( const XubString &rExpand ) const
+SwFldPortion *SwNumberPortion::Clone( const OUString &rExpand ) const
{
SwFont *pNewFnt;
if( 0 != ( pNewFnt = pFnt ) )
@@ -701,7 +698,7 @@
pThis->Width( nOldWidth );
}
- if( aExpand.Len() )
+ if( !aExpand.isEmpty() )
{
const SwFont *pTmpFnt = rInf.GetFont();
bool bPaintSpace = ( UNDERLINE_NONE != pTmpFnt->GetUnderline() ||
@@ -1096,8 +1093,8 @@
{
SetLen(1);
SetWhichPor( POR_COMBINED );
- if( aExpand.Len() > 6 )
- aExpand.Erase( 6 );
+ if( aExpand.getLength() > 6 )
+ aExpand = aExpand.copy( 0, 6 );
// Initialization of the scripttype array,
// the arrays of width and position are filled by the format function
if( pBreakIt->GetBreakIter().is() )
@@ -1138,7 +1135,7 @@
if( rInf.OnWin() && pPortion && !pPortion->Width() )
pPortion->PrePaint( rInf, this );
- sal_uInt16 nCount = aExpand.Len();
+ sal_Int32 nCount = aExpand.getLength();
if( !nCount )
return;
OSL_ENSURE( nCount < 7, "Too much combined characters" );
@@ -1186,7 +1183,7 @@
sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
{
- sal_uInt16 nCount = aExpand.Len();
+ sal_Int32 nCount = aExpand.getLength();
if( !nCount )
{
Width( 0 );
@@ -1203,7 +1200,7 @@
{
// more than four? Ok, then we need the 2/3 font width
i = 0;
- while( i < aExpand.Len() )
+ while( i < aExpand.getLength() )
{
OSL_ENSURE( aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
if( !aWidth[ aScrType[i] ] )
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 971d86a..94f43b9 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -36,7 +36,7 @@
{
friend class SwTxtFormatter;
protected:
- XubString aExpand; // The expanded field
+ OUString aExpand; // The expanded field
SwFont *pFnt; // For multi-line fields
xub_StrLen nNextOffset; // Offset of the follow in the original string
xub_StrLen nNextScriptChg;
@@ -58,7 +58,7 @@
public:
SwFldPortion( const SwFldPortion& rFld );
- SwFldPortion( const XubString &rExpand, SwFont *pFnt = 0, bool bPlaceHolder = false );
+ SwFldPortion( const OUString &rExpand, SwFont *pFnt = 0, bool bPlaceHolder = false );
~SwFldPortion();
void TakeNextOffset( const SwFldPortion* pFld );
@@ -67,8 +67,8 @@
// #i89179# - made public
inline const SwFont *GetFont() const { return pFnt; }
- inline const XubString &GetExp() const { return aExpand; }
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ inline const OUString &GetExp() const { return aExpand; }
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
@@ -99,7 +99,7 @@
inline void SetNextScriptChg( xub_StrLen nNew ) { nNextScriptChg = nNew; }
// Field cloner for SplitGlue
- virtual SwFldPortion *Clone( const XubString &rExpand ) const;
+ virtual SwFldPortion *Clone( const OUString &rExpand ) const;
// Extra GetTxtSize because of pFnt
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
@@ -122,10 +122,10 @@
: SwFldPortion( rExpand, pFntL )
{ SetLen(1); SetWhichPor( POR_HIDDEN ); }
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
// Field cloner for SplitGlue
- virtual SwFldPortion *Clone( const XubString &rExpand ) const;
+ virtual SwFldPortion *Clone( const OUString &rExpand ) const;
OUTPUT_OPERATOR
};
@@ -152,7 +152,7 @@
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
// Field cloner for SplitGlue
- virtual SwFldPortion *Clone( const XubString &rExpand ) const;
+ virtual SwFldPortion *Clone( const OUString &rExpand ) const;
virtual void FormatEOL( SwTxtFormatInfo &rInf );
OUTPUT_OPERATOR
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 9b6068d..54446d9 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -77,7 +77,7 @@
rInf.GetParaPortion()->SetFly( sal_True );
// trailing blank:
- if( rInf.GetIdx() < rInf.GetTxt().Len() && 1 < rInf.GetIdx()
+ if( rInf.GetIdx() < rInf.GetTxt().getLength() && 1 < rInf.GetIdx()
&& !rInf.GetRest()
&& ' ' == rInf.GetChar( rInf.GetIdx() )
&& ' ' != rInf.GetChar( rInf.GetIdx() - 1 )
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index d342eb3..f45a8b0 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -41,7 +41,7 @@
inline KSHORT& Orig() { return nOrigHeight; }
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
@@ -77,14 +77,14 @@
SwQuoVadisPortion( const XubString &rExp, const XubString& rStr );
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
inline void SetNumber( const XubString& rStr ) { aErgo = rStr; }
- inline const XubString &GetQuoTxt() const { return aExpand; }
+ inline const OUString GetQuoTxt() const { return aExpand; }
inline const XubString &GetContTxt() const { return aErgo; }
// Field cloner for SplitGlue
- virtual SwFldPortion *Clone( const XubString &rExpand ) const;
+ virtual SwFldPortion *Clone( const OUString &rExpand ) const;
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
@@ -104,7 +104,7 @@
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
// Field cloner for SplitGlue
- virtual SwFldPortion *Clone( const XubString &rExpand ) const;
+ virtual SwFldPortion *Clone( const OUString &rExpand ) const;
OUTPUT_OPERATOR
};
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 8ce717d..bc20492 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -66,7 +66,7 @@
* virtual SwGluePortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwGluePortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+sal_Bool SwGluePortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
if( GetLen() && rInf.OnWin() &&
rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() )
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index 25d3c99..c47d127 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -47,7 +47,7 @@
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
OUTPUT_OPERATOR
};
diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx
index 8a78dac..8e68bc3 100644
--- a/sw/source/core/text/porhyph.hxx
+++ b/sw/source/core/text/porhyph.hxx
@@ -29,7 +29,7 @@
{
public:
inline SwHyphPortion( ) { SetWhichPor( POR_HYPH ); }
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
// Accessibility: pass information about this portion to the PortionHandler
@@ -47,7 +47,7 @@
XubString aExpand;
public:
inline SwHyphStrPortion( const XubString &rStr );
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
@@ -67,7 +67,7 @@
public:
SwSoftHyphPortion();
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual SwLinePortion *Compress();
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 6fa5b43..e61adeb 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -459,8 +459,8 @@
{
if ( pPos->InExpGrp() )
{
- XubString aTxt;
- if( pPos->GetExpTxt( rInf, aTxt ) && aTxt.Len() )
+ OUString aTxt;
+ if( pPos->GetExpTxt( rInf, aTxt ) && !aTxt.isEmpty() )
SetCntnt( sal_True );
}
else if( ( pPos->InTxtGrp() || pPos->IsMultiPortion() ) &&
@@ -628,7 +628,7 @@
* Sw Script Types (SW_LATIN, SW_CJK, SW_CTL), used to identify the font
*************************************************************************/
-sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
+sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const OUString* pTxt, const SwScriptInfo* pSI )
{
SAL_WARN_IF( !pTxt && !pSI, "sw.core", "How should I determine the script type?" );
sal_uInt16 nScript;
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 69017ec..586f037 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -374,7 +374,7 @@
* virtual SwLinePortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &, XubString & ) const
+sal_Bool SwLinePortion::GetExpTxt( const SwTxtSizeInfo &, OUString & ) const
{
return sal_False;
}
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index fb7ac39..12f275b 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -176,7 +176,7 @@
void Move( SwTxtPaintInfo &rInf );
// For SwTxtSlot
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
// For SwFldPortion, SwSoftHyphPortion
virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index e99fcc9..18951c5 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -233,8 +233,8 @@
// Calculate number of blanks for justified alignment
SwLinePortion* pPor = GetRoot().GetFirstPortion();
xub_StrLen nTmpStart = rInf.GetIdx();
- xub_StrLen nNull = 0;
- xub_StrLen nBlanks;
+ sal_Int32 nNull = 0;
+ sal_Int32 nBlanks;
for( nBlanks = 0; pPor; pPor = pPor->GetPortion() )
{
@@ -318,14 +318,14 @@
sal_uInt8 nTmp = SW_SCRIPTS;
if( pBracket->cPre > 255 )
{
- String aTxt = OUString(pBracket->cPre);
+ OUString aTxt = OUString(pBracket->cPre);
nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
}
pBracket->nPreScript = nTmp;
nTmp = SW_SCRIPTS;
if( pBracket->cPost > 255 )
{
- String aTxt = OUString(pBracket->cPost);
+ OUString aTxt = OUString(pBracket->cPost);
nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
}
pBracket->nPostScript = nTmp;
@@ -483,8 +483,8 @@
void SwDoubleLinePortion::CalcBlanks( SwTxtFormatInfo &rInf )
{
SwLinePortion* pPor = GetRoot().GetFirstPortion();
- xub_StrLen nNull = 0;
- xub_StrLen nStart = rInf.GetIdx();
+ sal_Int32 nNull = 0;
+ sal_Int32 nStart = rInf.GetIdx();
SetTab1( sal_False );
SetTab2( sal_False );
for( nBlank1 = 0; pPor; pPor = pPor->GetPortion() )
@@ -707,7 +707,7 @@
case 3: nSub = 1; // no break
case 4:
{
- xub_StrLen nCharCnt = 0;
+ sal_Int32 nCharCnt = 0;
SwLinePortion *pPor;
for( pPor = pCurr->GetFirstPortion(); pPor; pPor = pPor->GetPortion() )
{
@@ -908,7 +908,7 @@
else
nNextLevel = rSI.DirType( rPos );
- if ( GetTxt().Len() != rPos && nNextLevel > nCurrLevel )
+ if ( GetTxt().getLength() != rPos && nNextLevel > nCurrLevel )
{
rPos = bFldBidi ? rPos + 1 : rSI.NextDirChg( rPos, &nCurrLevel );
if ( STRING_LEN == rPos )
@@ -994,7 +994,7 @@
return pRet;
}
if( n2Lines < nCount || ( pItem && pItem == p2Lines &&
- rPos < GetTxt().Len() ) )
+ rPos < GetTxt().getLength() ) )
{ // The winner is a 2-line-attribute,
// the end of the multiportion depends on the following attributes...
SwMultiCreator *pRet = new SwMultiCreator;
@@ -1014,7 +1014,7 @@
aEnd.push_front( *pRet->pAttr->GetEnd() );
if( pItem )
{
- aEnd.front() = GetTxt().Len();
+ aEnd.front() = GetTxt().getLength();
bOn = ((SvxTwoLinesItem*)pItem)->GetEndBracket() ==
p2Lines->GetEndBracket() &&
((SvxTwoLinesItem*)pItem)->GetStartBracket() ==
@@ -1025,7 +1025,7 @@
{
pRet->pItem = pItem;
pRet->pAttr = NULL;
- aEnd.push_front( GetTxt().Len() );
+ aEnd.push_front( GetTxt().getLength() );
}
pRet->nId = SW_MC_DOUBLE;
pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
@@ -1110,7 +1110,7 @@
return pRet;
}
if( nRotate < nCount || ( pRotItem && pRotItem == pRotate &&
- rPos < GetTxt().Len() ) )
+ rPos < GetTxt().getLength() ) )
{ // The winner is a rotate-attribute,
// the end of the multiportion depends on the following attributes...
SwMultiCreator *pRet = new SwMultiCreator;
@@ -1122,7 +1122,7 @@
// The bOn flag signs the state of the last 2-line attribute in the
// aEnd-stack, which could interrupts the winning rotation attribute.
sal_Bool bOn = pItem ? sal_True : sal_False;
- aEnd.push_front( GetTxt().Len() );
+ aEnd.push_front( GetTxt().getLength() );
// n2Lines is the index of the last 2-line-attribute, which contains
// the actual position.
i = 0;
@@ -1188,7 +1188,7 @@
aEnd.push_front( *pRet->pAttr->GetEnd() );
if( pRotItem )
{
- aEnd.front() = GetTxt().Len();
+ aEnd.front() = GetTxt().getLength();
bOn = ((SvxCharRotateItem*)pRotItem)->GetValue() ==
pRotate->GetValue();
}
@@ -1197,7 +1197,7 @@
{
pRet->pItem = pRotItem;
pRet->pAttr = NULL;
- aEnd.push_front( GetTxt().Len() );
+ aEnd.push_front( GetTxt().getLength() );
}
i = 0;
while( i < nCount )
@@ -1843,7 +1843,7 @@
}
// save some values
- const XubString* pOldTxt = &(rInf.GetTxt());
+ const OUString* pOldTxt = &(rInf.GetTxt());
const SwTwips nOldPaintOfst = rInf.GetPaintOfst();
XubString aMultiStr( rInf.GetTxt(), 0, nMultiLen + rInf.GetIdx() );
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 14b6ac2..74901cd 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -110,7 +110,7 @@
Width( 0 );
Height( pRoot->Height() );
SetAscent( pRoot->GetAscent() );
- if ( rInf.GetIdx()+1 == rInf.GetTxt().Len() )
+ if ( rInf.GetIdx()+1 == rInf.GetTxt().getLength() )
rInf.SetNewLine( sal_True );
return sal_True;
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 26972e6..73528ed 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -50,17 +50,17 @@
* (for justified alignment).
*************************************************************************/
-static sal_uInt16 lcl_AddSpace( const SwTxtSizeInfo &rInf, const XubString* pStr,
- const SwLinePortion& rPor )
+static sal_Int32 lcl_AddSpace( const SwTxtSizeInfo &rInf, const OUString* pStr,
+ const SwLinePortion& rPor )
{
- xub_StrLen nPos, nEnd;
+ sal_Int32 nPos, nEnd;
const SwScriptInfo* pSI = 0;
if ( pStr )
{
// passing a string means we are inside a field
nPos = 0;
- nEnd = pStr->Len();
+ nEnd = pStr->getLength();
}
else
{
@@ -70,7 +70,7 @@
pSI = &((SwParaPortion*)rInf.GetParaPortion())->GetScriptInfo();
}
- sal_uInt16 nCnt = 0;
+ sal_Int32 nCnt = 0;
sal_uInt8 nScript = 0;
// If portion consists of Asian characters and language is not
@@ -162,7 +162,7 @@
for ( ; nPos < nEnd; ++nPos )
{
- if( CH_BLANK == pStr->GetChar( nPos ) )
+ if( CH_BLANK == (*pStr)[ nPos ] )
++nCnt;
}
@@ -172,7 +172,7 @@
// nPos referes to the original string, even if a field string has
// been passed to this function
nPos = rInf.GetIdx() + rPor.GetLen();
- if ( nPos < rInf.GetTxt().Len() )
+ if ( nPos < rInf.GetTxt().getLength() )
{
sal_uInt8 nNextScript = 0;
const SwLinePortion* pPor = rPor.GetPortion();
@@ -188,7 +188,7 @@
bool bOldOnWin = rInf.OnWin();
((SwTxtSizeInfo &)rInf).SetOnWin( false );
- XubString aStr;
+ OUString aStr;
pPor->GetExpTxt( rInf, aStr );
((SwTxtSizeInfo &)rInf).SetOnWin( bOldOnWin );
@@ -289,8 +289,8 @@
static bool lcl_HasContent( const SwFldPortion& rFld, SwTxtFormatInfo &rInf )
{
- String aTxt;
- return rFld.GetExpTxt( rInf, aTxt ) && aTxt.Len();
+ OUString aTxt;
+ return rFld.GetExpTxt( rInf, aTxt ) && !aTxt.isEmpty();
}
sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
@@ -497,7 +497,7 @@
{
if( ( !GetPortion() || ( GetPortion()->IsKernPortion() &&
!GetPortion()->GetPortion() ) ) && GetLen() &&
- rInf.GetIdx() < rInf.GetTxt().Len() &&
+ rInf.GetIdx() < rInf.GetTxt().getLength() &&
1 < rInf.GetIdx() && ' ' == rInf.GetChar( rInf.GetIdx() - 1 )
&& !rInf.GetLast()->IsHolePortion() )
{
@@ -548,13 +548,13 @@
*************************************************************************/
void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- if (rInf.OnWin() && 1==rInf.GetLen() &&
CH_TXT_ATR_FIELDEND==rInf.GetTxt().GetChar(rInf.GetIdx()))
+ if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetTxt()[rInf.GetIdx()])
{
rInf.DrawBackBrush( *this );
const OUString aTxt(CH_TXT_ATR_SUBST_FIELDEND);
rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false );
}
- else if (rInf.OnWin() && 1==rInf.GetLen() &&
CH_TXT_ATR_FIELDSTART==rInf.GetTxt().GetChar(rInf.GetIdx()))
+ else if (rInf.OnWin() && 1==rInf.GetLen() &&
CH_TXT_ATR_FIELDSTART==rInf.GetTxt()[rInf.GetIdx()])
{
rInf.DrawBackBrush( *this );
const OUString aTxt(CH_TXT_ATR_SUBST_FIELDSTART);
@@ -590,7 +590,7 @@
-sal_Bool SwTxtPortion::GetExpTxt( const SwTxtSizeInfo &, XubString & ) const
+sal_Bool SwTxtPortion::GetExpTxt( const SwTxtSizeInfo &, OUString & ) const
{
return sal_False;
}
@@ -602,11 +602,11 @@
* count and the resulting added space.
*************************************************************************/
-xub_StrLen SwTxtPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf,
- xub_StrLen& rCharCnt ) const
+sal_Int32 SwTxtPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf,
+ sal_Int32& rCharCnt ) const
{
- xub_StrLen nCnt = 0;
- xub_StrLen nPos = 0;
+ sal_Int32 nCnt = 0;
+ sal_Int32 nPos = 0;
if ( InExpGrp() )
{
if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
@@ -616,12 +616,12 @@
bool bOldOnWin = rInf.OnWin();
((SwTxtSizeInfo &)rInf).SetOnWin( false );
- XubString aStr;
+ OUString aStr;
GetExpTxt( rInf, aStr );
((SwTxtSizeInfo &)rInf).SetOnWin( bOldOnWin );
nCnt = nCnt + lcl_AddSpace( rInf, &aStr, *this );
- nPos = aStr.Len();
+ nPos = aStr.getLength();
}
}
else if( !IsDropPortion() )
@@ -646,7 +646,7 @@
bool bOldOnWin = rInf.OnWin();
((SwTxtSizeInfo &)rInf).SetOnWin( false );
- XubString aStr;
+ OUString aStr;
GetExpTxt( rInf, aStr );
((SwTxtSizeInfo &)rInf).SetOnWin( bOldOnWin );
if( nSpaceAdd > 0 )
@@ -654,7 +654,7 @@
else
{
nSpaceAdd = -nSpaceAdd;
- nCnt = aStr.Len();
+ nCnt = aStr.getLength();
}
}
}
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 90e6b3e..97d4ff4 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -48,11 +48,11 @@
virtual void FormatEOL( SwTxtFormatInfo &rInf );
virtual xub_StrLen GetCrsrOfst( const KSHORT nOfst ) const;
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
- virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
virtual long CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo &rInf ) const;
// Counts the spaces for justified paragraph
- xub_StrLen GetSpaceCnt( const SwTxtSizeInfo &rInf, xub_StrLen& rCnt ) const;
+ sal_Int32 GetSpaceCnt( const SwTxtSizeInfo &rInf, sal_Int32& rCnt ) const;
sal_Bool CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess );
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 6536cbb..3eaa84a 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -613,7 +613,7 @@
// find next attribute change / script change
const xub_StrLen nTmpIdx = nNextChg;
- xub_StrLen nNextAttr = Min( GetNextAttr(), rInf.GetTxt().Len() );
+ sal_Int32 nNextAttr = Min( static_cast<sal_Int32>(GetNextAttr()),
rInf.GetTxt().getLength() );
nNextChg = pScriptInfo->NextScriptChg( nTmpIdx );
if( nNextChg > nNextAttr )
nNextChg = nNextAttr;
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 41ec497..9d4a338 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1343,7 +1343,7 @@
else
{
// examine text and set script
- String aTmpStr( rFtn.GetViewNumStr( *pDoc ) );
+ OUString aTmpStr( rFtn.GetViewNumStr( *pDoc ) );
pFnt->SetActual( SwScriptInfo::WhichFont( 0, &aTmpStr, 0 ) );
}
@@ -1418,7 +1418,7 @@
* SwFtnPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwFtnPortion::GetExpTxt( const SwTxtSizeInfo &, XubString &rTxt ) const
+sal_Bool SwFtnPortion::GetExpTxt( const SwTxtSizeInfo &, OUString &rTxt ) const
{
rTxt = aExpand;
return sal_True;
@@ -1483,7 +1483,7 @@
* class SwQuoVadisPortion
*************************************************************************/
-SwFldPortion *SwQuoVadisPortion::Clone( const XubString &rExpand ) const
+SwFldPortion *SwQuoVadisPortion::Clone( const OUString &rExpand ) const
{ return new SwQuoVadisPortion( rExpand, aErgo ); }
SwQuoVadisPortion::SwQuoVadisPortion( const XubString &rExp, const XubString& rStr )
@@ -1528,7 +1528,7 @@
* virtual SwQuoVadisPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwQuoVadisPortion::GetExpTxt( const SwTxtSizeInfo &, XubString &rTxt ) const
+sal_Bool SwQuoVadisPortion::GetExpTxt( const SwTxtSizeInfo &, OUString &rTxt ) const
{
rTxt = aExpand;
// if this QuoVadisPortion has a follow, the follow is responsible for
@@ -1570,7 +1570,7 @@
* class SwErgoSumPortion
*************************************************************************/
-SwFldPortion *SwErgoSumPortion::Clone( const XubString &rExpand ) const
+SwFldPortion *SwErgoSumPortion::Clone( const OUString &rExpand ) const
{
return new SwErgoSumPortion( rExpand, OUString() );
}
@@ -1582,7 +1582,7 @@
aExpand += rStr;
// 7773: sinnvolle Massnahme: ein Blank Abstand zum Text
- aExpand += ' ';
+ aExpand += OUString(' ');
SetWhichPor( POR_ERGOSUM );
}
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index c4dee6e..f41bc62 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -238,7 +238,7 @@
bRet = 0 != nLen;
if( bRet )
{
- XubString aSelTxt( rInf.GetTxt().Copy(nWrdStart, nLen) );
+ XubString aSelTxt( rInf.GetTxt().copy(nWrdStart, nLen) );
{
MSHORT nMinTrail = 0;
@@ -299,7 +299,7 @@
xub_StrLen nTmpLen = 0;
// soft hyphen at alternative spelling position?
- if( rInf.GetTxt().GetChar( rInf.GetSoftHyphPos() ) == CHAR_SOFTHYPHEN )
+ if( rInf.GetTxt()[ rInf.GetSoftHyphPos() ] == CHAR_SOFTHYPHEN )
{
pHyphPor = new SwSoftHyphStrPortion( aAltTxt );
nTmpLen = 1;
@@ -371,7 +371,7 @@
* virtual SwHyphPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
// #i16816# tagged pdf support
const sal_Unicode cChar = rInf.GetVsh() &&
@@ -380,7 +380,7 @@
0xad :
'-';
- rTxt = cChar;
+ rTxt = OUString(cChar);
return sal_True;
}
@@ -403,7 +403,7 @@
const SwLinePortion *pLast = rInf.GetLast();
Height( pLast->Height() );
SetAscent( pLast->GetAscent() );
- XubString aTxt;
+ OUString aTxt;
if( !GetExpTxt( rInf, aTxt ) )
return sal_False;
@@ -422,7 +422,7 @@
* virtual SwHyphStrPortion::GetExpTxt()
*************************************************************************/
-sal_Bool SwHyphStrPortion::GetExpTxt( const SwTxtSizeInfo &, XubString &rTxt ) const
+sal_Bool SwHyphStrPortion::GetExpTxt( const SwTxtSizeInfo &, OUString &rTxt ) const
{
rTxt = aExpand;
return sal_True;
@@ -599,7 +599,7 @@
* - wenn wir vor einem (echten/emuliertem) Zeilenumbruch stehen
*************************************************************************/
-sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const
{
if( IsExpand() || ( rInf.OnWin() && rInf.GetOpt().IsSoftHyph() ) ||
( GetPortion() && ( GetPortion()->InFixGrp() ||
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index c6eda0a..18cf802 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -432,7 +432,7 @@
// In tabulator compatibility mode, we reset the bFull flag
// if the tabulator is at the end of the paragraph and the
// tab stop position is outside the frame:
- bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetTxt().Len();
+ bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetTxt().getLength();
if ( bFull && bTabCompat &&
( ( bTabOverflow && ( rInf.IsTabOverflow() || !IsAutoTabStop() ) ) ||
bAtParaEnd ) &&
GetTabPos() >= rInf.GetTxtFrm()->Frm().Width() )
--
To view, visit https://gerrit.libreoffice.org/3266
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I29cce32f8f6ae760397ae0633ebfa56942a7cd6d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christina Roßmanith <ChrRossmanith@web.de>
Context
- [PATCH] Use OUString and sal_Int32 in sw · via Code Review
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.