From 45a44e9f193312e82c12083fc6c62c3de3f9a88b Mon Sep 17 00:00:00 2001 From: "Elen.Subbotina" Date: Tue, 21 Oct 2014 12:13:00 +0000 Subject: [PATCH] linux build git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59074 954022d7-b5bf-4e40-9824-e11837661b57 --- ASCOfficePPTXFile/ASCOfficePPTXFile.h | 47 +++++++++++++++---- .../ASCOfficePPTXFileRealization.cpp | 10 ++-- ASCOfficePPTXFile/Editor/Converter.h | 11 +++-- ASCOfficePPTXFile/Editor/PPTXWriter.h | 15 ++++-- 4 files changed, 60 insertions(+), 23 deletions(-) diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFile.h b/ASCOfficePPTXFile/ASCOfficePPTXFile.h index 80f5f454a6..13b7f43909 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFile.h +++ b/ASCOfficePPTXFile/ASCOfficePPTXFile.h @@ -2,8 +2,14 @@ #define ASC_OFFICE_PPTX_FILE //todo -#include -#include +#ifdef _WIN32 + #include + #include +#else + #include "../DesktopEditor/common/ASCVariant.h" + #include "../../../Common/DocxFormat/Source/Base/ASCString.h" +#endif + #include "../Common/DocxFormat/Source/Base/Base.h" #include "PPTXFormat/PPTXEvent.h" @@ -44,17 +50,18 @@ public: CPPTXFile(load_from_resource fCallbackResource, extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg); ~CPPTXFile(); -public: + HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions); -public: + HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions); -public: + +#ifdef WIN32 STDMETHOD(get_TempDirectory)(BSTR* pVal); STDMETHOD(put_TempDirectory)(BSTR newVal); -public: + STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml); STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml); -public: + STDMETHOD(get_DrawingXml)(BSTR* pVal); STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue); STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue); @@ -67,8 +74,30 @@ public: STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput); STDMETHOD(OpenDirectoryToPPTY)(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: - INT32 RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true); + int RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true); }; -#endif //ASC_OFFICE_PPTX_FILE \ No newline at end of file +#endif //ASC_OFFICE_PPTX_FILE diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp index 36b0e3dd9e..ffbd80b52f 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp +++ b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp @@ -3,10 +3,10 @@ #include "PPTXFormat/PPTXEvent.h" #ifdef _WIN32 -#include -#include -#include -#pragma comment( lib, "shell32.lib" ) // добавить shell32.lib + #include + #include + #include + #pragma comment( lib, "shell32.lib" ) // добавить shell32.lib #else #endif @@ -346,7 +346,7 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(BSTR bsInput, BSTR bsOutput) return hRes; } -INT32 CPPTXFile::RemoveDirOrFile(CString sPath, bool bIsRemoveHead) +int CPPTXFile::RemoveDirOrFile(CString sPath, bool bIsRemoveHead) { DWORD dwFileAttrib = ::GetFileAttributes( sPath ); if( dwFileAttrib != INVALID_FILE_ATTRIBUTES ) diff --git a/ASCOfficePPTXFile/Editor/Converter.h b/ASCOfficePPTXFile/Editor/Converter.h index 45ca33dd96..b01a0bcb5a 100644 --- a/ASCOfficePPTXFile/Editor/Converter.h +++ b/ASCOfficePPTXFile/Editor/Converter.h @@ -105,13 +105,13 @@ namespace PPTX2EditorAdvanced _notesMasters.push_back(noteMaster); // проверяем theme - size_t pPointerTh = (size_t)(noteMaster->Theme.operator ->()); + size_t pPointerTh = (size_t)(noteMaster->theme_.operator ->()); std::map::const_iterator pSearchTh = pCommon->themes.find(pPointerTh); if (pSearchTh == pCommon->themes.end()) { LONG lCountTh = (LONG)_themes.size(); pCommon->themes [pPointerTh] = lCountTh; - _themes.push_back(noteMaster->Theme); + _themes.push_back(noteMaster->theme_); } } @@ -377,8 +377,11 @@ namespace PPTX2EditorAdvanced if (TRUE == Base64::Base64Encode(pbBinBuffer, nBinBufferLen, (LPSTR)pbBase64Buffer, &nBase64BufferLen, Base64::B64_BASE64_FLAG_NOCRLF)) { CFile oFile; - oFile.CreateFileW(strDstFile); - +#ifdef WIN32 + oFile.CreateFileW(strDstFile); +#else + oFile.CreateFile(strDstFile); +#endif CString strPrefix = _T(""); strPrefix.Format(_T("PPTY;v1;%d;"), nBinBufferLen); CStringA sW = (CStringA)strPrefix; diff --git a/ASCOfficePPTXFile/Editor/PPTXWriter.h b/ASCOfficePPTXFile/Editor/PPTXWriter.h index 747801240a..5ee07715b0 100644 --- a/ASCOfficePPTXFile/Editor/PPTXWriter.h +++ b/ASCOfficePPTXFile/Editor/PPTXWriter.h @@ -61,8 +61,10 @@ namespace NSBinPptxRW CDirectory::CreateDirectory(m_strDstFolder); 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")); m_oImageManager.Clear(); @@ -111,7 +113,7 @@ namespace NSBinPptxRW BYTE* pDstBuffer = new BYTE[dstLenTemp]; int dstLen = dstLenTemp; - Base64Decode((LPCSTR)pBuffer, len, pDstBuffer, &dstLen); + Base64::Base64Decode((LPCSTR)pBuffer, len, pDstBuffer, &dstLen); m_oReader.m_strContentTypes = _T(""); m_oReader.Init(pDstBuffer, 0, dstLen); @@ -385,9 +387,12 @@ namespace NSBinPptxRW CString strFolder = m_strDstFolder + _T("\\ppt\\slides"); CString strFolderRels = strFolder + _T("\\_rels"); - CDirectory::CreateDirectory(strFolder); +#ifdef WIN32 + CDirectory::CreateDirectory(strFolder); CDirectory::CreateDirectory(strFolderRels); - +#else + ???? +#endif m_oReader.Seek(pPair->second); m_oReader.Skip(4);