Kaydet (Commit) e20a55ea authored tarafından Caolán McNamara's avatar Caolán McNamara

check return of osl_setFilePos

üst 21fc8b9e
......@@ -1328,9 +1328,8 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo
{
oslFileHandle pFile = NULL;
osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
if( pFile )
if (pFile && (osl_setFilePos(pFile, osl_Pos_Absolut, 0) == osl_File_E_None))
{
osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
std::vector< char > buffer( 0x10000, 0 );
// update job data with current page size
Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
......
......@@ -77,13 +77,14 @@ AppendPS (FILE* pDst, osl::File* pSrc, sal_uChar* pBuffer,
if ((pDst == NULL) || (pSrc == NULL))
return sal_False;
if (pSrc->setPos(osl_Pos_Absolut, 0) != osl::FileBase::E_None)
return sal_False;
if (nBlockSize == 0)
nBlockSize = nBLOCKSIZE;
if (pBuffer == NULL)
pBuffer = (sal_uChar*)alloca (nBlockSize);
pSrc->setPos (osl_Pos_Absolut, 0);
sal_uInt64 nIn = 0;
sal_uInt64 nOut = 0;
do
......
......@@ -819,10 +819,14 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppli
convertPfbToPfa (aFontFile, *pFile);
aFontFile.close ();
pFile->setPos(osl_Pos_Current, -1);
char lastchar = '\n';
sal_uInt64 uBytes(1);
pFile->read((void *)(&lastchar), uBytes, uBytes);
if (pFile->setPos(osl_Pos_Current, -1) == osl::FileBase::E_None)
{
sal_uInt64 uBytes(1);
pFile->read((void *)(&lastchar), uBytes, uBytes);
}
if (lastchar != '\n')
WritePS (pFile, "\n");
}
......
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