Commit 9be4d6ca authored by ElenaSubbotina's avatar ElenaSubbotina

x2t linux build

parent 9e9da204
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* *
*/ */
#include "FontProcessor.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Xlsx.h" #include "../../Common/DocxFormat/Source/XlsxFormat/Xlsx.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Docx.h" #include "../../Common/DocxFormat/Source/DocxFormat/Docx.h"
......
...@@ -52,8 +52,8 @@ class CPPTXFile : public PPTX::IPPTXEvent ...@@ -52,8 +52,8 @@ class CPPTXFile : public PPTX::IPPTXEvent
{ {
private: private:
PPTX::Folder* m_pFolder; PPTX::Folder* m_pFolder;
std::wstring m_strTempDir; std::wstring m_strTempDir;
std::wstring m_strDirectory; std::wstring m_strDirectory;
// writer to ppty // writer to ppty
std::wstring m_strFontDirectory; std::wstring m_strFontDirectory;
......
...@@ -58,11 +58,10 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct ...@@ -58,11 +58,10 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
GetLongPathName(m_strTempDir.c_str(), buffer, 4096); GetLongPathName(m_strTempDir.c_str(), buffer, 4096);
m_strTempDir = std::wstring(buffer) + std::wstring(L"_PPTX\\"); m_strTempDir = std::wstring(buffer) + std::wstring(L"_PPTX\\");
#else #else
m_strTempDir = NSDirectory::GetTempPath(); m_strTempDir = NSDirectory::GetTempPath() + L"_PPTX/";
m_strTempDir = NSDirectory::GetLongPathName_(m_strTempDir) + std::wstring("_PPTX/");
#endif #endif
// //
m_strFontDirectory = _T(""); m_strFontDirectory = _T("");
m_strMediaDirectory = _T(""); m_strMediaDirectory = _T("");
m_bIsUseSystemFonts = false; m_bIsUseSystemFonts = false;
m_strEmbeddedFontsDirectory = _T(""); m_strEmbeddedFontsDirectory = _T("");
...@@ -70,18 +69,14 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct ...@@ -70,18 +69,14 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
m_strFolderThemes = _T(""); m_strFolderThemes = _T("");
//m_fCallbackResource = fCallbackResource; //m_fCallbackResource = fCallbackResource;
m_fCallbackExtract = fCallbackExtract; m_fCallbackExtract = fCallbackExtract;
m_fCallbackCompress = fCallbackCompress; m_fCallbackCompress = fCallbackCompress;
m_fCallbackProgress = fCallbackProgress; m_fCallbackProgress = fCallbackProgress;
m_pCallbackArg = pCallbackArg; m_pCallbackArg = pCallbackArg;
m_pFolder = NULL; m_pFolder = NULL;
//m_pOfficeUtils = NULL;
//if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&m_pOfficeUtils))
// return S_FALSE;
} }
CPPTXFile::~CPPTXFile() CPPTXFile::~CPPTXFile()
{ {
RELEASEOBJECT(m_pFolder); RELEASEOBJECT(m_pFolder);
...@@ -93,33 +88,16 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath ...@@ -93,33 +88,16 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
{ {
bool res = NSDirectory::CreateDirectory(localTempDir); bool res = NSDirectory::CreateDirectory(localTempDir);
if (res == false) return S_FALSE; if (res == false) return S_FALSE;
//int res = SHCreateDirectoryExW(NULL, localTempDir.GetString(), NULL);
//if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
// return S_FALSE;
put_TempDirectory(sDstPath); put_TempDirectory(sDstPath);
} }
else else
{ {
bool res = NSDirectory::CreateDirectory(m_strTempDir); bool res = NSDirectory::CreateDirectory(m_strTempDir);
if (res == false) return S_FALSE; if (res == false) return S_FALSE;
// int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
// if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
// return S_FALSE;
} }
localTempDir = m_strTempDir; localTempDir = m_strTempDir;
/*
SHFILEOPSTRUCTW shfos;
ZeroMemory(&shfos, sizeof(shfos));
shfos.wFunc = FO_DELETE;
std::wstring _local = localTempDir + std::wstring(L"*.*");
_local.AppendChar(0);
_local.AppendChar(0);
shfos.pFrom = _local.GetString();
shfos.fFlags = FOF_SILENT + FOF_NOCONFIRMATION;
if(SHFileOperationW(&shfos) != 0)
return S_FALSE;
*/
std::wstring srcFileName = sSrcFileName; std::wstring srcFileName = sSrcFileName;
if (m_pCallbackArg) if (m_pCallbackArg)
{ {
...@@ -192,8 +170,8 @@ HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal) ...@@ -192,8 +170,8 @@ HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal)
#else #else
if(NSDirectory::PathIsDirectory(TempStr)) if(NSDirectory::PathIsDirectory(TempStr))
{ {
if(TempStr.Right(1) != _T("/")) if(TempStr[TempStr.length() - 1] != L'/')
TempStr += _T("/"); TempStr += L"/";
m_strTempDir = TempStr; m_strTempDir = TempStr;
} }
#endif #endif
...@@ -336,7 +314,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp ...@@ -336,7 +314,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
NSDirectory::CreateDirectory(m_strMediaDirectory); NSDirectory::CreateDirectory(m_strMediaDirectory);
if (_T("") != m_strEmbeddedFontsDirectory) if (!m_strEmbeddedFontsDirectory.empty())
{ {
NSDirectory::CreateDirectory(m_strEmbeddedFontsDirectory); NSDirectory::CreateDirectory(m_strEmbeddedFontsDirectory);
......
...@@ -127,7 +127,7 @@ namespace NSBinPptxRW ...@@ -127,7 +127,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
std::string __str_ppty((LPSTR)(pBuffer + start_pos), cur_pos - start_pos); std::string __str_ppty((char*)(pBuffer + start_pos), cur_pos - start_pos);
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
cur_pos = start_pos; cur_pos = start_pos;
...@@ -137,7 +137,7 @@ namespace NSBinPptxRW ...@@ -137,7 +137,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
std::string __str_version((LPSTR)(pBuffer + start_pos), cur_pos - start_pos); std::string __str_version((char*)(pBuffer + start_pos), cur_pos - start_pos);
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
cur_pos = start_pos; cur_pos = start_pos;
...@@ -147,7 +147,7 @@ namespace NSBinPptxRW ...@@ -147,7 +147,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos) if (cur_pos == len || cur_pos == start_pos)
return; return;
std::string __str_decode_len_ansi((LPSTR)(pBuffer + start_pos), cur_pos - start_pos); std::string __str_decode_len_ansi((char*)(pBuffer + start_pos), cur_pos - start_pos);
std::wstring __str_decode_len = std::wstring(__str_decode_len_ansi.begin(), __str_decode_len_ansi.end()); std::wstring __str_decode_len = std::wstring(__str_decode_len_ansi.begin(), __str_decode_len_ansi.end());
start_pos = cur_pos + 1; start_pos = cur_pos + 1;
...@@ -158,7 +158,7 @@ namespace NSBinPptxRW ...@@ -158,7 +158,7 @@ namespace NSBinPptxRW
BYTE* pDstBuffer = new BYTE[dstLenTemp]; BYTE* pDstBuffer = new BYTE[dstLenTemp];
int dstLen = dstLenTemp; int dstLen = dstLenTemp;
Base64::Base64Decode((LPCSTR)pBuffer, len, pDstBuffer, &dstLen); Base64::Base64Decode((const char*)pBuffer, len, pDstBuffer, &dstLen);
m_oReader.m_strContentTypes = _T(""); m_oReader.m_strContentTypes = _T("");
m_oReader.Init(pDstBuffer, 0, dstLen); m_oReader.Init(pDstBuffer, 0, dstLen);
......
...@@ -69,7 +69,7 @@ namespace NSCustomShapesConvert ...@@ -69,7 +69,7 @@ namespace NSCustomShapesConvert
}; };
#define VML_GUIDE_COUNT 18 #define VML_GUIDE_COUNT 18
const LPSTR VML_GUIDE_TYPE[VML_GUIDE_COUNT] = { static const char* VML_GUIDE_TYPE[VML_GUIDE_COUNT] = {
"sum", "sum",
"prod", "prod",
"mid", "mid",
......
...@@ -69,7 +69,8 @@ SOURCES += \ ...@@ -69,7 +69,8 @@ SOURCES += \
../Source/Common/Utils.cpp \ ../Source/Common/Utils.cpp \
../Source/Common/Wrap.cpp \ ../Source/Common/Wrap.cpp \
../Source/Common/ZIndex.cpp \ ../Source/Common/ZIndex.cpp \
../Source/Common/SimpleTypes_Word.cpp ../Source/Common/SimpleTypes_Word.cpp \
../Source/SystemUtility/SystemUtility.cpp
} }
...@@ -78,7 +79,6 @@ SOURCES += docxformatlib.cpp \ ...@@ -78,7 +79,6 @@ SOURCES += docxformatlib.cpp \
../Source/Utility/DateTime.cpp \ ../Source/Utility/DateTime.cpp \
../Source/Utility/TxtFile.cpp \ ../Source/Utility/TxtFile.cpp \
../Source/Base/unicode_util.cpp \ ../Source/Base/unicode_util.cpp \
../Source/SystemUtility/SystemUtility.cpp \
../../3dParty/pole/pole.cpp ../../3dParty/pole/pole.cpp
HEADERS += docxformatlib.h \ HEADERS += docxformatlib.h \
......
...@@ -68,3 +68,4 @@ ...@@ -68,3 +68,4 @@
#include "../Source/Common/Wrap.cpp" #include "../Source/Common/Wrap.cpp"
#include "../Source/Common/ZIndex.cpp" #include "../Source/Common/ZIndex.cpp"
#include "../Source/Common/SimpleTypes_Word.cpp" #include "../Source/Common/SimpleTypes_Word.cpp"
#include "../Source/SystemUtility/SystemUtility.cpp"
...@@ -70,6 +70,9 @@ core_mac { ...@@ -70,6 +70,9 @@ core_mac {
INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3 INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
} }
INCLUDEPATH += ../../../DesktopEditor/xml/build/qt
INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include
...@@ -91,13 +94,15 @@ DEPENDPATH += $$PWD/../../../ASCOfficeDocxFile2 ...@@ -91,13 +94,15 @@ DEPENDPATH += $$PWD/../../../ASCOfficeDocxFile2
############################################################################################################## ##############################################################################################################
SOURCES += ../../src/cextracttools.cpp \ SOURCES += ../../src/cextracttools.cpp \
../../../Common/OfficeFileFormatChecker2.cpp \ ../../../Common/OfficeFileFormatChecker2.cpp \
../../src/ASCConverters.cpp ../../src/ASCConverters.cpp \
HEADERS += ../../src/cextracttools.h \ ../../../DesktopEditor/xml/src/xmllight.cpp \
../../../Common/OfficeFileFormatChecker.h \ ../../../DesktopEditor/xml/src/xmldom.cpp
../../src/ASCConverters.h \ HEADERS += ../../src/cextracttools.h \
../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h ../../../Common/OfficeFileFormatChecker.h \
../../src/ASCConverters.h \
../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h
#Xls file #Xls file
......
This diff is collapsed.
...@@ -750,7 +750,7 @@ namespace NExtractTools ...@@ -750,7 +750,7 @@ namespace NExtractTools
#if defined(_WIN32) || defined (_WIN64) #if defined(_WIN32) || defined (_WIN64)
options_stream.open(xmlFileName.c_str()); options_stream.open(xmlFileName.c_str());
#else #else
options_stream.open(stringWstingToUtf8String(xmlFileName)); options_stream.open(NSFile::CUtf8Converter::GetUtf8StringFromUnicode(xmlFileName));
#endif #endif
if (options_stream.is_open()) if (options_stream.is_open())
{ {
......
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