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
69b4a094
Commit
69b4a094
authored
Jun 28, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder bugs
parent
ab360be6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletion
+53
-1
DesktopEditor/common/Directory.h
DesktopEditor/common/Directory.h
+7
-1
DesktopEditor/doctrenderer/docbuilder.h
DesktopEditor/doctrenderer/docbuilder.h
+2
-0
DesktopEditor/doctrenderer/docbuilder_p.h
DesktopEditor/doctrenderer/docbuilder_p.h
+44
-0
No files found.
DesktopEditor/common/Directory.h
View file @
69b4a094
...
...
@@ -365,7 +365,13 @@ namespace NSDirectory
SECURITY_ATTRIBUTES
sa
=
{};
codeResult
=
SHCreateDirectoryExW
(
NULL
,
strDirectory
.
c_str
(),
&
sa
);
if
(
strDirectory
.
find
(
L"./"
)
==
0
)
{
std
::
wstring
sDir
=
NSFile
::
GetProcessDirectory
()
+
L"/"
+
strDirectory
;
codeResult
=
SHCreateDirectoryExW
(
NULL
,
sDir
.
c_str
(),
&
sa
);
}
else
codeResult
=
SHCreateDirectoryExW
(
NULL
,
strDirectory
.
c_str
(),
&
sa
);
bool
created
=
false
;
if
(
codeResult
==
ERROR_SUCCESS
)
...
...
DesktopEditor/doctrenderer/docbuilder.h
View file @
69b4a094
...
...
@@ -59,6 +59,8 @@ namespace NSDoctRenderer
void
SetProperty
(
const
char
*
param
,
const
wchar_t
*
value
);
void
SetPropertyW
(
const
wchar_t
*
param
,
const
wchar_t
*
value
);
char
*
GetVersion
();
public:
static
void
Initialize
();
static
void
Dispose
();
...
...
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
69b4a094
...
...
@@ -1395,6 +1395,50 @@ namespace NSDoctRenderer
m_pInternal
->
CloseFile
();
}
char
*
CDocBuilder
::
GetVersion
()
{
m_pInternal
->
Init
();
if
(
0
==
m_pInternal
->
m_arDoctSDK
.
size
())
return
NULL
;
std
::
wstring
sFile
;
for
(
std
::
vector
<
std
::
wstring
>::
iterator
i
=
m_pInternal
->
m_arDoctSDK
.
begin
();
i
!=
m_pInternal
->
m_arDoctSDK
.
end
();
i
++
)
{
if
(
std
::
wstring
::
npos
!=
i
->
find
(
L"sdk-all-min.js"
))
{
sFile
=
*
i
;
break
;
}
}
if
(
sFile
.
empty
())
return
NULL
;
std
::
string
sData
;
if
(
!
NSFile
::
CFileBinary
::
ReadAllTextUtf8A
(
sFile
,
sData
))
return
NULL
;
std
::
string
::
size_type
startPos
=
sData
.
find
(
"Version:"
);
if
(
std
::
string
::
npos
==
startPos
)
return
NULL
;
startPos
+=
8
;
std
::
string
::
size_type
endPos
=
sData
.
find
(
')'
,
startPos
);
if
(
std
::
string
::
npos
==
endPos
)
return
NULL
;
size_t
sSrcLen
=
endPos
-
startPos
+
1
;
if
(
sSrcLen
==
0
)
return
NULL
;
char
*
sRet
=
new
char
[
sSrcLen
+
1
];
memcpy
(
sRet
,
sData
.
c_str
()
+
startPos
,
sSrcLen
);
sRet
[
sSrcLen
]
=
'\0'
;
return
sRet
;
}
bool
CDocBuilder
::
Run
(
const
wchar_t
*
path
)
{
std
::
wstring
sPath
(
path
);
...
...
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