Kaydet (Commit) 5926f48a authored tarafından Noel Grandin's avatar Noel Grandin

convert some XubString to OUString in editeng

Change-Id: I49b9a4e148510d68807fbb720a8c32d542853f8b
üst 3b8283a8
...@@ -2751,9 +2751,9 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2751,9 +2751,9 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{ {
ContentNode* pNode = aEditDoc.GetObject( nNode ); ContentNode* pNode = aEditDoc.GetObject( nNode );
const XubString& aNodeStr = pNode->GetString(); const OUString& aNodeStr = pNode->GetString();
xub_StrLen nStartPos = 0; xub_StrLen nStartPos = 0;
xub_StrLen nEndPos = aNodeStr.Len(); xub_StrLen nEndPos = aNodeStr.getLength();
if ( nNode == nStartNode ) if ( nNode == nStartNode )
nStartPos = aSel.Min().GetIndex(); nStartPos = aSel.Min().GetIndex();
if ( nNode == nEndNode ) // can also be == nStart! if ( nNode == nEndNode ) // can also be == nStart!
...@@ -2827,7 +2827,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2827,7 +2827,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
nCurrentStart, nLen, &aOffsets )); nCurrentStart, nLen, &aOffsets ));
if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen )) if (aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{ {
aChgData.nStart = nCurrentStart; aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen; aChgData.nLen = nLen;
...@@ -2915,7 +2915,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2915,7 +2915,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
nCurrentStart, nLen, &aOffsets )); nCurrentStart, nLen, &aOffsets ));
if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen )) if ( aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{ {
aChgData.nStart = nCurrentStart; aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen; aChgData.nLen = nLen;
...@@ -2953,7 +2953,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, ...@@ -2953,7 +2953,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
Sequence< sal_Int32 > aOffsets; Sequence< sal_Int32 > aOffsets;
OUString aNewText( aTranslitarationWrapper.transliterate( aNodeStr, nLanguage, nCurrentStart, nLen, &aOffsets ) ); OUString aNewText( aTranslitarationWrapper.transliterate( aNodeStr, nLanguage, nCurrentStart, nLen, &aOffsets ) );
if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen )) if (aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{ {
aChgData.nStart = nCurrentStart; aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen; aChgData.nLen = nLen;
......
...@@ -164,12 +164,12 @@ class SvxDoCapitals ...@@ -164,12 +164,12 @@ class SvxDoCapitals
{ {
protected: protected:
OutputDevice *pOut; OutputDevice *pOut;
const XubString &rTxt; const OUString &rTxt;
const xub_StrLen nIdx; const xub_StrLen nIdx;
const xub_StrLen nLen; const xub_StrLen nLen;
public: public:
SvxDoCapitals( OutputDevice *_pOut, const XubString &_rTxt, SvxDoCapitals( OutputDevice *_pOut, const OUString &_rTxt,
const xub_StrLen _nIdx, const xub_StrLen _nLen ) const xub_StrLen _nIdx, const xub_StrLen _nLen )
: pOut(_pOut), rTxt(_rTxt), nIdx(_nIdx), nLen(_nLen) : pOut(_pOut), rTxt(_rTxt), nIdx(_nIdx), nLen(_nLen)
{ } { }
...@@ -178,12 +178,12 @@ public: ...@@ -178,12 +178,12 @@ public:
virtual void DoSpace( const sal_Bool bDraw ); virtual void DoSpace( const sal_Bool bDraw );
virtual void SetSpace(); virtual void SetSpace();
virtual void Do( const XubString &rTxt, virtual void Do( const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen, const xub_StrLen nIdx, const xub_StrLen nLen,
const sal_Bool bUpper ) = 0; const sal_Bool bUpper ) = 0;
inline OutputDevice *GetOut() { return pOut; } inline OutputDevice *GetOut() { return pOut; }
inline const XubString &GetTxt() const { return rTxt; } inline const OUString &GetTxt() const { return rTxt; }
xub_StrLen GetIdx() const { return nIdx; } xub_StrLen GetIdx() const { return nIdx; }
xub_StrLen GetLen() const { return nLen; } xub_StrLen GetLen() const { return nLen; }
}; };
...@@ -245,10 +245,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const ...@@ -245,10 +245,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210# // #108210#
// If strings differ work preparing the necessary snippet to address that // If strings differ work preparing the necessary snippet to address that
// potential difference // potential difference
const XubString aSnippet(rTxt, nIdx + nOldPos, nPos-nOldPos); const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos-nOldPos);
XubString aNewText = CalcCaseMap(aSnippet); OUString aNewText = CalcCaseMap(aSnippet);
rDo.Do( aNewText, 0, aNewText.Len(), sal_True ); rDo.Do( aNewText, 0, aNewText.getLength(), sal_True );
} }
else else
{ {
...@@ -275,10 +275,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const ...@@ -275,10 +275,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210# // #108210#
// If strings differ work preparing the necessary snippet to address that // If strings differ work preparing the necessary snippet to address that
// potential difference // potential difference
const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos); const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos - nOldPos);
XubString aNewText = CalcCaseMap(aSnippet); OUString aNewText = CalcCaseMap(aSnippet);
rDo.Do( aNewText, 0, aNewText.Len(), sal_False ); rDo.Do( aNewText, 0, aNewText.getLength(), sal_False );
} }
else else
{ {
...@@ -300,10 +300,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const ...@@ -300,10 +300,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210# // #108210#
// If strings differ work preparing the necessary snippet to address that // If strings differ work preparing the necessary snippet to address that
// potential difference // potential difference
const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos); const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos - nOldPos);
XubString aNewText = CalcCaseMap(aSnippet); OUString aNewText = CalcCaseMap(aSnippet);
rDo.Do( aNewText, 0, aNewText.Len(), sal_False ); rDo.Do( aNewText, 0, aNewText.getLength(), sal_False );
} }
else else
{ {
...@@ -368,9 +368,9 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt, ...@@ -368,9 +368,9 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
{ {
// If strings differ work preparing the necessary snippet to address that // If strings differ work preparing the necessary snippet to address that
// potential difference // potential difference
const XubString aSnippet(rTxt, nIdx, nLen); const OUString aSnippet = rTxt.copy(nIdx, nLen);
XubString _aNewText = CalcCaseMap(aSnippet); OUString _aNewText = CalcCaseMap(aSnippet);
nWidth = pOut->GetTextWidth( _aNewText, 0, _aNewText.Len() ); nWidth = pOut->GetTextWidth( _aNewText, 0, _aNewText.getLength() );
} }
else else
{ {
...@@ -590,7 +590,7 @@ protected: ...@@ -590,7 +590,7 @@ protected:
short nKern; short nKern;
public: public:
SvxDoGetCapitalSize( SvxFont *_pFnt, const OutputDevice *_pOut, SvxDoGetCapitalSize( SvxFont *_pFnt, const OutputDevice *_pOut,
const XubString &_rTxt, const xub_StrLen _nIdx, const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const short _nKrn ) const xub_StrLen _nLen, const short _nKrn )
: SvxDoCapitals( (OutputDevice*)_pOut, _rTxt, _nIdx, _nLen ), : SvxDoCapitals( (OutputDevice*)_pOut, _rTxt, _nIdx, _nLen ),
pFont( _pFnt ), pFont( _pFnt ),
...@@ -599,13 +599,13 @@ public: ...@@ -599,13 +599,13 @@ public:
virtual ~SvxDoGetCapitalSize() {} virtual ~SvxDoGetCapitalSize() {}
virtual void Do( const XubString &rTxt, const xub_StrLen nIdx, virtual void Do( const OUString &rTxt, const xub_StrLen nIdx,
const xub_StrLen nLen, const sal_Bool bUpper ); const xub_StrLen nLen, const sal_Bool bUpper );
inline const Size &GetSize() const { return aTxtSize; }; inline const Size &GetSize() const { return aTxtSize; };
}; };
void SvxDoGetCapitalSize::Do( const XubString &_rTxt, const xub_StrLen _nIdx, void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const sal_Bool bUpper ) const xub_StrLen _nLen, const sal_Bool bUpper )
{ {
Size aPartSize; Size aPartSize;
...@@ -654,7 +654,7 @@ protected: ...@@ -654,7 +654,7 @@ protected:
Point aSpacePos; Point aSpacePos;
short nKern; short nKern;
public: public:
SvxDoDrawCapital( SvxFont *pFnt, OutputDevice *_pOut, const XubString &_rTxt, SvxDoDrawCapital( SvxFont *pFnt, OutputDevice *_pOut, const OUString &_rTxt,
const xub_StrLen _nIdx, const xub_StrLen _nLen, const xub_StrLen _nIdx, const xub_StrLen _nLen,
const Point &rPos, const short nKrn ) const Point &rPos, const short nKrn )
: SvxDoCapitals( _pOut, _rTxt, _nIdx, _nLen ), : SvxDoCapitals( _pOut, _rTxt, _nIdx, _nLen ),
...@@ -666,7 +666,7 @@ public: ...@@ -666,7 +666,7 @@ public:
virtual ~SvxDoDrawCapital() {} virtual ~SvxDoDrawCapital() {}
virtual void DoSpace( const sal_Bool bDraw ); virtual void DoSpace( const sal_Bool bDraw );
virtual void SetSpace(); virtual void SetSpace();
virtual void Do( const XubString &rTxt, const xub_StrLen nIdx, virtual void Do( const OUString &rTxt, const xub_StrLen nIdx,
const xub_StrLen nLen, const sal_Bool bUpper ); const xub_StrLen nLen, const sal_Bool bUpper );
}; };
...@@ -682,8 +682,7 @@ void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw ) ...@@ -682,8 +682,7 @@ void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw )
pFont->SetWordLineMode( sal_False ); pFont->SetWordLineMode( sal_False );
pFont->SetTransparent( sal_True ); pFont->SetTransparent( sal_True );
pFont->SetPhysFont( pOut ); pFont->SetPhysFont( pOut );
pOut->DrawStretchText( aSpacePos, nDiff, XubString( " ", pOut->DrawStretchText( aSpacePos, nDiff, " ", 0, 2 );
RTL_TEXTENCODING_MS_1252 ), 0, 2 );
pFont->SetWordLineMode( bWordWise ); pFont->SetWordLineMode( bWordWise );
pFont->SetTransparent( bTrans ); pFont->SetTransparent( bTrans );
pFont->SetPhysFont( pOut ); pFont->SetPhysFont( pOut );
...@@ -697,7 +696,7 @@ void SvxDoDrawCapital::SetSpace() ...@@ -697,7 +696,7 @@ void SvxDoDrawCapital::SetSpace()
aSpacePos.X() = aPos.X(); aSpacePos.X() = aPos.X();
} }
void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx, void SvxDoDrawCapital::Do( const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const sal_Bool bUpper) const xub_StrLen _nLen, const sal_Bool bUpper)
{ {
sal_uInt8 nProp = 0; sal_uInt8 nProp = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment