Commit 9be4d6ca authored by ElenaSubbotina's avatar ElenaSubbotina

x2t linux build

parent 9e9da204
......@@ -29,6 +29,7 @@
* 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/DocxFormat/Docx.h"
......
......@@ -52,8 +52,8 @@ class CPPTXFile : public PPTX::IPPTXEvent
{
private:
PPTX::Folder* m_pFolder;
std::wstring m_strTempDir;
std::wstring m_strDirectory;
std::wstring m_strTempDir;
std::wstring m_strDirectory;
// writer to ppty
std::wstring m_strFontDirectory;
......
......@@ -58,11 +58,10 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
GetLongPathName(m_strTempDir.c_str(), buffer, 4096);
m_strTempDir = std::wstring(buffer) + std::wstring(L"_PPTX\\");
#else
m_strTempDir = NSDirectory::GetTempPath();
m_strTempDir = NSDirectory::GetLongPathName_(m_strTempDir) + std::wstring("_PPTX/");
m_strTempDir = NSDirectory::GetTempPath() + L"_PPTX/";
#endif
//
m_strFontDirectory = _T("");
m_strFontDirectory = _T("");
m_strMediaDirectory = _T("");
m_bIsUseSystemFonts = false;
m_strEmbeddedFontsDirectory = _T("");
......@@ -70,18 +69,14 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
m_strFolderThemes = _T("");
//m_fCallbackResource = fCallbackResource;
m_fCallbackExtract = fCallbackExtract;
m_fCallbackExtract = fCallbackExtract;
m_fCallbackCompress = fCallbackCompress;
m_fCallbackProgress = fCallbackProgress;
m_pCallbackArg = pCallbackArg;
m_pCallbackArg = pCallbackArg;
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()
{
RELEASEOBJECT(m_pFolder);
......@@ -93,33 +88,16 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
{
bool res = NSDirectory::CreateDirectory(localTempDir);
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);
}
else
{
bool res = NSDirectory::CreateDirectory(m_strTempDir);
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;
/*
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;
if (m_pCallbackArg)
{
......@@ -192,8 +170,8 @@ HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal)
#else
if(NSDirectory::PathIsDirectory(TempStr))
{
if(TempStr.Right(1) != _T("/"))
TempStr += _T("/");
if(TempStr[TempStr.length() - 1] != L'/')
TempStr += L"/";
m_strTempDir = TempStr;
}
#endif
......@@ -336,7 +314,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
NSDirectory::CreateDirectory(m_strMediaDirectory);
if (_T("") != m_strEmbeddedFontsDirectory)
if (!m_strEmbeddedFontsDirectory.empty())
{
NSDirectory::CreateDirectory(m_strEmbeddedFontsDirectory);
......
......@@ -127,7 +127,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos)
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;
cur_pos = start_pos;
......@@ -137,7 +137,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos)
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;
cur_pos = start_pos;
......@@ -147,7 +147,7 @@ namespace NSBinPptxRW
if (cur_pos == len || cur_pos == start_pos)
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());
start_pos = cur_pos + 1;
......@@ -158,7 +158,7 @@ namespace NSBinPptxRW
BYTE* pDstBuffer = new BYTE[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.Init(pDstBuffer, 0, dstLen);
......
......@@ -69,7 +69,7 @@ namespace NSCustomShapesConvert
};
#define VML_GUIDE_COUNT 18
const LPSTR VML_GUIDE_TYPE[VML_GUIDE_COUNT] = {
static const char* VML_GUIDE_TYPE[VML_GUIDE_COUNT] = {
"sum",
"prod",
"mid",
......
......@@ -69,7 +69,8 @@ SOURCES += \
../Source/Common/Utils.cpp \
../Source/Common/Wrap.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 \
../Source/Utility/DateTime.cpp \
../Source/Utility/TxtFile.cpp \
../Source/Base/unicode_util.cpp \
../Source/SystemUtility/SystemUtility.cpp \
../../3dParty/pole/pole.cpp
HEADERS += docxformatlib.h \
......
......@@ -68,3 +68,4 @@
#include "../Source/Common/Wrap.cpp"
#include "../Source/Common/ZIndex.cpp"
#include "../Source/Common/SimpleTypes_Word.cpp"
#include "../Source/SystemUtility/SystemUtility.cpp"
......@@ -70,6 +70,9 @@ core_mac {
INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}
INCLUDEPATH += ../../../DesktopEditor/xml/build/qt
INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include
......@@ -91,13 +94,15 @@ 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
SOURCES += ../../src/cextracttools.cpp \
../../../Common/OfficeFileFormatChecker2.cpp \
../../src/ASCConverters.cpp \
../../../DesktopEditor/xml/src/xmllight.cpp \
../../../DesktopEditor/xml/src/xmldom.cpp
HEADERS += ../../src/cextracttools.h \
../../../Common/OfficeFileFormatChecker.h \
../../src/ASCConverters.h \
../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h
#Xls file
......
This diff is collapsed.
......@@ -750,7 +750,7 @@ namespace NExtractTools
#if defined(_WIN32) || defined (_WIN64)
options_stream.open(xmlFileName.c_str());
#else
options_stream.open(stringWstingToUtf8String(xmlFileName));
options_stream.open(NSFile::CUtf8Converter::GetUtf8StringFromUnicode(xmlFileName));
#endif
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