Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
b21d7628
Commit
b21d7628
authored
Apr 15, 2016
by
Oleg Korshul
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
билдер по новой схеме
parent
ff16fdcb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
DesktopEditor/doctrenderer/docbuilder.cpp
DesktopEditor/doctrenderer/docbuilder.cpp
+25
-13
DesktopEditor/doctrenderer/test_builder/docbuilder.pro
DesktopEditor/doctrenderer/test_builder/docbuilder.pro
+3
-3
DesktopEditor/doctrenderer/test_builder/main.cpp
DesktopEditor/doctrenderer/test_builder/main.cpp
+5
-5
No files found.
DesktopEditor/doctrenderer/docbuilder.cpp
View file @
b21d7628
...
...
@@ -92,7 +92,7 @@ public:
bool
ExecuteCommand
(
const
std
::
wstring
&
command
,
bool
bIsSave
=
true
)
{
std
::
string
commandA
=
U_TO_UTF8
(
command
);
commandA
=
"_api."
+
commandA
;
//
commandA = "_api." + commandA;
if
(
bIsSave
)
commandA
+=
"_api.asc_Save();"
;
...
...
@@ -207,7 +207,7 @@ public:
if
(
pNative
!=
NULL
)
{
pNative
->
m_strFontsDirectory
=
NSFile
::
GetProcessDirectory
()
+
L"/sdk
/C
ommon"
;
pNative
->
m_strFontsDirectory
=
NSFile
::
GetProcessDirectory
()
+
L"/sdk
js/c
ommon"
;
pNative
->
m_strImagesDirectory
=
path
+
L"/media"
;
pNative
->
CheckFonts
();
...
...
@@ -257,9 +257,9 @@ public:
}
if
(
!
bIsBreak
)
bIsBreak
=
!
this
->
ExecuteCommand
(
L"asc_nativeInitBuilder();"
,
false
);
bIsBreak
=
!
this
->
ExecuteCommand
(
L"
_api.
asc_nativeInitBuilder();"
,
false
);
if
(
!
bIsBreak
)
bIsBreak
=
!
this
->
ExecuteCommand
(
L"asc_SetSilentMode(true);"
,
false
);
bIsBreak
=
!
this
->
ExecuteCommand
(
L"
_api.
asc_SetSilentMode(true);"
,
false
);
return
!
bIsBreak
;
}
...
...
@@ -300,7 +300,7 @@ namespace NSDoctRenderer
m_nFileType
=
-
1
;
#if
0
#if
1
m_sX2tPath
+=
L"/converter"
;
#endif
...
...
@@ -321,10 +321,12 @@ namespace NSDoctRenderer
std
::
wstring
strFilePath
=
_node
.
GetText
();
if
(
std
::
wstring
::
npos
!=
strFilePath
.
find
(
L"AllFonts.js"
))
{
m_strAllFonts
=
strFilePath
;
if
(
!
NSFile
::
CFileBinary
::
Exists
(
m_strAllFonts
)
||
NSFile
::
CFileBinary
::
Exists
(
sConfigDir
+
m_strAllFonts
))
m_strAllFonts
=
sConfigDir
+
m_strAllFonts
;
}
if
(
NSFile
::
CFileBinary
::
Exists
(
strFilePath
)
&&
!
NSFile
::
CFileBinary
::
Exists
(
sConfigDir
+
strFilePath
))
m_arrFiles
.
Add
(
strFilePath
);
...
...
@@ -414,7 +416,7 @@ namespace NSDoctRenderer
bool
bIsEqual
=
NSFile
::
CFileBinary
::
Exists
(
strFontsSelectionBin
);
if
(
bIsEqual
&&
bIsCheckSystemFonts
)
if
(
!
bIsEqual
||
bIsCheckSystemFonts
)
{
CApplicationFonts
oApplicationF
;
CArray
<
std
::
wstring
>
strFontsW_Cur
=
oApplicationF
.
GetSetupFontFiles
();
...
...
@@ -550,9 +552,9 @@ namespace NSDoctRenderer
oBuilder
.
WriteEncodeXmlString
(
m_sFileDir
);
oBuilder
.
WriteString
(
L"/Editor.bin</m_sFileTo><m_nFormatTo>8192</m_nFormatTo>"
);
oBuilder
.
WriteString
(
L"<m_sFontDir>"
);
oBuilder
.
WriteEncodeXmlString
(
NSFile
::
GetProcessDirectory
()
+
L"/sdk
/C
ommon"
);
oBuilder
.
WriteEncodeXmlString
(
NSFile
::
GetProcessDirectory
()
+
L"/sdk
js/c
ommon"
);
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>./sdk
js/slide
/themes</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional>"
);
oBuilder
.
WriteString
(
params
);
oBuilder
.
WriteString
(
L"</TaskQueueDataConvert>"
);
...
...
@@ -709,11 +711,11 @@ namespace NSDoctRenderer
oBuilder
.
WriteString
(
L"</m_sFileTo><m_nFormatTo>"
);
oBuilder
.
WriteString
(
std
::
to_wstring
(
type
));
oBuilder
.
WriteString
(
L"</m_nFormatTo><m_sThemeDir>"
);
oBuilder
.
WriteEncodeXmlString
(
L"./sdk
/presentationeditor
/themes"
);
oBuilder
.
WriteEncodeXmlString
(
L"./sdk
js/slide
/themes"
);
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_sFontDir>"
);
oBuilder
.
WriteEncodeXmlString
(
NSFile
::
GetProcessDirectory
()
+
L"/sdk
/C
ommon"
);
oBuilder
.
WriteEncodeXmlString
(
NSFile
::
GetProcessDirectory
()
+
L"/sdk
js/c
ommon"
);
oBuilder
.
WriteString
(
L"</m_sFontDir>"
);
int
nDoctRendererParam
=
0
;
...
...
@@ -1063,6 +1065,7 @@ namespace NSDoctRenderer
break
;
}
std
::
string
sJsCommands
=
""
;
std
::
wstring
_builder_params
[
4
];
// с запасом
for
(
std
::
list
<
std
::
string
>::
iterator
i
=
_commands
.
begin
();
i
!=
_commands
.
end
();
i
++
)
{
...
...
@@ -1090,6 +1093,14 @@ namespace NSDoctRenderer
bool
bIsNoError
=
true
;
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
;
while
(
_data
[
_pos
]
!=
'('
)
++
_pos
;
...
...
@@ -1144,7 +1155,8 @@ namespace NSDoctRenderer
}
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
)
...
...
DesktopEditor/doctrenderer/test_builder/docbuilder.pro
View file @
b21d7628
...
...
@@ -17,8 +17,8 @@ CONFIG -= debug_and_release debug_and_release_target
CONFIG
+=
c
++
11
###############
destination
path
###############
DESTINATION_SDK_PATH
=
$$
PWD
/../../../
SDK
/
lib
DESTINATION_PATH
=
$$
PWD
/../../../
SDK
/
bin
/
docbuilder
DESTINATION_SDK_PATH
=
$$
PWD
/../../../
build
/
lib
DESTINATION_PATH
=
$$
PWD
/../../../
build
/
bin
/
docbuilder
win32
{
DEFINES
+=
WIN32
...
...
@@ -72,7 +72,7 @@ mac {
TARGET_PLATFORM
=
_mac64
}
DESTDIR
=
$$
DESTINATION_PATH
#
DESTDIR
=
$$
DESTINATION_PATH
TARGET
=
docbuilder
$$
TARGET_PLATFORM
################################################
...
...
DesktopEditor/doctrenderer/test_builder/main.cpp
View file @
b21d7628
...
...
@@ -53,11 +53,11 @@ int main(int argc, char *argv[])
NSDoctRenderer
::
CDocBuilder
::
Initialize
();
NSDoctRenderer
::
CDocBuilder
oBuilder
(
false
);
if
(
true
)
{
NSDoctRenderer
::
CDocBuilder
oBuilder
(
true
);
oBuilder
.
Run
(
sBuildFile
.
c_str
());
NSDoctRenderer
::
CDocBuilder
oBuilder2
(
false
);
oBuilder2
.
Run
(
sBuildFile
.
c_str
());
}
NSDoctRenderer
::
CDocBuilder
::
Dispose
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment