summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-08-07 12:00:18 +0200
committerNoel Grandin <noel@peralex.com>2013-08-12 11:56:47 +0200
commit8fcc5df74adbbee655f54e80a64c6920fb05f1b8 (patch)
tree986f06a1fcc71bcfc9e93308df5e74a257fbad7e /vcl
parent924c2177416e61327b586be551428a1380f22133 (diff)
convert vcl/source/filter/wmf/winmtf.hxx from String to OUString
Change-Id: I4c670e53f83af7a0d99ec4135cb614d30811a3b8
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/wmf/enhwmf.cxx23
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx10
-rw-r--r--vcl/source/filter/wmf/winmtf.hxx4
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx14
4 files changed, 26 insertions, 25 deletions
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 11bc047bd70e..c09b317220b6 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -1193,7 +1193,8 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
case EMR_EXTTEXTOUTW :
{
sal_Int32 nLeft, nTop, nRight, nBottom, ptlReferenceX, ptlReferenceY, nGfxMode, nXScale, nYScale;
- sal_uInt32 nCurPos, nLen, nOffString, nOptions, offDx;
+ sal_uInt32 nCurPos, nOffString, nOptions, offDx;
+ sal_Int32 nLen;
sal_Int32* pDX = NULL;
nCurPos = pWMF->Tell() - 8;
@@ -1211,7 +1212,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
DBG_ASSERT( ( nOptions & ( ETO_PDY | ETO_GLYPH_INDEX ) ) == 0, "SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF" );
Point aPos( ptlReferenceX, ptlReferenceY );
- if ( nLen && ( nLen < SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
+ if ( nLen && nLen < static_cast<sal_Int32>( SAL_MAX_UINT32 / sizeof(sal_Int32) ) )
{
if ( offDx && (( nCurPos + offDx + nLen * 4 ) <= nNextPos ) )
{
@@ -1219,33 +1220,33 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
if ( ( nLen * sizeof(sal_uInt32) ) <= ( nEndPos - pWMF->Tell() ) )
{
pDX = new sal_Int32[ nLen ];
- sal_uInt32 i;
+ sal_Int32 i;
for ( i = 0; i < nLen; i++ )
*pWMF >> pDX[ i ];
}
}
pWMF->Seek( nCurPos + nOffString );
- String aText;
+ OUString aText;
if ( bFlag )
{
- if ( nLen <= ( nEndPos - pWMF->Tell() ) )
+ if ( nLen <= static_cast<sal_Int32>( nEndPos - pWMF->Tell() ) )
{
sal_Char* pBuf = new sal_Char[ nLen ];
pWMF->Read( pBuf, nLen );
- aText = String( pBuf, (sal_uInt16)nLen, pOut->GetCharSet() );
+ aText = OUString( pBuf, (sal_uInt16)nLen, pOut->GetCharSet() );
delete[] pBuf;
- if ( aText.Len() != nLen )
+ if ( aText.getLength() != nLen )
{
sal_uInt16 i, j;
sal_Int32* pOldDx = pDX;
- pDX = new sal_Int32[ aText.Len() ];
- for ( i = 0, j = 0; i < aText.Len(); i++ )
+ pDX = new sal_Int32[ aText.getLength() ];
+ for ( i = 0, j = 0; i < aText.getLength(); i++ )
{
- sal_Unicode cUniChar = aText.GetChar(i);
+ sal_Unicode cUniChar = aText[i];
OString aCharacter(&cUniChar, 1, pOut->GetCharSet());
pDX[ i ] = 0;
- for (sal_Int32 k = 0; ( k < aCharacter.getLength() ) && ( j < nLen ) && ( i < aText.Len() ); ++k)
+ for (sal_Int32 k = 0; ( k < aCharacter.getLength() ) && ( j < nLen ) && ( i < aText.getLength() ); ++k)
pDX[ i ] += pOldDx[ j++ ];
}
delete[] pOldDx;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 62530c1d3061..ff7fc2e43902 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1445,7 +1445,7 @@ void WinMtfOutput::DrawPolyBezier( Polygon& rPolygon, sal_Bool bTo, sal_Bool bRe
}
-void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry, sal_Bool bRecordPath, sal_Int32 nGfxMode )
+void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, sal_Int32* pDXArry, sal_Bool bRecordPath, sal_Int32 nGfxMode )
{
UpdateClipRegion();
rPosition = ImplMap( rPosition );
@@ -1454,7 +1454,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
if ( pDXArry )
{
- sal_Int32 i, nSum, nLen = rText.Len();
+ sal_Int32 i, nSum, nLen = rText.getLength();
for( i = 0, nSum = 0; i < nLen; i++ )
{
@@ -1557,8 +1557,8 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
aVDev.SetFont( maFont );
if( pDXArry )
{
- sal_uInt32 nLen = rText.Len();
- nTextWidth = aVDev.GetTextWidth( OUString(rText.GetChar( (sal_uInt16)( nLen - 1 ) )) );
+ sal_uInt32 nLen = rText.getLength();
+ nTextWidth = aVDev.GetTextWidth( OUString(rText[ nLen - 1 ]) );
if( nLen > 1 )
nTextWidth += pDXArry[ nLen - 2 ];
}
@@ -1601,7 +1601,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
SolarMutexGuard aGuard;
VirtualDevice aVDev;
- pDX = new sal_Int32[ rText.Len() ];
+ pDX = new sal_Int32[ rText.getLength() ];
aVDev.SetMapMode( MAP_100TH_MM );
aVDev.SetFont( maLatestFont );
aVDev.GetTextArray( rText, pDX, 0, STRING_LEN );
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 15c36a75dd06..df64f2ace3c6 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -136,7 +136,7 @@ struct LOGFONTW
sal_uInt8 lfClipPrecision;
sal_uInt8 lfQuality;
sal_uInt8 lfPitchAndFamily;
- String alfFaceName;
+ OUString alfFaceName;
};
struct WMF_EXTERNALHEADER;
@@ -750,7 +750,7 @@ public:
);
void DrawText(
Point& rPosition,
- String& rString,
+ OUString& rString,
sal_Int32* pDXArry = NULL,
sal_Bool bRecordPath = sal_False,
sal_Int32 nGraphicsMode = GM_COMPATIBLE
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 6d3d40312703..7796a9051757 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -454,7 +454,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
char* pChar = new char[ ( nLength + 1 ) &~ 1 ];
pWMF->Read( pChar, ( nLength + 1 ) &~ 1 );
- String aText( pChar, nLength, pOut->GetCharSet() );
+ OUString aText( pChar, nLength, pOut->GetCharSet() );
delete[] pChar;
Point aPosition( ReadYX() );
pOut->DrawText( aPosition, aText );
@@ -495,8 +495,8 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
}
char* pChar = new char[ ( nOriginalTextLen + 1 ) &~ 1 ];
pWMF->Read( pChar, ( nOriginalTextLen + 1 ) &~ 1 );
- String aText( pChar, (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain
- nNewTextLen = aText.Len(); // less character (japanese version), so the
+ OUString aText( pChar, (sal_uInt16)nOriginalTextLen, pOut->GetCharSet() );// after this conversion the text may contain
+ nNewTextLen = aText.getLength(); // less character (japanese version), so the
delete[] pChar; // dxAry will not fit
if ( nNewTextLen )
@@ -518,7 +518,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
*pWMF >> nDx;
if ( nNewTextLen != nOriginalTextLen )
{
- sal_Unicode nUniChar = aText.GetChar(i);
+ sal_Unicode nUniChar = aText[i];
OString aTmp(&nUniChar, 1, pOut->GetCharSet());
if ( aTmp.getLength() > 1 )
{
@@ -808,7 +808,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
aLogFont.lfOrientation = lfOrientation;
aLogFont.lfWeight = lfWeight;
- CharSet eCharSet;
+ rtl_TextEncoding eCharSet;
if ( ( aLogFont.lfCharSet == OEM_CHARSET ) || ( aLogFont.lfCharSet == DEFAULT_CHARSET ) )
eCharSet = osl_getThreadTextEncoding();
else
@@ -817,7 +817,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
eCharSet = osl_getThreadTextEncoding();
if ( eCharSet == RTL_TEXTENCODING_SYMBOL )
eCharSet = RTL_TEXTENCODING_MS_1252;
- aLogFont.alfFaceName = String( lfFaceName, eCharSet );
+ aLogFont.alfFaceName = OUString( lfFaceName, strlen(lfFaceName), eCharSet );
pOut->CreateObject( GDI_FONT, new WinMtfFontStyle( aLogFont ) );
}
@@ -934,7 +934,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
if ( Application::GetDefaultDevice()->IsFontAvailable( pOut->GetFont().GetName() ) )
{
Point aPt;
- String aString;
+ OUString aString;
sal_uInt32 nStringLen, nDXCount;
sal_Int32* pDXAry = NULL;
SvMemoryStream aMemoryStream( nEscLen );