summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2012-08-13 11:21:13 +0200
committerArnaud Versini <arnaud.versini@gmail.com>2012-08-14 16:18:05 +0200
commit9a3d8ed28dc44743b6715cd8bac39b55762cba11 (patch)
tree2755682e3e28998f7df4c2fa4fde1d7235e8c872 /vcl/source/gdi
parentd26599c3e1dea940439985b46b727cfc22b37c38 (diff)
Replace usage of rtl/memory.h in vcl with equivalent from string.h
Change-Id: If8d460189c57f9c02923019e95bf47db1d96c716
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/bitmap3.cxx2
-rw-r--r--vcl/source/gdi/bmpfast.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx22
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx6
-rw-r--r--vcl/source/gdi/pngread.cxx11
-rw-r--r--vcl/source/gdi/pngwrite.cxx5
-rw-r--r--vcl/source/gdi/salmisc.cxx1
8 files changed, 26 insertions, 29 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 41a1dc3cb516..1ce4253509fb 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -1685,7 +1685,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount )
PopularColorCount* pCountTable = new PopularColorCount[ nTotalColors ];
long nX, nY, nR, nG, nB, nIndex;
- rtl_zeroMemory( pCountTable, nTotalColors * sizeof( PopularColorCount ) );
+ memset( pCountTable, 0, nTotalColors * sizeof( PopularColorCount ) );
for( nR = 0, nIndex = 0; nR < 256; nR += nColorOffset )
{
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 3d0a48dfc264..3bbed3e4bf13 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -919,7 +919,7 @@ bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor )
if( bByteFill )
{
long nByteCount = rDst.mnHeight * rDst.mnScanlineSize;
- rtl_fillMemory( rDst.mpBits, nByteCount, nFillByte );
+ memset( rDst.mpBits, nFillByte, nByteCount );
return true;
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ca4491671102..e17c3184c92d 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -126,7 +126,7 @@ void PDFTestOutputStream::write( const com::sun::star::uno::Reference< com::sun:
{
OString aStr( "lalala\ntest\ntest\ntest" );
com::sun::star::uno::Sequence< sal_Int8 > aData( aStr.getLength() );
- rtl_copyMemory( aData.getArray(), aStr.getStr(), aStr.getLength() );
+ memcpy( aData.getArray(), aStr.getStr(), aStr.getLength() );
xStream->writeBytes( aData );
}
@@ -3151,7 +3151,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const PhysicalFo
aInfo.m_aFontBBox = Rectangle( Point( -200, -200 ), Size( 1700, 1700 ) );
aInfo.m_aPSName = pFont->maName;
sal_Int32 pWidths[256];
- rtl_zeroMemory( pWidths, sizeof(pWidths) );
+ memset( pWidths, 0, sizeof(pWidths) );
if( pFont->IsEmbeddable() )
{
const unsigned char* pFontData = NULL;
@@ -3304,10 +3304,10 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
sal_Int32 pEncToUnicodeIndex[256];
if( pEncoding )
{
- rtl_zeroMemory( nEncoding, sizeof(nEncoding) );
- rtl_zeroMemory( nEncodedCodes, sizeof(nEncodedCodes) );
- rtl_zeroMemory( pUnicodesPerGlyph, sizeof(pUnicodesPerGlyph) );
- rtl_zeroMemory( pEncToUnicodeIndex, sizeof(pEncToUnicodeIndex) );
+ memset( nEncoding, 0, sizeof(nEncoding) );
+ memset( nEncodedCodes, 0, sizeof(nEncodedCodes) );
+ memset( pUnicodesPerGlyph, 0, sizeof(pUnicodesPerGlyph) );
+ memset( pEncToUnicodeIndex, 0, sizeof(pEncToUnicodeIndex) );
for( Ucs2SIntMap::const_iterator it = pEncoding->begin(); it != pEncoding->end(); ++it )
{
if( it->second != -1 )
@@ -3599,7 +3599,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical
else
{
boost::shared_array<unsigned char> pWriteBuffer( new unsigned char[ nLength2 ] );
- rtl_zeroMemory( pWriteBuffer.get(), nLength2 );
+ memset( pWriteBuffer.get(), 0, nLength2 );
int nWriteIndex = 0;
int nNextSectionIndex = 0;
@@ -4085,10 +4085,10 @@ bool PDFWriterImpl::emitFonts()
// fill arrays and prepare encoding index map
sal_Int32 nToUnicodeStream = 0;
- rtl_zeroMemory( pGlyphIDs, sizeof( pGlyphIDs ) );
- rtl_zeroMemory( pEncoding, sizeof( pEncoding ) );
- rtl_zeroMemory( pUnicodesPerGlyph, sizeof( pUnicodesPerGlyph ) );
- rtl_zeroMemory( pEncToUnicodeIndex, sizeof( pEncToUnicodeIndex ) );
+ memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) );
+ memset( pEncoding, 0, sizeof( pEncoding ) );
+ memset( pUnicodesPerGlyph, 0, sizeof( pUnicodesPerGlyph ) );
+ memset( pEncToUnicodeIndex, 0, sizeof( pEncToUnicodeIndex ) );
for( FontEmitMapping::iterator fit = lit->m_aMapping.begin(); fit != lit->m_aMapping.end();++fit )
{
sal_uInt8 nEnc = fit->second.getGlyphId();
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 2f3a6b3bbbaf..2a57926e321b 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -294,7 +294,7 @@ public:
public:
GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0)
{
- rtl_zeroMemory( m_aBufferedUnicodes, sizeof( m_aBufferedUnicodes ) );
+ memset( m_aBufferedUnicodes, 0, sizeof( m_aBufferedUnicodes ) );
m_nMaxUnicodes = SAL_N_ELEMENTS(m_aBufferedUnicodes);
}
~GlyphEmit()
@@ -310,9 +310,9 @@ public:
{
sal_Ucs* pNew = new sal_Ucs[ 2 * m_nMaxUnicodes];
if( m_pUnicodes.get() )
- rtl_copyMemory( pNew, m_pUnicodes.get(), m_nMaxUnicodes * sizeof(sal_Ucs) );
+ memcpy( pNew, m_pUnicodes.get(), m_nMaxUnicodes * sizeof(sal_Ucs) );
else
- rtl_copyMemory( pNew, m_aBufferedUnicodes, m_nMaxUnicodes * sizeof(sal_Ucs) );
+ memcpy( pNew, m_aBufferedUnicodes, m_nMaxUnicodes * sizeof(sal_Ucs) );
m_pUnicodes.reset( pNew );
m_nMaxUnicodes *= 2;
}
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index d7998c9b1264..16f806bf6c7b 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1234,8 +1234,8 @@ uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rt
xResult.clear();
// trash temporary padded cleartext PWDs
- rtl_zeroMemory( aPadOPW, sizeof(aPadOPW) );
- rtl_zeroMemory( aPadUPW, sizeof(aPadUPW) );
+ memset( aPadOPW, 0, sizeof(aPadOPW) );
+ memset( aPadUPW, 0, sizeof(aPadUPW) );
}
return xResult;
@@ -1317,7 +1317,7 @@ void PDFWriterImpl::padPassword( const rtl::OUString& i_rPassword, sal_uInt8* o_
o_pPaddedPW[i] = s_nPadString[y];
// trash memory of temporary clear text password
- rtl_zeroMemory( (sal_Char*)aString.getStr(), aString.getLength() );
+ memset( (sal_Char*)aString.getStr(), 0, aString.getLength() );
}
/**********************************
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index a01b66d110a8..e94f0f540f68 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -31,7 +31,6 @@
#include <cmath>
#include <rtl/crc.h>
-#include <rtl/memory.h>
#include <rtl/alloc.h>
#include <tools/zcodec.hxx>
#include <tools/stream.hxx>
@@ -750,7 +749,7 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
if ( mnChunkLen == 2 )
{
mpTransTab = new sal_uInt8[ 256 ];
- rtl_fillMemory( mpTransTab, 256, 0xff );
+ memset( mpTransTab, 0xff, 256);
// color type 0 and 4 is always greyscale,
// so the return value can be used as index
sal_uInt8 nIndex = ImplScaleColor();
@@ -778,10 +777,10 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
{
mbTransparent = true;
mpTransTab = new sal_uInt8 [ 256 ];
- rtl_fillMemory( mpTransTab, 256, 0xff );
+ memset( mpTransTab, 0xff, 256 );
if (mnChunkLen > 0)
{
- rtl_copyMemory( mpTransTab, &(*maDataIter), mnChunkLen );
+ memcpy( mpTransTab, &(*maDataIter), mnChunkLen );
maDataIter += mnChunkLen;
// need alpha transparency if not on/off masking
for( int i = 0; i < mnChunkLen; ++i )
@@ -1023,7 +1022,7 @@ bool PNGReaderImpl::ImplPreparePass()
mnScansize = ( mnScansize*mnPngDepth + 7 ) >> 3;
++mnScansize; // scan size also needs room for the filtertype byte
- rtl_zeroMemory( mpScanPrior, mnScansize );
+ memset( mpScanPrior, 0, mnScansize );
return true;
}
@@ -1132,7 +1131,7 @@ void PNGReaderImpl::ImplApplyFilter()
break;
}
- rtl_copyMemory( mpScanPrior, mpInflateInBuf, mnScansize );
+ memcpy( mpScanPrior, mpInflateInBuf, mnScansize );
}
// ---------------------------------------------------------------------------------------------------
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 9a90fd9e08d3..2412cf85a0c5 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -32,7 +32,6 @@
#include <cmath>
#include <limits>
#include <rtl/crc.h>
-#include <rtl/memory.h>
#include <rtl/alloc.h>
#include <tools/zcodec.hxx>
#include <tools/stream.hxx>
@@ -648,7 +647,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL
void PNGWriterImpl::ImplClearFirstScanline()
{
if ( mnFilterType )
- rtl_zeroMemory( mpPreviousScan, mnDeflateInSize );
+ memset( mpPreviousScan, 0, mnDeflateInSize );
}
// ------------------------------------------------------------------------
@@ -682,7 +681,7 @@ void PNGWriterImpl::ImplWriteChunk ( unsigned char* pSource, sal_uInt32 nDatSize
vcl::PNGWriter::ChunkData& rChunkData = maChunkSeq.back();
sal_uInt32 nSize = rChunkData.aData.size();
rChunkData.aData.resize( nSize + nDatSize );
- rtl_copyMemory( &rChunkData.aData[ nSize ], pSource, nDatSize );
+ memcpy( &rChunkData.aData[ nSize ], pSource, nDatSize );
}
}
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 4f13fbbb784d..a6241ad36e6f 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-#include <rtl/memory.h>
#include <vcl/bmpacc.hxx>
#include <vcl/salbtype.hxx>
#include <bmpfast.hxx>