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
79e05885
Commit
79e05885
authored
Jun 01, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix partly 35047
parent
a3d08cfc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
1 deletion
+102
-1
X2tConverter/src/ASCConverters.cpp
X2tConverter/src/ASCConverters.cpp
+67
-0
X2tConverter/src/ASCConverters.h
X2tConverter/src/ASCConverters.h
+4
-0
X2tConverter/src/cextracttools.cpp
X2tConverter/src/cextracttools.cpp
+18
-0
X2tConverter/src/cextracttools.h
X2tConverter/src/cextracttools.h
+13
-1
No files found.
X2tConverter/src/ASCConverters.cpp
View file @
79e05885
...
...
@@ -2521,7 +2521,54 @@ namespace NExtractTools
}
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
int
html2doct_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
std
::
wstring
sResultDoctDir
=
NSFile
::
GetDirectoryName
(
sTo
);
int
nRes
=
html2doct_dir
(
sFrom
,
sResultDoctDir
,
sTemp
,
params
);
return
nRes
;
}
int
html2doct
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
std
::
wstring
sResultDoctDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"doct_unpacked"
);
std
::
wstring
sResultDoctFileEditor
=
sResultDoctDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
NSDirectory
::
CreateDirectory
(
sResultDoctDir
);
int
nRes
=
html2doct_dir
(
sFrom
,
sResultDoctDir
,
sTemp
,
params
);
if
(
SUCCEEDED_X2T
(
nRes
))
{
COfficeUtils
oCOfficeUtils
(
NULL
);
nRes
=
(
S_OK
==
oCOfficeUtils
.
CompressFileOrDirectory
(
sResultDoctDir
,
sTo
))
?
nRes
:
AVS_FILEUTILS_ERROR_CONVERT
;
}
return
nRes
;
}
int
html2docx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
std
::
wstring
sResultDoctDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"doct_unpacked"
);
std
::
wstring
sResultDoctFileEditor
=
sResultDoctDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
NSDirectory
::
CreateDirectory
(
sResultDoctDir
);
int
nRes
=
html2doct_dir
(
sFrom
,
sResultDoctDir
,
sTemp
,
params
);
if
(
SUCCEEDED_X2T
(
nRes
))
{
std
::
wstring
sDocxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"docx_unpacked"
);
NSDirectory
::
CreateDirectory
(
sDocxDir
);
nRes
=
doct_bin2docx_dir
(
sResultDoctFileEditor
,
L""
,
sDocxDir
,
false
,
L""
,
params
);
if
(
SUCCEEDED_X2T
(
nRes
))
{
COfficeUtils
oCOfficeUtils
(
NULL
);
nRes
=
(
S_OK
==
oCOfficeUtils
.
CompressFileOrDirectory
(
sDocxDir
,
sTo
))
?
nRes
:
AVS_FILEUTILS_ERROR_CONVERT
;
}
}
return
nRes
;
}
//------------------------------------------------------------------------------------------------------------------
int
fromInputParams
(
InputParams
&
oInputParams
)
{
TConversionDirection
conversion
=
oInputParams
.
getConversionDirection
();
...
...
@@ -2828,6 +2875,26 @@ namespace NExtractTools
result
=
mscrypt2oot_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
{
}
break
;
case
TCD_HTML2DOCX
:
{
result
=
html2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_HTML2DOCT
:
{
result
=
html2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_HTML2DOCT_BIN
:
{
result
=
html2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
//TCD_FB22DOCX,
//TCD_FB22DOCT,
//TCD_FB22DOCT_BIN,
//TCD_EPUB2DOCX,
//TCD_EPUB2DOCT,
//TCD_EPUB2DOCT_BIN,
}
// delete temp dir
...
...
X2tConverter/src/ASCConverters.h
View file @
79e05885
...
...
@@ -131,6 +131,10 @@ namespace NExtractTools
int
oox2mscrypt
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
html2doct_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
html2doct
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
html2docx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
//-------------------------------------------------------------------------------------------------------------------------------------------------
int
dir2zip
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
);
int
zip2dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
);
...
...
X2tConverter/src/cextracttools.cpp
View file @
79e05885
...
...
@@ -223,6 +223,24 @@ namespace NExtractTools
else
if
(
0
==
sExt2
.
compare
(
_T
(
".pptt"
)))
res
=
TCD_MSCRYPT2PPTT
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_MSCRYPT2BIN
;
}
break
;
case
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML
:
{
if
(
0
==
sExt2
.
compare
(
_T
(
".docx"
)))
res
=
TCD_HTML2DOCX
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".doct"
)))
res
=
TCD_HTML2DOCT
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_HTML2DOCT_BIN
;
}
break
;
case
AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2
:
{
if
(
0
==
sExt2
.
compare
(
_T
(
".docx"
)))
res
=
TCD_FB22DOCX
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".doct"
)))
res
=
TCD_FB22DOCT
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_FB22DOCT_BIN
;
}
break
;
case
AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB
:
{
if
(
0
==
sExt2
.
compare
(
_T
(
".docx"
)))
res
=
TCD_EPUB2DOCX
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".doct"
)))
res
=
TCD_EPUB2DOCT
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_EPUB2DOCT_BIN
;
}
break
;
}
}
}
...
...
X2tConverter/src/cextracttools.h
View file @
79e05885
...
...
@@ -136,7 +136,7 @@ namespace NExtractTools
TCD_PPTT2ODP
,
TCD_PPTX_BIN2ODP
,
TCD_XML2DOCX
,
TCD_XML2DOCX
,
TCD_DOCX2XML
,
//
TCD_MSCRYPT2
,
...
...
@@ -145,6 +145,18 @@ namespace NExtractTools
TCD_MSCRYPT2PPTT
,
TCD_MSCRYPT2BIN
,
//
TCD_HTML2DOCX
,
TCD_HTML2DOCT
,
TCD_HTML2DOCT_BIN
,
TCD_FB22DOCX
,
TCD_FB22DOCT
,
TCD_FB22DOCT_BIN
,
TCD_EPUB2DOCX
,
TCD_EPUB2DOCT
,
TCD_EPUB2DOCT_BIN
,
TCD_MAILMERGE
,
TCD_T2
,
TCD_DOCT_BIN2
,
...
...
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