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