Commit 45a44e9f authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

linux build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59074 954022d7-b5bf-4e40-9824-e11837661b57
parent e930e852
...@@ -2,8 +2,14 @@ ...@@ -2,8 +2,14 @@
#define ASC_OFFICE_PPTX_FILE #define ASC_OFFICE_PPTX_FILE
//todo //todo
#include <atlbase.h> #ifdef _WIN32
#include <atlstr.h> #include <atlbase.h>
#include <atlstr.h>
#else
#include "../DesktopEditor/common/ASCVariant.h"
#include "../../../Common/DocxFormat/Source/Base/ASCString.h"
#endif
#include "../Common/DocxFormat/Source/Base/Base.h" #include "../Common/DocxFormat/Source/Base/Base.h"
#include "PPTXFormat/PPTXEvent.h" #include "PPTXFormat/PPTXEvent.h"
...@@ -44,17 +50,18 @@ public: ...@@ -44,17 +50,18 @@ public:
CPPTXFile(load_from_resource fCallbackResource, extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg); CPPTXFile(load_from_resource fCallbackResource, extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg);
~CPPTXFile(); ~CPPTXFile();
public:
HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions); HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions);
public:
HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions); HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions);
public:
#ifdef WIN32
STDMETHOD(get_TempDirectory)(BSTR* pVal); STDMETHOD(get_TempDirectory)(BSTR* pVal);
STDMETHOD(put_TempDirectory)(BSTR newVal); STDMETHOD(put_TempDirectory)(BSTR newVal);
public:
STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml); STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml);
STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml); STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml);
public:
STDMETHOD(get_DrawingXml)(BSTR* pVal); STDMETHOD(get_DrawingXml)(BSTR* pVal);
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue); STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue);
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue); STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue);
...@@ -67,8 +74,30 @@ public: ...@@ -67,8 +74,30 @@ public:
STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput); STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput);
STDMETHOD(OpenDirectoryToPPTY)(BSTR bsInput, BSTR bsOutput); STDMETHOD(OpenDirectoryToPPTY)(BSTR bsInput, BSTR bsOutput);
STDMETHOD(ConvertPPTYToPPTX)(BSTR bsInput, BSTR bsOutput); STDMETHOD(ConvertPPTYToPPTX)(BSTR bsInput, BSTR bsOutput);
#else
HRESULT get_TempDirectory(BSTR* pVal);
HRESULT put_TempDirectory(BSTR newVal);
HRESULT GetDVDXml(BSTR* pbstrPTTXml);
HRESULT GetBluRayXml(BSTR* pbstrDVDXml);
HRESULT get_DrawingXml(BSTR* pVal);
HRESULT SetAdditionalParam(BSTR ParamName, VARIANT ParamValue);
HRESULT GetAdditionalParam(BSTR ParamName, VARIANT* ParamValue);
virtual bool Progress(long ID, long Percent);
// to PPTY
HRESULT SetMediaDir(BSTR bsMediaDir);
HRESULT SetFontDir(BSTR bsFontDir);
HRESULT SetThemesDir(BSTR bsDir);
HRESULT SetUseSystemFonts(VARIANT_BOOL useSystemFonts);
HRESULT OpenFileToPPTY(BSTR bsInput, BSTR bsOutput);
HRESULT OpenDirectoryToPPTY(BSTR bsInput, BSTR bsOutput);
HRESULT ConvertPPTYToPPTX(BSTR bsInput, BSTR bsOutput);
#endif
private: private:
INT32 RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true); int RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true);
}; };
#endif //ASC_OFFICE_PPTX_FILE #endif //ASC_OFFICE_PPTX_FILE
\ No newline at end of file
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#include "PPTXFormat/PPTXEvent.h" #include "PPTXFormat/PPTXEvent.h"
#ifdef _WIN32 #ifdef _WIN32
#include <shellapi.h> #include <shellapi.h>
#include <shlobj.h> #include <shlobj.h>
#include <shlwapi.h> #include <shlwapi.h>
#pragma comment( lib, "shell32.lib" ) // shell32.lib #pragma comment( lib, "shell32.lib" ) // shell32.lib
#else #else
#endif #endif
...@@ -346,7 +346,7 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(BSTR bsInput, BSTR bsOutput) ...@@ -346,7 +346,7 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(BSTR bsInput, BSTR bsOutput)
return hRes; return hRes;
} }
INT32 CPPTXFile::RemoveDirOrFile(CString sPath, bool bIsRemoveHead) int CPPTXFile::RemoveDirOrFile(CString sPath, bool bIsRemoveHead)
{ {
DWORD dwFileAttrib = ::GetFileAttributes( sPath ); DWORD dwFileAttrib = ::GetFileAttributes( sPath );
if( dwFileAttrib != INVALID_FILE_ATTRIBUTES ) if( dwFileAttrib != INVALID_FILE_ATTRIBUTES )
......
...@@ -105,13 +105,13 @@ namespace PPTX2EditorAdvanced ...@@ -105,13 +105,13 @@ namespace PPTX2EditorAdvanced
_notesMasters.push_back(noteMaster); _notesMasters.push_back(noteMaster);
// theme // theme
size_t pPointerTh = (size_t)(noteMaster->Theme.operator ->()); size_t pPointerTh = (size_t)(noteMaster->theme_.operator ->());
std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find(pPointerTh); std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find(pPointerTh);
if (pSearchTh == pCommon->themes.end()) if (pSearchTh == pCommon->themes.end())
{ {
LONG lCountTh = (LONG)_themes.size(); LONG lCountTh = (LONG)_themes.size();
pCommon->themes [pPointerTh] = lCountTh; pCommon->themes [pPointerTh] = lCountTh;
_themes.push_back(noteMaster->Theme); _themes.push_back(noteMaster->theme_);
} }
} }
...@@ -377,8 +377,11 @@ namespace PPTX2EditorAdvanced ...@@ -377,8 +377,11 @@ namespace PPTX2EditorAdvanced
if (TRUE == Base64::Base64Encode(pbBinBuffer, nBinBufferLen, (LPSTR)pbBase64Buffer, &nBase64BufferLen, Base64::B64_BASE64_FLAG_NOCRLF)) if (TRUE == Base64::Base64Encode(pbBinBuffer, nBinBufferLen, (LPSTR)pbBase64Buffer, &nBase64BufferLen, Base64::B64_BASE64_FLAG_NOCRLF))
{ {
CFile oFile; CFile oFile;
oFile.CreateFileW(strDstFile); #ifdef WIN32
oFile.CreateFileW(strDstFile);
#else
oFile.CreateFile(strDstFile);
#endif
CString strPrefix = _T(""); CString strPrefix = _T("");
strPrefix.Format(_T("PPTY;v1;%d;"), nBinBufferLen); strPrefix.Format(_T("PPTY;v1;%d;"), nBinBufferLen);
CStringA sW = (CStringA)strPrefix; CStringA sW = (CStringA)strPrefix;
......
...@@ -61,8 +61,10 @@ namespace NSBinPptxRW ...@@ -61,8 +61,10 @@ namespace NSBinPptxRW
CDirectory::CreateDirectory(m_strDstFolder); CDirectory::CreateDirectory(m_strDstFolder);
CDirectory::CreateDirectory(m_strDstFolder, _T("docProps")); CDirectory::CreateDirectory(m_strDstFolder, _T("docProps"));
CString strPPT = m_strDstFolder + _T("\\ppt");
CDirectory::CreateDirectory(strPPT); CString strPPT = m_strDstFolder + _T("\\ppt");
CDirectory::CreateDirectory(strPPT);
CDirectory::CreateDirectory(strPPT, _T("media")); CDirectory::CreateDirectory(strPPT, _T("media"));
m_oImageManager.Clear(); m_oImageManager.Clear();
...@@ -111,7 +113,7 @@ namespace NSBinPptxRW ...@@ -111,7 +113,7 @@ namespace NSBinPptxRW
BYTE* pDstBuffer = new BYTE[dstLenTemp]; BYTE* pDstBuffer = new BYTE[dstLenTemp];
int dstLen = dstLenTemp; int dstLen = dstLenTemp;
Base64Decode((LPCSTR)pBuffer, len, pDstBuffer, &dstLen); Base64::Base64Decode((LPCSTR)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);
...@@ -385,9 +387,12 @@ namespace NSBinPptxRW ...@@ -385,9 +387,12 @@ namespace NSBinPptxRW
CString strFolder = m_strDstFolder + _T("\\ppt\\slides"); CString strFolder = m_strDstFolder + _T("\\ppt\\slides");
CString strFolderRels = strFolder + _T("\\_rels"); CString strFolderRels = strFolder + _T("\\_rels");
CDirectory::CreateDirectory(strFolder); #ifdef WIN32
CDirectory::CreateDirectory(strFolder);
CDirectory::CreateDirectory(strFolderRels); CDirectory::CreateDirectory(strFolderRels);
#else
????
#endif
m_oReader.Seek(pPair->second); m_oReader.Seek(pPair->second);
m_oReader.Skip(4); m_oReader.Skip(4);
......
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