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
Hide 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 @@
...
@@ -61,6 +61,13 @@
namespace
NSDirectory
namespace
NSDirectory
{
{
#if !defined(_WIN32) && !defined (_WIN64)
#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
)
static
bool
_mkdir
(
const
char
*
dir
)
{
{
char
tmp
[
MAX_PATH
];
char
tmp
[
MAX_PATH
];
...
@@ -75,7 +82,9 @@ namespace NSDirectory
...
@@ -75,7 +82,9 @@ namespace NSDirectory
for
(
p
=
tmp
+
1
;
*
p
;
p
++
)
for
(
p
=
tmp
+
1
;
*
p
;
p
++
)
if
(
*
p
==
'/'
)
{
if
(
*
p
==
'/'
)
{
*
p
=
0
;
*
p
=
0
;
res
=
(
0
==
mkdir
(
tmp
,
S_IRWXU
|
S_IRWXG
|
S_IROTH
|
S_IXOTH
));
res
=
is_directory_exist
(
tmp
);
if
(
!
res
)
res
=
(
0
==
mkdir
(
tmp
,
S_IRWXU
|
S_IRWXG
|
S_IROTH
|
S_IXOTH
));
*
p
=
'/'
;
*
p
=
'/'
;
if
(
!
res
)
if
(
!
res
)
break
;
break
;
...
@@ -293,18 +302,17 @@ namespace NSDirectory
...
@@ -293,18 +302,17 @@ namespace NSDirectory
return
(
dwAttrib
!=
INVALID_FILE_ATTRIBUTES
&&
0
!=
(
dwAttrib
&
FILE_ATTRIBUTE_DIRECTORY
));
return
(
dwAttrib
!=
INVALID_FILE_ATTRIBUTES
&&
0
!=
(
dwAttrib
&
FILE_ATTRIBUTE_DIRECTORY
));
#elif __linux__
#elif __linux__
BYTE
*
pUtf8
=
NULL
;
BYTE
*
pUtf8
=
NULL
;
LONG
lLen
=
0
;
LONG
lLen
=
0
;
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
struct
stat
st
;
bool
bRes
=
is_directory_exist
((
char
*
)
pUtf8
);
bool
bRes
=
(
0
==
stat
((
char
*
)
pUtf8
,
&
st
))
&&
S_ISDIR
(
st
.
st_mode
);
delete
[]
pUtf8
;
delete
[]
pUtf8
;
return
bRes
;
return
bRes
;
#elif MAC
#elif MAC
BYTE
*
pUtf8
=
NULL
;
BYTE
*
pUtf8
=
NULL
;
LONG
lLen
=
0
;
LONG
lLen
=
0
;
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode
(
strDirectory
.
c_str
(),
strDirectory
.
length
(),
pUtf8
,
lLen
,
false
);
struct
stat
st
;
struct
stat
st
;
bool
bRes
=
(
0
==
stat
((
char
*
)
pUtf8
,
&
st
))
&&
S_ISDIR
(
st
.
st_mode
);
bool
bRes
=
is_directory_exist
((
char
*
)
pUtf8
);
delete
[]
pUtf8
;
delete
[]
pUtf8
;
return
bRes
;
return
bRes
;
#endif
#endif
...
...
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
b49b8246
...
@@ -920,10 +920,19 @@ namespace NSDoctRenderer
...
@@ -920,10 +920,19 @@ namespace NSDoctRenderer
NSStringUtils
::
CStringBuilder
oBuilder
;
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
.
WriteString
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?><TaskQueueDataConvert><m_sFileFrom>"
);
oBuilder
.
WriteEncodeXmlString
(
m_sFileDir
);
oBuilder
.
WriteEncodeXmlString
(
m_sFileDir
);
oBuilder
.
WriteString
(
sFileBin
+
L"</m_sFileFrom><m_sFileTo>"
);
oBuilder
.
WriteString
(
sFileBin
+
L"</m_sFileFrom><m_sFileTo>"
);
oBuilder
.
WriteEncodeXmlString
(
path
);
oBuilder
.
WriteEncodeXmlString
(
_
path
);
oBuilder
.
WriteString
(
L"</m_sFileTo><m_nFormatTo>"
);
oBuilder
.
WriteString
(
L"</m_sFileTo><m_nFormatTo>"
);
oBuilder
.
WriteString
(
std
::
to_wstring
(
type
));
oBuilder
.
WriteString
(
std
::
to_wstring
(
type
));
oBuilder
.
WriteString
(
L"</m_nFormatTo><m_sThemeDir>"
);
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