summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/jobdata.hxx4
-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
5 files changed, 11 insertions, 10 deletions
diff --git a/include/vcl/jobdata.hxx b/include/vcl/jobdata.hxx
index 4244fdbaeda7..771f73c314ea 100644
--- a/include/vcl/jobdata.hxx
+++ b/include/vcl/jobdata.hxx
@@ -75,8 +75,8 @@ struct VCL_DLLPUBLIC JobData
// creates a new buffer using new
// it is up to the user to delete it again
- bool getStreamBuffer( void*& pData, int& bytes );
- static bool constructFromStreamBuffer( void* pData, int bytes, JobData& rJobData );
+ bool getStreamBuffer( void*& pData, sal_uInt32& bytes );
+ static bool constructFromStreamBuffer( void* pData, sal_uInt32 bytes, JobData& rJobData );
};
bool operator==(const psp::JobData& rLeft, const psp::JobData& rRight);
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 );