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
24dc3554
Commit
24dc3554
authored
Dec 15, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arguments to builder (JSON format)
parent
fc2707f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
DesktopEditor/doctrenderer/docbuilder_p.h
DesktopEditor/doctrenderer/docbuilder_p.h
+34
-0
No files found.
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
24dc3554
...
...
@@ -83,6 +83,7 @@ public:
v8
::
Local
<
v8
::
Context
>
m_context
;
int
m_nFileType
;
std
::
string
m_sUtf8ArgumentJSON
;
public:
...
...
@@ -211,6 +212,31 @@ public:
}
LOGGER_SPEED_LAP
(
"run"
)
if
(
true
)
{
std
::
string
sArg
=
m_sUtf8ArgumentJSON
;
if
(
sArg
.
empty
())
sArg
=
"{}"
;
NSCommon
::
string_replaceA
(
sArg
,
"
\\
"
,
"
\\\\
"
);
NSCommon
::
string_replaceA
(
sArg
,
"
\"
"
,
"
\\\"
"
);
std
::
string
sArgument
=
"var Argument = JSON.parse(
\"
"
+
sArg
+
"
\"
);"
;
v8
::
Local
<
v8
::
String
>
_sourceArg
=
v8
::
String
::
NewFromUtf8
(
m_isolate
,
sArgument
.
c_str
());
v8
::
Local
<
v8
::
Script
>
_scriptArg
=
v8
::
Script
::
Compile
(
_sourceArg
);
_scriptArg
->
Run
();
if
(
try_catch
.
HasCaught
())
{
std
::
wstring
strCode
=
to_cstring
(
try_catch
.
Message
()
->
GetSourceLine
());
std
::
wstring
strException
=
to_cstring
(
try_catch
.
Message
()
->
Get
());
_LOGGING_ERROR_
(
L"sdk_argument_code"
,
strCode
);
_LOGGING_ERROR_
(
L"sdk_argument"
,
strException
);
return
false
;
}
}
CNativeControl
*
pNative
=
NULL
;
bool
bIsBreak
=
false
;
...
...
@@ -401,12 +427,14 @@ namespace NSDoctRenderer
m_bCheckFonts
=
false
;
m_sWorkDir
=
L""
;
m_bSaveWithDoctrendererMode
=
false
;
m_sArgumentJSON
=
""
;
}
public:
bool
m_bCheckFonts
;
std
::
wstring
m_sWorkDir
;
bool
m_bSaveWithDoctrendererMode
;
std
::
string
m_sArgumentJSON
;
};
class
CDocBuilder_Private
...
...
@@ -1095,6 +1123,7 @@ namespace NSDoctRenderer
{
m_pWorker
=
new
CV8RealTimeWorker
();
m_pWorker
->
m_nFileType
=
m_nFileType
;
m_pWorker
->
m_sUtf8ArgumentJSON
=
m_oParams
.
m_sArgumentJSON
;
bool
bOpen
=
m_pWorker
->
OpenFile
(
m_sX2tPath
,
m_sFileDir
,
GetScript
());
if
(
!
bOpen
)
...
...
@@ -1419,6 +1448,11 @@ namespace NSDoctRenderer
m_pInternal
->
m_oParams
.
m_bCheckFonts
=
true
;
else
if
(
sParam
==
"--work-directory"
)
m_pInternal
->
m_oParams
.
m_sWorkDir
=
std
::
wstring
(
value
);
else
if
(
sParam
==
"--argument"
)
{
std
::
wstring
sArg
(
value
);
m_pInternal
->
m_oParams
.
m_sArgumentJSON
=
U_TO_UTF8
(
sArg
);
}
}
void
CDocBuilder
::
SetPropertyW
(
const
wchar_t
*
param
,
const
wchar_t
*
value
)
{
...
...
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