r23770 by jghali - Do not leave broken XPS file behind if temporary directory fails to be written to ZIP

scribus-commit scribus-commit at lists.scribus.net
Mon May 11 15:43:26 UTC 2020


Author: jghali
Date: Mon May 11 15:43:26 2020
New Revision: 23770

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23770
Log:
Do not leave broken XPS file behind if temporary directory fails to be written to ZIP

Modified:
    trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp

Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23770&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	Mon May 11 15:43:26 2020
@@ -291,9 +291,12 @@
 		s.writeRawData(utf8wr.data(), utf8wr.length());
 		fdo.close();
 	}
-	zip.write(baseDir);
+	
+	bool written = zip.write(baseDir);
 	zip.close();
-	return true;
+	if (!written)
+		QFile::remove(fName);
+	return written;
 }
 
 void XPSExPlug::writePages(QDomElement &root)




More information about the scribus-commit mailing list