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
6452e7a1
Commit
6452e7a1
authored
Jul 07, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable xvfb in config
parent
2ca535d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
31 deletions
+51
-31
HtmlFile/HtmlFile.cpp
HtmlFile/HtmlFile.cpp
+51
-31
No files found.
HtmlFile/HtmlFile.cpp
View file @
6452e7a1
...
...
@@ -90,6 +90,23 @@ static std::wstring CorrectHtmlPath(const std::wstring& sPath)
return
L"file:///"
+
sReturn
;
}
static
bool
IsLinuxXVFB
()
{
std
::
wstring
sProcess
=
NSFile
::
GetProcessDirectory
()
+
L"/"
;
std
::
wstring
sPathConfig
=
sProcess
+
L"DoctRenderer.config"
;
XmlUtils
::
CXmlNode
oNode
;
if
(
oNode
.
FromXmlFile
(
sPathConfig
))
{
XmlUtils
::
CXmlNodes
oNodes
;
if
(
oNode
.
GetNodes
(
L"htmlnoxvfb"
,
oNodes
))
{
if
(
oNodes
.
GetCount
()
==
1
)
return
false
;
}
}
return
true
;
}
static
void
GetScriptsPath
(
NSStringUtils
::
CStringBuilder
&
oBuilder
)
{
std
::
wstring
sProcess
=
NSFile
::
GetProcessDirectory
()
+
L"/"
;
...
...
@@ -336,37 +353,40 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
if
(
std
::
string
::
npos
!=
sProgramm
.
find_last_of
(
'/'
))
sLibraryDir
=
"LD_LIBRARY_PATH="
+
sProgramm
.
substr
(
0
,
sProgramm
.
find_last_of
(
'/'
));
#ifdef asc_static_link_libstd
const
char
*
nargs
[
2
];
nargs
[
0
]
=
sXmlA
.
c_str
();
nargs
[
1
]
=
NULL
;
const
char
*
nenv
[
3
];
nenv
[
0
]
=
sLibraryDir
.
c_str
();
nenv
[
1
]
=
"DISPLAY=:0"
;
nenv
[
2
]
=
NULL
;
execve
(
sProgramm
.
c_str
(),
(
char
*
const
*
)
nargs
,
(
char
*
const
*
)
nenv
);
exit
(
EXIT_SUCCESS
);
#else
const
char
*
nargs
[
6
];
nargs
[
0
]
=
"-a"
;
nargs
[
1
]
=
"--auto-servernum"
;
nargs
[
2
]
=
"--server-num=1"
;
nargs
[
3
]
=
sProgramm
.
c_str
();
nargs
[
4
]
=
sXmlA
.
c_str
();
nargs
[
5
]
=
NULL
;
const
char
*
nenv
[
3
];
nenv
[
0
]
=
sLibraryDir
.
c_str
();
nenv
[
1
]
=
NULL
;
//"DISPLAY=:99";
nenv
[
2
]
=
NULL
;
execve
(
"/usr/bin/xvfb-run"
,
(
char
*
const
*
)
nargs
,
(
char
*
const
*
)
nenv
);
exit
(
EXIT_SUCCESS
);
#endif
if
(
!
IsLinuxXVFB
())
{
const
char
*
nargs
[
2
];
nargs
[
0
]
=
sXmlA
.
c_str
();
nargs
[
1
]
=
NULL
;
const
char
*
nenv
[
3
];
nenv
[
0
]
=
sLibraryDir
.
c_str
();
nenv
[
1
]
=
"DISPLAY=:0"
;
nenv
[
2
]
=
NULL
;
execve
(
sProgramm
.
c_str
(),
(
char
*
const
*
)
nargs
,
(
char
*
const
*
)
nenv
);
exit
(
EXIT_SUCCESS
);
}
else
{
const
char
*
nargs
[
6
];
nargs
[
0
]
=
"-a"
;
nargs
[
1
]
=
"--auto-servernum"
;
nargs
[
2
]
=
"--server-num=1"
;
nargs
[
3
]
=
sProgramm
.
c_str
();
nargs
[
4
]
=
sXmlA
.
c_str
();
nargs
[
5
]
=
NULL
;
const
char
*
nenv
[
3
];
nenv
[
0
]
=
sLibraryDir
.
c_str
();
nenv
[
1
]
=
NULL
;
//"DISPLAY=:99";
nenv
[
2
]
=
NULL
;
execve
(
"/usr/bin/xvfb-run"
,
(
char
*
const
*
)
nargs
,
(
char
*
const
*
)
nenv
);
exit
(
EXIT_SUCCESS
);
}
break
;
}
...
...
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