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
3ee9c0fa
Commit
3ee9c0fa
authored
Apr 20, 2016
by
Oleg Korshul
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
работа билдера сразу в двух режимах. Чтобы тестировать сборку.
parent
db9c9b13
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
21 deletions
+45
-21
DesktopEditor/doctrenderer/docbuilder.cpp
DesktopEditor/doctrenderer/docbuilder.cpp
+31
-19
DesktopEditor/doctrenderer/docbuilder.h
DesktopEditor/doctrenderer/docbuilder.h
+2
-0
DesktopEditor/doctrenderer/nativecontrol.h
DesktopEditor/doctrenderer/nativecontrol.h
+0
-2
DesktopEditor/doctrenderer/test_builder/main.cpp
DesktopEditor/doctrenderer/test_builder/main.cpp
+12
-0
No files found.
DesktopEditor/doctrenderer/docbuilder.cpp
View file @
3ee9c0fa
...
...
@@ -90,18 +90,13 @@ public:
std
::
cerr
<<
sT
<<
": "
<<
sE
<<
std
::
endl
;
}
bool
ExecuteCommand
(
const
std
::
wstring
&
command
,
bool
bIsSave
=
true
)
bool
ExecuteCommand
(
const
std
::
wstring
&
command
)
{
LOGGER_SPEED_START
std
::
string
commandA
=
U_TO_UTF8
(
command
);
//commandA = "_api." + commandA;
#ifndef APPLY_CHANGES_IN_BUILDER
if
(
bIsSave
)
commandA
+=
"_api.asc_Save();"
;
#endif
v8
::
Context
::
Scope
context_scope
(
m_context
);
v8
::
TryCatch
try_catch
;
...
...
@@ -271,9 +266,9 @@ public:
}
if
(
!
bIsBreak
)
bIsBreak
=
!
this
->
ExecuteCommand
(
L"_api.asc_nativeInitBuilder();"
,
false
);
bIsBreak
=
!
this
->
ExecuteCommand
(
L"_api.asc_nativeInitBuilder();"
);
if
(
!
bIsBreak
)
bIsBreak
=
!
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(true);"
,
false
);
bIsBreak
=
!
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(true);"
);
LOGGER_SPEED_LAP
(
"open"
)
...
...
@@ -331,7 +326,7 @@ public:
return
false
;
if
(
_formatDst
==
NSDoctRenderer
::
DoctRendererFormat
::
PDF
)
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(false);"
,
false
);
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(false);"
);
std
::
wstring
strError
;
bool
bIsError
=
Doct_renderer_SaveFile_ForBuilder
(
_formatDst
,
...
...
@@ -344,7 +339,7 @@ public:
strError
);
if
(
_formatDst
==
NSDoctRenderer
::
DoctRendererFormat
::
PDF
)
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(true);"
,
false
);
this
->
ExecuteCommand
(
L"_api.asc_SetSilentMode(true);"
);
return
bIsError
;
}
...
...
@@ -377,9 +372,13 @@ namespace NSDoctRenderer
std
::
wstring
m_sX2tPath
;
CV8RealTimeWorker
*
m_pWorker
;
bool
m_bIsSaveWithDoctrendererMode
;
public:
CDocBuilder_Private
(
bool
bIsCheckSystemFonts
)
{
m_bIsSaveWithDoctrendererMode
=
false
;
m_sX2tPath
=
NSFile
::
GetProcessDirectory
();
m_pWorker
=
NULL
;
...
...
@@ -795,10 +794,11 @@ namespace NSDoctRenderer
std
::
wstring
sFileBin
=
L"/Editor.bin"
;
#ifdef APPLY_CHANGES_IN_BUILDER
if
(
!
m_bIsSaveWithDoctrendererMode
)
{
this
->
m_pWorker
->
SaveFileWithChanges
(
type
,
m_sFileDir
+
L"/Editor2.bin"
);
sFileBin
=
L"/Editor2.bin"
;
#endif
}
NSStringUtils
::
CStringBuilder
oBuilder
;
...
...
@@ -810,11 +810,10 @@ namespace NSDoctRenderer
oBuilder
.
WriteString
(
std
::
to_wstring
(
type
));
oBuilder
.
WriteString
(
L"</m_nFormatTo><m_sThemeDir>"
);
oBuilder
.
WriteEncodeXmlString
(
L"./sdkjs/slide/themes"
);
#ifdef APPLY_CHANGES_IN_BUILDER
if
(
!
m_bIsSaveWithDoctrendererMode
)
oBuilder
.
WriteString
(
L"</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional>"
);
#
else
else
oBuilder
.
WriteString
(
L"</m_sThemeDir><m_bFromChanges>true</m_bFromChanges><m_bDontSaveAdditional>true</m_bDontSaveAdditional>"
);
#endif
oBuilder
.
WriteString
(
L"<m_nCsvTxtEncoding>46</m_nCsvTxtEncoding><m_nCsvDelimiter>4</m_nCsvDelimiter>"
);
oBuilder
.
WriteString
(
L"<m_sFontDir>"
);
oBuilder
.
WriteEncodeXmlString
(
NSFile
::
GetProcessDirectory
()
+
L"/sdkjs/common"
);
...
...
@@ -1262,6 +1261,12 @@ namespace NSDoctRenderer
else
if
(
L"pdf"
==
_builder_params
[
0
])
nFormat
=
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF
;
if
(
m_pInternal
->
m_bIsSaveWithDoctrendererMode
)
{
// перед сохранением в такой схеме нужно скинуть изменения
this
->
ExecuteCommand
(
L"_api.asc_Save();"
);
}
this
->
SaveFile
(
nFormat
,
_builder_params
[
1
].
c_str
());
}
}
...
...
@@ -1278,6 +1283,13 @@ namespace NSDoctRenderer
return
true
;
}
void
CDocBuilder
::
SetProperty
(
const
char
*
param
)
{
std
::
string
sParam
=
std
::
string
(
param
);
if
(
sParam
==
"--use-doctrenderer-scheme"
)
m_pInternal
->
m_bIsSaveWithDoctrendererMode
=
true
;
}
void
CDocBuilder
::
Initialize
()
{
CV8Worker
::
Initialize
();
...
...
DesktopEditor/doctrenderer/docbuilder.h
View file @
3ee9c0fa
...
...
@@ -25,6 +25,8 @@ namespace NSDoctRenderer
bool
RunTextW
(
const
wchar_t
*
commands
);
bool
RunTextA
(
const
char
*
commands
);
void
SetProperty
(
const
char
*
param
);
public:
static
void
Initialize
();
static
void
Dispose
();
...
...
DesktopEditor/doctrenderer/nativecontrol.h
View file @
3ee9c0fa
...
...
@@ -850,8 +850,6 @@ void CreateNativeObject(const v8::FunctionCallbackInfo<v8::Value>& args);
void
CreateNativeObjectBuilder
(
const
v8
::
FunctionCallbackInfo
<
v8
::
Value
>&
args
);
void
CreateNativeMemoryStream
(
const
v8
::
FunctionCallbackInfo
<
v8
::
Value
>&
args
);
#define APPLY_CHANGES_IN_BUILDER
#if 0
class CLoggerSpeed
{
...
...
DesktopEditor/doctrenderer/test_builder/main.cpp
View file @
3ee9c0fa
...
...
@@ -56,6 +56,18 @@ int main(int argc, char *argv[])
if
(
true
)
{
NSDoctRenderer
::
CDocBuilder
oBuilder
(
true
);
for
(
int
i
=
0
;
i
<
(
argc
-
1
);
++
i
)
{
#ifdef WIN32
std
::
wstring
sW
(
argv
[
i
]);
std
::
string
sParam
(
sW
.
begin
(),
sW
.
end
());
#else
std
::
string
sParam
(
argv
[
i
]);
#endif
oBuilder
.
SetProperty
(
sParam
.
c_str
());
}
oBuilder
.
Run
(
sBuildFile
.
c_str
());
}
...
...
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