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
fdbd735e
Commit
fdbd735e
authored
Oct 28, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add X2tConverterDll.pro to build x2t as dll
parent
621acc78
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
672 additions
and
582 deletions
+672
-582
X2tConverter/build/Qt/X2tConverter.pri
X2tConverter/build/Qt/X2tConverter.pri
+166
-0
X2tConverter/build/Qt/X2tConverter.pro
X2tConverter/build/Qt/X2tConverter.pro
+3
-160
X2tConverter/build/Qt/X2tConverterDll.pro
X2tConverter/build/Qt/X2tConverterDll.pro
+14
-0
X2tConverter/build/Qt/X2tSLN.pri
X2tConverter/build/Qt/X2tSLN.pri
+62
-0
X2tConverter/build/Qt/X2tSLN.pro
X2tConverter/build/Qt/X2tSLN.pro
+2
-61
X2tConverter/build/Qt/X2tSLNDll.pro
X2tConverter/build/Qt/X2tSLNDll.pro
+4
-0
X2tConverter/src/ASCConverters.cpp
X2tConverter/src/ASCConverters.cpp
+330
-0
X2tConverter/src/ASCConverters.h
X2tConverter/src/ASCConverters.h
+11
-0
X2tConverter/src/cextracttools.h
X2tConverter/src/cextracttools.h
+74
-54
X2tConverter/src/main.cpp
X2tConverter/src/main.cpp
+6
-307
No files found.
X2tConverter/build/Qt/X2tConverter.pri
0 → 100644
View file @
fdbd735e
#-------------------------------------------------
#
# Project created by QtCreator 2014-10-03T18:30:31
#
#-------------------------------------------------
QT -= core
QT -= gui
VERSION = 2.0.2.402
DEFINES += INTVER=$$VERSION
TARGET = x2t
CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD
CONFIG += core_static_link_libstd
CONFIG += core_x2t
include(../../../Common/base.pri)
include(../../../Common/3dParty/icu/icu.pri)
core_windows {
QMAKE_LFLAGS += /INCREMENTAL:NO
contains(QMAKE_TARGET.arch, x86_64):{
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
} else {
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
}
} else {
QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}
#CONFIG += build_for_centos6
build_for_centos6 {
QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux-x86-64.so.2
}
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
PPTX_DEF\
PPT_DEF\
ENABLE_PPT_TO_PPTX_CONVERT\
NODOCX \
#DISABLE_FILE_DOWNLOADER \
FILTER_FLATE_DECODE_ENABLED \
CXIMAGE_DONT_DECLARE_TCHAR \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
LIBXML_READER_ENABLED
DEFINES += PDFREADER_USE_DYNAMIC_LIBRARY
DEFINES += PDFWRITER_USE_DYNAMIC_LIBRARY
DEFINES += XPS_USE_DYNAMIC_LIBRARY
DEFINES += DJVU_USE_DYNAMIC_LIBRARY
DEFINES += HTMLRENDERER_USE_DYNAMIC_LIBRARY
DEFINES += HTMLFILE_USE_DYNAMIC_LIBRARY
DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY
core_windows {
INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}
core_mac {
INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}
INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include
INCLUDEPATH += $$PWD/../../../Common/DocxFormat
DEPENDPATH += $$PWD/../../../Common/DocxFormat
INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/
INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/
INCLUDEPATH += $$PWD/../../../OfficeUtils/src
DEPENDPATH += $$PWD/../../../OfficeUtils/src
INCLUDEPATH += $$PWD/../../../ASCOfficeDocxFile2
DEPENDPATH += $$PWD/../../../ASCOfficeDocxFile2
##############################################################################################################
SOURCES += ../../src/cextracttools.cpp \
../../../Common/OfficeFileFormatChecker2.cpp \
../../src/ASCConverters.cpp
HEADERS += ../../src/cextracttools.h \
../../../Common/OfficeFileFormatChecker.h \
../../src/ASCConverters.h \
../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h
#Xls file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXlsFormatLib
# odf format writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileWriterLib
# odf format reader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileReaderLib
#doc file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocFormatLib
# ppt file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPptFormatLib
#rtf file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lRtfFormatLib
#txt(xml) file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lTxtXmlFormatLib
# pdf writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfWriter
#docxfile2
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lASCOfficeDocxFile2Lib
#pptxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPPTXFormatLib
#docxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocxFormatLib
#office utils
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOfficeUtils
#graphics
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics
#doctrenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -ldoctrenderer
#HtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfReader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDjVuFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXpsFile
#HtmlFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlFile
#UnicodeConverter
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter
#Crypto++
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib
#####################################################
# внешнее подключение сторонних библиотек
#BOOST
CONFIG += core_boost_regex
include($$PWD/../../../Common/3dParty/boost/boost.pri)
core_windows {
LIBS += -lurlmon
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
}
core_linux {
LIBS += -lz
LIBS += -lxml2
LIBS += -lcurl
}
mac {
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
LIBS += -framework AppKit
}
########################################################
X2tConverter/build/Qt/X2tConverter.pro
View file @
fdbd735e
...
...
@@ -4,105 +4,13 @@
#
#-------------------------------------------------
QT
-=
core
QT
-=
gui
VERSION
=
2.0
.
2.402
DEFINES
+=
INTVER
=
$$
VERSION
TEMPLATE
=
app
CONFIG
+=
console
CONFIG
-=
app_bundle
TARGET
=
x2t
CORE_ROOT_DIR
=
$$
PWD
/../../..
PWD_ROOT_DIR
=
$$
PWD
CONFIG
+=
core_static_link_libstd
CONFIG
+=
core_x2t
include
(..
/../../
Common
/
base
.
pri
)
include
(..
/../../
Common
/
3
dParty
/
icu
/
icu
.
pri
)
core_windows
{
QMAKE_LFLAGS
+=
/
INCREMENTAL
:
NO
contains
(
QMAKE_TARGET
.
arch
,
x86_64
)
:
{
QMAKE_LFLAGS_CONSOLE
=
/
SUBSYSTEM
:
CONSOLE
,
5.02
}
else
{
QMAKE_LFLAGS_CONSOLE
=
/
SUBSYSTEM
:
CONSOLE
,
5.01
}
}
else
{
QMAKE_CXXFLAGS
+=
-
Wall
-
Wno
-
ignored
-
qualifiers
}
#
CONFIG
+=
build_for_centos6
build_for_centos6
{
QMAKE_LFLAGS
+=
-
Wl
,
--
dynamic
-
linker
=./
ld
-
linux
-
x86
-
64
.
so
.
2
}
DEFINES
+=
UNICODE
\
_UNICODE
\
_USE_LIBXML2_READER_
\
_USE_XMLLITE_READER_
\
USE_LITE_READER
\
PPTX_DEF
\
PPT_DEF
\
ENABLE_PPT_TO_PPTX_CONVERT
\
NODOCX
\
#
DISABLE_FILE_DOWNLOADER
\
FILTER_FLATE_DECODE_ENABLED
\
CXIMAGE_DONT_DECLARE_TCHAR
\
BUILD_CONFIG_FULL_VERSION
\
DONT_WRITE_EMBEDDED_FONTS
\
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
\
LIBXML_READER_ENABLED
DEFINES
+=
PDFREADER_USE_DYNAMIC_LIBRARY
DEFINES
+=
PDFWRITER_USE_DYNAMIC_LIBRARY
DEFINES
+=
XPS_USE_DYNAMIC_LIBRARY
DEFINES
+=
DJVU_USE_DYNAMIC_LIBRARY
DEFINES
+=
HTMLRENDERER_USE_DYNAMIC_LIBRARY
DEFINES
+=
HTMLFILE_USE_DYNAMIC_LIBRARY
DEFINES
+=
UNICODECONVERTER_USE_DYNAMIC_LIBRARY
core_windows
{
INCLUDEPATH
+=
..
/../../
OfficeUtils
/
src
/
zlib
-
1.2
.
3
}
core_mac
{
INCLUDEPATH
+=
..
/../../
OfficeUtils
/
src
/
zlib
-
1.2
.
3
}
INCLUDEPATH
+=
..
/../../
DesktopEditor
/
xml
/
libxml2
/
include
INCLUDEPATH
+=
..
/../../
DesktopEditor
/
freetype
-
2.5
.
2
/
include
INCLUDEPATH
+=
..
/../../
DesktopEditor
/
agg
-
2.4
/
include
include
(
X2tConverter
.
pri
)
INCLUDEPATH
+=
$$
PWD
/../../../
Common
/
DocxFormat
DEPENDPATH
+=
$$
PWD
/../../../
Common
/
DocxFormat
INCLUDEPATH
+=
$$
PWD
/../../../
ASCOfficePPTXFile
/
DEPENDPATH
+=
$$
PWD
/../../../
ASCOfficePPTXFile
/
INCLUDEPATH
+=
$$
PWD
/../../../
ASCOfficePPTXFile
/
Editor
/
DEPENDPATH
+=
$$
PWD
/../../../
ASCOfficePPTXFile
/
Editor
/
INCLUDEPATH
+=
$$
PWD
/../../../
OfficeUtils
/
src
DEPENDPATH
+=
$$
PWD
/../../../
OfficeUtils
/
src
INCLUDEPATH
+=
$$
PWD
/../../../
ASCOfficeDocxFile2
DEPENDPATH
+=
$$
PWD
/../../../
ASCOfficeDocxFile2
##############################################################################################################
SOURCES
+=
..
/../
src
/
main
.
cpp
\
..
/../
src
/
cextracttools
.
cpp
\
..
/../../
Common
/
OfficeFileFormatChecker2
.
cpp
\
..
/../
src
/
ASCConverters
.
cpp
HEADERS
+=
..
/../
src
/
cextracttools
.
h
\
..
/../../
Common
/
OfficeFileFormatChecker
.
h
\
..
/../
src
/
ASCConverters
.
h
\
..
/../../
DesktopEditor
/
graphics
/
MetafileToGraphicsRenderer
.
h
SOURCES
+=
..
/../
src
/
main
.
cpp
###############################################################################################################
...
...
@@ -125,69 +33,4 @@ core_linux_32 {
}
core_mac
{
DESTDIR
=
$$
DESTDIR
/
mac
}
#
Xls
file
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lXlsFormatLib
#
odf
format
writer
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lOdfFileWriterLib
#
odf
format
reader
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lOdfFileReaderLib
#
doc
file
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lDocFormatLib
#
ppt
file
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lPptFormatLib
#
rtf
file
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lRtfFormatLib
#
txt
(
xml
)
file
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lTxtXmlFormatLib
#
pdf
writer
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lPdfWriter
#
docxfile2
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lASCOfficeDocxFile2Lib
#
pptxformat
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lPPTXFormatLib
#
docxformat
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lDocxFormatLib
#
office
utils
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lOfficeUtils
#
graphics
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lgraphics
#
doctrenderer
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
ldoctrenderer
#
HtmlRenderer
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lHtmlRenderer
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lPdfReader
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lDjVuFile
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lXpsFile
#
HtmlFile
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lHtmlFile
#
UnicodeConverter
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lUnicodeConverter
#
Crypto
++
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
lCryptoPPLib
#####################################################
#
внешнее
подключение
сторонних
библиотек
#
BOOST
CONFIG
+=
core_boost_regex
include
(
$$
PWD
/../../../
Common
/
3
dParty
/
boost
/
boost
.
pri
)
core_windows
{
LIBS
+=
-
lurlmon
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
llibxml
}
core_linux
{
LIBS
+=
-
lz
LIBS
+=
-
lxml2
LIBS
+=
-
lcurl
}
mac
{
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
-
llibxml
LIBS
+=
-
framework
AppKit
}
########################################################
}
\ No newline at end of file
X2tConverter/build/Qt/X2tConverterDll.pro
0 → 100644
View file @
fdbd735e
#-------------------------------------------------
#
#
Project
created
by
QtCreator
2014
-
10
-
03
T18
:
30
:
31
#
#-------------------------------------------------
TEMPLATE
=
lib
CONFIG
+=
shared
CONFIG
+=
plugin
include
(
X2tConverter
.
pri
)
DEFINES
+=
X2T_USE_DYNAMIC_LIBRARY
\ No newline at end of file
X2tConverter/build/Qt/X2tSLN.pri
0 → 100644
View file @
fdbd735e
TEMPLATE = subdirs
CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD
include(../../../Common/base.pri)
SUBDIRS = \
OfficeUtils \
graphics \
cryptopp \
DocxFormatLib \
PPTXFormatLib \
ASCOfficeDocxFile2Lib \
TxtXmlFormatLib \
RtfFormatLib \
PptFormatLib \
DocFormatLib \
OdfFileReaderLib \
OdfFileWriterLib \
XlsFormatLib \
XmlLib \
X2tConverter
OfficeUtils.file = ../../../OfficeUtils/OfficeUtils.pro
graphics.file = ../../../DesktopEditor/Qt_build/graphics/project/graphics.pro
cryptopp.file = ../../../Common/3dParty/cryptopp/project/cryptopp.pro
DocxFormatLib.file = ../../../Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro
PPTXFormatLib.file = ../../../ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
ASCOfficeDocxFile2Lib.file = ../../../ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro
TxtXmlFormatLib.file = ../../../ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro
RtfFormatLib.file = ../../../ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro
PptFormatLib.file = ../../../ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro
DocFormatLib.file = ../../../ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro
OdfFileReaderLib.file = ../../../ASCOfficeOdfFile/linux/OdfFileReaderLib.pro
OdfFileWriterLib.file = ../../../ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
XlsFormatLib.file = ../../../ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro
XmlLib.file = ../../../DesktopEditor/xml/build/qt/libxml2.pro
X2tConverter.depends = \
OfficeUtils \
graphics \
cryptopp \
DocxFormatLib \
PPTXFormatLib \
ASCOfficeDocxFile2Lib \
TxtXmlFormatLib \
RtfFormatLib \
PptFormatLib \
DocFormatLib \
OdfFileReaderLib \
OdfFileWriterLib \
XlsFormatLib
core_windows {
X2tConverter.depends += XmlLib
}
# for run in qt from this solution
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH
include(../../../Common/3dParty/icu/icu.pri)
X2tConverter/build/Qt/X2tSLN.pro
View file @
fdbd735e
TEMPLATE
=
subdirs
CORE_ROOT_DIR
=
$$
PWD
/../../..
PWD_ROOT_DIR
=
$$
PWD
include
(
X2tSLN
.
pri
)
include
(..
/../../
Common
/
base
.
pri
)
SUBDIRS
=
\
OfficeUtils
\
graphics
\
cryptopp
\
DocxFormatLib
\
PPTXFormatLib
\
ASCOfficeDocxFile2Lib
\
TxtXmlFormatLib
\
RtfFormatLib
\
PptFormatLib
\
DocFormatLib
\
OdfFileReaderLib
\
OdfFileWriterLib
\
XlsFormatLib
\
XmlLib
\
X2tConverter
OfficeUtils
.
file
=
..
/../../
OfficeUtils
/
OfficeUtils
.
pro
graphics
.
file
=
..
/../../
DesktopEditor
/
Qt_build
/
graphics
/
project
/
graphics
.
pro
cryptopp
.
file
=
..
/../../
Common
/
3
dParty
/
cryptopp
/
project
/
cryptopp
.
pro
DocxFormatLib
.
file
=
..
/../../
Common
/
DocxFormat
/
DocxFormatLib
/
DocxFormatLib
.
pro
PPTXFormatLib
.
file
=
..
/../../
ASCOfficePPTXFile
/
PPTXLib
/
Linux
/
PPTXFormatLib
/
PPTXFormatLib
.
pro
ASCOfficeDocxFile2Lib
.
file
=
..
/../../
ASCOfficeDocxFile2
/
Linux
/
ASCOfficeDocxFile2Lib
.
pro
TxtXmlFormatLib
.
file
=
..
/../../
ASCOfficeTxtFile
/
TxtXmlFormatLib
/
Linux
/
TxtXmlFormatLib
.
pro
RtfFormatLib
.
file
=
..
/../../
ASCOfficeRtfFile
/
RtfFormatLib
/
Linux
/
RtfFormatLib
.
pro
PptFormatLib
.
file
=
..
/../../
ASCOfficePPTFile
/
PPTFormatLib
/
Linux
/
PPTFormatLib
.
pro
DocFormatLib
.
file
=
..
/../../
ASCOfficeDocFile
/
DocFormatLib
/
Linux
/
DocFormatLib
.
pro
OdfFileReaderLib
.
file
=
..
/../../
ASCOfficeOdfFile
/
linux
/
OdfFileReaderLib
.
pro
OdfFileWriterLib
.
file
=
..
/../../
ASCOfficeOdfFileW
/
linux
/
OdfFileWriterLib
.
pro
XlsFormatLib
.
file
=
..
/../../
ASCOfficeXlsFile2
/
source
/
linux
/
XlsFormatLib
.
pro
XmlLib
.
file
=
..
/../../
DesktopEditor
/
xml
/
build
/
qt
/
libxml2
.
pro
X2tConverter
.
file
=
.
/
X2tConverter
.
pro
X2tConverter
.
depends
=
\
OfficeUtils
\
graphics
\
cryptopp
\
DocxFormatLib
\
PPTXFormatLib
\
ASCOfficeDocxFile2Lib
\
TxtXmlFormatLib
\
RtfFormatLib
\
PptFormatLib
\
DocFormatLib
\
OdfFileReaderLib
\
OdfFileWriterLib
\
XlsFormatLib
core_windows
{
X2tConverter
.
depends
+=
XmlLib
}
#
for
run
in
qt
from
this
solution
LIBS
+=
-
L
$$
CORE_BUILDS_LIBRARIES_PATH
include
(..
/../../
Common
/
3
dParty
/
icu
/
icu
.
pri
)
X2tConverter
.
file
=
.
/
X2tConverter
.
pro
\ No newline at end of file
X2tConverter/build/Qt/X2tSLNDll.pro
0 → 100644
View file @
fdbd735e
include
(
X2tSLN
.
pri
)
X2tConverter
.
file
=
.
/
X2tConverterDll
.
pro
\ No newline at end of file
X2tConverter/src/ASCConverters.cpp
View file @
fdbd735e
...
...
@@ -50,6 +50,7 @@
#include "../../ASCOfficeOdfFile/src/ConvertOO2OOX.h"
#include "../../ASCOfficeOdfFileW/source/Oox2OdfConverter/Oox2OdfConverter.h"
#include "../../DesktopEditor/doctrenderer/doctrenderer.h"
#include "../../DesktopEditor/doctrenderer/docbuilder.h"
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
#include "../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h"
#include "../../PdfReader/PdfReader.h"
...
...
@@ -2436,5 +2437,334 @@ namespace NExtractTools
}
return
AVS_FILEUTILS_ERROR_CONVERT
;
}
int
fromInputParams
(
InputParams
&
oInputParams
)
{
TConversionDirection
conversion
=
oInputParams
.
getConversionDirection
();
std
::
wstring
sFileFrom
=
*
oInputParams
.
m_sFileFrom
;
std
::
wstring
sFileTo
=
*
oInputParams
.
m_sFileTo
;
int
nFormatFrom
=
AVS_OFFICESTUDIO_FILE_UNKNOWN
;
if
(
NULL
!=
oInputParams
.
m_nFormatFrom
)
nFormatFrom
=
*
oInputParams
.
m_nFormatFrom
;
int
nFormatTo
=
AVS_OFFICESTUDIO_FILE_UNKNOWN
;
if
(
NULL
!=
oInputParams
.
m_nFormatTo
)
nFormatTo
=
*
oInputParams
.
m_nFormatTo
;
if
(
TCD_ERROR
==
conversion
)
{
if
(
AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT
==
nFormatFrom
||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
==
nFormatFrom
)
return
AVS_FILEUTILS_ERROR_CONVERT_NEED_PARAMS
;
else
{
// print out conversion direction error
std
::
cerr
<<
"Couldn't recognize conversion direction from an argument"
<<
std
::
endl
;
return
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
;
}
}
if
(
sFileFrom
.
empty
()
||
sFileTo
.
empty
())
{
std
::
cerr
<<
"Empty sFileFrom or sFileTo"
<<
std
::
endl
;
return
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
;
}
// get conversion direction from file extensions
if
(
TCD_AUTO
==
conversion
)
{
conversion
=
getConversionDirectionFromExt
(
sFileFrom
,
sFileTo
);
}
if
(
TCD_ERROR
==
conversion
)
{
// print out conversion direction error
std
::
cerr
<<
"Couldn't automatically recognize conversion direction from extensions"
<<
std
::
endl
;
return
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
;
}
bool
bFromChanges
=
false
;
if
(
NULL
!=
oInputParams
.
m_bFromChanges
)
bFromChanges
=
*
oInputParams
.
m_bFromChanges
;
bool
bPaid
=
true
;
if
(
NULL
!=
oInputParams
.
m_bPaid
)
bPaid
=
*
oInputParams
.
m_bPaid
;
std
::
wstring
sThemeDir
;
if
(
NULL
!=
oInputParams
.
m_sThemeDir
)
sThemeDir
=
*
oInputParams
.
m_sThemeDir
;
InputParamsMailMerge
*
oMailMerge
=
NULL
;
if
(
NULL
!=
oInputParams
.
m_oMailMergeSend
)
oMailMerge
=
oInputParams
.
m_oMailMergeSend
;
std
::
wstring
sTempDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sFileFrom
)
+
FILE_SEPARATOR_STR
+
_T
(
"Temp"
);
NSDirectory
::
CreateDirectory
(
sTempDir
);
if
(
sTempDir
.
empty
())
{
std
::
cerr
<<
"Couldn't create temp folder"
<<
std
::
endl
;
return
AVS_FILEUTILS_ERROR_UNKNOWN
;
}
int
result
=
0
;
switch
(
conversion
)
{
case
TCD_DOCX2DOCT
:
{
result
=
docx2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT2DOCX
:
{
result
=
doct2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2XLST
:
{
result
=
xlsx2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST2XLSX
:
{
result
=
xlst2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_PPTX2PPTT
:
{
result
=
pptx2pptt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPTT2PPTX
:
{
result
=
pptt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_ZIPDIR
:
{
result
=
dir2zip
(
sFileFrom
,
sFileTo
);
}
break
;
case
TCD_UNZIPDIR
:
{
result
=
zip2dir
(
sFileFrom
,
sFileTo
);
}
break
;
case
TCD_CSV2XLSX
:
{
result
=
csv2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_CSV2XLST
:
{
result
=
csv2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2CSV
:
{
result
=
xlsx2csv
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST2CSV
:
{
result
=
xlst2csv
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCX2DOCT_BIN
:
{
result
=
docx2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2DOCX
:
{
result
=
doct_bin2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2XLST_BIN
:
{
result
=
xlsx2xlst_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST_BIN2XLSX
:
{
result
=
xlst_bin2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_PPTX2PPTT_BIN
:
{
result
=
pptx2pptt_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPTT_BIN2PPTX
:
{
result
=
pptt_bin2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_BIN2PDF
:
{
result
=
bin2pdf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bPaid
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_BIN2T
:
{
result
=
dir2zip
(
FileSystem
::
Directory
::
GetFolderPath
(
sFileFrom
),
sFileTo
);
}
break
;
case
TCD_T2BIN
:
{
result
=
zip2dir
(
sFileFrom
,
FileSystem
::
Directory
::
GetFolderPath
(
sFileTo
));
}
break
;
case
TCD_PPSX2PPTX
:
{
result
=
ppsx2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPT2PPTX
:
{
result
=
ppt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
case
TCD_PPT2PPTT
:
{
result
=
ppt2pptt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPT2PPTT_BIN
:
{
result
=
ppt2pptt_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCX
:
{
result
=
rtf2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCT
:
{
result
=
rtf2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCT_BIN
:
{
result
=
rtf2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCX2RTF
:
{
result
=
docx2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOC2DOCX
:
{
result
=
doc2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT2RTF
:
{
result
=
doct2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2RTF
:
{
result
=
doct_bin2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCX
:
{
result
=
txt2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCT
:
{
result
=
txt2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCT_BIN
:
{
result
=
txt2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLSX
:
{
result
=
xls2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLST
:
{
result
=
xls2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLST_BIN
:
{
result
=
xls2xlst_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOX
:
{
result
=
odf2oox
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOT
:
{
result
=
odf2oot
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOT_BIN
:
{
result
=
odf2oot_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
case
TCD_DOCX2ODT
:
{
result
=
docx2odt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2ODS
:
{
result
=
xlsx2ods
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MAILMERGE
:
{
result
=
convertmailmerge
(
*
oMailMerge
,
sFileFrom
,
sFileTo
,
sTempDir
,
bPaid
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_DOCUMENT2
:
{
result
=
fromDocument
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_SPREADSHEET2
:
{
result
=
fromSpreadsheet
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PRESENTATION2
:
{
result
=
fromPresentation
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_T2
:
{
result
=
fromT
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2
:
{
result
=
fromDoctBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_XLST_BIN2
:
{
result
=
fromXlstBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_PPTT_BIN2
:
{
result
=
fromPpttBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_CROSSPLATFORM2
:
{
result
=
fromCrossPlatform
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_CANVAS_PDF2
:
{
result
=
fromCanvasPdf
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2
:
{
result
=
fromMscrypt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2DOCT
:
case
TCD_MSCRYPT2XLST
:
case
TCD_MSCRYPT2PPTT
:
{
result
=
mscrypt2oot
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2BIN
:
result
=
mscrypt2oot_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
{
}
break
;
}
// delete temp dir
NSDirectory
::
DeleteDirectory
(
sTempDir
);
//clean up v8
NSDoctRenderer
::
CDocBuilder
::
Dispose
();
return
result
;
}
int
FromFile
(
const
std
::
wstring
&
file
)
{
InputParams
oInputParams
;
if
(
oInputParams
.
FromXmlFile
(
file
))
{
return
fromInputParams
(
oInputParams
);
}
else
{
return
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
;
}
}
int
FromXml
(
const
std
::
wstring
&
xml
)
{
InputParams
oInputParams
;
if
(
oInputParams
.
FromXml
(
xml
))
{
return
fromInputParams
(
oInputParams
);
}
else
{
return
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
;
}
}
}
X2tConverter/src/ASCConverters.h
View file @
fdbd735e
...
...
@@ -32,6 +32,13 @@
#ifndef ASCCONVERTERS_H
#define ASCCONVERTERS_H
#ifndef X2T_USE_DYNAMIC_LIBRARY
#define X2T_DECL_EXPORT
#else
#include "../../DesktopEditor/common/base_export.h"
#define X2T_DECL_EXPORT Q_DECL_EXPORT
#endif
#include <string>
namespace
NExtractTools
...
...
@@ -141,5 +148,9 @@ namespace NExtractTools
int
fromT
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromCrossPlatform
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromCanvasPdf
(
const
std
::
wstring
&
sFrom
,
int
nFormatFrom
,
const
std
::
wstring
&
sTo
,
int
nFormatTo
,
const
std
::
wstring
&
sTemp
,
const
std
::
wstring
&
sThemeDir
,
bool
bFromChanges
,
bool
bPaid
,
InputParams
&
params
);
int
fromInputParams
(
InputParams
&
oInputParams
);
X2T_DECL_EXPORT
int
FromFile
(
const
std
::
wstring
&
file
);
X2T_DECL_EXPORT
int
FromXml
(
const
std
::
wstring
&
xml
);
}
#endif // ASCCONVERTERS_H
X2tConverter/src/cextracttools.h
View file @
fdbd735e
...
...
@@ -381,69 +381,89 @@ namespace NExtractTools
RELEASEOBJECT
(
m_sPassword
);
}
bool
FromXmlFile
(
std
::
wstring
sFilename
)
bool
FromXmlFile
(
const
std
::
wstring
&
sFilename
)
{
XmlUtils
::
CXmlNode
oRoot
;
if
(
TRUE
==
oRoot
.
FromXmlFile2
(
std_string2string
(
sFilename
)))
{
XmlUtils
::
CXmlNodes
oXmlNodes
;
if
(
TRUE
==
oRoot
.
GetChilds
(
oXmlNodes
))
return
FromXmlNode
(
oRoot
);
}
else
{
return
false
;
}
}
bool
FromXml
(
const
std
::
wstring
&
sXml
)
{
XmlUtils
::
CXmlNode
oRoot
;
if
(
TRUE
==
oRoot
.
FromXmlString
(
std_string2string
(
sXml
)))
{
return
FromXmlNode
(
oRoot
);
}
else
{
return
false
;
}
}
bool
FromXmlNode
(
XmlUtils
::
CXmlNode
&
oRoot
)
{
XmlUtils
::
CXmlNodes
oXmlNodes
;
if
(
TRUE
==
oRoot
.
GetChilds
(
oXmlNodes
))
{
for
(
int
i
=
0
;
i
<
oXmlNodes
.
GetCount
();
++
i
)
{
for
(
int
i
=
0
;
i
<
oXmlNodes
.
GetCount
();
++
i
)
XmlUtils
::
CXmlNode
oXmlNode
;
if
(
oXmlNodes
.
GetAt
(
i
,
oXmlNode
))
{
XmlUtils
::
CXmlNode
oXmlNode
;
if
(
oXmlNodes
.
GetAt
(
i
,
oXmlNode
)
)
std
::
wstring
sName
=
oXmlNode
.
GetName
()
;
if
(
_T
(
"m_oMailMergeSend"
)
==
sName
)
{
std
::
wstring
sName
=
oXmlNode
.
GetName
();
if
(
_T
(
"m_oMailMergeSend"
)
==
sName
)
{
m_oMailMergeSend
=
new
InputParamsMailMerge
();
m_oMailMergeSend
->
FromXmlNode
(
oXmlNode
);
}
else
if
(
_T
(
"m_oThumbnail"
)
==
sName
)
m_oMailMergeSend
=
new
InputParamsMailMerge
();
m_oMailMergeSend
->
FromXmlNode
(
oXmlNode
);
}
else
if
(
_T
(
"m_oThumbnail"
)
==
sName
)
{
m_oThumbnail
=
new
InputParamsThumbnail
();
m_oThumbnail
->
FromXmlNode
(
oXmlNode
);
}
else
{
CString
sValue
;
if
(
oXmlNode
.
GetTextIfExist
(
sValue
))
{
m_oThumbnail
=
new
InputParamsThumbnail
();
m_oThumbnail
->
FromXmlNode
(
oXmlNode
);
if
(
_T
(
"m_sKey"
)
==
sName
)
m_sKey
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFileFrom"
)
==
sName
)
m_sFileFrom
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFileTo"
)
==
sName
)
m_sFileTo
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_nFormatFrom"
)
==
sName
)
m_nFormatFrom
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nFormatTo"
)
==
sName
)
m_nFormatTo
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nCsvTxtEncoding"
)
==
sName
)
m_nCsvTxtEncoding
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nCsvDelimiter"
)
==
sName
)
m_nCsvDelimiter
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_bPaid"
)
==
sName
)
m_bPaid
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_bFromChanges"
)
==
sName
)
m_bFromChanges
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_sAllFontsPath"
)
==
sName
)
m_sAllFontsPath
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFontDir"
)
==
sName
)
m_sFontDir
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sThemeDir"
)
==
sName
)
m_sThemeDir
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_bDontSaveAdditional"
)
==
sName
)
m_bDontSaveAdditional
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_nDoctParams"
)
==
sName
)
m_nDoctParams
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_sHtmlFileInternalPath"
)
==
sName
)
m_sHtmlFileInternalPath
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sPassword"
)
==
sName
)
m_sPassword
=
new
std
::
wstring
(
sValue
);
}
else
{
CString
sValue
;
if
(
oXmlNode
.
GetTextIfExist
(
sValue
))
{
if
(
_T
(
"m_sKey"
)
==
sName
)
m_sKey
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFileFrom"
)
==
sName
)
m_sFileFrom
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFileTo"
)
==
sName
)
m_sFileTo
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_nFormatFrom"
)
==
sName
)
m_nFormatFrom
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nFormatTo"
)
==
sName
)
m_nFormatTo
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nCsvTxtEncoding"
)
==
sName
)
m_nCsvTxtEncoding
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_nCsvDelimiter"
)
==
sName
)
m_nCsvDelimiter
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_bPaid"
)
==
sName
)
m_bPaid
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_bFromChanges"
)
==
sName
)
m_bFromChanges
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_sAllFontsPath"
)
==
sName
)
m_sAllFontsPath
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sFontDir"
)
==
sName
)
m_sFontDir
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sThemeDir"
)
==
sName
)
m_sThemeDir
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_bDontSaveAdditional"
)
==
sName
)
m_bDontSaveAdditional
=
new
bool
(
XmlUtils
::
GetBoolean2
(
sValue
));
else
if
(
_T
(
"m_nDoctParams"
)
==
sName
)
m_nDoctParams
=
new
int
(
XmlUtils
::
GetInteger
(
sValue
));
else
if
(
_T
(
"m_sHtmlFileInternalPath"
)
==
sName
)
m_sHtmlFileInternalPath
=
new
std
::
wstring
(
sValue
);
else
if
(
_T
(
"m_sPassword"
)
==
sName
)
m_sPassword
=
new
std
::
wstring
(
sValue
);
}
}
}
}
}
...
...
X2tConverter/src/main.cpp
View file @
fdbd735e
...
...
@@ -33,11 +33,7 @@
#include "cextracttools.h"
#include "ASCConverters.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/doctrenderer/docbuilder.h"
//#include <iostream>
#include <iostream>
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
...
...
@@ -105,8 +101,6 @@ int main(int argc, char *argv[])
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
);
}
std
::
wstring
sArg1
,
sExePath
;
InputParams
oInputParams
;
TConversionDirection
conversion
=
TCD_AUTO
;
#if !defined(_WIN32) && !defined (_WIN64)
sExePath
=
utf8_to_unicode
(
argv
[
0
]);
...
...
@@ -116,11 +110,11 @@ int main(int argc, char *argv[])
sArg1
=
CA2T
(
argv
[
1
]);
#endif
int
result
=
0
;
std
::
wstring
sXmlExt
=
_T
(
".xml"
);
if
(
sXmlExt
==
sArg1
.
substr
(
sArg1
.
length
()
-
sXmlExt
.
length
(),
sXmlExt
.
length
()))
{
oInputParams
.
FromXmlFile
(
sArg1
);
conversion
=
oInputParams
.
getConversionDirection
();
result
=
NExtractTools
::
FromFile
(
sArg1
);
}
else
{
...
...
@@ -137,6 +131,7 @@ int main(int argc, char *argv[])
if
(
argc
>=
5
)
sArg4
=
CA2T
(
argv
[
4
]);
if
(
argc
>=
6
)
sArg5
=
CA2T
(
argv
[
5
]);
#endif
InputParams
oInputParams
;
oInputParams
.
m_sFileFrom
=
new
std
::
wstring
(
sArg1
);
oInputParams
.
m_sFileTo
=
new
std
::
wstring
(
sArg2
);
//oInputParams.m_sPassword = new std::wstring(L"password");
...
...
@@ -146,304 +141,8 @@ int main(int argc, char *argv[])
{
oInputParams
.
m_sFontDir
=
new
std
::
wstring
(
sArg3
);
}
result
=
NExtractTools
::
fromInputParams
(
oInputParams
);
}
std
::
wstring
sFileFrom
=
*
oInputParams
.
m_sFileFrom
;
std
::
wstring
sFileTo
=
*
oInputParams
.
m_sFileTo
;
int
nFormatFrom
=
AVS_OFFICESTUDIO_FILE_UNKNOWN
;
if
(
NULL
!=
oInputParams
.
m_nFormatFrom
)
nFormatFrom
=
*
oInputParams
.
m_nFormatFrom
;
int
nFormatTo
=
AVS_OFFICESTUDIO_FILE_UNKNOWN
;
if
(
NULL
!=
oInputParams
.
m_nFormatTo
)
nFormatTo
=
*
oInputParams
.
m_nFormatTo
;
if
(
TCD_ERROR
==
conversion
)
{
if
(
AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT
==
nFormatFrom
||
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV
==
nFormatFrom
)
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_CONVERT_NEED_PARAMS
);
else
{
// print out conversion direction error
std
::
cerr
<<
"Couldn't recognize conversion direction from an argument"
<<
std
::
endl
;
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
);
}
}
if
(
sFileFrom
.
empty
()
||
sFileTo
.
empty
())
{
std
::
cerr
<<
"Empty sFileFrom or sFileTo"
<<
std
::
endl
;
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
);
}
// get conversion direction from file extensions
if
(
TCD_AUTO
==
conversion
)
{
conversion
=
getConversionDirectionFromExt
(
sFileFrom
,
sFileTo
);
}
if
(
TCD_ERROR
==
conversion
)
{
// print out conversion direction error
std
::
cerr
<<
"Couldn't automatically recognize conversion direction from extensions"
<<
std
::
endl
;
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_CONVERT_PARAMS
);
}
bool
bFromChanges
=
false
;
if
(
NULL
!=
oInputParams
.
m_bFromChanges
)
bFromChanges
=
*
oInputParams
.
m_bFromChanges
;
bool
bPaid
=
true
;
if
(
NULL
!=
oInputParams
.
m_bPaid
)
bPaid
=
*
oInputParams
.
m_bPaid
;
std
::
wstring
sThemeDir
;
if
(
NULL
!=
oInputParams
.
m_sThemeDir
)
sThemeDir
=
*
oInputParams
.
m_sThemeDir
;
InputParamsMailMerge
*
oMailMerge
=
NULL
;
if
(
NULL
!=
oInputParams
.
m_oMailMergeSend
)
oMailMerge
=
oInputParams
.
m_oMailMergeSend
;
std
::
wstring
sTempDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sFileFrom
)
+
FILE_SEPARATOR_STR
+
_T
(
"Temp"
);
NSDirectory
::
CreateDirectory
(
sTempDir
);
if
(
sTempDir
.
empty
())
{
std
::
cerr
<<
"Couldn't create temp folder"
<<
std
::
endl
;
return
getReturnErrorCode
(
AVS_FILEUTILS_ERROR_UNKNOWN
);
}
int
result
=
0
;
switch
(
conversion
)
{
case
TCD_DOCX2DOCT
:
{
result
=
docx2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT2DOCX
:
{
result
=
doct2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2XLST
:
{
result
=
xlsx2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST2XLSX
:
{
result
=
xlst2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_PPTX2PPTT
:
{
result
=
pptx2pptt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPTT2PPTX
:
{
result
=
pptt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_ZIPDIR
:
{
result
=
dir2zip
(
sFileFrom
,
sFileTo
);
}
break
;
case
TCD_UNZIPDIR
:
{
result
=
zip2dir
(
sFileFrom
,
sFileTo
);
}
break
;
case
TCD_CSV2XLSX
:
{
result
=
csv2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_CSV2XLST
:
{
result
=
csv2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2CSV
:
{
result
=
xlsx2csv
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST2CSV
:
{
result
=
xlst2csv
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCX2DOCT_BIN
:
{
result
=
docx2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2DOCX
:
{
result
=
doct_bin2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2XLST_BIN
:
{
result
=
xlsx2xlst_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLST_BIN2XLSX
:
{
result
=
xlst_bin2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_PPTX2PPTT_BIN
:
{
result
=
pptx2pptt_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPTT_BIN2PPTX
:
{
result
=
pptt_bin2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_BIN2PDF
:
{
result
=
bin2pdf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bPaid
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_BIN2T
:
{
result
=
dir2zip
(
FileSystem
::
Directory
::
GetFolderPath
(
sFileFrom
),
sFileTo
);
}
break
;
case
TCD_T2BIN
:
{
result
=
zip2dir
(
sFileFrom
,
FileSystem
::
Directory
::
GetFolderPath
(
sFileTo
));
}
break
;
case
TCD_PPSX2PPTX
:
{
result
=
ppsx2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPT2PPTX
:
{
result
=
ppt2pptx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
case
TCD_PPT2PPTT
:
{
result
=
ppt2pptt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PPT2PPTT_BIN
:
{
result
=
ppt2pptt_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCX
:
{
result
=
rtf2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCT
:
{
result
=
rtf2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_RTF2DOCT_BIN
:
{
result
=
rtf2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCX2RTF
:
{
result
=
docx2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOC2DOCX
:
{
result
=
doc2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_DOCT2RTF
:
{
result
=
doct2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2RTF
:
{
result
=
doct_bin2rtf
(
sFileFrom
,
sFileTo
,
sTempDir
,
bFromChanges
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCX
:
{
result
=
txt2docx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCT
:
{
result
=
txt2doct
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_TXT2DOCT_BIN
:
{
result
=
txt2doct_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLSX
:
{
result
=
xls2xlsx
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLST
:
{
result
=
xls2xlst
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLS2XLST_BIN
:
{
result
=
xls2xlst_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOX
:
{
result
=
odf2oox
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOT
:
{
result
=
odf2oot
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_ODF2OOT_BIN
:
{
result
=
odf2oot_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
case
TCD_DOCX2ODT
:
{
result
=
docx2odt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_XLSX2ODS
:
{
result
=
xlsx2ods
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MAILMERGE
:
{
result
=
convertmailmerge
(
*
oMailMerge
,
sFileFrom
,
sFileTo
,
sTempDir
,
bPaid
,
sThemeDir
,
oInputParams
);
}
break
;
case
TCD_DOCUMENT2
:
{
result
=
fromDocument
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_SPREADSHEET2
:
{
result
=
fromSpreadsheet
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_PRESENTATION2
:
{
result
=
fromPresentation
(
sFileFrom
,
nFormatFrom
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_T2
:
{
result
=
fromT
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_DOCT_BIN2
:
{
result
=
fromDoctBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_XLST_BIN2
:
{
result
=
fromXlstBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_PPTT_BIN2
:
{
result
=
fromPpttBin
(
sFileFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_CROSSPLATFORM2
:
{
result
=
fromCrossPlatform
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_CANVAS_PDF2
:
{
result
=
fromCanvasPdf
(
sFileFrom
,
nFormatFrom
,
sFileTo
,
nFormatTo
,
sTempDir
,
sThemeDir
,
bFromChanges
,
bPaid
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2
:
{
result
=
fromMscrypt
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2DOCT
:
case
TCD_MSCRYPT2XLST
:
case
TCD_MSCRYPT2PPTT
:
{
result
=
mscrypt2oot
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
}
break
;
case
TCD_MSCRYPT2BIN
:
result
=
mscrypt2oot_bin
(
sFileFrom
,
sFileTo
,
sTempDir
,
oInputParams
);
{
}
break
;
}
// delete temp dir
NSDirectory
::
DeleteDirectory
(
sTempDir
);
//clean up v8
NSDoctRenderer
::
CDocBuilder
::
Dispose
();
return
getReturnErrorCode
(
result
);
return
getReturnErrorCode
(
result
);
}
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