Commit a9076beb authored by konovalovsergey's avatar konovalovsergey

CONVERT_CORRUPTED

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