Commit ed373b7e authored by Oleg Korshul's avatar Oleg Korshul

pivot table build on server

parent a67eb564
......@@ -387,11 +387,22 @@ public:
CChangesWorker oWorkerLoader;
int nVersion = oWorkerLoader.OpenNative(pNative->GetFilePath());
v8::Handle<v8::Value> args_open[2];
v8::Handle<v8::Value> args_open[3];
args_open[0] = oWorkerLoader.GetDataFull();
args_open[1] = v8::Integer::New(m_isolate, nVersion);
func_open->Call(global_js, 2, args_open);
std::wstring sXlsx = NSCommon::GetDirectoryName(pNative->GetFilePath()) + L"/Editor.xlsx";
if (NSFile::CFileBinary::Exists(sXlsx))
{
std::string sXlsxA = U_TO_UTF8(sXlsx);
args_open[2] = v8::String::NewFromUtf8(m_isolate, (char*)(sXlsxA.c_str()));
}
else
{
args_open[2] = v8::Undefined(m_isolate);
}
func_open->Call(global_js, 3, args_open);
if (try_catch.HasCaught())
{
......
......@@ -364,18 +364,18 @@ namespace NSDoctRenderer
static void _LOGGING_ERROR_(const std::wstring& strType, const std::wstring& strError)
{
#if 0
if (m_sErrorsLogFile.empty())
return;
#if 0
if (m_sErrorsLogFile.empty())
return;
FILE* f = NSFile::CFileBinary::OpenFileNative(m_sErrorsLogFile, L"a+");
FILE* f = NSFile::CFileBinary::OpenFileNative(m_sErrorsLogFile, L"a+");
std::string sT = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strType);
std::string sE = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strError);
std::string sT = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strType);
std::string sE = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strError);
fprintf(f, sT.c_str());
fprintf(f, sT.c_str());
fprintf(f, ": ");
fprintf(f, sE.c_str());
fprintf(f, sE.c_str());
fprintf(f, "\n");
fclose(f);
#endif
......@@ -730,11 +730,22 @@ namespace NSDoctRenderer
CChangesWorker oWorkerLoader;
int nVersion = oWorkerLoader.OpenNative(pNative->GetFilePath());
v8::Handle<v8::Value> args_open[2];
v8::Handle<v8::Value> args_open[3];
args_open[0] = oWorkerLoader.GetDataFull();
args_open[1] = v8::Integer::New(isolate, nVersion);
func_open->Call(global_js, 2, args_open);
std::wstring sXlsx = NSCommon::GetDirectoryName(pNative->GetFilePath()) + L"/Editor.xlsx";
if (NSFile::CFileBinary::Exists(sXlsx))
{
std::string sXlsxA = U_TO_UTF8(sXlsx);
args_open[2] = v8::String::NewFromUtf8(isolate, (char*)(sXlsxA.c_str()));
}
else
{
args_open[2] = v8::Undefined(isolate);
}
func_open->Call(global_js, 3, args_open);
if (try_catch.HasCaught())
{
......
......@@ -461,6 +461,12 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
result->Set(v8::String::NewFromUtf8(current, "ConsoleLog"), v8::FunctionTemplate::New(current, _ConsoleLog));
result->Set(v8::String::NewFromUtf8(current, "ZipOpen"), v8::FunctionTemplate::New(current, _zipOpenFile));
result->Set(v8::String::NewFromUtf8(current, "ZipOpenBase64"), v8::FunctionTemplate::New(current, _zipOpenFileBase64));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsString"), v8::FunctionTemplate::New(current, _zipGetFileAsString));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsBinary"), v8::FunctionTemplate::New(current, _zipGetFileAsBinary));
result->Set(v8::String::NewFromUtf8(current, "ZipClose"), v8::FunctionTemplate::New(current, _zipCloseFile));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope
......
......@@ -76,6 +76,7 @@ public:
{
m_sTmpFolder = m_sWorkerFolder + L"/nativeZip";
COfficeUtils oUtils;
NSDirectory::CreateDirectory(m_sTmpFolder);
if (S_OK != oUtils.ExtractToDirectory(sFile, m_sTmpFolder, NULL, 0))
return false;
......@@ -102,6 +103,7 @@ public:
m_sTmpFolder = m_sWorkerFolder + L"/nativeZip";
COfficeUtils oUtils;
NSDirectory::CreateDirectory(m_sTmpFolder);
if (S_OK != oUtils.ExtractToDirectory(sTmpFile, m_sTmpFolder, NULL, 0))
{
NSFile::CFileBinary::Remove(sTmpFile);
......
......@@ -42,15 +42,15 @@ int main(int argc, char *argv[])
#if 1
std::wstring strXml = L"<Settings>\
<SrcFileType>0</SrcFileType>\
<DstFileType>3</DstFileType>\
<SrcFilePath>D:\\DE_CAD4</SrcFilePath>\
<DstFilePath>D:\\DE_CAD4\\EditorWithChanges.bin</DstFilePath>\
<SrcFileType>1</SrcFileType>\
<DstFileType>1</DstFileType>\
<SrcFilePath>D:\\source</SrcFilePath>\
<DstFilePath>D:\\source\\EditorWithChanges.bin</DstFilePath>\
<FontsDirectory>D:\\activex\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\ChromiumBasedEditors2\\app\\test\\src\\build\\win64\\Debug\\Local\\converter\\fonts\\</FontsDirectory>\
<ImagesDirectory>D:\\DE_CAD4\\media</ImagesDirectory>\
<ImagesDirectory>D:\\source\\media</ImagesDirectory>\
<ThemesDirectory>D:\\activex\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\Test\\Applications\\TestAVSOfficeDocxFile2\\TestAVSOfficeDocxFile2\\bin\\x86\\presentationthemes</ThemesDirectory>\
<Changes TopItem=\"-1\">\
<Change>D:\\DE_CAD4\\changes\\changes0.json</Change>\
<Change>D:\\source\\changes\\changes0.json</Change>\
</Changes>\
</Settings>";
......
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