Commit a9076beb authored by konovalovsergey's avatar konovalovsergey

CONVERT_CORRUPTED

parent 5157908b
......@@ -2738,7 +2738,14 @@ namespace NExtractTools
//clean up v8
NSDoctRenderer::CDocBuilder::Dispose();
return result;
if (SUCCEEDED_X2T(result) && oInputParams.m_bOutputConvertCorrupted)
{
return AVS_FILEUTILS_ERROR_CONVERT_CORRUPTED;
}
else
{
return result;
}
}
int FromFile(const std::wstring& file)
......
......@@ -298,7 +298,6 @@ namespace NExtractTools
}
int apply_changes(const std::wstring &sBinFrom, const std::wstring &sToResult, NSDoctRenderer::DoctRendererFormat::FormatFile eType, const std::wstring &sThemeDir, std::wstring &sBinTo, const InputParams& params)
{
int nRes = 0;
std::wstring sBinDir = FileSystem::Directory::GetFolderPath(sBinFrom);
std::wstring sChangesDir = sBinDir + FILE_SEPARATOR_STR + _T("changes");
if (NSDirectory::Exists(sChangesDir))
......@@ -317,7 +316,7 @@ namespace NExtractTools
if (!sResult.empty() && -1 != sResult.find(_T("error")))
{
std::wcerr << _T("DoctRenderer:") << sResult << std::endl;
nRes = AVS_FILEUTILS_ERROR_CONVERT_CORRUPTED;
params.m_bOutputConvertCorrupted = true;
int nErrorIndex = -1;
int nErrorIndexStart = sResult.find(_T("index"));
if (-1 != nErrorIndexStart)
......@@ -364,6 +363,6 @@ namespace NExtractTools
}
else
sBinTo = sBinFrom;
return nRes;
return 0;
}
}
......@@ -45,7 +45,7 @@
#include <iostream>
#include <fstream>
#define SUCCEEDED_X2T(nRes) (0 == (nRes) || AVS_FILEUTILS_ERROR_CONVERT_CORRUPTED == (nRes))
#define SUCCEEDED_X2T(nRes) (0 == (nRes))
namespace NExtractTools
{
......@@ -337,6 +337,8 @@ namespace NExtractTools
int* m_nDoctParams;
std::wstring* m_sHtmlFileInternalPath;
std::wstring* m_sPassword;
//output params
mutable bool m_bOutputConvertCorrupted;
public:
InputParams()
{
......@@ -358,6 +360,8 @@ namespace NExtractTools
m_nDoctParams = NULL;
m_sHtmlFileInternalPath = NULL;
m_sPassword = NULL;
m_bOutputConvertCorrupted = false;
}
~InputParams()
{
......
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