Compare commits

...

2 Commits

Author SHA1 Message Date
cd12777c68 up 2017-06-22 18:27:00 +03:00
0708c1f45a . 2017-06-22 12:32:00 +03:00
3 changed files with 108 additions and 131 deletions

View File

@ -247,9 +247,8 @@ namespace DocFileFormat
{
freeform = false;
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())));
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
}
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
if (pShape->is<LineType>())
{
@ -446,7 +445,7 @@ namespace DocFileFormat
{
yCoord = iter->op;
}break;
// OUTLINE
// LINE
case lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
@ -493,6 +492,21 @@ namespace DocFileFormat
{
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ));
}break;
case cxstyle:
{
if (pShape->GetShapeType() == NULL)
{
freeform = false;
m_pXmlWriter->WriteAttribute(L"type", L"#_x0000_t32");
}
switch(iter->op)
{
case 0: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"straight"); break;
case 1: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"elbow"); break;
case 2: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"curved"); break;
case 3: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"none"); break;
}
}break;
// FILL
case fillColor:
{

View File

@ -39,7 +39,6 @@
6967AFB11E2793A500A129E2 /* cextracttools.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967AFAF1E2793A500A129E2 /* cextracttools.h */; };
6967AFB51E27940600A129E2 /* ASCConverters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967AFB31E27940600A129E2 /* ASCConverters.h */; };
6967AFDF1E279B3600A129E2 /* libTxtXmlFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967AFDC1E279B2300A129E2 /* libTxtXmlFormatLib.a */; };
6967B0B31E27A07100A129E2 /* libPPTFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B0961E27A03800A129E2 /* libPPTFormatLib.a */; };
6967B0D41E27A36E00A129E2 /* libHtmlFile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B0D11E27A35F00A129E2 /* libHtmlFile.a */; };
6967B10A1E27A41B00A129E2 /* libPdfWriter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6967B1091E27A41400A129E2 /* libPdfWriter.a */; };
6967B10F1E27A65600A129E2 /* OfficeFileFormatChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967B10D1E27A65600A129E2 /* OfficeFileFormatChecker.h */; };
@ -242,20 +241,6 @@
remoteGlobalIDString = 6967AFBE1E2798B900A129E2;
remoteInfo = TxtXmlFormatLib;
};
6967B0951E27A03800A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 6967AFFB1E279D3900A129E2;
remoteInfo = PPTFormatLib;
};
6967B0B01E27A06900A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 6967AFFA1E279D3900A129E2;
remoteInfo = PPTFormatLib;
};
6967B0D01E27A35F00A129E2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */;
@ -474,7 +459,6 @@
6967AFAF1E2793A500A129E2 /* cextracttools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cextracttools.h; path = ../../../../src/cextracttools.h; sourceTree = "<group>"; };
6967AFB31E27940600A129E2 /* ASCConverters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCConverters.h; path = ../../../../src/ASCConverters.h; sourceTree = "<group>"; };
6967AFD71E279B2300A129E2 /* TxtXmlFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TxtXmlFormatLib.xcodeproj; path = ../../../../ASCOfficeTxtFile/TxtXmlFormatLib/Mac/TxtXmlFormatLib/TxtXmlFormatLib.xcodeproj; sourceTree = "<group>"; };
6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTFormatLib.xcodeproj; path = ../../../../ASCOfficePPTFile/PPTFormatLib/Mac/PPTFormatLib.xcodeproj; sourceTree = "<group>"; };
6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = HtmlFile.xcodeproj; path = ../../../../HtmlFile/Mac/HtmlFile/HtmlFile.xcodeproj; sourceTree = "<group>"; };
6967B1031E27A41300A129E2 /* PdfWriter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PdfWriter.xcodeproj; path = ../../../../DesktopEditor/ios_projects/PdfWriter/PdfWriter.xcodeproj; sourceTree = "<group>"; };
6967B10D1E27A65600A129E2 /* OfficeFileFormatChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OfficeFileFormatChecker.h; path = ../../../../../Common/OfficeFileFormatChecker.h; sourceTree = "<group>"; };
@ -503,7 +487,6 @@
6967B1D11E27B9D700A129E2 /* libRtfFormatLib.a in Frameworks */,
6967B10A1E27A41B00A129E2 /* libPdfWriter.a in Frameworks */,
6967B0D41E27A36E00A129E2 /* libHtmlFile.a in Frameworks */,
6967B0B31E27A07100A129E2 /* libPPTFormatLib.a in Frameworks */,
6967AFDF1E279B3600A129E2 /* libTxtXmlFormatLib.a in Frameworks */,
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */,
69DA32F11CEE100E00E10AF0 /* libagg_ios.a in Frameworks */,
@ -548,7 +531,6 @@
6967B1C91E27B9C400A129E2 /* RtfFormatLib.xcodeproj */,
6967B1031E27A41300A129E2 /* PdfWriter.xcodeproj */,
6967B0CC1E27A35E00A129E2 /* HtmlFile.xcodeproj */,
6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */,
6967AFD71E279B2300A129E2 /* TxtXmlFormatLib.xcodeproj */,
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */,
69415FAE1CB5243F003E771B /* mng.xcodeproj */,
@ -704,14 +686,6 @@
name = Products;
sourceTree = "<group>";
};
6967B0921E27A03800A129E2 /* Products */ = {
isa = PBXGroup;
children = (
6967B0961E27A03800A129E2 /* libPPTFormatLib.a */,
);
name = Products;
sourceTree = "<group>";
};
6967B0CD1E27A35E00A129E2 /* Products */ = {
isa = PBXGroup;
children = (
@ -865,7 +839,6 @@
6967B1D01E27B9D000A129E2 /* PBXTargetDependency */,
6967B10C1E27A42500A129E2 /* PBXTargetDependency */,
6967B0D31E27A36800A129E2 /* PBXTargetDependency */,
6967B0B11E27A06900A129E2 /* PBXTargetDependency */,
6967AFDE1E279B2D00A129E2 /* PBXTargetDependency */,
69EC66D81E01774D003527E2 /* PBXTargetDependency */,
69DA32F01CEE100700E10AF0 /* PBXTargetDependency */,
@ -995,10 +968,6 @@
ProductGroup = 69415FB21CB5243F003E771B /* Products */;
ProjectRef = 69415FB11CB5243F003E771B /* png.xcodeproj */;
},
{
ProductGroup = 6967B0921E27A03800A129E2 /* Products */;
ProjectRef = 6967B0911E27A03800A129E2 /* PPTFormatLib.xcodeproj */;
},
{
ProductGroup = 69DA325D1CEE09BB00E10AF0 /* Products */;
ProjectRef = 69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */;
@ -1128,13 +1097,6 @@
remoteRef = 6967AFDB1E279B2300A129E2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6967B0961E27A03800A129E2 /* libPPTFormatLib.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libPPTFormatLib.a;
remoteRef = 6967B0951E27A03800A129E2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6967B0D11E27A35F00A129E2 /* libHtmlFile.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1331,11 +1293,6 @@
name = TxtXmlFormatLib;
targetProxy = 6967AFDD1E279B2D00A129E2 /* PBXContainerItemProxy */;
};
6967B0B11E27A06900A129E2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = PPTFormatLib;
targetProxy = 6967B0B01E27A06900A129E2 /* PBXContainerItemProxy */;
};
6967B0D31E27A36800A129E2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = HtmlFile;

View File

@ -758,41 +758,41 @@ namespace NExtractTools
// ppsx -> pptx
int ppsx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
std::wstring sTempUnpackedPPSX = sTemp + FILE_SEPARATOR_STR + L"ppsx_unpacked";
NSDirectory::CreateDirectory(sTempUnpackedPPSX);
int nRes = ppsx2pptx_dir(sFrom, sTempUnpackedPPSX, params);
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, -1))
return 0;
}
// std::wstring sTempUnpackedPPSX = sTemp + FILE_SEPARATOR_STR + L"ppsx_unpacked";
// NSDirectory::CreateDirectory(sTempUnpackedPPSX);
//
// int nRes = ppsx2pptx_dir(sFrom, sTempUnpackedPPSX, params);
// if(SUCCEEDED_X2T(nRes))
// {
// COfficeUtils oCOfficeUtils(NULL);
// if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, -1))
// return 0;
// }
return AVS_FILEUTILS_ERROR_CONVERT;
}
int ppsx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params)
{
COfficeUtils oCOfficeUtils(NULL);
if (S_OK == oCOfficeUtils.ExtractToDirectory(sFrom, sTo, NULL, 0))
{
std::wstring sContentTypesPath = sTo + FILE_SEPARATOR_STR + L"[Content_Types].xml";
if(NSFile::CFileBinary::Exists(sContentTypesPath))
{
std::wstring sData;
if(NSFile::CFileBinary::ReadAllTextUtf8(sContentTypesPath, sData))
{
std::wstring sCTFrom = L"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml";
std::wstring sCTTo = L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
sData = string_replaceAll(sData, sCTFrom, sCTTo);
if(NSFile::CFileBinary::SaveToFile(sContentTypesPath, sData, true))
{
return 0;
}
}
}
}
// COfficeUtils oCOfficeUtils(NULL);
// if (S_OK == oCOfficeUtils.ExtractToDirectory(sFrom, sTo, NULL, 0))
// {
// std::wstring sContentTypesPath = sTo + FILE_SEPARATOR_STR + L"[Content_Types].xml";
// if(NSFile::CFileBinary::Exists(sContentTypesPath))
// {
// std::wstring sData;
// if(NSFile::CFileBinary::ReadAllTextUtf8(sContentTypesPath, sData))
// {
// std::wstring sCTFrom = L"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml";
// std::wstring sCTTo = L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
//
// sData = string_replaceAll(sData, sCTFrom, sCTTo);
//
// if(NSFile::CFileBinary::SaveToFile(sContentTypesPath, sData, true))
// {
// return 0;
// }
// }
// }
// }
return AVS_FILEUTILS_ERROR_CONVERT;
}
@ -812,70 +812,76 @@ namespace NExtractTools
}
return AVS_FILEUTILS_ERROR_CONVERT;
}
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
COfficePPTFile pptFile;
pptFile.put_TempDirectory(sTemp);
return S_OK == pptFile.LoadFromFile(sFrom, sTo) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
//COfficePPTFile pptFile;
//pptFile.put_TempDirectory(sTemp);
//return S_OK == pptFile.LoadFromFile(sFrom, sTo, params.getPassword()) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// ppt -> pptt
int ppt2pptt (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 sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
//std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
//std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
NSDirectory::CreateDirectory(sResultPpttDir);
//NSDirectory::CreateDirectory(sResultPpttDir);
int nRes = ppt2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
if (SUCCEEDED_X2T(nRes))
{
// zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
//int nRes = ppt2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
//if (SUCCEEDED_X2T(nRes))
//{
// // zip pptt folder to output file
// COfficeUtils oCOfficeUtils(NULL);
// nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
//}
//return nRes;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// ppt -> pptt_bin
int ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
// unzip pptx to temp folder
std::wstring sTempUnpackedPPTX = sTemp + FILE_SEPARATOR_STR + L"pptx_unpacked"+ FILE_SEPARATOR_STR; // leading slash is very important!
NSDirectory::CreateDirectory(sTempUnpackedPPTX);
COfficePPTFile pptFile;
pptFile.put_TempDirectory(sTemp);
if ( pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX) != S_OK) return AVS_FILEUTILS_ERROR_CONVERT;
// convert unzipped pptx to unzipped pptt
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
int nRes = 0;
if (pptx_file)
{
#if defined(_WIN32) || defined (_WIN64)
BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
BSTR bstrTempUnpackedPPTX = SysAllocString(sTempUnpackedPPTX.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());
nRes = (S_OK == pptx_file->OpenFileToPPTY (sTempUnpackedPPTX, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
#endif
delete pptx_file;
}
return nRes;
// std::wstring sTempUnpackedPPTX = sTemp + FILE_SEPARATOR_STR + L"pptx_unpacked"+ FILE_SEPARATOR_STR; // leading slash is very important!
//
// NSDirectory::CreateDirectory(sTempUnpackedPPTX);
//
// COfficePPTFile pptFile;
//
// pptFile.put_TempDirectory(sTemp);
//
// if ( pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword()) != S_OK) return AVS_FILEUTILS_ERROR_CONVERT;
//
// // convert unzipped pptx to unzipped pptt
// CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
//
// int nRes = 0;
//
// if (pptx_file)
// {
//#if defined(_WIN32) || defined (_WIN64)
// BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
// BSTR bstrTempUnpackedPPTX = SysAllocString(sTempUnpackedPPTX.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());
// nRes = (S_OK == pptx_file->OpenFileToPPTY (sTempUnpackedPPTX, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
//#endif
// delete pptx_file;
// }
//
// return nRes;
return AVS_FILEUTILS_ERROR_CONVERT;
}
// rtf -> docx