convert include/editeng/svxfont.hxx from String to OUString

Change-Id: Ibee55393373d4b8bc9e17effc2f2bdf862c17cc9
This commit is contained in:
Noel Grandin
2013-09-05 12:22:59 +02:00
parent af40ffdcef
commit 987356e22f
2 changed files with 47 additions and 47 deletions

View File

@@ -349,8 +349,8 @@ Font SvxFont::ChgPhysFont( OutputDevice *pOut ) const
} }
Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt, Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen ) const const sal_Int32 nIdx, const sal_Int32 nLen ) const
{ {
if ( !IsCaseMap() && !IsKern() ) if ( !IsCaseMap() && !IsKern() )
return Size( pOut->GetTextWidth( rTxt, nIdx, nLen ), return Size( pOut->GetTextWidth( rTxt, nIdx, nLen ),
@@ -363,8 +363,8 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt,
else else
{ {
// #108210# // #108210#
const XubString aNewText = CalcCaseMap(rTxt); const OUString aNewText = CalcCaseMap(rTxt);
sal_Bool bCaseMapLengthDiffers(aNewText.Len() != rTxt.Len()); sal_Bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength());
sal_Int32 nWidth(0L); sal_Int32 nWidth(0L);
if(bCaseMapLengthDiffers) if(bCaseMapLengthDiffers)
@@ -389,7 +389,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt,
return aTxtSize; return aTxtSize;
} }
Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt ) Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt )
{ {
if ( !IsCaseMap() && !IsKern() ) if ( !IsCaseMap() && !IsKern() )
return Size( pOut->GetTextWidth( rTxt ), pOut->GetTextHeight() ); return Size( pOut->GetTextWidth( rTxt ), pOut->GetTextHeight() );
@@ -401,14 +401,14 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt )
else else
aTxtSize.setWidth( pOut->GetTextWidth( CalcCaseMap( rTxt ) ) ); aTxtSize.setWidth( pOut->GetTextWidth( CalcCaseMap( rTxt ) ) );
if( IsKern() && ( rTxt.Len() > 1 ) ) if( IsKern() && ( rTxt.getLength() > 1 ) )
aTxtSize.Width() += ( ( rTxt.Len()-1 ) * long( nKern ) ); aTxtSize.Width() += ( ( rTxt.getLength()-1 ) * long( nKern ) );
return aTxtSize; return aTxtSize;
} }
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt, Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_uInt16 nIdx, const sal_uInt16 nLen, sal_Int32* pDXArray ) const const sal_Int32 nIdx, const sal_Int32 nLen, sal_Int32* pDXArray ) const
{ {
if ( !IsCaseMap() && !IsKern() ) if ( !IsCaseMap() && !IsKern() )
return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ), return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
@@ -438,15 +438,15 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt,
} }
Size SvxFont::GetTxtSize( const OutputDevice *pOut, const XubString &rTxt, Size SvxFont::GetTxtSize( const OutputDevice *pOut, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen ) const const sal_Int32 nIdx, const sal_Int32 nLen ) const
{ {
xub_StrLen nTmp = nLen; sal_Int32 nTmp = nLen;
if ( nTmp == STRING_LEN ) // already initialized? if ( nTmp == SAL_MAX_INT32 ) // already initialized?
nTmp = rTxt.Len(); nTmp = rTxt.getLength();
Font aOldFont( ChgPhysFont((OutputDevice *)pOut) ); Font aOldFont( ChgPhysFont((OutputDevice *)pOut) );
Size aTxtSize; Size aTxtSize;
if( IsCapital() && rTxt.Len() ) if( IsCapital() && !rTxt.isEmpty() )
{ {
aTxtSize = GetCapitalSize( pOut, rTxt, nIdx, nTmp ); aTxtSize = GetCapitalSize( pOut, rTxt, nIdx, nTmp );
} }
@@ -457,8 +457,8 @@ Size SvxFont::GetTxtSize( const OutputDevice *pOut, const XubString &rTxt,
void SvxFont::QuickDrawText( OutputDevice *pOut, void SvxFont::QuickDrawText( OutputDevice *pOut,
const Point &rPos, const XubString &rTxt, const Point &rPos, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen, const sal_Int32* pDXArray ) const const sal_Int32 nIdx, const sal_Int32 nLen, const sal_Int32* pDXArray ) const
{ {
// Font has to be selected in OutputDevice... // Font has to be selected in OutputDevice...
if ( !IsCaseMap() && !IsCapital() && !IsKern() && !IsEsc() ) if ( !IsCaseMap() && !IsCapital() && !IsKern() && !IsEsc() )
@@ -509,15 +509,15 @@ void SvxFont::QuickDrawText( OutputDevice *pOut,
void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter, void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter,
const Point &rPos, const XubString &rTxt, const Point &rPos, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen ) const const sal_Int32 nIdx, const sal_Int32 nLen ) const
{ {
if ( !nLen || !rTxt.Len() ) if ( !nLen || rTxt.isEmpty() )
return; return;
xub_StrLen nTmp = nLen; sal_Int32 nTmp = nLen;
if ( nTmp == STRING_LEN ) // already initialized? if ( nTmp == SAL_MAX_INT32 ) // already initialized?
nTmp = rTxt.Len(); nTmp = rTxt.getLength();
Point aPos( rPos ); Point aPos( rPos );
if ( nEsc ) if ( nEsc )
@@ -546,17 +546,17 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter,
else else
{ {
// #108210# // #108210#
const XubString aNewText = CalcCaseMap(rTxt); const OUString aNewText = CalcCaseMap(rTxt);
sal_Bool bCaseMapLengthDiffers(aNewText.Len() != rTxt.Len()); sal_Bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength());
if(bCaseMapLengthDiffers) if(bCaseMapLengthDiffers)
{ {
// 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, nTmp); const OUString aSnippet(rTxt.copy( nIdx, nTmp));
XubString _aNewText = CalcCaseMap(aSnippet); OUString _aNewText = CalcCaseMap(aSnippet);
pOut->DrawStretchText( aPos, aSize.Width(), _aNewText, 0, _aNewText.Len() ); pOut->DrawStretchText( aPos, aSize.Width(), _aNewText, 0, _aNewText.getLength() );
} }
else else
{ {
@@ -632,8 +632,8 @@ void SvxDoGetCapitalSize::Do( const XubString &_rTxt, const xub_StrLen _nIdx,
aTxtSize.Width() += ( _nLen * long( nKern ) ); aTxtSize.Width() += ( _nLen * long( nKern ) );
} }
Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const XubString &rTxt, Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen) const const sal_Int32 nIdx, const sal_Int32 nLen) const
{ {
// Start: // Start:
SvxDoGetCapitalSize aDo( (SvxFont *)this, pOut, rTxt, nIdx, nLen, nKern ); SvxDoGetCapitalSize aDo( (SvxFont *)this, pOut, rTxt, nIdx, nLen, nKern );
@@ -743,8 +743,8 @@ void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx,
*************************************************************************/ *************************************************************************/
void SvxFont::DrawCapital( OutputDevice *pOut, void SvxFont::DrawCapital( OutputDevice *pOut,
const Point &rPos, const XubString &rTxt, const Point &rPos, const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen ) const const sal_Int32 nIdx, const sal_Int32 nLen ) const
{ {
SvxDoDrawCapital aDo( (SvxFont *)this,pOut,rTxt,nIdx,nLen,rPos,nKern ); SvxDoDrawCapital aDo( (SvxFont *)this,pOut,rTxt,nIdx,nLen,rPos,nKern );
DoOnCapitals( aDo ); DoOnCapitals( aDo );

View File

@@ -80,28 +80,28 @@ public:
void SetPhysFont( OutputDevice *pOut ) const; void SetPhysFont( OutputDevice *pOut ) const;
Font ChgPhysFont( OutputDevice *pOut ) const; Font ChgPhysFont( OutputDevice *pOut ) const;
Size GetCapitalSize( const OutputDevice *pOut, const String &rTxt, Size GetCapitalSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_uInt16 nIdx, const sal_uInt16 nLen) const; const sal_Int32 nIdx, const sal_Int32 nLen) const;
void DrawCapital( OutputDevice *pOut, const Point &rPos, const String &rTxt, void DrawCapital( OutputDevice *pOut, const Point &rPos, const OUString &rTxt,
const sal_uInt16 nIdx, const sal_uInt16 nLen ) const; const sal_Int32 nIdx, const sal_Int32 nLen ) const;
Size GetPhysTxtSize( const OutputDevice *pOut, const String &rTxt, Size GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_uInt16 nIdx, const sal_uInt16 nLen ) const; const sal_Int32 nIdx, const sal_Int32 nLen ) const;
Size GetPhysTxtSize( const OutputDevice *pOut, const String &rTxt ); Size GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt );
Size GetTxtSize( const OutputDevice *pOut, const String &rTxt, Size GetTxtSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const; const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32 ) const;
void QuickDrawText( OutputDevice *pOut, const Point &rPos, const String &rTxt, void QuickDrawText( OutputDevice *pOut, const Point &rPos, const OUString &rTxt,
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN, const sal_Int32* pDXArray = NULL ) const; const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32, const sal_Int32* pDXArray = NULL ) const;
Size QuickGetTextSize( const OutputDevice *pOut, const String &rTxt, Size QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
const sal_uInt16 nIdx, const sal_uInt16 nLen, sal_Int32* pDXArray = NULL ) const; const sal_Int32 nIdx, const sal_Int32 nLen, sal_Int32* pDXArray = NULL ) const;
void DrawPrev( OutputDevice* pOut, Printer* pPrinter, void DrawPrev( OutputDevice* pOut, Printer* pPrinter,
const Point &rPos, const String &rTxt, const Point &rPos, const OUString &rTxt,
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const; const sal_Int32 nIdx = 0, const sal_Int32 nLen = SAL_MAX_INT32 ) const;
static void DrawArrow( OutputDevice &rOut, const Rectangle& rRect, static void DrawArrow( OutputDevice &rOut, const Rectangle& rRect,
const Size& rSize, const Color& rCol, sal_Bool bLeft ); const Size& rSize, const Color& rCol, sal_Bool bLeft );