mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
.
This commit is contained in:
@ -33,6 +33,7 @@ HEADERS += \
|
||||
./../DesktopEditor/graphics/TemporaryCS.h
|
||||
|
||||
SOURCES += \
|
||||
../OdfFile/Common/logging.cpp \
|
||||
./../DesktopEditor/graphics/TemporaryCS.cpp
|
||||
|
||||
# THREAD
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
#include "ZipUtilsCP.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../../OdfFile/Common/logging.h"
|
||||
#include <sstream>
|
||||
|
||||
COfficeUtils::COfficeUtils(OnProgressCallback* fCallback)
|
||||
{
|
||||
@ -48,9 +50,11 @@ HRESULT COfficeUtils::ExtractToDirectory(const std::wstring& _zipFile, const std
|
||||
std::wstring zipFile = _zipFile;
|
||||
std::wstring unzipDir = _unzipDir;
|
||||
#endif
|
||||
_CP_LOG << L"start unzip" << std::endl;
|
||||
|
||||
if( ZLibZipUtils::UnzipToDir( zipFile.c_str(), unzipDir.c_str(), m_fCallback, password, ( extract_without_path > 0 ) ? (true) : (false) ) == 0 )
|
||||
{
|
||||
_CP_LOG << L"end unzip" << std::endl;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
@ -66,9 +70,11 @@ HRESULT COfficeUtils::ExtractToDirectory(BYTE* data, size_t len, const std::wstr
|
||||
#else
|
||||
std::wstring unzipDir = _unzipDir;
|
||||
#endif
|
||||
_CP_LOG << L"start unzip" << std::endl;
|
||||
|
||||
if( ZLibZipUtils::UnzipToDir( data, len, unzipDir.c_str(), m_fCallback, password, ( extract_without_path > 0 ) ? (true) : (false) ) == 0 )
|
||||
{
|
||||
_CP_LOG << L"end unzip" << std::endl;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
@ -87,12 +93,14 @@ HRESULT COfficeUtils::CompressFileOrDirectory(const std::wstring& _name, const s
|
||||
std::wstring name = _name;
|
||||
std::wstring outputFile = _outputFile;
|
||||
#endif
|
||||
_CP_LOG << L"start zip" << std::endl;
|
||||
|
||||
HRESULT result = S_FALSE;
|
||||
if(NSDirectory::Exists(name))
|
||||
{
|
||||
if ( ZLibZipUtils::ZipDir( name.c_str(), outputFile.c_str(), m_fCallback, bSorted, method, level, bDateTime ) == 0 )
|
||||
{
|
||||
_CP_LOG << L"end zip" << std::endl;
|
||||
result = S_OK;
|
||||
}
|
||||
else
|
||||
@ -104,6 +112,7 @@ HRESULT COfficeUtils::CompressFileOrDirectory(const std::wstring& _name, const s
|
||||
{
|
||||
if ( ZLibZipUtils::ZipFile( name.c_str(), outputFile.c_str(), method, level, bDateTime ) == 0 )
|
||||
{
|
||||
_CP_LOG << L"end zip" << std::endl;
|
||||
result = S_OK;
|
||||
}
|
||||
else
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
|
||||
#include "../../DesktopEditor/doctrenderer/docbuilder.h"
|
||||
#include "../../MsBinaryFile/Common/Vba/VbaReader.h"
|
||||
#include "../../OdfFile/Common/logging.h"
|
||||
|
||||
namespace NExtractTools
|
||||
{
|
||||
@ -1577,6 +1578,7 @@ namespace NExtractTools
|
||||
|
||||
_UINT32 fromInputParams(InputParams& oInputParams)
|
||||
{
|
||||
_CP_LOG << L"start/detect conversion" << std::endl;
|
||||
TConversionDirection conversion = oInputParams.getConversionDirection();
|
||||
|
||||
std::wstring sFileFrom = oInputParams.m_sFileFrom ? *oInputParams.m_sFileFrom : L"";
|
||||
@ -1647,11 +1649,13 @@ namespace NExtractTools
|
||||
NSFile::CFileBinary::SetTempPath(sGlobalTempDir);
|
||||
return AVS_FILEUTILS_ERROR_CONVERT_LIMITS;
|
||||
}
|
||||
_CP_LOG << L"doct initialize" << std::endl;
|
||||
|
||||
#ifndef BUILD_X2T_AS_LIBRARY_DYLIB
|
||||
NSDoctRenderer::CDocBuilder::Initialize();
|
||||
#endif
|
||||
|
||||
_CP_LOG << L"start conversion" << std::endl;
|
||||
_UINT32 result = 0;
|
||||
switch (conversion)
|
||||
{
|
||||
@ -2310,10 +2314,13 @@ namespace NExtractTools
|
||||
if (!sGlobalTempDir.empty())
|
||||
NSFile::CFileBinary::SetTempPath(sGlobalTempDir);
|
||||
|
||||
_CP_LOG << L"end conversion and start dispose doctrenderer" << std::endl;
|
||||
// clean up v8
|
||||
#ifndef BUILD_X2T_AS_LIBRARY_DYLIB
|
||||
NSDoctRenderer::CDocBuilder::Dispose();
|
||||
#endif
|
||||
_CP_LOG << L"finish" << std::endl;
|
||||
|
||||
if (SUCCEEDED_X2T(result) && oInputParams.m_bOutputConvertCorrupted)
|
||||
{
|
||||
return AVS_FILEUTILS_ERROR_CONVERT_CORRUPTED;
|
||||
|
||||
Reference in New Issue
Block a user