Commit 7fab3826 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@59523 954022d7-b5bf-4e40-9824-e11837661b57
parent a9fb2ecc
...@@ -40,8 +40,10 @@ namespace Writers ...@@ -40,8 +40,10 @@ namespace Writers
} }
m_oWriter.WriteString(s_dr_End); m_oWriter.WriteString(s_dr_End);
CFile oFile; OOX::CPath fileName = m_sDir + _T("\\word\\_rels\\") + sFileName;
oFile.CreateFile(m_sDir + _T("\\word\\_rels\\") + sFileName);
CFile oFile;
oFile.CreateFile(fileName.GetFilename());
oFile.WriteStringUTF8(m_oWriter.GetData()); oFile.WriteStringUTF8(m_oWriter.GetData());
oFile.CloseFile(); oFile.CloseFile();
} }
...@@ -62,4 +64,4 @@ namespace Writers ...@@ -62,4 +64,4 @@ namespace Writers
} }
}; };
} }
#endif // #ifndef DOCUMENT_RELS_WRITER #endif // #ifndef DOCUMENT_RELS_WRITER
\ No newline at end of file
...@@ -5944,8 +5944,9 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes ...@@ -5944,8 +5944,9 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes
Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments); Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments);
res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItemContent, this, &oBinary_DocumentTableReader); res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItemContent, this, &oBinary_DocumentTableReader);
CString sRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\") + poHdrFtrItem->m_sFilename + _T(".rels"); OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\") + poHdrFtrItem->m_sFilename + _T(".rels");
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(sRelsPath);
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetFilename());
} }
} }
else else
...@@ -6133,9 +6134,10 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB ...@@ -6133,9 +6134,10 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB
} }
} }
res = Binary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_oDocumentWriter, &oBinary_CommentsTableReader.m_oComments).Read(); res = Binary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_oDocumentWriter, &oBinary_CommentsTableReader.m_oComments).Read();
CString sRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\document.xml.rels");
CComments& oComments = oBinary_CommentsTableReader.m_oComments; OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\document.xml.rels");
CComments& oComments = oBinary_CommentsTableReader.m_oComments;
Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.m_oCommentsWriter; Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.m_oCommentsWriter;
CString sContent = oComments.writeContent(); CString sContent = oComments.writeContent();
CString sContentEx = oComments.writeContentExt();// writeContentExt writeContent CString sContentEx = oComments.writeContentExt();// writeContentExt writeContent
...@@ -6157,7 +6159,7 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB ...@@ -6157,7 +6159,7 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB
m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.microsoft.com/office/2011/relationships/people")), CString(_T("people.xml")), CString(), &rId); m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.microsoft.com/office/2011/relationships/people")), CString(_T("people.xml")), CString(), &rId);
} }
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(sRelsPath); m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetFilename());
if(c_oSerConstants::ReadOk != res) if(c_oSerConstants::ReadOk != res)
return res; return res;
} }
......
...@@ -3129,14 +3129,17 @@ HRESULT CDrawingConverter::SaveThemeXml(LONG lStart, LONG lLength, const CString ...@@ -3129,14 +3129,17 @@ HRESULT CDrawingConverter::SaveThemeXml(LONG lStart, LONG lLength, const CString
m_pXmlWriter->SaveToFile(strThemePath); m_pXmlWriter->SaveToFile(strThemePath);
OOX::CPath filename = strThemePath; OOX::CPath filename = strThemePath;
CString strTemp = filename.GetDirectory() + _T("\\_rels\\"); CString strTemp = filename.GetDirectory() + _T("\\_rels\\");
CString strFileName = filename.GetFilename(); CString strFileName = filename.GetFilename();
if (strFileName == _T("")) if (strFileName == _T(""))
strTemp += _T(".rels"); strTemp += _T(".rels");
else else
strTemp += (strFileName + _T(".rels")); strTemp += (strFileName + _T(".rels"));
SaveDstContentRels(strTemp); filename = strTemp;
SaveDstContentRels(filename.GetFilename());
m_pXmlWriter->ClearNoAttack(); m_pXmlWriter->ClearNoAttack();
......
...@@ -756,8 +756,13 @@ namespace NSBinPptxRW ...@@ -756,8 +756,13 @@ namespace NSBinPptxRW
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\ <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\
</Relationships>"); </Relationships>");
FileSystem::Directory::CreateDirectory (m_strDstFolder + _T("\\_rels")); OOX::CPath filePath = m_strDstFolder + _T("\\_rels");
oFile.CreateFile(m_strDstFolder + _T("\\_rels\\.rels"));
FileSystem::Directory::CreateDirectory (filePath.GetFilename());
filePath = m_strDstFolder + _T("\\_rels\\.rels");
oFile.CreateFile(filePath.GetFilename());
oFile.WriteStringUTF8(strRELS); oFile.WriteStringUTF8(strRELS);
oFile.CloseFile(); oFile.CloseFile();
......
...@@ -111,8 +111,13 @@ namespace PPTX ...@@ -111,8 +111,13 @@ namespace PPTX
private: private:
const OOX::CPath createFileName(const OOX::CPath& filename) const const OOX::CPath createFileName(const OOX::CPath& filename) const
{ {
CString strTemp = filename.GetDirectory() + _T("\\_rels\\"); CString strTemp = filename.GetDirectory();
if (filename.GetFilename() == _T("")) #ifdef _WIN32
strTemp += _T("\\_rels\\");
#else
strTemp += _T("/_rels/");
#endif
if (filename.GetFilename() == _T(""))
strTemp += _T(".rels"); strTemp += _T(".rels");
else else
strTemp += (filename.GetFilename() + _T(".rels")); strTemp += (filename.GetFilename() + _T(".rels"));
......
...@@ -24,7 +24,6 @@ namespace NSSystemPath ...@@ -24,7 +24,6 @@ namespace NSSystemPath
_tsplitpath( strFileName.c_str(), tDrive, tFolder, NULL, NULL ); _tsplitpath( strFileName.c_str(), tDrive, tFolder, NULL, NULL );
sRes.append(tDrive); sRes.append(tDrive);
sRes.append(tFolder); sRes.append(tFolder);
return sRes;
#elif LINUX #elif LINUX
BYTE* pUtf8 = NULL; BYTE* pUtf8 = NULL;
LONG lLen = 0; LONG lLen = 0;
...@@ -34,6 +33,7 @@ namespace NSSystemPath ...@@ -34,6 +33,7 @@ namespace NSSystemPath
delete [] pUtf8; delete [] pUtf8;
#elif MAC #elif MAC
#endif #endif
return sRes;
} }
static std::wstring GetFileName(const std::wstring& strFileName) static std::wstring GetFileName(const std::wstring& strFileName)
{ {
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
#define SERIALIZER_COMMON #define SERIALIZER_COMMON
#ifdef _WIN32 #ifdef _WIN32
#include <atlbase.h> #include <atlbase.h>
#include <atlstr.h> #include <atlstr.h>
#else #else
#include "../../Common/DocxFormat/Source/Base/ASCString.h" #include "../../Common/DocxFormat/Source/Base/ASCString.h"
#endif #endif
#include "../../DesktopEditor/common/File.h" #include "../../DesktopEditor/common/File.h"
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -49,4 +50,4 @@ namespace SerializeCommon ...@@ -49,4 +50,4 @@ namespace SerializeCommon
void ReadFileType(CString& sXMLOptions, BYTE& result, UINT& nCodePage, WCHAR& wcDelimiter); void ReadFileType(CString& sXMLOptions, BYTE& result, UINT& nCodePage, WCHAR& wcDelimiter);
} }
#endif //SERIALIZER_COMMON #endif //SERIALIZER_COMMON
\ No newline at end of file
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