Commit 5700503e authored by Alexey.Musinov's avatar Alexey.Musinov

fix build converter ios

parent d01b1e7d
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1991E27B4B800A129E2 /* RtfWriter.cpp */; }; 6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1991E27B4B800A129E2 /* RtfWriter.cpp */; };
6967B1C21E27B4B800A129E2 /* OOXDocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B19F1E27B4B800A129E2 /* OOXDocumentWriter.cpp */; }; 6967B1C21E27B4B800A129E2 /* OOXDocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B19F1E27B4B800A129E2 /* OOXDocumentWriter.cpp */; };
6967B1C31E27B4B800A129E2 /* OOXWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1A81E27B4B800A129E2 /* OOXWriter.cpp */; }; 6967B1C31E27B4B800A129E2 /* OOXWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1A81E27B4B800A129E2 /* OOXWriter.cpp */; };
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69ACB6D11E7A983400096E94 /* svg_parser.cpp */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -167,6 +168,8 @@ ...@@ -167,6 +168,8 @@
6967B1C61E27B81B00A129E2 /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuilder.h; path = ../../../../DesktopEditor/common/StringBuilder.h; sourceTree = "<group>"; }; 6967B1C61E27B81B00A129E2 /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuilder.h; path = ../../../../DesktopEditor/common/StringBuilder.h; sourceTree = "<group>"; };
6967B1C71E27B89400A129E2 /* PPTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PPTShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h; sourceTree = "<group>"; }; 6967B1C71E27B89400A129E2 /* PPTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PPTShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h; sourceTree = "<group>"; };
6967B1C81E27B8F900A129E2 /* BaseShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.h; sourceTree = "<group>"; }; 6967B1C81E27B8F900A129E2 /* BaseShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.h; sourceTree = "<group>"; };
69ACB6D11E7A983400096E94 /* svg_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = svg_parser.cpp; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.cpp; sourceTree = "<group>"; };
69ACB6D21E7A983400096E94 /* svg_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = svg_parser.h; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.h; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -208,6 +211,7 @@ ...@@ -208,6 +211,7 @@
6967B13D1E27B4B800A129E2 /* Reader */ = { 6967B13D1E27B4B800A129E2 /* Reader */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
69ACB6D01E7A982B00096E94 /* odf */,
6967B13E1E27B4B800A129E2 /* OOXAbstractNumReader.h */, 6967B13E1E27B4B800A129E2 /* OOXAbstractNumReader.h */,
6967B13F1E27B4B800A129E2 /* OOXAppReader.h */, 6967B13F1E27B4B800A129E2 /* OOXAppReader.h */,
6967B1401E27B4B800A129E2 /* OOXBorderReader.h */, 6967B1401E27B4B800A129E2 /* OOXBorderReader.h */,
...@@ -355,6 +359,15 @@ ...@@ -355,6 +359,15 @@
name = common; name = common;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
69ACB6D01E7A982B00096E94 /* odf */ = {
isa = PBXGroup;
children = (
69ACB6D11E7A983400096E94 /* svg_parser.cpp */,
69ACB6D21E7A983400096E94 /* svg_parser.h */,
);
name = odf;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
...@@ -419,6 +432,7 @@ ...@@ -419,6 +432,7 @@
6967B1B61E27B4B800A129E2 /* RtfField.cpp in Sources */, 6967B1B61E27B4B800A129E2 /* RtfField.cpp in Sources */,
6967B1BB1E27B4B800A129E2 /* RtfParagraph.cpp in Sources */, 6967B1BB1E27B4B800A129E2 /* RtfParagraph.cpp in Sources */,
6967B1AC1E27B4B800A129E2 /* OOXDrawingGraphicReader.cpp in Sources */, 6967B1AC1E27B4B800A129E2 /* OOXDrawingGraphicReader.cpp in Sources */,
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */,
6967B1AD1E27B4B800A129E2 /* OOXHeaderReader.cpp in Sources */, 6967B1AD1E27B4B800A129E2 /* OOXHeaderReader.cpp in Sources */,
6967B1B31E27B4B800A129E2 /* RtfBookmark.cpp in Sources */, 6967B1B31E27B4B800A129E2 /* RtfBookmark.cpp in Sources */,
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */, 6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */,
...@@ -547,6 +561,7 @@ ...@@ -547,6 +561,7 @@
PPT_DEF, PPT_DEF,
_IOS, _IOS,
DONT_WRITE_EMBEDDED_FONTS, DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
); );
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -579,6 +594,7 @@ ...@@ -579,6 +594,7 @@
PPT_DEF, PPT_DEF,
_IOS, _IOS,
DONT_WRITE_EMBEDDED_FONTS, DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
); );
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
......
...@@ -344,52 +344,41 @@ namespace NExtractTools ...@@ -344,52 +344,41 @@ namespace NExtractTools
else return AVS_FILEUTILS_ERROR_CONVERT; else return AVS_FILEUTILS_ERROR_CONVERT;
} }
return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, params); return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, sTemp, params);
} }
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params) int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{ {
// convert unzipped pptx to unzipped pptt // convert unzipped pptx to unzipped pptt
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL); CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
int nRes = 0; int nRes = 0;
if (pptx_file) if (pptx_file)
{ {
#if defined(_WIN32) || defined (_WIN64) pptx_file->put_TempDirectory(sTemp);
BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
BSTR bstrTempUnpackedPPTX = SysAllocString(sFrom.c_str());
BSTR bstrTo = SysAllocString(sTo.c_str());
pptx_file->SetFontDir (bstrFontPath);
nRes = (S_OK == pptx_file->OpenFileToPPTY (bstrTempUnpackedPPTX, bstrTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
SysFreeString(bstrFontPath);
SysFreeString(bstrTempUnpackedPPTX);
SysFreeString(bstrTo);
#else
pptx_file->SetFontDir (params.getFontPath()); pptx_file->SetFontDir (params.getFontPath());
nRes = (S_OK == pptx_file->OpenFileToPPTY (sFrom, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT; nRes = (S_OK == pptx_file->OpenFileToPPTY (sFrom, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
#endif
delete pptx_file; delete pptx_file;
} }
return nRes; return nRes;
} }
// pptx -> pptt // pptx -> pptt
int pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params) int pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{ {
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked"; std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin"; std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
NSDirectory::CreateDirectory(sResultPpttDir); NSDirectory::CreateDirectory(sResultPpttDir);
int nRes = pptx2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params); int nRes = pptx2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
if (SUCCEEDED_X2T(nRes)) if (SUCCEEDED_X2T(nRes))
{ {
// zip pptt folder to output file // zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL); COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT; nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
} }
return nRes; return nRes;
} }
...@@ -2160,36 +2149,36 @@ namespace NExtractTools ...@@ -2160,36 +2149,36 @@ namespace NExtractTools
} }
int fromPptxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params) int fromPptxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{ {
int nRes = 0; int nRes = 0;
if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo)) if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
{ {
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo) if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
{ {
nRes = dir2zip(sFrom, sTo); nRes = dir2zip(sFrom, sTo);
} }
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo) //else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo)
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo) //else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo)
else else
nRes = AVS_FILEUTILS_ERROR_CONVERT; nRes = AVS_FILEUTILS_ERROR_CONVERT;
} }
else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo) else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
{ {
nRes = pptx_dir2pptt_bin(sFrom, sTo, params); nRes = pptx_dir2pptt_bin(sFrom, sTo, sTemp, params);
} }
else else
{ {
std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked"; std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
NSDirectory::CreateDirectory(sPpttDir); NSDirectory::CreateDirectory(sPpttDir);
std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + L"Editor.bin"; std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
nRes = pptx_dir2pptt_bin(sFrom, sTFile, params); nRes = pptx_dir2pptt_bin(sFrom, sTFile, sTemp, params);
if(SUCCEEDED_X2T(nRes)) if(SUCCEEDED_X2T(nRes))
{ {
nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params); nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
} }
} }
return nRes; return nRes;
} }
int fromPpttBin(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params) int fromPpttBin(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment