Commit a197743a authored by konovalovsergey's avatar konovalovsergey Committed by Alexander Trofimov

add param:password; error: drm, password

parent 39a3fd1b
......@@ -206,3 +206,5 @@
#define AVS_FILEUTILS_ERROR_CONVERT_LIBREOFFICE (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x0057)
#define AVS_FILEUTILS_ERROR_CONVERT_PARAMS (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x0058)
#define AVS_FILEUTILS_ERROR_CONVERT_NEED_PARAMS (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x0059)
#define AVS_FILEUTILS_ERROR_CONVERT_DRM (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x005a)
#define AVS_FILEUTILS_ERROR_CONVERT_PASSWORD (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x005b)
This diff is collapsed.
......@@ -63,8 +63,8 @@ namespace NExtractTools
int doc2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, const std::wstring &sFontPath);
int docx_dir2doc (const std::wstring &sDocxDir, const std::wstring &sTo, const std::wstring &sTemp, const std::wstring &sFontPath);
int xls2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sPassword, const std::wstring &sTemp, const std::wstring &sFontPath);
int xls2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sPassword, const std::wstring &sTemp, const std::wstring &sFontPath);
int xls2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, const std::wstring &sFontPath, const InputParams& params);
int xls2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, const std::wstring &sFontPath, const InputParams& params);
int xls2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sPassword, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions);
int xls2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sPassword, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions);
......@@ -95,7 +95,7 @@ namespace NExtractTools
int fromXlsxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
int fromXlstBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
int fromSpreadsheet (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sPassword, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
int fromSpreadsheet (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
int fromPptxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
int fromPpttBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sFontPath, const std::wstring &sXmlOptions, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, const InputParams& params);
......
......@@ -123,7 +123,13 @@ namespace NExtractTools
TCSVD_COMMA = 4,
TCSVD_SPACE = 5
} TCsvDelimiter;
static bool copyOrigin(const std::wstring& sFileFrom, const std::wstring& sFileTo)
{
size_t nIndex = sFileFrom.rfind('.');
return NSFile::CFileBinary::Copy(sFileFrom, NSSystemPath::GetDirectoryName(sFileTo) + FILE_SEPARATOR_STR + _T("origin") + sFileFrom.substr(nIndex));
}
class InputParamsMailMerge
{
public:
......@@ -235,6 +241,7 @@ namespace NExtractTools
InputParamsMailMerge* m_oMailMergeSend;
int* m_nDoctParams;
std::wstring* m_sHtmlFileInternalPath;
std::wstring* m_sPassword;
public:
InputParams()
{
......@@ -254,6 +261,7 @@ namespace NExtractTools
m_oMailMergeSend = NULL;
m_nDoctParams = NULL;
m_sHtmlFileInternalPath = NULL;
m_sPassword = NULL;
}
~InputParams()
{
......@@ -273,6 +281,7 @@ namespace NExtractTools
RELEASEOBJECT(m_oMailMergeSend);
RELEASEOBJECT(m_nDoctParams);
RELEASEOBJECT(m_sHtmlFileInternalPath);
RELEASEOBJECT(m_sPassword);
}
bool FromXmlFile(std::wstring sFilename)
......@@ -329,6 +338,8 @@ namespace NExtractTools
m_nDoctParams = new int(XmlUtils::GetInteger(sValue));
else if(_T("m_sHtmlFileInternalPath") == sName)
m_sHtmlFileInternalPath = new std::wstring(sValue);
else if(_T("m_sPassword") == sName)
m_sPassword = new std::wstring(sValue);
}
}
}
......@@ -337,9 +348,9 @@ namespace NExtractTools
}
return true;
}
std::wstring getPassword()
std::wstring getPassword() const
{
return L"";
return (NULL != m_sPassword) ? (*m_sPassword) : L"";
}
std::wstring getXmlOptions()
......@@ -445,8 +456,7 @@ namespace NExtractTools
{
if(!getDontSaveAdditional())
{
size_t nIndex = m_sFileFrom->rfind('.');
NSFile::CFileBinary::Copy(*m_sFileFrom, NSSystemPath::GetDirectoryName(*m_sFileTo) + FILE_SEPARATOR_STR + _T("origin") + m_sFileFrom->substr(nIndex));
copyOrigin(*m_sFileFrom, *m_sFileTo);
}
eRes = TCD_ERROR;
}
......@@ -467,8 +477,7 @@ namespace NExtractTools
oBuilder.WriteString(_T("}"));
std::wstring sFilePath = NSSystemPath::GetDirectoryName(*m_sFileTo) + FILE_SEPARATOR_STR + _T("settings.json");
NSFile::CFileBinary::SaveToFile(sFilePath, oBuilder.GetData());
size_t nIndex = m_sFileFrom->rfind('.');
NSFile::CFileBinary::Copy(*m_sFileFrom, NSSystemPath::GetDirectoryName(*m_sFileTo) + FILE_SEPARATOR_STR + _T("origin") + m_sFileFrom->substr(nIndex));
copyOrigin(*m_sFileFrom, *m_sFileTo);
}
eRes = TCD_ERROR;
}
......
......@@ -341,7 +341,7 @@ int main(int argc, char *argv[])
}
else if (TCD_XLS2XLSX == conversion)
{
result = xls2xlsx (sFileFrom, sFileTo, sPassword, sTempDir, sFontPath);
result = xls2xlsx (sFileFrom, sFileTo, sTempDir, sFontPath, oInputParams);
}
else if (TCD_XLS2XLST == conversion)
{
......@@ -381,7 +381,7 @@ int main(int argc, char *argv[])
}
else if (TCD_SPREADSHEET2 == conversion)
{
result = fromSpreadsheet(sFileFrom, nFormatFrom, sFileTo, nFormatTo, sPassword, sTempDir, sFontPath, sXmlOptions, sThemeDir, bFromChanges, bPaid, oInputParams);
result = fromSpreadsheet(sFileFrom, nFormatFrom, sFileTo, nFormatTo, sTempDir, sFontPath, sXmlOptions, sThemeDir, bFromChanges, bPaid, oInputParams);
}
else if (TCD_PRESENTATION2 == conversion)
{
......
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