Kaydet (Commit) 8fcc5df7 authored tarafından Noel Grandin's avatar Noel Grandin

convert vcl/source/filter/wmf/winmtf.hxx from String to OUString

Change-Id: I4c670e53f83af7a0d99ec4135cb614d30811a3b8
üst 924c2177
......@@ -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;
......
......@@ -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 );
......
......@@ -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
......
......@@ -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 );
......
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