Commit b21d7628 authored by Oleg Korshul's avatar Oleg Korshul Committed by Alexander Trofimov

билдер по новой схеме

parent ff16fdcb
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
bool ExecuteCommand(const std::wstring& command, bool bIsSave = true) bool ExecuteCommand(const std::wstring& command, bool bIsSave = true)
{ {
std::string commandA = U_TO_UTF8(command); std::string commandA = U_TO_UTF8(command);
commandA = "_api." + commandA; //commandA = "_api." + commandA;
if (bIsSave) if (bIsSave)
commandA += "_api.asc_Save();"; commandA += "_api.asc_Save();";
...@@ -207,7 +207,7 @@ public: ...@@ -207,7 +207,7 @@ public:
if (pNative != NULL) if (pNative != NULL)
{ {
pNative->m_strFontsDirectory = NSFile::GetProcessDirectory() + L"/sdk/Common"; pNative->m_strFontsDirectory = NSFile::GetProcessDirectory() + L"/sdkjs/common";
pNative->m_strImagesDirectory = path + L"/media"; pNative->m_strImagesDirectory = path + L"/media";
pNative->CheckFonts(); pNative->CheckFonts();
...@@ -257,9 +257,9 @@ public: ...@@ -257,9 +257,9 @@ public:
} }
if (!bIsBreak) if (!bIsBreak)
bIsBreak = !this->ExecuteCommand(L"asc_nativeInitBuilder();", false); bIsBreak = !this->ExecuteCommand(L"_api.asc_nativeInitBuilder();", false);
if (!bIsBreak) if (!bIsBreak)
bIsBreak = !this->ExecuteCommand(L"asc_SetSilentMode(true);", false); bIsBreak = !this->ExecuteCommand(L"_api.asc_SetSilentMode(true);", false);
return !bIsBreak; return !bIsBreak;
} }
...@@ -300,7 +300,7 @@ namespace NSDoctRenderer ...@@ -300,7 +300,7 @@ namespace NSDoctRenderer
m_nFileType = -1; m_nFileType = -1;
#if 0 #if 1
m_sX2tPath += L"/converter"; m_sX2tPath += L"/converter";
#endif #endif
...@@ -321,10 +321,12 @@ namespace NSDoctRenderer ...@@ -321,10 +321,12 @@ namespace NSDoctRenderer
std::wstring strFilePath = _node.GetText(); std::wstring strFilePath = _node.GetText();
if (std::wstring::npos != strFilePath.find(L"AllFonts.js")) if (std::wstring::npos != strFilePath.find(L"AllFonts.js"))
{
m_strAllFonts = strFilePath; m_strAllFonts = strFilePath;
if (!NSFile::CFileBinary::Exists(m_strAllFonts) || NSFile::CFileBinary::Exists(sConfigDir + m_strAllFonts)) if (!NSFile::CFileBinary::Exists(m_strAllFonts) || NSFile::CFileBinary::Exists(sConfigDir + m_strAllFonts))
m_strAllFonts = sConfigDir + m_strAllFonts; m_strAllFonts = sConfigDir + m_strAllFonts;
}
if (NSFile::CFileBinary::Exists(strFilePath) && !NSFile::CFileBinary::Exists(sConfigDir + strFilePath)) if (NSFile::CFileBinary::Exists(strFilePath) && !NSFile::CFileBinary::Exists(sConfigDir + strFilePath))
m_arrFiles.Add(strFilePath); m_arrFiles.Add(strFilePath);
...@@ -414,7 +416,7 @@ namespace NSDoctRenderer ...@@ -414,7 +416,7 @@ namespace NSDoctRenderer
bool bIsEqual = NSFile::CFileBinary::Exists(strFontsSelectionBin); bool bIsEqual = NSFile::CFileBinary::Exists(strFontsSelectionBin);
if (bIsEqual && bIsCheckSystemFonts) if (!bIsEqual || bIsCheckSystemFonts)
{ {
CApplicationFonts oApplicationF; CApplicationFonts oApplicationF;
CArray<std::wstring> strFontsW_Cur = oApplicationF.GetSetupFontFiles(); CArray<std::wstring> strFontsW_Cur = oApplicationF.GetSetupFontFiles();
...@@ -550,9 +552,9 @@ namespace NSDoctRenderer ...@@ -550,9 +552,9 @@ namespace NSDoctRenderer
oBuilder.WriteEncodeXmlString(m_sFileDir); oBuilder.WriteEncodeXmlString(m_sFileDir);
oBuilder.WriteString(L"/Editor.bin</m_sFileTo><m_nFormatTo>8192</m_nFormatTo>"); oBuilder.WriteString(L"/Editor.bin</m_sFileTo><m_nFormatTo>8192</m_nFormatTo>");
oBuilder.WriteString(L"<m_sFontDir>"); oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetProcessDirectory() + L"/sdk/Common"); oBuilder.WriteEncodeXmlString(NSFile::GetProcessDirectory() + L"/sdkjs/common");
oBuilder.WriteString(L"</m_sFontDir>"); oBuilder.WriteString(L"</m_sFontDir>");
oBuilder.WriteString(L"<m_sThemeDir>./sdk/presentationeditor/themes</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional>"); oBuilder.WriteString(L"<m_sThemeDir>./sdkjs/slide/themes</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional>");
oBuilder.WriteString(params); oBuilder.WriteString(params);
oBuilder.WriteString(L"</TaskQueueDataConvert>"); oBuilder.WriteString(L"</TaskQueueDataConvert>");
...@@ -709,11 +711,11 @@ namespace NSDoctRenderer ...@@ -709,11 +711,11 @@ namespace NSDoctRenderer
oBuilder.WriteString(L"</m_sFileTo><m_nFormatTo>"); oBuilder.WriteString(L"</m_sFileTo><m_nFormatTo>");
oBuilder.WriteString(std::to_wstring(type)); oBuilder.WriteString(std::to_wstring(type));
oBuilder.WriteString(L"</m_nFormatTo><m_sThemeDir>"); oBuilder.WriteString(L"</m_nFormatTo><m_sThemeDir>");
oBuilder.WriteEncodeXmlString(L"./sdk/presentationeditor/themes"); oBuilder.WriteEncodeXmlString(L"./sdkjs/slide/themes");
oBuilder.WriteString(L"</m_sThemeDir><m_bFromChanges>true</m_bFromChanges><m_bDontSaveAdditional>true</m_bDontSaveAdditional>"); oBuilder.WriteString(L"</m_sThemeDir><m_bFromChanges>true</m_bFromChanges><m_bDontSaveAdditional>true</m_bDontSaveAdditional>");
oBuilder.WriteString(L"<m_nCsvTxtEncoding>46</m_nCsvTxtEncoding><m_nCsvDelimiter>4</m_nCsvDelimiter>"); oBuilder.WriteString(L"<m_nCsvTxtEncoding>46</m_nCsvTxtEncoding><m_nCsvDelimiter>4</m_nCsvDelimiter>");
oBuilder.WriteString(L"<m_sFontDir>"); oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetProcessDirectory() + L"/sdk/Common"); oBuilder.WriteEncodeXmlString(NSFile::GetProcessDirectory() + L"/sdkjs/common");
oBuilder.WriteString(L"</m_sFontDir>"); oBuilder.WriteString(L"</m_sFontDir>");
int nDoctRendererParam = 0; int nDoctRendererParam = 0;
...@@ -1063,6 +1065,7 @@ namespace NSDoctRenderer ...@@ -1063,6 +1065,7 @@ namespace NSDoctRenderer
break; break;
} }
std::string sJsCommands = "";
std::wstring _builder_params[4]; // с запасом std::wstring _builder_params[4]; // с запасом
for (std::list<std::string>::iterator i = _commands.begin(); i != _commands.end(); i++) for (std::list<std::string>::iterator i = _commands.begin(); i != _commands.end(); i++)
{ {
...@@ -1090,6 +1093,14 @@ namespace NSDoctRenderer ...@@ -1090,6 +1093,14 @@ namespace NSDoctRenderer
bool bIsNoError = true; bool bIsNoError = true;
if (bIsBuilder) if (bIsBuilder)
{ {
if (!sJsCommands.empty())
{
bIsNoError = this->m_pInternal->ExecuteCommand(NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sJsCommands.c_str(), (LONG)sJsCommands.length()));
sJsCommands = "";
if (!bIsNoError)
return false;
}
size_t _pos = 8; size_t _pos = 8;
while (_data[_pos] != '(') while (_data[_pos] != '(')
++_pos; ++_pos;
...@@ -1144,7 +1155,8 @@ namespace NSDoctRenderer ...@@ -1144,7 +1155,8 @@ namespace NSDoctRenderer
} }
else else
{ {
bIsNoError = this->m_pInternal->ExecuteCommand(NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)_data, (LONG)_len)); //bIsNoError = this->m_pInternal->ExecuteCommand(NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)_data, (LONG)_len));
sJsCommands += command;
} }
if (!bIsNoError) if (!bIsNoError)
......
...@@ -17,8 +17,8 @@ CONFIG -= debug_and_release debug_and_release_target ...@@ -17,8 +17,8 @@ CONFIG -= debug_and_release debug_and_release_target
CONFIG += c++11 CONFIG += c++11
############### destination path ############### ############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../../SDK/lib DESTINATION_SDK_PATH = $$PWD/../../../build/lib
DESTINATION_PATH = $$PWD/../../../SDK/bin/docbuilder DESTINATION_PATH = $$PWD/../../../build/bin/docbuilder
win32 { win32 {
DEFINES += WIN32 DEFINES += WIN32
...@@ -72,7 +72,7 @@ mac { ...@@ -72,7 +72,7 @@ mac {
TARGET_PLATFORM = _mac64 TARGET_PLATFORM = _mac64
} }
DESTDIR = $$DESTINATION_PATH #DESTDIR = $$DESTINATION_PATH
TARGET = docbuilder$$TARGET_PLATFORM TARGET = docbuilder$$TARGET_PLATFORM
################################################ ################################################
......
...@@ -53,11 +53,11 @@ int main(int argc, char *argv[]) ...@@ -53,11 +53,11 @@ int main(int argc, char *argv[])
NSDoctRenderer::CDocBuilder::Initialize(); NSDoctRenderer::CDocBuilder::Initialize();
NSDoctRenderer::CDocBuilder oBuilder(false); if (true)
oBuilder.Run(sBuildFile.c_str()); {
NSDoctRenderer::CDocBuilder oBuilder(true);
NSDoctRenderer::CDocBuilder oBuilder2(false); oBuilder.Run(sBuildFile.c_str());
oBuilder2.Run(sBuildFile.c_str()); }
NSDoctRenderer::CDocBuilder::Dispose(); NSDoctRenderer::CDocBuilder::Dispose();
......
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