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
f43a0bbf
Commit
f43a0bbf
authored
Sep 21, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
746c2282
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
10 deletions
+74
-10
X2tConverter/src/ASCConverters.cpp
X2tConverter/src/ASCConverters.cpp
+66
-8
X2tConverter/src/ASCConverters.h
X2tConverter/src/ASCConverters.h
+2
-0
X2tConverter/src/cextracttools.cpp
X2tConverter/src/cextracttools.cpp
+1
-1
X2tConverter/src/cextracttools.h
X2tConverter/src/cextracttools.h
+5
-1
No files found.
X2tConverter/src/ASCConverters.cpp
View file @
f43a0bbf
...
@@ -1675,7 +1675,7 @@ namespace NExtractTools
...
@@ -1675,7 +1675,7 @@ namespace NExtractTools
}
}
// ppt -> pptx
// ppt -> pptx
int
ppt2pptx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
int
ppt2pptx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
{
std
::
wstring
sResultPptxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptx_unpacked"
);
std
::
wstring
sResultPptxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptx_unpacked"
);
NSDirectory
::
CreateDirectory
(
sResultPptxDir
);
NSDirectory
::
CreateDirectory
(
sResultPptxDir
);
...
@@ -1701,14 +1701,15 @@ namespace NExtractTools
...
@@ -1701,14 +1701,15 @@ namespace NExtractTools
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
}
}
return
AVS_FILEUTILS_ERROR_CONVERT
;
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
}
int
ppt2pptx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
int
ppt2pptx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
{
COfficePPTFile
pptFile
;
COfficePPTFile
pptFile
;
pptFile
.
put_TempDirectory
(
sTemp
);
pptFile
.
put_TempDirectory
(
sTemp
);
long
hRes
=
pptFile
.
LoadFromFile
(
sFrom
,
sTo
,
params
.
getPassword
());
bool
bMacros
=
false
;
long
hRes
=
pptFile
.
LoadFromFile
(
sFrom
,
sTo
,
params
.
getPassword
(),
bMacros
);
if
(
AVS_ERROR_DRM
==
hRes
)
if
(
AVS_ERROR_DRM
==
hRes
)
{
{
...
@@ -1723,10 +1724,62 @@ namespace NExtractTools
...
@@ -1723,10 +1724,62 @@ namespace NExtractTools
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
}
}
return
0
==
hRes
?
0
:
AVS_FILEUTILS_ERROR_CONVERT
;
return
0
==
hRes
?
0
:
AVS_FILEUTILS_ERROR_CONVERT
;
}
}
// ppt -> pptm
int
ppt2pptm
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
std
::
wstring
sResultPptxDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptx_unpacked"
);
NSDirectory
::
CreateDirectory
(
sResultPptxDir
);
int
hRes
=
ppt2pptm_dir
(
sFrom
,
sResultPptxDir
,
sTemp
,
params
);
if
(
SUCCEEDED_X2T
(
hRes
))
{
COfficeUtils
oCOfficeUtils
(
NULL
);
if
(
S_OK
==
oCOfficeUtils
.
CompressFileOrDirectory
(
sResultPptxDir
,
sTo
,
true
))
return
0
;
}
else
if
(
AVS_ERROR_DRM
==
hRes
)
{
if
(
!
params
.
getDontSaveAdditional
())
{
copyOrigin
(
sFrom
,
*
params
.
m_sFileTo
);
}
return
AVS_FILEUTILS_ERROR_CONVERT_DRM
;
}
else
if
(
AVS_ERROR_PASSWORD
==
hRes
)
{
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
}
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
int
ppt2pptm_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
COfficePPTFile
pptFile
;
pptFile
.
put_TempDirectory
(
sTemp
);
bool
bMacros
=
true
;
long
hRes
=
pptFile
.
LoadFromFile
(
sFrom
,
sTo
,
params
.
getPassword
(),
bMacros
);
if
(
AVS_ERROR_DRM
==
hRes
)
{
if
(
!
params
.
getDontSaveAdditional
())
{
copyOrigin
(
sFrom
,
*
params
.
m_sFileTo
);
}
return
AVS_FILEUTILS_ERROR_CONVERT_DRM
;
}
else
if
(
AVS_ERROR_PASSWORD
==
hRes
)
{
return
AVS_FILEUTILS_ERROR_CONVERT_PASSWORD
;
}
return
0
==
hRes
?
0
:
AVS_FILEUTILS_ERROR_CONVERT
;
}
// ppt -> pptt
// ppt -> pptt
int
ppt2pptt
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
int
ppt2pptt
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
{
std
::
wstring
sResultPpttDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptt_unpacked"
);
std
::
wstring
sResultPpttDir
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptt_unpacked"
);
std
::
wstring
sTempPpttFileEditor
=
sResultPpttDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
std
::
wstring
sTempPpttFileEditor
=
sResultPpttDir
+
FILE_SEPARATOR_STR
+
_T
(
"Editor.bin"
);
...
@@ -1743,7 +1796,7 @@ namespace NExtractTools
...
@@ -1743,7 +1796,7 @@ namespace NExtractTools
}
}
// ppt -> pptt_bin
// ppt -> pptt_bin
int
ppt2pptt_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
int
ppt2pptt_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
)
{
{
// unzip pptx to temp folder
// unzip pptx to temp folder
std
::
wstring
sTempUnpackedPPTX
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptx_unpacked"
)
+
FILE_SEPARATOR_STR
;
// leading slash is very important!
std
::
wstring
sTempUnpackedPPTX
=
sTemp
+
FILE_SEPARATOR_STR
+
_T
(
"pptx_unpacked"
)
+
FILE_SEPARATOR_STR
;
// leading slash is very important!
...
@@ -1753,7 +1806,8 @@ namespace NExtractTools
...
@@ -1753,7 +1806,8 @@ namespace NExtractTools
pptFile
.
put_TempDirectory
(
sTemp
);
pptFile
.
put_TempDirectory
(
sTemp
);
long
nRes
=
pptFile
.
LoadFromFile
(
sFrom
,
sTempUnpackedPPTX
,
params
.
getPassword
());
bool
bMacros
=
true
;
long
nRes
=
pptFile
.
LoadFromFile
(
sFrom
,
sTempUnpackedPPTX
,
params
.
getPassword
(),
bMacros
);
if
(
SUCCEEDED_X2T
(
nRes
))
if
(
SUCCEEDED_X2T
(
nRes
))
{
{
...
@@ -3970,6 +4024,10 @@ namespace NExtractTools
...
@@ -3970,6 +4024,10 @@ namespace NExtractTools
case
TCD_PPT2PPTX
:
case
TCD_PPT2PPTX
:
{
{
result
=
ppt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
result
=
ppt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPT2PPTM
:
{
result
=
ppt2pptm
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
}
break
;
case
TCD_PPT2PPTT
:
case
TCD_PPT2PPTT
:
{
{
...
...
X2tConverter/src/ASCConverters.h
View file @
f43a0bbf
...
@@ -115,6 +115,8 @@ namespace NExtractTools
...
@@ -115,6 +115,8 @@ namespace NExtractTools
int
ppt2pptx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptt_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptt_bin
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptt
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptt
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptm
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
ppt2pptm_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
rtf2docx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
rtf2docx
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
rtf2docx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
int
rtf2docx_dir
(
const
std
::
wstring
&
sFrom
,
const
std
::
wstring
&
sTo
,
const
std
::
wstring
&
sTemp
,
InputParams
&
params
);
...
...
X2tConverter/src/cextracttools.cpp
View file @
f43a0bbf
...
@@ -261,7 +261,7 @@ namespace NExtractTools
...
@@ -261,7 +261,7 @@ namespace NExtractTools
case
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT
:
case
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT
:
{
{
if
(
0
==
sExt2
.
compare
(
_T
(
".pptx"
)))
res
=
TCD_PPT2PPTX
;
if
(
0
==
sExt2
.
compare
(
_T
(
".pptx"
)))
res
=
TCD_PPT2PPTX
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".pptm"
)))
res
=
TCD_PPT2PPT
X
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".pptm"
)))
res
=
TCD_PPT2PPT
M
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_PPT2PPTT_BIN
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".bin"
)))
res
=
TCD_PPT2PPTT_BIN
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".pptt"
)))
res
=
TCD_PPT2PPTT
;
else
if
(
0
==
sExt2
.
compare
(
_T
(
".pptt"
)))
res
=
TCD_PPT2PPTT
;
}
break
;
}
break
;
...
...
X2tConverter/src/cextracttools.h
View file @
f43a0bbf
...
@@ -108,6 +108,7 @@ namespace NExtractTools
...
@@ -108,6 +108,7 @@ namespace NExtractTools
TCD_PPT2PPTX
,
TCD_PPT2PPTX
,
TCD_PPT2PPTT
,
TCD_PPT2PPTT
,
TCD_PPT2PPTT_BIN
,
TCD_PPT2PPTT_BIN
,
TCD_PPT2PPTM
,
//doc 2
//doc 2
TCD_DOC2DOCT
,
TCD_DOC2DOCT
,
TCD_DOC2DOCT_BIN
,
TCD_DOC2DOCT_BIN
,
...
@@ -954,7 +955,10 @@ namespace NExtractTools
...
@@ -954,7 +955,10 @@ namespace NExtractTools
else
if
(
0
==
sArg3
.
compare
(
_T
(
"ppt2pptx"
)))
{
else
if
(
0
==
sArg3
.
compare
(
_T
(
"ppt2pptx"
)))
{
res
=
TCD_PPT2PPTX
;
res
=
TCD_PPT2PPTX
;
}
}
else
if
(
0
==
sArg3
.
compare
(
_T
(
"doc2docx"
)))
{
else
if
(
0
==
sArg3
.
compare
(
_T
(
"ppt2pptm"
)))
{
res
=
TCD_PPT2PPTM
;
}
else
if
(
0
==
sArg3
.
compare
(
_T
(
"doc2docx"
)))
{
res
=
TCD_DOC2DOCX
;
res
=
TCD_DOC2DOCX
;
}
}
else
if
(
0
==
sArg3
.
compare
(
_T
(
"doc2docm"
)))
{
else
if
(
0
==
sArg3
.
compare
(
_T
(
"doc2docm"
)))
{
...
...
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