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