Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 12386 → Rev 12387

/trunk/Scribus/scribus/pdflib_core.h
78,10 → 78,11
void PDF_End_Page();
bool PDF_TemplatePage(const Page* pag, bool clip = false);
bool PDF_ProcessPage(const Page* pag, uint PNr, bool clip = false);
void PDF_End_Doc(const QString& PrintPr = "", const QString& Name = "", int Components = 0);
void closeAndCleanup();
bool PDF_End_Doc(const QString& PrintPr = "", const QString& Name = "", int Components = 0);
bool closeAndCleanup();
 
void PDF_Error(const QString& errorMsg);
void PDF_Error_WriteFailure(void);
void PDF_Error_ImageLoadFailure(const QString& fileName);
void PDF_Error_ImageWriteFailure(const QString& fileName);
void PDF_Error_MaskLoadFailure(const QString& fileName);
/trunk/Scribus/scribus/pdflib_core.cpp
227,9 → 227,9
if (!abortExport)
{
if (doc.PDF_Options.Version == PDFOptions::PDFVersion_X3)
PDF_End_Doc(ScCore->PrinterProfiles[doc.PDF_Options.PrintProf], nam, Components);
ret = PDF_End_Doc(ScCore->PrinterProfiles[doc.PDF_Options.PrintProf], nam, Components);
else
PDF_End_Doc();
ret = PDF_End_Doc();
}
else
closeAndCleanup();
7014,7 → 7014,7
return true;
}
 
void PDFLibCore::PDF_End_Doc(const QString& PrintPr, const QString& Name, int Components)
bool PDFLibCore::PDF_End_Doc(const QString& PrintPr, const QString& Name, int Components)
{
QString tmp;
uint StX;
7438,7 → 7438,7
PutDoc("/Encrypt "+QString::number(Encrypt)+" 0 R\n");
PutDoc(">>\nstartxref\n");
PutDoc(QString::number(StX)+"\n%%EOF\n");
closeAndCleanup();
return closeAndCleanup();
}
 
void PDFLibCore::PDF_Error(const QString& errorMsg)
7448,6 → 7448,11
qDebug(errorMsg.toLocal8Bit().data());
}
 
void PDFLibCore::PDF_Error_WriteFailure(void)
{
PDF_Error( tr("A write error occured, please check available disk space"));
}
 
void PDFLibCore::PDF_Error_ImageLoadFailure(const QString& fileName)
{
PDF_Error( tr("Failed to load an image : %1").arg(fileName) );
7468,10 → 7473,13
PDF_Error( tr("Insufficient memory for processing an image"));
}
 
void PDFLibCore::closeAndCleanup()
bool PDFLibCore::closeAndCleanup()
{
bool writeSucceed = (Spool.error() == QFile::NoError);
if (!writeSucceed)
PDF_Error_WriteFailure();
Spool.close();
if (abortExport)
if (abortExport || !writeSucceed)
{
if (Spool.exists())
Spool.remove();
7485,6 → 7493,7
Shadings.clear();
Transpar.clear();
ICCProfiles.clear();
return writeSucceed;
}
 
void PDFLibCore::cancelRequested()