Related: fdo#38838 remove XubString alias
Change-Id: I29efbe2bee94c0059f5a2e3dc4d163375e439e1a
This commit is contained in:
@@ -1301,7 +1301,7 @@ ContentNode::ContentNode( SfxItemPool& rPool ) : aContentAttribs( rPool )
|
||||
DBG_CTOR( EE_ContentNode, 0 );
|
||||
}
|
||||
|
||||
ContentNode::ContentNode( const XubString& rStr, const ContentAttribs& rContentAttribs ) :
|
||||
ContentNode::ContentNode( const OUString& rStr, const ContentAttribs& rContentAttribs ) :
|
||||
maString(rStr), aContentAttribs(rContentAttribs)
|
||||
{
|
||||
DBG_CTOR( EE_ContentNode, 0 );
|
||||
@@ -1697,12 +1697,12 @@ void ContentNode::SetChar(sal_uInt16 nPos, sal_Unicode c)
|
||||
maString = maString.replaceAt(nPos, 1, OUString(c));
|
||||
}
|
||||
|
||||
void ContentNode::Insert(const XubString& rStr, sal_uInt16 nPos)
|
||||
void ContentNode::Insert(const OUString& rStr, sal_uInt16 nPos)
|
||||
{
|
||||
maString = maString.replaceAt(nPos, 0, rStr);
|
||||
}
|
||||
|
||||
void ContentNode::Append(const XubString& rStr)
|
||||
void ContentNode::Append(const OUString& rStr)
|
||||
{
|
||||
maString += rStr;
|
||||
}
|
||||
@@ -1717,12 +1717,12 @@ void ContentNode::Erase(sal_uInt16 nPos, sal_uInt16 nCount)
|
||||
maString = maString.replaceAt(nPos, nCount, "");
|
||||
}
|
||||
|
||||
XubString ContentNode::Copy(sal_uInt16 nPos) const
|
||||
OUString ContentNode::Copy(sal_uInt16 nPos) const
|
||||
{
|
||||
return maString.copy(nPos);
|
||||
}
|
||||
|
||||
XubString ContentNode::Copy(sal_uInt16 nPos, sal_uInt16 nCount) const
|
||||
OUString ContentNode::Copy(sal_uInt16 nPos, sal_uInt16 nCount) const
|
||||
{
|
||||
return maString.copy(nPos, nCount);
|
||||
}
|
||||
@@ -2126,12 +2126,12 @@ OUString EditDoc::GetText( LineEnd eEnd ) const
|
||||
return OUString(newStr, SAL_NO_ACQUIRE);
|
||||
}
|
||||
|
||||
XubString EditDoc::GetParaAsString( sal_Int32 nNode ) const
|
||||
OUString EditDoc::GetParaAsString( sal_Int32 nNode ) const
|
||||
{
|
||||
return GetParaAsString( GetObject( nNode ) );
|
||||
}
|
||||
|
||||
XubString EditDoc::GetParaAsString(
|
||||
OUString EditDoc::GetParaAsString(
|
||||
const ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, bool bResolveFields) const
|
||||
{
|
||||
if ( nEndPos > pNode->Len() )
|
||||
@@ -2140,7 +2140,7 @@ XubString EditDoc::GetParaAsString(
|
||||
DBG_ASSERT( nStartPos <= nEndPos, "Start and End reversed?" );
|
||||
|
||||
sal_uInt16 nIndex = nStartPos;
|
||||
XubString aStr;
|
||||
OUString aStr;
|
||||
const EditCharAttrib* pNextFeature = pNode->GetCharAttribs().FindFeature( nIndex );
|
||||
while ( nIndex < nEndPos )
|
||||
{
|
||||
@@ -2154,15 +2154,15 @@ XubString EditDoc::GetParaAsString(
|
||||
//!! beware of sub string length of -1 which is also defined as STRING_LEN and
|
||||
//!! thus would result in adding the whole sub string up to the end of the node !!
|
||||
if (nEnd > nIndex)
|
||||
aStr += XubString(pNode->GetString(), nIndex, nEnd - nIndex);
|
||||
aStr += pNode->GetString().copy(nIndex, nEnd - nIndex);
|
||||
|
||||
if ( pNextFeature )
|
||||
{
|
||||
switch ( pNextFeature->GetItem()->Which() )
|
||||
{
|
||||
case EE_FEATURE_TAB: aStr += '\t';
|
||||
case EE_FEATURE_TAB: aStr += "\t";
|
||||
break;
|
||||
case EE_FEATURE_LINEBR: aStr += '\x0A';
|
||||
case EE_FEATURE_LINEBR: aStr += "\x0A";
|
||||
break;
|
||||
case EE_FEATURE_FIELD:
|
||||
if ( bResolveFields )
|
||||
@@ -2266,16 +2266,16 @@ EditPaM EditDoc::RemoveText()
|
||||
return aPaM;
|
||||
}
|
||||
|
||||
EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr )
|
||||
EditPaM EditDoc::InsertText( EditPaM aPaM, const OUString& rStr )
|
||||
{
|
||||
DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( rStr.Search( '\t' ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( rStr.indexOf( 0x0A ) == -1, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( rStr.indexOf( 0x0D ) == -1, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( rStr.indexOf( '\t' ) == -1, "EditDoc::InsertText: Newlines prohibited in paragraph!" );
|
||||
DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertText1" );
|
||||
|
||||
aPaM.GetNode()->Insert( rStr, aPaM.GetIndex() );
|
||||
aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), rStr.Len(), GetItemPool() );
|
||||
aPaM.GetIndex() = aPaM.GetIndex() + rStr.Len();
|
||||
aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), rStr.getLength(), GetItemPool() );
|
||||
aPaM.GetIndex() = aPaM.GetIndex() + rStr.getLength();
|
||||
|
||||
SetModified( sal_True );
|
||||
|
||||
@@ -2287,7 +2287,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs )
|
||||
DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertParaBreak" );
|
||||
ContentNode* pCurNode = aPaM.GetNode();
|
||||
sal_Int32 nPos = GetPos( pCurNode );
|
||||
XubString aStr = aPaM.GetNode()->Copy( aPaM.GetIndex() );
|
||||
OUString aStr = aPaM.GetNode()->Copy( aPaM.GetIndex() );
|
||||
aPaM.GetNode()->Erase( aPaM.GetIndex() );
|
||||
|
||||
// the paragraph attributes...
|
||||
@@ -2304,8 +2304,8 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs )
|
||||
SfxStyleSheet* pStyle = aPaM.GetNode()->GetStyleSheet();
|
||||
if ( pStyle )
|
||||
{
|
||||
XubString aFollow( pStyle->GetFollow() );
|
||||
if ( aFollow.Len() && ( aFollow != pStyle->GetName() ) )
|
||||
OUString aFollow( pStyle->GetFollow() );
|
||||
if ( !aFollow.isEmpty() && ( aFollow != pStyle->GetName() ) )
|
||||
{
|
||||
SfxStyleSheetBase* pNext = pStyle->GetPool().Find( aFollow, pStyle->GetFamily() );
|
||||
pNode->SetStyleSheet( (SfxStyleSheet*)pNext );
|
||||
|
||||
@@ -263,7 +263,7 @@ private:
|
||||
|
||||
public:
|
||||
ContentNode( SfxItemPool& rItemPool );
|
||||
ContentNode( const XubString& rStr, const ContentAttribs& rContentAttribs );
|
||||
ContentNode( const OUString& rStr, const ContentAttribs& rContentAttribs );
|
||||
~ContentNode();
|
||||
|
||||
ContentAttribs& GetContentAttribs() { return aContentAttribs; }
|
||||
@@ -297,12 +297,12 @@ public:
|
||||
const OUString& GetString() const;
|
||||
|
||||
void SetChar(sal_uInt16 nPos, sal_Unicode c);
|
||||
void Insert(const XubString& rStr, sal_uInt16 nPos);
|
||||
void Append(const XubString& rStr);
|
||||
void Insert(const OUString& rStr, sal_uInt16 nPos);
|
||||
void Append(const OUString& rStr);
|
||||
void Erase(sal_uInt16 nPos);
|
||||
void Erase(sal_uInt16 nPos, sal_uInt16 nCount);
|
||||
XubString Copy(sal_uInt16 nPos) const;
|
||||
XubString Copy(sal_uInt16 nPos, sal_uInt16 nCount) const;
|
||||
OUString Copy(sal_uInt16 nPos) const;
|
||||
OUString Copy(sal_uInt16 nPos, sal_uInt16 nCount) const;
|
||||
sal_Unicode GetChar(sal_uInt16 nPos) const;
|
||||
};
|
||||
|
||||
@@ -774,7 +774,7 @@ public:
|
||||
EditPaM Clear();
|
||||
EditPaM RemoveText();
|
||||
EditPaM RemoveChars( EditPaM aPaM, sal_uInt16 nChars );
|
||||
EditPaM InsertText( EditPaM aPaM, const XubString& rStr );
|
||||
EditPaM InsertText( EditPaM aPaM, const OUString& rStr );
|
||||
EditPaM InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs );
|
||||
EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem );
|
||||
EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight );
|
||||
@@ -782,8 +782,8 @@ public:
|
||||
OUString GetText( LineEnd eEnd ) const;
|
||||
sal_uLong GetTextLen() const;
|
||||
|
||||
XubString GetParaAsString( sal_Int32 nNode ) const;
|
||||
XubString GetParaAsString(const ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, bool bResolveFields = true) const;
|
||||
OUString GetParaAsString( sal_Int32 nNode ) const;
|
||||
OUString GetParaAsString(const ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, bool bResolveFields = true) const;
|
||||
|
||||
EditPaM GetStartPaM() const;
|
||||
EditPaM GetEndPaM() const;
|
||||
|
||||
@@ -119,7 +119,6 @@ inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[7
|
||||
#endif
|
||||
|
||||
#define UniString String
|
||||
#define XubString String
|
||||
#define xub_StrLen sal_uInt16
|
||||
|
||||
#define STRING_CONCAT3( s1, s2, s3 ) \
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ class SwFmtRefMark : public SfxPoolItem
|
||||
OUString aRefName;
|
||||
|
||||
public:
|
||||
SwFmtRefMark( const String& rTxt );
|
||||
SwFmtRefMark( const OUString& rTxt );
|
||||
SwFmtRefMark( const SwFmtRefMark& rRefMark );
|
||||
~SwFmtRefMark( );
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace {
|
||||
: 0;
|
||||
const xub_StrLen nTxtFrmTextEndPos = rTxtFrm.HasFollow()
|
||||
? rTxtFrm.GetFollow()->GetOfst()
|
||||
: rTxtFrm.GetTxt().Len();
|
||||
: rTxtFrm.GetTxt().getLength();
|
||||
|
||||
// iteration over the redlines which overlap with the text node.
|
||||
const SwRedlineTbl& rRedlineTbl = pIDocChangeTrack->GetRedlineTbl();
|
||||
|
||||
@@ -104,8 +104,8 @@ class SwSubFont : public SvxFont
|
||||
inline void SetProportion( const sal_uInt8 nNewPropr );
|
||||
|
||||
inline void SetFamily( const FontFamily eFamily );
|
||||
inline void SetName( const XubString& rName );
|
||||
inline void SetStyleName( const XubString& rStyleName );
|
||||
inline void SetName( const OUString& rName );
|
||||
inline void SetStyleName( const OUString& rStyleName );
|
||||
inline void SetSize( const Size& rSize );
|
||||
inline void SetWeight( const FontWeight eWeight );
|
||||
inline void SetLanguage( LanguageType eNewLang );
|
||||
@@ -227,8 +227,8 @@ public:
|
||||
inline void SetPropWidth( const sal_uInt16 nNew );
|
||||
|
||||
inline void SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich );
|
||||
inline void SetName( const XubString& rName, const sal_uInt8 nWhich );
|
||||
inline void SetStyleName( const XubString& rStyleName, const sal_uInt8 nWhich );
|
||||
inline void SetName( const OUString& rName, const sal_uInt8 nWhich );
|
||||
inline void SetStyleName( const OUString& rStyleName, const sal_uInt8 nWhich );
|
||||
inline void SetSize( const Size& rSize, const sal_uInt8 nWhich );
|
||||
inline void SetWeight( const FontWeight eWeight, const sal_uInt8 nWhich );
|
||||
inline void SetItalic( const FontItalic eItalic, const sal_uInt8 nWhich );
|
||||
@@ -329,7 +329,7 @@ public:
|
||||
{ return aSub[nActual].GetCapitalSize( rInf ); }
|
||||
|
||||
xub_StrLen GetCapitalBreak( ViewShell* pSh, const OutputDevice* pOut,
|
||||
const SwScriptInfo* pScript, const XubString& rTxt,
|
||||
const SwScriptInfo* pScript, const OUString& rTxt,
|
||||
long nTextWidth, const xub_StrLen nIdx,
|
||||
const xub_StrLen nLen );
|
||||
|
||||
@@ -485,26 +485,26 @@ inline void SwFont::SetFamily( const FontFamily eFamily, const sal_uInt8 nWhich
|
||||
}
|
||||
|
||||
// gekapselte SV-Font-Methode
|
||||
inline void SwSubFont::SetName( const XubString& rName )
|
||||
inline void SwSubFont::SetName( const OUString& rName )
|
||||
{
|
||||
pMagic = 0;
|
||||
Font::SetName( rName );
|
||||
}
|
||||
|
||||
inline void SwFont::SetName( const XubString& rName, const sal_uInt8 nWhich )
|
||||
inline void SwFont::SetName( const OUString& rName, const sal_uInt8 nWhich )
|
||||
{
|
||||
bFntChg = sal_True;
|
||||
aSub[nWhich].SetName( rName );
|
||||
}
|
||||
|
||||
// gekapselte SV-Font-Methode
|
||||
inline void SwSubFont::SetStyleName( const XubString& rStyleName )
|
||||
inline void SwSubFont::SetStyleName( const OUString& rStyleName )
|
||||
{
|
||||
pMagic = 0;
|
||||
Font::SetStyleName( rStyleName );
|
||||
}
|
||||
|
||||
inline void SwFont::SetStyleName( const XubString& rStyle, const sal_uInt8 nWhich )
|
||||
inline void SwFont::SetStyleName( const OUString& rStyle, const sal_uInt8 nWhich )
|
||||
{
|
||||
bFntChg = sal_True;
|
||||
aSub[nWhich].SetStyleName( rStyle );
|
||||
|
||||
@@ -155,8 +155,8 @@ class SwTxtFrm: public SwCntntFrm
|
||||
sal_Bool CalcFollow( const xub_StrLen nTxtOfst );
|
||||
|
||||
// korrigiert die Stelle ab der formatiert werden muss.
|
||||
xub_StrLen FindBrk(const String &rTxt, const xub_StrLen nStart,
|
||||
const xub_StrLen nEnd) const;
|
||||
xub_StrLen FindBrk(const OUString &rTxt, const sal_Int32 nStart,
|
||||
const sal_Int32 nEnd) const;
|
||||
|
||||
// inline-Weiche
|
||||
SwTwips _GetFtnFrmHeight() const;
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
{ return GetFollow() && !GetFollow()->GetOfst(); }
|
||||
|
||||
// Liefert den zu bearbeitenden Textausschnitt zurueck (inline, s.u.)
|
||||
const String& GetTxt() const;
|
||||
const OUString& GetTxt() const;
|
||||
inline SwTxtNode *GetTxtNode()
|
||||
{ return static_cast< SwTxtNode* >( SwCntntFrm::GetNode()); }
|
||||
inline const SwTxtNode *GetTxtNode() const
|
||||
|
||||
@@ -462,7 +462,7 @@ bool SwTxtFrm::GetTopOfLine( SwTwips& _onTopOfLine,
|
||||
// get position offset
|
||||
xub_StrLen nOffset = _rPos.nContent.GetIndex();
|
||||
|
||||
if ( GetTxt().Len() < nOffset )
|
||||
if ( GetTxt().getLength() < nOffset )
|
||||
{
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ void SwTxtFrm::_SetOfst( const xub_StrLen nNewOfst )
|
||||
{
|
||||
SwCharRange &rReformat = *(pPara->GetReformat());
|
||||
rReformat.Start() = 0;
|
||||
rReformat.Len() = GetTxt().Len();
|
||||
rReformat.Len() = GetTxt().getLength();
|
||||
*(pPara->GetDelta()) = rReformat.Len();
|
||||
}
|
||||
InvalidateSize();
|
||||
@@ -1243,8 +1243,8 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
|
||||
rLine.SetUnclipped( sal_False );
|
||||
|
||||
// That was too complicated for the C30: aString( GetTxt() );
|
||||
const XubString &rString = GetTxtNode()->GetTxt();
|
||||
const xub_StrLen nStrLen = rString.Len();
|
||||
const OUString &rString = GetTxtNode()->GetTxt();
|
||||
const xub_StrLen nStrLen = rString.getLength();
|
||||
|
||||
SwCharRange &rReformat = *(pPara->GetReformat());
|
||||
SwRepaint &rRepaint = *(pPara->GetRepaint());
|
||||
@@ -1308,7 +1308,7 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
|
||||
if( nNew )
|
||||
{
|
||||
--nNew;
|
||||
if( CH_BREAK == rString.GetChar( nNew ) )
|
||||
if( CH_BREAK == rString[nNew] )
|
||||
{
|
||||
++nNew;
|
||||
rLine.Next();
|
||||
@@ -1620,9 +1620,9 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
|
||||
|
||||
void SwTxtFrm::_Format( SwParaPortion *pPara )
|
||||
{
|
||||
const xub_StrLen nStrLen = GetTxt().Len();
|
||||
const bool bIsEmpty = GetTxt().isEmpty();
|
||||
|
||||
if ( !nStrLen )
|
||||
if ( bIsEmpty )
|
||||
{
|
||||
// Empty lines do not get tortured for very long:
|
||||
// pPara is cleared, which is the same as:
|
||||
@@ -1865,7 +1865,7 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
|
||||
"SwTxtFrm::FormatQuick with swapped frame" );
|
||||
|
||||
#if OSL_DEBUG_LEVEL > 1
|
||||
const XubString aXXX = GetTxtNode()->GetTxt();
|
||||
const OUString aXXX = GetTxtNode()->GetTxt();
|
||||
const SwTwips nDbgY = Frm().Top();
|
||||
(void)nDbgY;
|
||||
// nStopAt allows CV to alter it
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
xub_StrLen SwTxtMargin::GetTxtStart() const
|
||||
{
|
||||
const XubString &rTxt = GetInfo().GetTxt();
|
||||
const OUString &rTxt = GetInfo().GetTxt();
|
||||
const xub_StrLen nTmpPos = nStart;
|
||||
const xub_StrLen nEnd = nTmpPos + pCurr->GetLen();
|
||||
xub_StrLen i;
|
||||
|
||||
for( i = nTmpPos; i < nEnd; ++i )
|
||||
{
|
||||
const sal_Unicode aChar = rTxt.GetChar( i );
|
||||
const sal_Unicode aChar = rTxt[i];
|
||||
if( CH_TAB != aChar && ' ' != aChar )
|
||||
return i;
|
||||
}
|
||||
@@ -47,13 +47,13 @@ xub_StrLen SwTxtMargin::GetTxtStart() const
|
||||
|
||||
xub_StrLen SwTxtMargin::GetTxtEnd() const
|
||||
{
|
||||
const XubString &rTxt = GetInfo().GetTxt();
|
||||
const OUString &rTxt = GetInfo().GetTxt();
|
||||
const xub_StrLen nTmpPos = nStart;
|
||||
const xub_StrLen nEnd = nTmpPos + pCurr->GetLen();
|
||||
long i;
|
||||
sal_Int32 i;
|
||||
for( i = nEnd - 1; i >= nTmpPos; --i )
|
||||
{
|
||||
sal_Unicode aChar = rTxt.GetChar( static_cast<xub_StrLen>(i) );
|
||||
sal_Unicode aChar = rTxt[i];
|
||||
if( CH_TAB != aChar && CH_BREAK != aChar && ' ' != aChar )
|
||||
return static_cast<xub_StrLen>(i + 1);
|
||||
}
|
||||
@@ -337,20 +337,20 @@ KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos,
|
||||
return 0;
|
||||
|
||||
// Is on front of a non-space
|
||||
const XubString& rTxt = aInf.GetTxt();
|
||||
sal_Unicode aChar = rTxt.GetChar( rFndPos );
|
||||
const OUString& rTxt = aInf.GetTxt();
|
||||
sal_Unicode aChar = rTxt[rFndPos];
|
||||
if( CH_TAB == aChar || CH_BREAK == aChar || ' ' == aChar ||
|
||||
(( CH_TXTATR_BREAKWORD == aChar || CH_TXTATR_INWORD == aChar ) &&
|
||||
aInf.HasHint( rFndPos ) ) )
|
||||
return 0;
|
||||
|
||||
// and after a space
|
||||
aChar = rTxt.GetChar( rFndPos - 1 );
|
||||
aChar = rTxt[rFndPos - 1];
|
||||
if( CH_TAB != aChar && CH_BREAK != aChar &&
|
||||
( ( CH_TXTATR_BREAKWORD != aChar && CH_TXTATR_INWORD != aChar ) ||
|
||||
!aInf.HasHint( rFndPos - 1 ) ) &&
|
||||
// More than two Blanks!
|
||||
( ' ' != aChar || ' ' != rTxt.GetChar( rFndPos - 2 ) ) )
|
||||
( ' ' != aChar || ' ' != rTxt[rFndPos - 2] ) )
|
||||
return 0;
|
||||
|
||||
SwRect aRect;
|
||||
|
||||
@@ -363,7 +363,7 @@ void SwTxtSizeInfo::NoteAnimation() const
|
||||
|
||||
SwPosSize SwTxtSizeInfo::GetTxtSize( OutputDevice* pOutDev,
|
||||
const SwScriptInfo* pSI,
|
||||
const XubString& rTxt,
|
||||
const OUString& rTxt,
|
||||
const xub_StrLen nIndex,
|
||||
const xub_StrLen nLength,
|
||||
const sal_uInt16 nComp ) const
|
||||
@@ -540,7 +540,7 @@ static sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
|
||||
* SwTxtPaintInfo::_DrawText()
|
||||
*************************************************************************/
|
||||
|
||||
void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPor,
|
||||
void SwTxtPaintInfo::_DrawText( const OUString &rText, const SwLinePortion &rPor,
|
||||
const xub_StrLen nStart, const xub_StrLen nLength,
|
||||
const sal_Bool bKern, const sal_Bool bWrong,
|
||||
const sal_Bool bSmartTag,
|
||||
@@ -1638,7 +1638,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
|
||||
{
|
||||
if( pCh )
|
||||
{
|
||||
aTxt = XubString( pCh, RTL_TEXTENCODING_MS_1252 );
|
||||
aTxt = OUString( pCh, strlen(pCh), RTL_TEXTENCODING_MS_1252 );
|
||||
bOn = sal_True;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
// GetTxtSize
|
||||
//
|
||||
SwPosSize GetTxtSize( OutputDevice* pOut, const SwScriptInfo* pSI,
|
||||
const XubString& rTxt, const xub_StrLen nIdx,
|
||||
const OUString& rTxt, const xub_StrLen nIdx,
|
||||
const xub_StrLen nLen, const sal_uInt16 nComp ) const;
|
||||
SwPosSize GetTxtSize() const;
|
||||
void GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
sal_uInt16& nMinSize, sal_uInt16& nMaxSizeDiff ) const;
|
||||
inline SwPosSize GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIdx,
|
||||
const xub_StrLen nLen, const sal_uInt16 nComp ) const;
|
||||
inline SwPosSize GetTxtSize( const XubString &rTxt ) const;
|
||||
inline SwPosSize GetTxtSize( const OUString &rTxt ) const;
|
||||
|
||||
//
|
||||
// GetTxtBreak
|
||||
@@ -383,7 +383,7 @@ class SwTxtPaintInfo : public SwTxtSizeInfo
|
||||
SwRect aPaintRect; // Original paint rect (from Layout paint)
|
||||
|
||||
MSHORT nSpaceIdx;
|
||||
void _DrawText( const XubString &rText, const SwLinePortion &rPor,
|
||||
void _DrawText( const OUString &rText, const SwLinePortion &rPor,
|
||||
const xub_StrLen nIdx, const xub_StrLen nLen,
|
||||
const sal_Bool bKern, const sal_Bool bWrong = sal_False,
|
||||
const sal_Bool bSmartTag = sal_False,
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
|
||||
inline SwTxtFly *GetTxtFly() { return &aTxtFly; }
|
||||
inline const SwTxtFly *GetTxtFly() const { return &aTxtFly; }
|
||||
inline void DrawText( const XubString &rText, const SwLinePortion &rPor,
|
||||
inline void DrawText( const OUString &rText, const SwLinePortion &rPor,
|
||||
const xub_StrLen nIdx = 0,
|
||||
const xub_StrLen nLen = STRING_LEN,
|
||||
const sal_Bool bKern = sal_False) const;
|
||||
@@ -804,9 +804,9 @@ inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
|
||||
return ((SwFont*)GetFont())->GetHeight( m_pVsh, *GetOut() );
|
||||
}
|
||||
|
||||
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const XubString &rTxt ) const
|
||||
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const OUString &rTxt ) const
|
||||
{
|
||||
return GetTxtSize( m_pOut, 0, rTxt, 0, rTxt.Len(), 0 );
|
||||
return GetTxtSize( m_pOut, 0, rTxt, 0, rTxt.getLength(), 0 );
|
||||
}
|
||||
|
||||
inline SwPosSize SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI,
|
||||
@@ -832,7 +832,7 @@ inline void SwTxtPaintInfo::SetPaintOfst( const SwTwips nNew )
|
||||
}
|
||||
|
||||
|
||||
inline void SwTxtPaintInfo::DrawText( const XubString &rText,
|
||||
inline void SwTxtPaintInfo::DrawText( const OUString &rText,
|
||||
const SwLinePortion &rPor,
|
||||
const xub_StrLen nStart, const xub_StrLen nLength,
|
||||
const sal_Bool bKern ) const
|
||||
|
||||
@@ -1759,7 +1759,7 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
|
||||
// Zeile am Absatzende geben (bei leeren Abs?tzen oder nach einem
|
||||
// Shift-Return), die das Register durchaus beachten soll.
|
||||
if( !pCurr->IsDummy() || ( !pCurr->GetNext() &&
|
||||
GetStart() >= GetTxtFrm()->GetTxt().Len() && !bNewLine ) )
|
||||
GetStart() >= GetTxtFrm()->GetTxt().getLength() && !bNewLine ) )
|
||||
{
|
||||
const SvxLineSpacingItem *pSpace = aLineInf.GetLineSpacing();
|
||||
if( pSpace )
|
||||
|
||||
@@ -435,7 +435,7 @@ void SwTxtIter::TruncLines( bool bNoteFollow )
|
||||
}
|
||||
if( pCurr->IsDummy() &&
|
||||
!pCurr->GetLen() &&
|
||||
nStart < GetTxtFrm()->GetTxt().Len() )
|
||||
nStart < GetTxtFrm()->GetTxt().getLength() )
|
||||
pCurr->SetRealHeight( 1 );
|
||||
if( GetHints() )
|
||||
pFrm->RemoveFtn( nEnd );
|
||||
|
||||
@@ -760,7 +760,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
|
||||
SwDropPortionPart* pCurrPart = pDrop->GetPart();
|
||||
const bool bUseCache = ! pCurrPart->GetFollow() && !pCurrPart->GetFont().HasBorder();
|
||||
xub_StrLen nIdx = rInf.GetIdx();
|
||||
XubString aStr( rInf.GetTxt(), nIdx, pCurrPart->GetLen() );
|
||||
OUString aStr(rInf.GetTxt().copy(nIdx, pCurrPart->GetLen()));
|
||||
|
||||
long nAscent = 0;
|
||||
long nDescent = 0;
|
||||
|
||||
@@ -388,9 +388,9 @@ SwTxtFrm::~SwTxtFrm()
|
||||
ClearPara();
|
||||
}
|
||||
|
||||
const XubString& SwTxtFrm::GetTxt() const
|
||||
const OUString& SwTxtFrm::GetTxt() const
|
||||
{
|
||||
return reinterpret_cast<const XubString&>(GetTxtNode()->GetTxt()); //FIXME
|
||||
return GetTxtNode()->GetTxt();
|
||||
}
|
||||
|
||||
void SwTxtFrm::ResetPreps()
|
||||
@@ -643,17 +643,15 @@ void SwTxtFrm::HideAndShowObjects()
|
||||
* nFound ist <= nEndLine.
|
||||
*************************************************************************/
|
||||
|
||||
xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt,
|
||||
const xub_StrLen nStart,
|
||||
const xub_StrLen nEnd ) const
|
||||
xub_StrLen SwTxtFrm::FindBrk( const OUString &rTxt,
|
||||
const sal_Int32 nStart,
|
||||
const sal_Int32 nEnd ) const
|
||||
{
|
||||
// #i104291# - applying patch to avoid overflow.
|
||||
unsigned long nFound = nStart;
|
||||
const xub_StrLen nEndLine = std::min( nEnd, rTxt.Len() );
|
||||
sal_Int32 nFound = nStart;
|
||||
const sal_Int32 nEndLine = std::min( nEnd, rTxt.getLength() );
|
||||
|
||||
// Wir ueberlesen erst alle Blanks am Anfang der Zeile (vgl. Bug 2235).
|
||||
while( nFound <= nEndLine &&
|
||||
' ' == rTxt.GetChar( static_cast<xub_StrLen>(nFound) ) )
|
||||
while( nFound <= nEndLine && ' ' == rTxt[nFound] )
|
||||
{
|
||||
nFound++;
|
||||
}
|
||||
@@ -662,8 +660,7 @@ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt,
|
||||
// "Dr.$Meyer" am Anfang der zweiten Zeile. Dahinter ein Blank eingegeben
|
||||
// und das Wort rutscht nicht in die erste Zeile, obwohl es ginge.
|
||||
// Aus diesem Grund nehmen wir das Dummy-Zeichen noch mit.
|
||||
while( nFound <= nEndLine &&
|
||||
' ' != rTxt.GetChar( static_cast<xub_StrLen>(nFound) ) )
|
||||
while( nFound <= nEndLine && ' ' != rTxt[nFound] )
|
||||
{
|
||||
nFound++;
|
||||
}
|
||||
@@ -689,7 +686,7 @@ sal_Bool SwTxtFrm::IsIdxInside( const xub_StrLen nPos, const xub_StrLen nLen ) c
|
||||
|
||||
// der Bereich liegt nicht komplett hinter uns bzw.
|
||||
// unser Text ist geloescht worden.
|
||||
if( nMax > nPos || nMax > GetTxt().Len() )
|
||||
if( nMax > nPos || nMax > GetTxt().getLength() )
|
||||
return sal_True;
|
||||
|
||||
// changes made in the first line of a follow can modify the master
|
||||
@@ -1465,7 +1462,7 @@ static bool lcl_ErgoVadis( SwTxtFrm* pFrm, xub_StrLen &rPos, const PrepareHint e
|
||||
if( pFrm->HasFollow() )
|
||||
rPos = pFrm->GetFollow()->GetOfst();
|
||||
else
|
||||
rPos = pFrm->GetTxt().Len();
|
||||
rPos = pFrm->GetTxt().getLength();
|
||||
if( rPos )
|
||||
--rPos; // unser letztes Zeichen
|
||||
}
|
||||
@@ -2059,7 +2056,7 @@ KSHORT SwTxtFrm::GetParHeight() const
|
||||
KSHORT nRet = (KSHORT)Prt().SSize().Height();
|
||||
if( IsUndersized() )
|
||||
{
|
||||
if( IsEmpty() || GetTxt().Len() == 0 )
|
||||
if( IsEmpty() || GetTxt().isEmpty() )
|
||||
nRet = (KSHORT)EmptyHeight();
|
||||
else
|
||||
++nRet;
|
||||
@@ -2324,7 +2321,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
|
||||
else
|
||||
{
|
||||
bool bCalcHeightOfLastLine = true;
|
||||
if ( ( !HasPara() && IsEmpty( ) ) || GetTxt().Len( ) == 0 )
|
||||
if ( ( !HasPara() && IsEmpty( ) ) || GetTxt().isEmpty() )
|
||||
{
|
||||
mnHeightOfLastLine = EmptyHeight();
|
||||
bCalcHeightOfLastLine = false;
|
||||
@@ -2477,7 +2474,7 @@ void SwTxtFrm::ChgThisLines()
|
||||
|
||||
sal_uLong nNew = 0;
|
||||
const SwLineNumberInfo &rInf = GetNode()->getIDocumentLineNumberAccess()->GetLineNumberInfo();
|
||||
if ( GetTxt().Len() && HasPara() )
|
||||
if ( !GetTxt().isEmpty() && HasPara() )
|
||||
{
|
||||
SwTxtSizeInfo aInf( this );
|
||||
SwTxtMargin aLine( this, &aInf );
|
||||
|
||||
@@ -33,7 +33,7 @@ SwFmtRefMark::~SwFmtRefMark( )
|
||||
{
|
||||
}
|
||||
|
||||
SwFmtRefMark::SwFmtRefMark( const XubString& rName )
|
||||
SwFmtRefMark::SwFmtRefMark( const OUString& rName )
|
||||
: SfxPoolItem( RES_TXTATR_REFMARK ),
|
||||
pTxtAttr( 0 ),
|
||||
aRefName( rName )
|
||||
|
||||
@@ -2339,7 +2339,7 @@ SwCacheObj *SwFntAccess::NewObj( )
|
||||
}
|
||||
|
||||
extern xub_StrLen sw_CalcCaseMap( const SwFont& rFnt,
|
||||
const XubString& rOrigString,
|
||||
const OUString& rOrigString,
|
||||
xub_StrLen nOfst,
|
||||
xub_StrLen nLen,
|
||||
xub_StrLen nIdx );
|
||||
@@ -2450,7 +2450,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
|
||||
}
|
||||
else
|
||||
{
|
||||
const XubString aSnippet( rInf.GetText(), rInf.GetIdx(), nLn );
|
||||
const OUString aSnippet(rInf.GetText().copy(rInf.GetIdx(), nLn));
|
||||
aTmpText = aSub[nActual].CalcCaseMap( aSnippet );
|
||||
const bool bTitle = SVX_CASEMAP_TITEL == aSub[nActual].GetCaseMap() &&
|
||||
g_pBreakIt->GetBreakIter().is();
|
||||
@@ -2465,9 +2465,9 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
|
||||
i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
|
||||
{
|
||||
// In this case, the beginning of aTmpText is wrong.
|
||||
XubString aSnippetTmp( aSnippet, 0, 1 );
|
||||
OUString aSnippetTmp(aSnippet.copy(0, 1));
|
||||
aSnippetTmp = aSub[nActual].CalcCaseMap( aSnippetTmp );
|
||||
aTmpText = aTmpText.replaceAt( 0, aSnippetTmp.Len(), OUString(aSnippet.GetChar( 0 )) );
|
||||
aTmpText = aTmpText.replaceAt( 0, aSnippetTmp.getLength(), OUString(aSnippet[0]) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ using namespace ::com::sun::star::i18n;
|
||||
class SwCapitalInfo
|
||||
{
|
||||
public:
|
||||
explicit SwCapitalInfo( const XubString& rOrigText ) :
|
||||
explicit SwCapitalInfo( const OUString& rOrigText ) :
|
||||
rString( rOrigText ), nIdx( 0 ), nLen( 0 ) {};
|
||||
const XubString& rString;
|
||||
const OUString& rString;
|
||||
xub_StrLen nIdx;
|
||||
xub_StrLen nLen;
|
||||
};
|
||||
@@ -65,21 +65,21 @@ public:
|
||||
*************************************************************************/
|
||||
|
||||
xub_StrLen sw_CalcCaseMap( const SwFont& rFnt,
|
||||
const XubString& rOrigString,
|
||||
const OUString& rOrigString,
|
||||
xub_StrLen nOfst,
|
||||
xub_StrLen nLen,
|
||||
xub_StrLen nIdx )
|
||||
{
|
||||
int j = 0;
|
||||
const xub_StrLen nEnd = nOfst + nLen;
|
||||
OSL_ENSURE( nEnd <= rOrigString.Len(), "sw_CalcCaseMap: Wrong parameters" );
|
||||
OSL_ENSURE( nEnd <= rOrigString.getLength(), "sw_CalcCaseMap: Wrong parameters" );
|
||||
|
||||
// special case for title case:
|
||||
const bool bTitle = SVX_CASEMAP_TITEL == rFnt.GetCaseMap() &&
|
||||
g_pBreakIt->GetBreakIter().is();
|
||||
for ( xub_StrLen i = nOfst; i < nEnd; ++i )
|
||||
{
|
||||
XubString aTmp( rOrigString, i, 1 );
|
||||
OUString aTmp(rOrigString.copy(i, 1));
|
||||
|
||||
if ( !bTitle ||
|
||||
g_pBreakIt->GetBreakIter()->isBeginWord(
|
||||
@@ -88,7 +88,7 @@ xub_StrLen sw_CalcCaseMap( const SwFont& rFnt,
|
||||
WordType::ANYWORD_IGNOREWHITESPACES ) )
|
||||
aTmp = rFnt.GetActualFont().CalcCaseMap( aTmp );
|
||||
|
||||
j += aTmp.Len();
|
||||
j += aTmp.getLength();
|
||||
|
||||
if ( j > nIdx )
|
||||
return i;
|
||||
@@ -244,7 +244,7 @@ void SwDoGetCapitalBreak::Do()
|
||||
*************************************************************************/
|
||||
|
||||
xub_StrLen SwFont::GetCapitalBreak( ViewShell* pSh, const OutputDevice* pOut,
|
||||
const SwScriptInfo* pScript, const XubString& rTxt, long const nTextWidth,
|
||||
const SwScriptInfo* pScript, const OUString& rTxt, long const nTextWidth,
|
||||
const xub_StrLen nIdx, const xub_StrLen nLen )
|
||||
{
|
||||
// Start:
|
||||
@@ -543,12 +543,12 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
OSL_ENSURE( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" );
|
||||
|
||||
long nKana = 0;
|
||||
const XubString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) );
|
||||
const OUString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) );
|
||||
xub_StrLen nMaxPos = std::min( sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()),
|
||||
rDo.GetInf().GetLen() );
|
||||
rDo.GetInf().SetLen( nMaxPos );
|
||||
|
||||
const XubString& rOldText = rDo.GetInf().GetText();
|
||||
const OUString& rOldText = rDo.GetInf().GetText();
|
||||
rDo.GetInf().SetText( aTxt );
|
||||
xub_StrLen nPos = rDo.GetInf().GetIdx();
|
||||
xub_StrLen nOldPos = nPos;
|
||||
@@ -557,9 +557,9 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
// #107816#
|
||||
// Look if the length of the original text and the ToUpper-converted
|
||||
// text is different. If yes, do special handling.
|
||||
XubString aNewText;
|
||||
OUString aNewText;
|
||||
SwCapitalInfo aCapInf( rOldText );
|
||||
sal_Bool bCaseMapLengthDiffers( aTxt.Len() != rOldText.Len() );
|
||||
sal_Bool bCaseMapLengthDiffers( aTxt.getLength() != rOldText.getLength() );
|
||||
if ( bCaseMapLengthDiffers )
|
||||
rDo.SetCapInf( aCapInf );
|
||||
|
||||
@@ -654,12 +654,12 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
// Build an own 'changed' string for the given part of the
|
||||
// source string and use it. That new string may differ in length
|
||||
// from the source string.
|
||||
const XubString aSnippet( rOldText, nOldPos, nPos - nOldPos);
|
||||
const OUString aSnippet(rOldText.copy(nOldPos, nPos - nOldPos));
|
||||
aNewText = CalcCaseMap( aSnippet );
|
||||
aCapInf.nIdx = nOldPos;
|
||||
aCapInf.nLen = nPos - nOldPos;
|
||||
rDo.GetInf().SetIdx( 0 );
|
||||
rDo.GetInf().SetLen( aNewText.Len() );
|
||||
rDo.GetInf().SetLen( aNewText.getLength() );
|
||||
rDo.GetInf().SetText( aNewText );
|
||||
}
|
||||
else
|
||||
@@ -702,7 +702,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
if( bWordWise )
|
||||
{
|
||||
nTmp = nOldPos;
|
||||
while( nTmp < nPos && CH_BLANK == rOldText.GetChar( nTmp ) )
|
||||
while( nTmp < nPos && CH_BLANK == rOldText[nTmp] )
|
||||
++nTmp;
|
||||
if( nOldPos < nTmp )
|
||||
{
|
||||
@@ -720,12 +720,12 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
// Build an own 'changed' string for the given part of the
|
||||
// source string and use it. That new string may differ in length
|
||||
// from the source string.
|
||||
const XubString aSnippet( rOldText, nOldPos, nTmp - nOldPos);
|
||||
const OUString aSnippet(rOldText.copy(nOldPos, nTmp - nOldPos));
|
||||
aNewText = CalcCaseMap( aSnippet );
|
||||
aCapInf.nIdx = nOldPos;
|
||||
aCapInf.nLen = nTmp - nOldPos;
|
||||
rDo.GetInf().SetIdx( 0 );
|
||||
rDo.GetInf().SetLen( aNewText.Len() );
|
||||
rDo.GetInf().SetLen( aNewText.getLength() );
|
||||
rDo.GetInf().SetText( aNewText );
|
||||
}
|
||||
else
|
||||
@@ -748,7 +748,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
nOldPos = nTmp;
|
||||
}
|
||||
|
||||
while( nTmp < nPos && CH_BLANK != rOldText.GetChar( nTmp ) )
|
||||
while( nTmp < nPos && CH_BLANK != rOldText[nTmp] )
|
||||
++nTmp;
|
||||
}
|
||||
else
|
||||
@@ -761,12 +761,12 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
// Build an own 'changed' string for the given part of the
|
||||
// source string and use it. That new string may differ in length
|
||||
// from the source string.
|
||||
const XubString aSnippet( rOldText, nOldPos, nTmp - nOldPos);
|
||||
const OUString aSnippet(rOldText.copy(nOldPos, nTmp - nOldPos));
|
||||
aNewText = CalcCaseMap( aSnippet );
|
||||
aCapInf.nIdx = nOldPos;
|
||||
aCapInf.nLen = nTmp - nOldPos;
|
||||
rDo.GetInf().SetIdx( 0 );
|
||||
rDo.GetInf().SetLen( aNewText.Len() );
|
||||
rDo.GetInf().SetLen( aNewText.getLength() );
|
||||
rDo.GetInf().SetText( aNewText );
|
||||
}
|
||||
else
|
||||
@@ -783,7 +783,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
|
||||
{
|
||||
for( xub_StrLen nI = nOldPos; nI < nPos; ++nI )
|
||||
{
|
||||
if( CH_BLANK == rOldText.GetChar( nI ) )
|
||||
if( CH_BLANK == rOldText[nI] )
|
||||
aPartSize.Width() += nSpaceAdd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1080,15 +1080,15 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
|
||||
{
|
||||
SV_STAT( nGetTextSize );
|
||||
long nOldKern = rInf.GetKern();
|
||||
const XubString &rOldTxt = rInf.GetText();
|
||||
const OUString &rOldTxt = rInf.GetText();
|
||||
rInf.SetKern( CheckKerning() );
|
||||
if ( !IsCaseMap() )
|
||||
aTxtSize = pLastFont->GetTextSize( rInf );
|
||||
else
|
||||
{
|
||||
String aTmp = CalcCaseMap( rInf.GetText() );
|
||||
const XubString &rOldStr = rInf.GetText();
|
||||
bool bCaseMapLengthDiffers(aTmp.Len() != rOldStr.Len());
|
||||
OUString aTmp = CalcCaseMap( rInf.GetText() );
|
||||
const OUString &rOldStr = rInf.GetText();
|
||||
bool bCaseMapLengthDiffers(aTmp.getLength() != rOldStr.getLength());
|
||||
|
||||
if(bCaseMapLengthDiffers && rInf.GetLen())
|
||||
{
|
||||
@@ -1098,12 +1098,12 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf )
|
||||
// a single snippet since its size may differ, too.
|
||||
xub_StrLen nOldIdx(rInf.GetIdx());
|
||||
xub_StrLen nOldLen(rInf.GetLen());
|
||||
const XubString aSnippet(rOldStr, nOldIdx, nOldLen);
|
||||
XubString aNewText(CalcCaseMap(aSnippet));
|
||||
const OUString aSnippet(rOldStr.copy(nOldIdx, nOldLen));
|
||||
OUString aNewText(CalcCaseMap(aSnippet));
|
||||
|
||||
rInf.SetText( aNewText );
|
||||
rInf.SetIdx( 0 );
|
||||
rInf.SetLen( aNewText.Len() );
|
||||
rInf.SetLen( aNewText.getLength() );
|
||||
|
||||
aTxtSize = pLastFont->GetTextSize( rInf );
|
||||
|
||||
@@ -1201,9 +1201,9 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey )
|
||||
pLastFont->DrawText( rInf );
|
||||
else
|
||||
{
|
||||
const XubString &rOldStr = rInf.GetText();
|
||||
XubString aString( CalcCaseMap( rOldStr ) );
|
||||
bool bCaseMapLengthDiffers(aString.Len() != rOldStr.Len());
|
||||
const OUString &rOldStr = rInf.GetText();
|
||||
OUString aString( CalcCaseMap( rOldStr ) );
|
||||
bool bCaseMapLengthDiffers(aString.getLength() != rOldStr.getLength());
|
||||
|
||||
if(bCaseMapLengthDiffers && rInf.GetLen())
|
||||
{
|
||||
@@ -1213,12 +1213,12 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey )
|
||||
// a single snippet since its size may differ, too.
|
||||
xub_StrLen nOldIdx(rInf.GetIdx());
|
||||
xub_StrLen nOldLen(rInf.GetLen());
|
||||
const XubString aSnippet(rOldStr, nOldIdx, nOldLen);
|
||||
XubString aNewText = CalcCaseMap(aSnippet);
|
||||
const OUString aSnippet(rOldStr.copy(nOldIdx, nOldLen));
|
||||
OUString aNewText = CalcCaseMap(aSnippet);
|
||||
|
||||
rInf.SetText( aNewText );
|
||||
rInf.SetIdx( 0 );
|
||||
rInf.SetLen( aNewText.Len() );
|
||||
rInf.SetLen( aNewText.getLength() );
|
||||
|
||||
pLastFont->DrawText( rInf );
|
||||
|
||||
@@ -1237,10 +1237,9 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey )
|
||||
|
||||
if( pUnderFnt && nOldUnder != UNDERLINE_NONE )
|
||||
{
|
||||
static sal_Char const sDoubleSpace[] = " ";
|
||||
Size aFontSize = _GetTxtSize( rInf );
|
||||
const XubString &rOldStr = rInf.GetText();
|
||||
XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
|
||||
const OUString &rOldStr = rInf.GetText();
|
||||
OUString aStr(" ");
|
||||
|
||||
xub_StrLen nOldIdx = rInf.GetIdx();
|
||||
xub_StrLen nOldLen = rInf.GetLen();
|
||||
@@ -1248,8 +1247,8 @@ static sal_Char const sDoubleSpace[] = " ";
|
||||
if( rInf.GetSpace() )
|
||||
{
|
||||
xub_StrLen nTmpEnd = nOldIdx + nOldLen;
|
||||
if( nTmpEnd > rOldStr.Len() )
|
||||
nTmpEnd = rOldStr.Len();
|
||||
if( nTmpEnd > rOldStr.getLength() )
|
||||
nTmpEnd = rOldStr.getLength();
|
||||
|
||||
const SwScriptInfo* pSI = rInf.GetScriptInfo();
|
||||
|
||||
@@ -1257,8 +1256,8 @@ static sal_Char const sDoubleSpace[] = " ";
|
||||
( rInf.GetFont() && SW_CJK == rInf.GetFont()->GetActual() );
|
||||
for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp )
|
||||
{
|
||||
if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont ||
|
||||
( nTmp + 1 < rOldStr.Len() && pSI &&
|
||||
if( CH_BLANK == rOldStr[nTmp] || bAsianFont ||
|
||||
( nTmp + 1 < rOldStr.getLength() && pSI &&
|
||||
i18n::ScriptType::ASIAN == pSI->ScriptType( nTmp + 1 ) ) )
|
||||
++nSpace;
|
||||
}
|
||||
@@ -1350,9 +1349,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf )
|
||||
|
||||
if( pUnderFnt && nOldUnder != UNDERLINE_NONE )
|
||||
{
|
||||
static sal_Char const sDoubleSpace[] = " ";
|
||||
const XubString &rOldStr = rInf.GetText();
|
||||
XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
|
||||
const OUString &rOldStr = rInf.GetText();
|
||||
OUString aStr(" ");
|
||||
xub_StrLen nOldIdx = rInf.GetIdx();
|
||||
xub_StrLen nOldLen = rInf.GetLen();
|
||||
rInf.SetText( aStr );
|
||||
@@ -1390,7 +1388,7 @@ xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf )
|
||||
nCrsr = GetCapitalCrsrOfst( rInf );
|
||||
else
|
||||
{
|
||||
const XubString &rOldTxt = rInf.GetText();
|
||||
const OUString &rOldTxt = rInf.GetText();
|
||||
long nOldKern = rInf.GetKern();
|
||||
rInf.SetKern( CheckKerning() );
|
||||
SV_STAT( nGetTextSize );
|
||||
|
||||
@@ -952,13 +952,13 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
|
||||
nBegin, nEnd );
|
||||
while( !pArgs->xSpellAlt.is() && aScanner.NextWord() )
|
||||
{
|
||||
const XubString& rWord = aScanner.GetWord();
|
||||
const OUString& rWord = aScanner.GetWord();
|
||||
|
||||
// get next language for next word, consider language attributes
|
||||
// within the word
|
||||
LanguageType eActLang = aScanner.GetCurrentLanguage();
|
||||
|
||||
if( rWord.Len() > 0 && LANGUAGE_NONE != eActLang )
|
||||
if( rWord.getLength() > 0 && LANGUAGE_NONE != eActLang )
|
||||
{
|
||||
if (pArgs->xSpeller.is())
|
||||
{
|
||||
@@ -979,11 +979,11 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
|
||||
// left and right in order to preserve those. Therefore
|
||||
// count those "in words" in order to modify the
|
||||
// selection accordingly.
|
||||
const sal_Unicode* pChar = rWord.GetBuffer();
|
||||
const sal_Unicode* pChar = rWord.getStr();
|
||||
xub_StrLen nLeft = 0;
|
||||
while (pChar && *pChar++ == CH_TXTATR_INWORD)
|
||||
++nLeft;
|
||||
pChar = rWord.Len() ? rWord.GetBuffer() + rWord.Len() - 1 : 0;
|
||||
pChar = rWord.getLength() ? rWord.getStr() + rWord.getLength() - 1 : 0;
|
||||
xub_StrLen nRight = 0;
|
||||
while (pChar && *pChar-- == CH_TXTATR_INWORD)
|
||||
++nRight;
|
||||
@@ -1282,7 +1282,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
|
||||
|
||||
while( aScanner.NextWord() )
|
||||
{
|
||||
const XubString& rWord = aScanner.GetWord();
|
||||
const OUString& rWord = aScanner.GetWord();
|
||||
nBegin = aScanner.GetBegin();
|
||||
xub_StrLen nLen = aScanner.GetLen();
|
||||
|
||||
@@ -1291,7 +1291,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
|
||||
LanguageType eActLang = aScanner.GetCurrentLanguage();
|
||||
|
||||
sal_Bool bSpell = xSpell.is() ? xSpell->hasLanguage( eActLang ) : sal_False;
|
||||
if( bSpell && rWord.Len() > 0 )
|
||||
if( bSpell && !rWord.isEmpty() )
|
||||
{
|
||||
// check for: bAlter => xHyphWord.is()
|
||||
OSL_ENSURE(!bSpell || xSpell.is(), "NULL pointer");
|
||||
@@ -1317,11 +1317,11 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( bAddAutoCmpl && rACW.GetMinWordLen() <= rWord.Len() )
|
||||
else if( bAddAutoCmpl && rACW.GetMinWordLen() <= rWord.getLength() )
|
||||
{
|
||||
if ( bRedlineChg )
|
||||
{
|
||||
XubString rNewWord( rWord );
|
||||
OUString rNewWord( rWord );
|
||||
rACW.InsertWord( rNewWord, *pDoc );
|
||||
}
|
||||
else
|
||||
@@ -1519,11 +1519,11 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
|
||||
nLen = aScanner.GetLen();
|
||||
if( rACW.GetMinWordLen() <= nLen )
|
||||
{
|
||||
const XubString& rWord = aScanner.GetWord();
|
||||
const OUString& rWord = aScanner.GetWord();
|
||||
|
||||
if( nActPos < nBegin || ( nBegin + nLen ) < nActPos )
|
||||
{
|
||||
if( rACW.GetMinWordLen() <= rWord.Len() )
|
||||
if( rACW.GetMinWordLen() <= rWord.getLength() )
|
||||
rACW.InsertWord( rWord, *pDoc );
|
||||
bAnyWrd = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user