summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-23 21:44:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-24 16:53:55 +0000
commit04d58ef75a5e6fd7066fcfd257d907f52e4de5a7 (patch)
tree5d4a01b7069c5963b4ba5a356731d81dcf08ceae
parent7938b75ab7d8052b66859db05201cafc5175d95e (diff)
String->rtl::OUString
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx8
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx8
-rw-r--r--filter/source/svg/svgwriter.cxx2
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx6
-rw-r--r--vcl/inc/vcl/metaact.hxx52
-rw-r--r--vcl/source/gdi/gdimtf.cxx8
-rw-r--r--vcl/source/gdi/metaact.cxx82
7 files changed, 92 insertions, 74 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 9132ebd698dc..80cd70bae29b 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2548,7 +2548,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen(),
NULL,
rFactoryParms,
bSubsettableActions );
@@ -2567,7 +2567,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen(),
pAct->GetDXArray(),
rFactoryParms,
bSubsettableActions );
@@ -2643,7 +2643,7 @@ namespace cppcanvas
convertToLocalizedNumerals ( sText,rVDev.GetDigitLanguage() );
const sal_uInt16 nLen( pAct->GetLen() == (sal_uInt16)STRING_LEN ?
- pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen() );
+ pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen() );
// #i70897# Nothing to do, actually...
if( nLen == 0 )
@@ -2678,7 +2678,7 @@ namespace cppcanvas
pAct->GetPoint(),
sText,
pAct->GetIndex(),
- pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(),
+ pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen(),
pDXArray.get(),
rFactoryParms,
bSubsettableActions );
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index f1f00f6a7c91..448ae143a493 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1984,7 +1984,7 @@ namespace
const MetaTextAction* pA = (const MetaTextAction*)pAction;
sal_uInt32 nTextLength(pA->GetLen());
const sal_uInt32 nTextIndex(pA->GetIndex());
- const sal_uInt32 nStringLength(pA->GetText().Len());
+ const sal_uInt32 nStringLength(pA->GetText().getLength());
if(nTextLength + nTextIndex > nStringLength)
{
@@ -2012,7 +2012,7 @@ namespace
const MetaTextArrayAction* pA = (const MetaTextArrayAction*)pAction;
sal_uInt32 nTextLength(pA->GetLen());
const sal_uInt32 nTextIndex(pA->GetIndex());
- const sal_uInt32 nStringLength(pA->GetText().Len());
+ const sal_uInt32 nStringLength(pA->GetText().getLength());
if(nTextLength + nTextIndex > nStringLength)
{
@@ -2060,7 +2060,7 @@ namespace
const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction;
sal_uInt32 nTextLength(pA->GetLen());
const sal_uInt32 nTextIndex(pA->GetIndex());
- const sal_uInt32 nStringLength(pA->GetText().Len());
+ const sal_uInt32 nStringLength(pA->GetText().getLength());
if(nTextLength + nTextIndex > nStringLength)
{
@@ -2116,7 +2116,7 @@ namespace
// OSL_FAIL("META_TEXTRECT_ACTION requested (!)");
const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction;
const Rectangle& rRectangle = pA->GetRect();
- const sal_uInt32 nStringLength(pA->GetText().Len());
+ const sal_uInt32 nStringLength(pA->GetText().getLength());
if(!rRectangle.IsEmpty() && 0 != nStringLength)
{
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 0639e5d681e0..4d417070320d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1890,7 +1890,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
{
const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- if( pA->GetText().Len() )
+ if (!pA->GetText().isEmpty())
{
Font aFont( mpVDev->GetFont() );
Size aSz;
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index e1b4a475d800..ff5037cbbf66 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -266,19 +266,19 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
case META_TEXT_ACTION: {
MetaTextAction * pAct = static_cast<MetaTextAction *>(pCurrAct);
return (pAct->GetLen() == (sal_uInt16)STRING_LEN
- ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen());
+ ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen());
}
case META_TEXTARRAY_ACTION: {
MetaTextArrayAction * pAct =
static_cast<MetaTextArrayAction *>(pCurrAct);
return (pAct->GetLen() == (sal_uInt16)STRING_LEN
- ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen());
+ ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen());
}
case META_STRETCHTEXT_ACTION: {
MetaStretchTextAction * pAct =
static_cast<MetaStretchTextAction *>(pCurrAct);
return (pAct->GetLen() == (sal_uInt16)STRING_LEN
- ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen());
+ ? pAct->GetText().getLength() - pAct->GetIndex() : pAct->GetLen());
}
case META_FLOATTRANSPARENT_ACTION: {
MetaFloatTransparentAction * pAct =
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index 64800fd6d0c8..3c02e79ccb75 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -505,23 +505,23 @@ class VCL_DLLPUBLIC MetaTextAction : public MetaAction
private:
Point maPt;
- XubString maStr;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ rtl::OUString maStr;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( Text, META_TEXT_ACTION )
- MetaTextAction( const Point& rPt, const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen );
+ MetaTextAction( const Point& rPt, const rtl::OUString& rStr,
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Point& GetPoint() const { return maPt; }
- const XubString& GetText() const { return maStr; }
+ const rtl::OUString& GetText() const { return maStr; }
sal_uInt16 GetIndex() const { return mnIndex; }
sal_uInt16 GetLen() const { return mnLen; }
};
@@ -535,10 +535,10 @@ class VCL_DLLPUBLIC MetaTextArrayAction : public MetaAction
private:
Point maStartPt;
- XubString maStr;
+ rtl::OUString maStr;
sal_Int32* mpDXAry;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -548,11 +548,9 @@ protected:
public:
MetaTextArrayAction();
MetaTextArrayAction( const MetaTextArrayAction& rAction );
- MetaTextArrayAction( const Point& rStartPt,
- const XubString& rStr,
- const sal_Int32* pDXAry,
- sal_uInt16 nIndex,
- sal_uInt16 nLen );
+ MetaTextArrayAction( const Point& rStartPt, const rtl::OUString& rStr,
+ const sal_Int32* pDXAry, sal_uInt16 nIndex,
+ sal_uInt16 nLen );
virtual void Execute( OutputDevice* pOut );
@@ -565,7 +563,7 @@ public:
virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
const Point& GetPoint() const { return maStartPt; }
- const XubString& GetText() const { return maStr; }
+ const rtl::OUString& GetText() const { return maStr; }
sal_uInt16 GetIndex() const { return mnIndex; }
sal_uInt16 GetLen() const { return mnLen; }
sal_Int32* GetDXArray() const { return mpDXAry; }
@@ -580,25 +578,25 @@ class VCL_DLLPUBLIC MetaStretchTextAction : public MetaAction
private:
Point maPt;
- XubString maStr;
+ rtl::OUString maStr;
sal_uInt32 mnWidth;
- sal_uInt16 mnIndex;
- sal_uInt16 mnLen;
+ sal_uInt16 mnIndex;
+ sal_uInt16 mnLen;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
- MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
- const XubString& rStr,
- sal_uInt16 nIndex, sal_uInt16 nLen );
+ MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
+ const rtl::OUString& rStr,
+ sal_uInt16 nIndex, sal_uInt16 nLen );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Point& GetPoint() const { return maPt; }
- const XubString& GetText() const { return maStr; }
+ const rtl::OUString& GetText() const { return maStr; }
sal_uInt32 GetWidth() const { return mnWidth; }
sal_uInt16 GetIndex() const { return mnIndex; }
sal_uInt16 GetLen() const { return mnLen; }
@@ -613,22 +611,22 @@ class VCL_DLLPUBLIC MetaTextRectAction : public MetaAction
private:
Rectangle maRect;
- XubString maStr;
- sal_uInt16 mnStyle;
+ rtl::OUString maStr;
+ sal_uInt16 mnStyle;
virtual sal_Bool Compare( const MetaAction& ) const;
public:
DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
- MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle );
+ MetaTextRectAction( const Rectangle& rRect,
+ const rtl::OUString& rStr, sal_uInt16 nStyle );
virtual void Move( long nHorzMove, long nVertMove );
virtual void Scale( double fScaleX, double fScaleY );
const Rectangle& GetRect() const { return maRect; }
- const XubString& GetText() const { return maStr; }
+ const rtl::OUString& GetText() const { return maStr; }
sal_uInt16 GetStyle() const { return mnStyle; }
};
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 1395fe66e941..49d3bbb6e49b 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2811,14 +2811,14 @@ sal_uLong GDIMetaFile::GetSizeBytes() const
}
break;
- case( META_TEXT_ACTION ): nSizeBytes += ( ( (MetaTextAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
- case( META_STRETCHTEXT_ACTION ): nSizeBytes += ( ( (MetaStretchTextAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
- case( META_TEXTRECT_ACTION ): nSizeBytes += ( ( (MetaTextRectAction*) pAction )->GetText().Len() * sizeof( sal_Unicode ) ); break;
+ case( META_TEXT_ACTION ): nSizeBytes += ( ( (MetaTextAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break;
+ case( META_STRETCHTEXT_ACTION ): nSizeBytes += ( ( (MetaStretchTextAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break;
+ case( META_TEXTRECT_ACTION ): nSizeBytes += ( ( (MetaTextRectAction*) pAction )->GetText().getLength() * sizeof( sal_Unicode ) ); break;
case( META_TEXTARRAY_ACTION ):
{
MetaTextArrayAction* pTextArrayAction = (MetaTextArrayAction*) pAction;
- nSizeBytes += ( pTextArrayAction->GetText().Len() * sizeof( sal_Unicode ) );
+ nSizeBytes += ( pTextArrayAction->GetText().getLength() * sizeof( sal_Unicode ) );
if( pTextArrayAction->GetDXArray() )
nSizeBytes += ( pTextArrayAction->GetLen() << 2 );
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 5a862186c3f0..12113b7ec014 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1203,7 +1203,7 @@ IMPL_META_ACTION( Text, META_TEXT_ACTION )
// ------------------------------------------------------------------------
-MetaTextAction::MetaTextAction( const Point& rPt, const XubString& rStr,
+MetaTextAction::MetaTextAction( const Point& rPt, const rtl::OUString& rStr,
sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_TEXT_ACTION ),
maPt ( rPt ),
@@ -1263,11 +1263,11 @@ void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm << mnIndex;
rOStm << mnLen;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 nLen = sal::static_int_cast<sal_uInt16>(maStr.getLength()); // version 2
rOStm << nLen;
- for ( i = 0; i < nLen; i++ )
+ for (sal_uInt16 i = 0; i < nLen; ++i )
{
- sal_Unicode nUni = maStr.GetChar( i );
+ sal_Unicode nUni = maStr[i];
rOStm << nUni;
}
}
@@ -1284,11 +1284,16 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
if ( aCompat.GetVersion() >= 2 ) // Version 2
{
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
rIStm >> nLen;
- sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
+ rtl::OUStringBuffer aBuffer(nLen);
while ( nLen-- )
- rIStm >> *pBuffer++;
+ {
+ sal_uInt16 nChar;
+ rIStm >> nChar;
+ aBuffer.append(nChar);
+ }
+ maStr = aBuffer.makeStringAndClear();
}
}
@@ -1325,7 +1330,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
// ------------------------------------------------------------------------
MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
- const XubString& rStr,
+ const rtl::OUString& rStr,
const sal_Int32* pDXAry,
sal_uInt16 nIndex,
sal_uInt16 nLen ) :
@@ -1333,7 +1338,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
maStartPt ( rStartPt ),
maStr ( rStr ),
mnIndex ( nIndex ),
- mnLen ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
+ mnLen ( ( nLen == STRING_LEN ) ? rStr.getLength() : nLen )
{
const sal_uLong nAryLen = pDXAry ? mnLen : 0;
@@ -1416,11 +1421,11 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
for( sal_uLong i = 0UL; i < nAryLen; i++ )
rOStm << mpDXAry[ i ];
- sal_uInt16 j, nLen = maStr.Len(); // version 2
+ sal_uInt16 nLen = sal::static_int_cast<sal_uInt16>(maStr.getLength()); // version 2
rOStm << nLen;
- for ( j = 0; j < nLen; j++ )
+ for (sal_uInt16 j = 0; j < nLen; ++j )
{
- sal_Unicode nUni = maStr.GetChar( j );
+ sal_Unicode nUni = maStr[j];
rOStm << nUni;
}
}
@@ -1440,7 +1445,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
rIStm >> mnLen;
rIStm >> nAryLen;
- if ( mnIndex + mnLen > maStr.Len() )
+ if ( mnIndex + mnLen > maStr.getLength() )
{
mnIndex = 0;
mpDXAry = 0;
@@ -1475,13 +1480,18 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
if ( aCompat.GetVersion() >= 2 ) // Version 2
{
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
rIStm >> nLen;
- sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
+ rtl::OUStringBuffer aBuffer(nLen);
while ( nLen-- )
- rIStm >> *pBuffer++;
+ {
+ sal_uInt16 nChar;
+ rIStm >> nChar;
+ aBuffer.append(nChar);
+ }
+ maStr = aBuffer.makeStringAndClear();
- if ( mnIndex + mnLen > maStr.Len() )
+ if ( mnIndex + mnLen > maStr.getLength() )
{
mnIndex = 0;
delete[] mpDXAry, mpDXAry = NULL;
@@ -1496,7 +1506,7 @@ IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
// ------------------------------------------------------------------------
MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
- const XubString& rStr,
+ const rtl::OUString& rStr,
sal_uInt16 nIndex, sal_uInt16 nLen ) :
MetaAction ( META_STRETCHTEXT_ACTION ),
maPt ( rPt ),
@@ -1560,11 +1570,11 @@ void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm << mnIndex;
rOStm << mnLen;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 nLen = sal::static_int_cast<sal_uInt16>(maStr.getLength()); // version 2
rOStm << nLen;
- for ( i = 0; i < nLen; i++ )
+ for ( sal_uInt16 i = 0; i < nLen; ++i )
{
- sal_Unicode nUni = maStr.GetChar( i );
+ sal_Unicode nUni = maStr[i];
rOStm << nUni;
}
}
@@ -1582,11 +1592,16 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
if ( aCompat.GetVersion() >= 2 ) // Version 2
{
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
rIStm >> nLen;
- sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
+ rtl::OUStringBuffer aBuffer(nLen);
while ( nLen-- )
- rIStm >> *pBuffer++;
+ {
+ sal_uInt16 nChar;
+ rIStm >> nChar;
+ aBuffer.append(nChar);
+ }
+ maStr = aBuffer.makeStringAndClear();
}
}
@@ -1597,7 +1612,7 @@ IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
// ------------------------------------------------------------------------
MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle ) :
+ const rtl::OUString& rStr, sal_uInt16 nStyle ) :
MetaAction ( META_TEXTRECT_ACTION ),
maRect ( rRect ),
maStr ( rStr ),
@@ -1653,11 +1668,11 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm << mnStyle;
- sal_uInt16 i, nLen = maStr.Len(); // version 2
+ sal_uInt16 nLen = sal::static_int_cast<sal_uInt16>(maStr.getLength()); // version 2
rOStm << nLen;
- for ( i = 0; i < nLen; i++ )
+ for (sal_uInt16 i = 0; i < nLen; ++i)
{
- sal_Unicode nUni = maStr.GetChar( i );
+ sal_Unicode nUni = maStr[i];
rOStm << nUni;
}
}
@@ -1673,11 +1688,16 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
if ( aCompat.GetVersion() >= 2 ) // Version 2
{
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
rIStm >> nLen;
- sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
+ rtl::OUStringBuffer aBuffer(nLen);
while ( nLen-- )
- rIStm >> *pBuffer++;
+ {
+ sal_uInt16 nChar;
+ rIStm >> nChar;
+ aBuffer.append(nChar);
+ }
+ maStr = aBuffer.makeStringAndClear();
}
}