mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-15 20:53:29 +08:00
doctrenderer work under windows
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@60556 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
b81457576d
commit
ca3ac2df80
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1400,6 +1400,7 @@ DesktopEditor/cximage/png/pngnow.png svn_mime_002dtype=application%2Foctet-strea
|
||||
DesktopEditor/cximage/png/pngtest.png svn_mime_002dtype=application%2Foctet-stream
|
||||
DesktopEditor/cximage/zlib/zlib.3.pdf svn_mime_002dtype=application%2Foctet-stream
|
||||
DesktopEditor/doctrenderer svnc_tsvn_003alogminsize=5
|
||||
DesktopEditor/doctrenderer/test svnc_tsvn_003alogminsize=5
|
||||
DesktopEditor/editor/GLplatform svnc_tsvn_003alogminsize=5
|
||||
DesktopEditor/editor/build/windows/Test/break_one.bmp svn_mime_002dtype=application%2Foctet-stream
|
||||
DesktopEditor/editor/build/windows/Test/break_two.bmp svn_mime_002dtype=application%2Foctet-stream
|
||||
|
||||
@ -136,8 +136,8 @@ namespace NSDoctRenderer
|
||||
{
|
||||
m_bIsInitTypedArrays = false;
|
||||
|
||||
m_strConfigPath = NSFile::GetProcessDirectory();
|
||||
m_strConfigDir = m_strConfigDir + L"DoctRenderer.config";
|
||||
m_strConfigDir = NSFile::GetProcessDirectory() + L"/";
|
||||
m_strConfigPath = m_strConfigDir + L"DoctRenderer.config";
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (oNode.FromXmlFile(m_strConfigPath))
|
||||
@ -280,13 +280,25 @@ namespace NSDoctRenderer
|
||||
std::wstring strFileName = m_oParams.m_strSrcFilePath;
|
||||
strFileName += L"/Editor.bin";
|
||||
|
||||
string_replaceAll(strFileName, L"\\\\", L"\\");
|
||||
string_replaceAll(strFileName, L"//", L"/");
|
||||
string_replaceAll(strFileName, L"\\", L"/");
|
||||
strFileName = string_replaceAll(strFileName, L"\\\\", L"\\");
|
||||
strFileName = string_replaceAll(strFileName, L"//", L"/");
|
||||
strFileName = string_replaceAll(strFileName, L"\\", L"/");
|
||||
|
||||
m_strFilePath = strFileName;
|
||||
|
||||
std::string strScript = this->ReadScriptFile(sResourceFile);
|
||||
std::string strScript = "";
|
||||
for (size_t i = 0; i < m_arrFiles.GetCount(); ++i)
|
||||
{
|
||||
#if 0
|
||||
if (m_arrFiles[i].find(L"AllFonts.js") != std::wstring::npos)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
strScript += this->ReadScriptFile(m_arrFiles[i]);
|
||||
strScript += "\n\n";
|
||||
}
|
||||
|
||||
strScript += this->ReadScriptFile(sResourceFile);
|
||||
if (m_strEditorType == L"spreadsheet")
|
||||
strScript += "\n$.ready();";
|
||||
|
||||
|
||||
141
DesktopEditor/doctrenderer/test/doctrenderer_test.pro
Normal file
141
DesktopEditor/doctrenderer/test/doctrenderer_test.pro
Normal file
@ -0,0 +1,141 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2015-01-19T14:14:33
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core
|
||||
|
||||
QT -= gui
|
||||
|
||||
TARGET = doctrenderer_test
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
DEFINES += _UNICODE
|
||||
DEFINES += _USE_LIBXML2_READER_
|
||||
DEFINES += LIBXML_READER_ENABLED
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -L../../Debug/debug -ldoctrenderer
|
||||
message(debug)
|
||||
} else {
|
||||
LIBS += -L../../Release/release -ldoctrenderer
|
||||
message(release)
|
||||
}
|
||||
|
||||
linux-g++ | linux-g++-64 | linux-g++-32 {
|
||||
DEFINES += \
|
||||
LINUX \
|
||||
_LINUX \
|
||||
_LINUX_QT
|
||||
}
|
||||
|
||||
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_base.x64
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_snapshot
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_nosnapshot.x64
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licui18n
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licuuc
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licudata
|
||||
|
||||
message(linux64)
|
||||
}
|
||||
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_base.ia32
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_snapshot
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_nosnapshot.ia32
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licui18n
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licuuc
|
||||
#LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licudata
|
||||
|
||||
message(linux32)
|
||||
}
|
||||
|
||||
mac {
|
||||
DEFINES += \
|
||||
LINUX \
|
||||
_LINUX \
|
||||
_LINUX_QT \
|
||||
_MAC \
|
||||
QT_MAC
|
||||
|
||||
LIBS += -L../../../../../../../../../v8/out/native -lv8_base.x64
|
||||
LIBS += -L../../../../../../../../../v8/out/native -lv8_snapshot
|
||||
LIBS += -L../../../../../../../../../v8/out/native -lv8_nosnapshot.x64
|
||||
LIBS += -L../../../../../../../../../v8/out/native -licui18n
|
||||
LIBS += -L../../../../../../../../../v8/out/native -licuuc
|
||||
LIBS += -L../../../../../../../../../v8/out/native -licudata
|
||||
|
||||
message(mac)
|
||||
}
|
||||
|
||||
win32 {
|
||||
DEFINES += \
|
||||
WIN32
|
||||
|
||||
DEFINES -= UNICODE
|
||||
|
||||
LIBS += -lwinmm
|
||||
LIBS += -ladvapi32
|
||||
}
|
||||
|
||||
win32:contains(QMAKE_TARGET.arch, x86_64):{
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lgraphics
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -llibxml2
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lv8_libbase
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lv8_base
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lv8_nosnapshot
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lv8_snapshot
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -lv8_libplatform
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -licui18n
|
||||
LIBS += -L../../../../SDK/lib/win_64/DEBUG -licuuc
|
||||
} else {
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lgraphics
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_64 -llibxml2
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lv8_libbase
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lv8_base
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lv8_nosnapshot
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lv8_snapshot
|
||||
LIBS += -L../../../../SDK/lib/win_64 -lv8_libplatform
|
||||
LIBS += -L../../../../SDK/lib/win_64 -licui18n
|
||||
LIBS += -L../../../../SDK/lib/win_64 -licuuc
|
||||
}
|
||||
|
||||
message(windows64)
|
||||
}
|
||||
win32:!contains(QMAKE_TARGET.arch, x86_64):{
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lgraphics
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_32 -llibxml2
|
||||
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lv8_libbase
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lv8_base
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lv8_nosnapshot
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lv8_snapshot
|
||||
LIBS += -L../../../../SDK/lib/win_32 -lv8_libplatform
|
||||
LIBS += -L../../../../SDK/lib/win_32 -licui18n
|
||||
LIBS += -L../../../../SDK/lib/win_32 -licuuc
|
||||
|
||||
message(windows32)
|
||||
}
|
||||
|
||||
INCLUDEPATH += \
|
||||
../../../agg-2.4/include \
|
||||
../../../freetype-2.5.2/include \
|
||||
../../../../../../../v8_trunk \
|
||||
../../../../../../../v8_trunk/include \
|
||||
../../../Common/DocxFormat/Source/XML/libxml2/XML/include \
|
||||
|
||||
|
||||
SOURCES += main.cpp \
|
||||
../../../Common/DocxFormat/Source/XML/libxml2/libxml2.cpp \
|
||||
../../../Common/DocxFormat/Source/XML/stringcommon.cpp
|
||||
28
DesktopEditor/doctrenderer/test/main.cpp
Normal file
28
DesktopEditor/doctrenderer/test/main.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "../doctrenderer.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
std::wstring strXml = L"<Settings>\
|
||||
<SrcFileType>0</SrcFileType>\
|
||||
<DstFileType>0</DstFileType>\
|
||||
<SrcFilePath>D:\\build_doc</SrcFilePath>\
|
||||
<DstFilePath>D:\\build_doc\\EditorWithChanges.bin</DstFilePath>\
|
||||
<FontsDirectory>D:\\activex\\AVS\\Sources\\TeamlabOffice\\trunk\\OfficeWeb\\Fonts\\native</FontsDirectory>\
|
||||
<ImagesDirectory>D:\\build_doc\\media</ImagesDirectory>\
|
||||
<ThemesDirectory>D:\\activex\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\Test\\Applications\\TestAVSOfficeDocxFile2\\TestAVSOfficeDocxFile2\\bin\\x86\\presentationthemes</ThemesDirectory>\
|
||||
<Changes TopItem=\"-1\">\
|
||||
<Change>D:\\build_doc\\changes\\changes0.json</Change>\
|
||||
</Changes>\
|
||||
</Settings>";
|
||||
|
||||
NSDoctRenderer::CDoctrenderer oRenderer;
|
||||
|
||||
std::wstring sError;
|
||||
oRenderer.Execute(strXml, sError);
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user