Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument().
MozReview-Commit-ID: 74UkMV3ZOWm
--- a/widget/windows/PDFViaEMFPrintHelper.cpp
+++ b/widget/windows/PDFViaEMFPrintHelper.cpp
@@ -32,18 +32,21 @@ PDFViaEMFPrintHelper::~PDFViaEMFPrintHel
{
CloseDocument();
}
nsresult
PDFViaEMFPrintHelper::OpenDocument(nsIFile *aFile)
{
MOZ_ASSERT(aFile);
+
if (mPDFDoc) {
- MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time");
+ MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time,"
+ "Use CloseDocument() to close the opened file"
+ "before calling OpenDocument()");
return NS_ERROR_FAILURE;
}
if (!mPDFiumEngine) {
mPDFiumEngine = PDFiumEngineShim::GetInstanceOrNull();
NS_ENSURE_TRUE(mPDFiumEngine, NS_ERROR_FAILURE);
}