Commit 67ae7720 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed issue with bad error code after the opening pdf.

parent 7c50f7a9
......@@ -83,6 +83,8 @@ namespace PdfReader
m_pInternal->m_pFontManager->SetOwnerCache(pMeasurerCache);
pMeasurerCache->SetCacheSize(1);
m_pInternal->m_pGlobalParams->SetFontManager(m_pInternal->m_pFontManager);
m_eError = errorNone;
}
CPdfReader::~CPdfReader()
{
......@@ -128,8 +130,14 @@ namespace PdfReader
if (!wsUserPassword.empty())
seUser = new StringExt(wsUserPassword.c_str());
m_eError = errorNone;
m_pInternal->m_pPDFDocument = new PDFDoc(m_pInternal->m_pGlobalParams, wsSrcPath.c_str(), seOwner, seUser);
if (m_pInternal->m_pPDFDocument)
m_eError = m_pInternal->m_pPDFDocument->GetErrorCode();
else
m_eError = errorMemory;
if (seUser)
delete seUser;
......@@ -144,7 +152,7 @@ namespace PdfReader
m_pInternal->m_pFontList->Clear();
return (errorNone == m_pInternal->m_pPDFDocument->GetErrorCode());
return (errorNone == m_eError);
}
void CPdfReader::Close()
{
......@@ -153,7 +161,7 @@ namespace PdfReader
EError CPdfReader::GetError()
{
if (!m_pInternal->m_pPDFDocument)
return errorOpenFile;
return m_eError;
return m_pInternal->m_pPDFDocument->GetErrorCode();
}
......
......@@ -77,6 +77,7 @@ namespace PdfReader
private:
CPdfReader_Private* m_pInternal;
EError m_eError;
};
}
......
......@@ -46,7 +46,8 @@ namespace PdfReader
errorPrinting = 7, // ошибка во время печати
errorPermission = 8, // Ошибка связанная с ограничениями наложенными на файл
errorBadPageNum = 9, // Неверное количество страниц
errorFileIO = 10 // Ошибка при чтении/записи
errorFileIO = 10, // Ошибка при чтении/записи
errorMemory = 11 // Memory exceed
} EError;
}
......
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