summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-12-01 23:22:59 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-12-27 16:51:25 +0100
commit59e3e041ccd119e72dee053172531a59832336c7 (patch)
tree9ef995f8c829d5ae821e9d821b847ecbccc575de /vcl
parent118318e3e9d6ac310861dc87c6219c2120da33fa (diff)
sal_uIntPtr to sal_uInt32, int to sal_uInt32/sal_uInt64
Change-Id: Ib86d6b63d16f24f3c5e17981562d100e247dc267
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/print/genprnpsp.cxx4
-rw-r--r--vcl/headless/svpprn.cxx2
-rw-r--r--vcl/inc/jobset.h2
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx9
4 files changed, 9 insertions, 8 deletions
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 672b2225ade0..36e3538fbb4f 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -235,7 +235,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( pJobSetup->mpDriverData )
rtl_freeMemory( pJobSetup->mpDriverData );
- int nBytes;
+ sal_uInt32 nBytes;
void* pBuffer = nullptr;
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
@@ -568,7 +568,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
rtl_freeMemory( pJobSetup->mpDriverData );
pJobSetup->mpDriverData = nullptr;
- int nBytes;
+ sal_uInt32 nBytes;
void* pBuffer = nullptr;
aInfo.getStreamBuffer( pBuffer, nBytes );
pJobSetup->mnDriverDataLen = nBytes;
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index fd5047ed135e..89413035513b 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -139,7 +139,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
if( pJobSetup->mpDriverData )
rtl_freeMemory( pJobSetup->mpDriverData );
- int nBytes;
+ sal_uInt32 nBytes;
void* pBuffer = nullptr;
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h
index f0bf8a5c467c..721f1b00b928 100644
--- a/vcl/inc/jobset.h
+++ b/vcl/inc/jobset.h
@@ -41,7 +41,7 @@ struct ImplJobSetup
Paper mePaperFormat; // paper format
long mnPaperWidth; // paper width (100th mm)
long mnPaperHeight; // paper height (100th mm)
- sal_uIntPtr mnDriverDataLen; // length of system specific data
+ sal_uInt32 mnDriverDataLen; // length of system specific data
sal_uInt8* mpDriverData; // system specific data (will be streamed a byte block)
bool mbPapersizeFromSetup;
std::unordered_map< OUString, OUString, OUStringHash > maValueMap;
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 9169b01f175c..a9f7c30ab6a7 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -125,7 +125,7 @@ bool JobData::setPaperBin( int i_nPaperBin )
return bSuccess;
}
-bool JobData::getStreamBuffer( void*& pData, int& bytes )
+bool JobData::getStreamBuffer( void*& pData, sal_uInt32& bytes )
{
// consistency checks
if( ! m_pParser )
@@ -198,12 +198,13 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes )
pContextBuffer.reset();
// success
- pData = rtl_allocateMemory( bytes = aStream.Tell() );
+ bytes = static_cast<sal_uInt32>(aStream.Tell());
+ pData = rtl_allocateMemory( bytes );
memcpy( pData, aStream.GetData(), bytes );
return true;
}
-bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobData )
+bool JobData::constructFromStreamBuffer( void* pData, sal_uInt32 bytes, JobData& rJobData )
{
SvMemoryStream aStream( pData, bytes, StreamMode::READ );
OString aLine;
@@ -291,7 +292,7 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
if( rJobData.m_pParser )
{
rJobData.m_aContext.setParser( rJobData.m_pParser );
- int nBytes = bytes - aStream.Tell();
+ const sal_uInt64 nBytes = bytes - aStream.Tell();
std::unique_ptr<char[]> pRemain(new char[bytes - aStream.Tell()]);
aStream.Read( pRemain.get(), nBytes );
rJobData.m_aContext.rebuildFromStreamBuffer( pRemain.get(), nBytes );