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
b49b8246
Commit
b49b8246
authored
Aug 11, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
45c2f923
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
DesktopEditor/common/Directory.h
DesktopEditor/common/Directory.h
+15
-7
DesktopEditor/doctrenderer/docbuilder_p.h
DesktopEditor/doctrenderer/docbuilder_p.h
+10
-1
No files found.
DesktopEditor/common/Directory.h
View file @
b49b8246
...
...
@@ -61,6 +61,13 @@
namespace
NSDirectory
{
#if !defined(_WIN32) && !defined (_WIN64)
static
bool
is_directory_exist
(
char
*
dir
)
{
struct
stat
st
;
bool
bRes
=
(
0
==
stat
(
dir
,
&
st
))
&&
S_ISDIR
(
st
.
st_mode
);
return
bRes
;
}
static
bool
_mkdir
(
const
char
*
dir
)
{
char
tmp
[
MAX_PATH
];
...
...
@@ -75,6 +82,8 @@ namespace NSDirectory
for
(
p
=
tmp
+
1
;
*
p
;
p
++
)
if
(
*
p
==
'/'
)
{
*
p
=
0
;
res
=
is_directory_exist
(
tmp
);
if
(
!
res
)
res
=
(
0
==
mkdir
(
tmp
,
S_IRWXU
|
S_IRWXG
|
S_IROTH
|
S_IXOTH
));
*
p
=
'/'
;
if
(
!
res
)
...
...
@@ -295,8 +304,7 @@ namespace NSDirectory
BYTE
*
pUtf8
=
NULL
;
LONG
lLen
=
0
;
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
struct
stat
st
;
bool
bRes
=
(
0
==
stat
((
char
*
)
pUtf8
,
&
st
))
&&
S_ISDIR
(
st
.
st_mode
);
bool
bRes
=
is_directory_exist
((
char
*
)
pUtf8
);
delete
[]
pUtf8
;
return
bRes
;
#elif MAC
...
...
@@ -304,7 +312,7 @@ namespace NSDirectory
LONG
lLen
=
0
;
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
struct
stat
st
;
bool
bRes
=
(
0
==
stat
((
char
*
)
pUtf8
,
&
st
))
&&
S_ISDIR
(
st
.
st_mode
);
bool
bRes
=
is_directory_exist
((
char
*
)
pUtf8
);
delete
[]
pUtf8
;
return
bRes
;
#endif
...
...
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
b49b8246
...
...
@@ -920,10 +920,19 @@ namespace NSDoctRenderer
NSStringUtils
::
CStringBuilder
oBuilder
;
std
::
wstring
_path
=
path
;
std
::
wstring
sDstFileDir
=
NSCommon
::
GetDirectoryName
(
_path
);
if
(
sDstFileDir
.
find
(
L"./"
)
==
0
)
sDstFileDir
=
NSFile
::
GetProcessDirectory
()
+
L"/"
+
sDstFileDir
.
substr
(
2
);
if
(
!
NSDirectory
::
Exists
(
sDstFileDir
))
NSDirectory
::
CreateDirectories
(
sDstFileDir
);
_path
=
sDstFileDir
+
L"/"
+
NSCommon
::
GetFileName
(
path
);
oBuilder
.
WriteString
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?><TaskQueueDataConvert><m_sFileFrom>"
);
oBuilder
.
WriteEncodeXmlString
(
m_sFileDir
);
oBuilder
.
WriteString
(
sFileBin
+
L"</m_sFileFrom><m_sFileTo>"
);
oBuilder
.
WriteEncodeXmlString
(
path
);
oBuilder
.
WriteEncodeXmlString
(
_
path
);
oBuilder
.
WriteString
(
L"</m_sFileTo><m_nFormatTo>"
);
oBuilder
.
WriteString
(
std
::
to_wstring
(
type
));
oBuilder
.
WriteString
(
L"</m_nFormatTo><m_sThemeDir>"
);
...
...
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