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
4e5ac14c
Commit
4e5ac14c
authored
Feb 18, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
errors for builder (open/save)
parent
dedf74b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
DesktopEditor/doctrenderer/docbuilder.cpp
DesktopEditor/doctrenderer/docbuilder.cpp
+2
-2
DesktopEditor/doctrenderer/docbuilder.h
DesktopEditor/doctrenderer/docbuilder.h
+2
-2
DesktopEditor/doctrenderer/docbuilder_p.h
DesktopEditor/doctrenderer/docbuilder_p.h
+18
-16
No files found.
DesktopEditor/doctrenderer/docbuilder.cpp
View file @
4e5ac14c
...
...
@@ -42,7 +42,7 @@ namespace NSDoctRenderer
RELEASEOBJECT
(
m_pInternal
);
}
bool
CDocBuilder
::
OpenFile
(
const
wchar_t
*
path
,
const
wchar_t
*
params
)
int
CDocBuilder
::
OpenFile
(
const
wchar_t
*
path
,
const
wchar_t
*
params
)
{
m_pInternal
->
m_nFileType
=
-
1
;
if
(
!
NSDirectory
::
Exists
(
m_pInternal
->
m_sTmpFolder
))
...
...
@@ -50,7 +50,7 @@ namespace NSDoctRenderer
return
m_pInternal
->
OpenFile
(
path
,
params
);
}
bool
CDocBuilder
::
SaveFile
(
const
int
&
type
,
const
wchar_t
*
path
,
const
wchar_t
*
params
)
int
CDocBuilder
::
SaveFile
(
const
int
&
type
,
const
wchar_t
*
path
,
const
wchar_t
*
params
)
{
return
m_pInternal
->
SaveFile
(
type
,
path
,
params
);
}
...
...
DesktopEditor/doctrenderer/docbuilder.h
View file @
4e5ac14c
...
...
@@ -44,10 +44,10 @@ namespace NSDoctRenderer
~
CDocBuilder
();
public:
bool
OpenFile
(
const
wchar_t
*
path
,
const
wchar_t
*
params
);
int
OpenFile
(
const
wchar_t
*
path
,
const
wchar_t
*
params
);
bool
CreateFile
(
const
int
&
type
);
void
SetTmpFolder
(
const
wchar_t
*
folder
);
bool
SaveFile
(
const
int
&
type
,
const
wchar_t
*
path
,
const
wchar_t
*
params
=
0
);
int
SaveFile
(
const
int
&
type
,
const
wchar_t
*
path
,
const
wchar_t
*
params
=
0
);
void
CloseFile
();
bool
ExecuteCommand
(
const
wchar_t
*
command
);
...
...
DesktopEditor/doctrenderer/docbuilder_p.h
View file @
4e5ac14c
...
...
@@ -611,7 +611,7 @@ namespace NSDoctRenderer
void
CheckFonts
(
bool
bIsCheckSystemFonts
)
{
CArray
<
std
::
string
>
strFonts
;
std
::
vector
<
std
::
string
>
strFonts
;
std
::
wstring
strDirectory
=
NSCommon
::
GetDirectoryName
(
m_strAllFonts
);
std
::
wstring
strAllFontsJSPath
=
strDirectory
+
L"/AllFonts.js"
;
...
...
@@ -638,7 +638,7 @@ namespace NSDoctRenderer
if
(
nEnd
>
nStart
)
{
std
::
string
s
(
pBuffer
+
nStart
,
nEnd
-
nStart
+
1
);
strFonts
.
Add
(
s
);
strFonts
.
push_back
(
s
);
}
nStart
=
nCur
+
1
;
}
...
...
@@ -653,14 +653,14 @@ namespace NSDoctRenderer
if
(
!
bIsEqual
||
bIsCheckSystemFonts
)
{
CApplicationFonts
oApplicationF
;
CArray
<
std
::
wstring
>
strFontsW_Cur
=
oApplicationF
.
GetSetupFontFiles
();
std
::
vector
<
std
::
wstring
>
strFontsW_Cur
=
oApplicationF
.
GetSetupFontFiles
();
if
(
strFonts
.
GetCount
()
!=
strFontsW_Cur
.
GetCount
())
if
(
strFonts
.
size
()
!=
strFontsW_Cur
.
size
())
bIsEqual
=
false
;
if
(
bIsEqual
)
{
int
nCount
=
strFonts
.
GetCount
();
int
nCount
=
(
int
)
strFonts
.
size
();
for
(
int
i
=
0
;
i
<
nCount
;
++
i
)
{
if
(
strFonts
[
i
]
!=
NSFile
::
CUtf8Converter
::
GetUtf8StringFromUnicode2
(
strFontsW_Cur
[
i
].
c_str
(),
strFontsW_Cur
[
i
].
length
()))
...
...
@@ -678,12 +678,12 @@ namespace NSDoctRenderer
if
(
NSFile
::
CFileBinary
::
Exists
(
strFontsSelectionBin
))
NSFile
::
CFileBinary
::
Remove
(
strFontsSelectionBin
);
if
(
strFonts
.
GetCount
()
!=
0
)
if
(
strFonts
.
size
()
!=
0
)
NSFile
::
CFileBinary
::
Remove
(
strDirectory
+
L"/fonts.log"
);
NSFile
::
CFileBinary
oFile
;
oFile
.
CreateFileW
(
strDirectory
+
L"/fonts.log"
);
int
nCount
=
strFontsW_Cur
.
GetCount
();
int
nCount
=
(
int
)
strFontsW_Cur
.
size
();
for
(
int
i
=
0
;
i
<
nCount
;
++
i
)
{
oFile
.
WriteStringUTF8
(
strFontsW_Cur
[
i
]);
...
...
@@ -761,7 +761,7 @@ namespace NSDoctRenderer
#endif
}
bool
OpenFile
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
params
)
int
OpenFile
(
const
std
::
wstring
&
path
,
const
std
::
wstring
&
params
)
{
Init
();
...
...
@@ -914,14 +914,15 @@ namespace NSDoctRenderer
LOGGER_SPEED_LAP
(
"open_convert"
)
if
(
0
==
nReturnCode
)
return
true
;
return
0
;
NSDirectory
::
DeleteDirectory
(
m_sFileDir
);
m_sFileDir
=
L""
;
m_nFileType
=
-
1
;
CV8RealTimeWorker
::
_LOGGING_ERROR_
(
L"error: "
,
L"open file error"
);
return
false
;
std
::
wstring
sErrorLog
=
L"open file error ("
+
std
::
to_wstring
(
nReturnCode
)
+
L")"
;
CV8RealTimeWorker
::
_LOGGING_ERROR_
(
L"error: "
,
sErrorLog
);
return
nReturnCode
;
}
void
CloseFile
()
...
...
@@ -937,7 +938,7 @@ namespace NSDoctRenderer
RELEASEOBJECT
(
m_pWorker
);
}
bool
SaveFile
(
const
int
&
type
,
const
std
::
wstring
&
path
,
const
wchar_t
*
params
=
NULL
)
int
SaveFile
(
const
int
&
type
,
const
std
::
wstring
&
path
,
const
wchar_t
*
params
=
NULL
)
{
Init
();
...
...
@@ -1114,10 +1115,11 @@ namespace NSDoctRenderer
LOGGER_SPEED_LAP
(
"save_convert"
)
if
(
0
==
nReturnCode
)
return
true
;
return
0
;
CV8RealTimeWorker
::
_LOGGING_ERROR_
(
L"error: "
,
L"save file error"
);
return
false
;
std
::
wstring
sErrorLog
=
L"save file error ("
+
std
::
to_wstring
(
nReturnCode
)
+
L")"
;
CV8RealTimeWorker
::
_LOGGING_ERROR_
(
L"error: "
,
sErrorLog
);
return
nReturnCode
;
}
bool
ExecuteCommand
(
const
std
::
wstring
&
command
)
...
...
@@ -1414,7 +1416,7 @@ namespace NSDoctRenderer
ParceParameters
(
command
,
_builder_params
,
nCountParameters
);
if
(
"OpenFile"
==
sFuncNum
)
bIsNoError
=
this
->
OpenFile
(
_builder_params
[
0
].
c_str
(),
_builder_params
[
1
].
c_str
(
));
bIsNoError
=
(
0
==
this
->
OpenFile
(
_builder_params
[
0
].
c_str
(),
_builder_params
[
1
].
c_str
()
));
else
if
(
"CreateFile"
==
sFuncNum
)
{
if
(
L"docx"
==
_builder_params
[
0
])
...
...
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