From 2720c95a95b547ced3d61e5901e41e10ab707f3e Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 22 Feb 2009 17:02:21 +0100 Subject: [PATCH] Set PDFDoc::errCode when saveAs() fails --- poppler/PDFDoc.cc | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index f73359c..b62ecd7 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -469,6 +469,7 @@ GBool PDFDoc::saveAs(GooString *name, PDFWriteMode mode) { if (!(f = fopen(name->getCString(), "wb"))) { error(-1, "Couldn't open file '%s'", name->getCString()); + errCode = errOpenFile; return gFalse; } outStr = new FileOutStream(f,0); @@ -486,6 +487,7 @@ GBool PDFDoc::saveAs(OutStream *outStr, PDFWriteMode mode) { if (!obj.isNull()) { obj.free(); + errCode = errEncrypted; return gFalse; } obj.free(); @@ -521,6 +523,7 @@ GBool PDFDoc::saveWithoutChangesAs(GooString *name) { if (!(f = fopen(name->getCString(), "wb"))) { error(-1, "Couldn't open file '%s'", name->getCString()); + errCode = errOpenFile; return gFalse; } -- 1.5.6.3