mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
x2t/x2ttester/standardarttester update
This commit is contained in:
@ -338,12 +338,10 @@ public:
|
||||
NSStringUtils::CStringBuilder oBuilder;
|
||||
oBuilder.WriteString(L"<?xml version=\"1.0\" encoding=\"utf-8\"?><TaskQueueDataConvert><m_sFileFrom>");
|
||||
|
||||
std::wstring sFileDst = sDirectoryDst + L"/page.zip";
|
||||
|
||||
oBuilder.WriteEncodeXmlString(m_file);
|
||||
oBuilder.WriteString(L"</m_sFileFrom><m_sFileTo>");
|
||||
|
||||
oBuilder.WriteEncodeXmlString(sFileDst);
|
||||
oBuilder.WriteEncodeXmlString(sDirectoryDst);
|
||||
oBuilder.WriteString(L"</m_sFileTo><m_nFormatTo>");
|
||||
oBuilder.WriteString(std::to_wstring(AVS_OFFICESTUDIO_FILE_IMAGE));
|
||||
oBuilder.WriteString(L"</m_nFormatTo><m_sThemeDir>./</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional><m_sAllFontsPath>");
|
||||
|
||||
@ -659,10 +659,6 @@ DWORD CConverter::ThreadProc()
|
||||
|
||||
builder.WriteString(L"<m_sFileTo>");
|
||||
builder.WriteEncodeXmlString(output_file);
|
||||
|
||||
if (output_format & AVS_OFFICESTUDIO_FILE_IMAGE)
|
||||
builder.WriteEncodeXmlString(L".zip");
|
||||
|
||||
builder.WriteString(L"</m_sFileTo>");
|
||||
|
||||
builder.WriteString(L"<m_nFormatTo>");
|
||||
@ -714,15 +710,28 @@ DWORD CConverter::ThreadProc()
|
||||
input_size = b_file.GetFileSize();
|
||||
b_file.CloseFile();
|
||||
|
||||
|
||||
// get sizes
|
||||
if (!exit_code)
|
||||
{
|
||||
if(output_format & AVS_OFFICESTUDIO_FILE_IMAGE)
|
||||
b_file.OpenFile(output_file + L".zip");
|
||||
{
|
||||
int total_size = 0;
|
||||
std::vector<std::wstring> pages = NSDirectory::GetFiles(output_file);
|
||||
for(int j = 0; j < pages.size(); j++)
|
||||
{
|
||||
b_file.OpenFile(pages[j]);
|
||||
total_size += b_file.GetFileSize();
|
||||
b_file.CloseFile();
|
||||
}
|
||||
output_size = total_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
b_file.OpenFile(output_file);
|
||||
|
||||
output_size = b_file.GetFileSize();
|
||||
b_file.CloseFile();
|
||||
output_size = b_file.GetFileSize();
|
||||
b_file.CloseFile();
|
||||
}
|
||||
}
|
||||
|
||||
// save param xml of error conversion
|
||||
@ -760,12 +769,12 @@ DWORD CConverter::ThreadProc()
|
||||
|
||||
if(!exit_code)
|
||||
{
|
||||
std::cout << "OK ";
|
||||
std::cout << "OK";
|
||||
}
|
||||
else
|
||||
{
|
||||
is_all_ok = false;
|
||||
std::cout << "BAD ";
|
||||
std::cout << "BAD " << exit_code;
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
@ -1686,11 +1686,15 @@ namespace NExtractTools
|
||||
imageWriter.SetFileName(sThumbnailDir + FILE_SEPARATOR_STR + L"image" + getExtentionByRasterFormat(imageWriter.GetRasterFormat()));
|
||||
}
|
||||
nRes = imageWriter.ConvertBuffer(pBuffer, lBufferLen) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
if(!imageWriter.GetIsOnlyFirst() && *params.m_oThumbnail->zip)
|
||||
if(!imageWriter.GetIsOnlyFirst() && (NULL == params.m_oThumbnail->zip || *(params.m_oThumbnail->zip)))
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
else if(!imageWriter.GetIsOnlyFirst() && NULL != params.m_oThumbnail->zip && !(*(params.m_oThumbnail->zip)))
|
||||
{
|
||||
nRes = S_OK == NSDirectory::CopyDirectory(sThumbnailDir, sTo);
|
||||
}
|
||||
RELEASEOBJECT(pApplicationFonts);
|
||||
return nRes;
|
||||
}
|
||||
@ -3891,12 +3895,17 @@ namespace NExtractTools
|
||||
}
|
||||
pReader->ConvertToRaster(i, sFileTo, nRasterFormat, nRasterWCur, nRasterHCur);
|
||||
}
|
||||
//zip
|
||||
if(!bIsOnlyFirst && bIsZip)
|
||||
// zip
|
||||
if(!bIsZip)
|
||||
{
|
||||
nRes = S_OK == NSDirectory::CopyDirectory(sThumbnailDir, sTo);
|
||||
}
|
||||
else if(!bIsOnlyFirst)
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user