Commit 875717ac authored by Sergey Konovalov's avatar Sergey Konovalov

Add m_sSavePassword (m_sPassword - only for open)

parent d1227f77
......@@ -2553,7 +2553,7 @@ namespace NExtractTools
}
int oox2mscrypt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params)
{
std::wstring password = params.getPassword();
std::wstring password = params.getSavePassword();
ECMACryptFile cryptReader;
......@@ -2987,7 +2987,7 @@ namespace NExtractTools
{
if(AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX == nFormatTo)
{
if(params.hasPassword())
if(params.hasSavePassword())
{
std::wstring sToMscrypt = sTemp + FILE_SEPARATOR_STR + _T("tomscrypt.docx");
nRes = dir2zip(sFrom, sToMscrypt);
......@@ -3199,7 +3199,7 @@ namespace NExtractTools
{
if(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatTo)
{
if(params.hasPassword())
if(params.hasSavePassword())
{
std::wstring sToMscrypt = sTemp + FILE_SEPARATOR_STR + _T("tomscrypt.xlsx");
nRes = dir2zip(sFrom, sToMscrypt);
......@@ -3386,7 +3386,7 @@ namespace NExtractTools
{
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
{
if(params.hasPassword())
if(params.hasSavePassword())
{
std::wstring sToMscrypt = sTemp + FILE_SEPARATOR_STR + _T("tomscrypt.pptx");
nRes = dir2zip(sFrom, sToMscrypt);
......
......@@ -382,6 +382,7 @@ namespace NExtractTools
int* m_nDoctParams;
std::wstring* m_sHtmlFileInternalPath;
std::wstring* m_sPassword;
std::wstring* m_sSavePassword;
std::wstring* m_sTempDir;
bool* m_bIsNoBase64;
//output params
......@@ -408,6 +409,7 @@ namespace NExtractTools
m_nDoctParams = NULL;
m_sHtmlFileInternalPath = NULL;
m_sPassword = NULL;
m_sSavePassword = NULL;
m_sTempDir = NULL;
m_bIsNoBase64 = NULL;
......@@ -434,6 +436,7 @@ namespace NExtractTools
RELEASEOBJECT(m_nDoctParams);
RELEASEOBJECT(m_sHtmlFileInternalPath);
RELEASEOBJECT(m_sPassword);
RELEASEOBJECT(m_sSavePassword);
RELEASEOBJECT(m_sTempDir);
RELEASEOBJECT(m_bIsNoBase64);
}
......@@ -522,6 +525,8 @@ namespace NExtractTools
m_sHtmlFileInternalPath = new std::wstring(sValue);
else if(_T("m_sPassword") == sName)
m_sPassword = new std::wstring(sValue);
else if(_T("m_sSavePassword") == sName)
m_sSavePassword = new std::wstring(sValue);
else if(_T("m_sTempDir") == sName)
m_sTempDir = new std::wstring(sValue);
else if(_T("m_bIsNoBase64") == sName)
......@@ -549,6 +554,14 @@ namespace NExtractTools
{
return (NULL != m_sPassword) ? (*m_sPassword) : L"";
}
bool hasSavePassword() const
{
return NULL != m_sSavePassword;
}
std::wstring getSavePassword() const
{
return (NULL != m_sSavePassword) ? (*m_sSavePassword) : L"";
}
std::wstring getFontPath() const
{
return (NULL != m_sFontDir) ? (*m_sFontDir) : L"";
......
......@@ -146,6 +146,7 @@ static std::wstring utf8_to_unicode(const char *src)
if (argc > 4)
{
oInputParams.m_sPassword = new std::wstring(sArg4);
oInputParams.m_sSavePassword = new std::wstring(sArg4);
}
result = NExtractTools::fromInputParams(oInputParams);
}
......
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