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

Rtf->Docx

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62010 954022d7-b5bf-4e40-9824-e11837661b57
parent ce0e05ad
#pragma once #pragma once
#include <stdio.h> //#include <stdio.h>
#include <stdlib.h> //#include <stdlib.h>
#include <ctype.h> //#include <ctype.h>
#include "RtfToken.h" #include "RtfToken.h"
#include "Utils.h" #include "Utils.h"
...@@ -36,20 +36,21 @@ public: ...@@ -36,20 +36,21 @@ public:
void SetSource( CString sPath ) void SetSource( CString sPath )
{ {
Clear(); Clear();
HANDLE hSrc = CreateFile((LPCWSTR)sPath, // file to open
GENERIC_READ, // open for reading CFile srcFile;
FILE_SHARE_READ| FILE_SHARE_WRITE, // share for reading
NULL, // default security if (srcFile.OpenFile(sPath) != S_OK) return;
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file __int64 totalFileSize = srcFile.GetFileSize();
NULL); // no attr. template
__int64 totalFileSize;
GetFileSizeEx(hSrc,(LARGE_INTEGER *)&totalFileSize);
m_nSizeAbs = (long)totalFileSize; m_nSizeAbs = (long)totalFileSize;
m_aBuffer = new unsigned char[m_nSizeAbs]; m_aBuffer = new unsigned char[m_nSizeAbs];
DWORD dwBytesRead = 0; DWORD dwBytesRead = 0;
ReadFile(hSrc, m_aBuffer, m_nSizeAbs, &dwBytesRead, NULL);
RELEASEHANDLE( hSrc ); srcFile.ReadFile(m_aBuffer, m_nSizeAbs);
dwBytesRead = srcFile.GetPosition();
srcFile.CloseFile();
} }
void getBytes( int nCount, byte** pbData ) void getBytes( int nCount, byte** pbData )
{ {
......
...@@ -88,15 +88,15 @@ public: ...@@ -88,15 +88,15 @@ public:
static DataType GetPictureType( CString sFilename ) static DataType GetPictureType( CString sFilename )
{ {
BYTE pBuffer[ 16 ]; BYTE pBuffer[ 16 ];
DWORD dwBytesRead; DWORD dwBytesRead = 0;
HANDLE hFile; HANDLE hFile;
hFile = ::CreateFile(sFilename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); CFile file;
if (INVALID_HANDLE_VALUE == hFile) if (file.OpenFile(sFilename) != S_OK) return dt_none;
return dt_none;
::ReadFile(hFile, pBuffer, 16, &dwBytesRead, NULL); file.ReadFile(pBuffer, 16);
::CloseHandle(hFile); dwBytesRead = file.GetPosition();
file.CloseFile();
//jpeg //jpeg
// Hex: FF D8 FF // Hex: FF D8 FF
......
...@@ -762,20 +762,27 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame ...@@ -762,20 +762,27 @@ CString RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderParame
sRootName = _T("w:ftr"); sRootName = _T("w:ftr");
sContent.AppendFormat( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n") ); sContent.AppendFormat( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n") );
sContent.AppendFormat( _T("<%ls xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">"), sRootName ); sContent.AppendFormat( _T("<%ls xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\">"), sRootName );
RenderParameter oNewParameter = oRenderParameter; RenderParameter oNewParameter = oRenderParameter;
OOXRelsWriterPtr oNewRelsWr = OOXRelsWriterPtr( new OOXRelsWriter( sFilename, *poRtfDocument ) ); OOXRelsWriterPtr oNewRelsWr = OOXRelsWriterPtr( new OOXRelsWriter( sFilename, *poRtfDocument ) );
poOOXWriter->m_oCustomRelsWriter.push_back( oNewRelsWr ); poOOXWriter->m_oCustomRelsWriter.push_back( oNewRelsWr );
oNewParameter.poRels = oNewRelsWr.get(); oNewParameter.poRels = oNewRelsWr.get();
sContent.Append( oTarget->RenderToOOX(oNewParameter) ); sContent.Append( oTarget->RenderToOOX(oNewParameter) );
sContent.AppendFormat( _T("</%ls>"), sRootName ); sContent.AppendFormat( _T("</%ls>"), sRootName );
CStringA sContentUTF = Convert::UnicodeToUtf8( sContent ); CStringA sContentUTF = Convert::UnicodeToUtf8( sContent );
CString sFilePath = poOOXWriter->m_sTargetFolder + _T("\\") +poOOXWriter->m_sDocumentFolder+ _T("\\")+sFilename; CString sFilePath = poOOXWriter->m_sTargetFolder + FILE_SEPARATOR_STR + poOOXWriter->m_sDocumentFolder+ FILE_SEPARATOR_STR + sFilename;
DWORD dwBytesWritten = 0; DWORD dwBytesWritten = 0;
HANDLE hFile = ::CreateFile(sFilePath,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); CFile file;
::WriteFile(hFile, sContentUTF, sContentUTF.GetLength(), &dwBytesWritten, NULL);
CloseHandle( hFile ); if (file.CreateFileW(sFilePath) == S_OK)
{
file.WriteFile(sContentUTF.GetBuffer(), sContentUTF.GetLength());
file.CloseFile();
}
CString sContentTarget = _T("/") + poOOXWriter->m_sDocumentFolder + _T("/") + sFilename; CString sContentTarget = _T("/") + poOOXWriter->m_sDocumentFolder + _T("/") + sFilename;
CString srID; CString srID;
......
...@@ -110,26 +110,6 @@ bool RtfWriter::SaveByItem() ...@@ -110,26 +110,6 @@ bool RtfWriter::SaveByItem()
} }
// //
m_oDocument.RemoveItem( 0 ); m_oDocument.RemoveItem( 0 );
////
//HANDLE hFile = ::CreateFile(m_sTempFile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0);
//DWORD dwBytesRead = 1;
//BYTE byteBuffer[ 4096 ];
//while( 0 != dwBytesRead )
//{
// ::ReadFile(hFile,byteBuffer ,4096, &dwBytesRead, NULL);
// m_oFileWriter->Write( (BYTE*)&byteBuffer, dwBytesRead );
//}
//CloseHandle( hFile );
////
//CStringA sRtfExt = "\\sect";
//m_oFileWriter->Write( (BYTE*)(LPCSTR)sRtfExt, sRtfExt.GetLength() );
////
//BSTR bstrFileName = m_sTempFile.AllocSysString();
//m_oTempFileWriter = new NFileWriter::CBufferedFileWriter( bstrFileName );
//SysFreeString( bstrFileName );
} }
// //
if( m_oDocument.GetCount() > 0 && m_oDocument[0]->GetCount() > 0 ) if( m_oDocument.GetCount() > 0 && m_oDocument[0]->GetCount() > 0 )
...@@ -183,23 +163,6 @@ bool RtfWriter::SaveByItemEnd() ...@@ -183,23 +163,6 @@ bool RtfWriter::SaveByItemEnd()
m_oDocument.RemoveItem( 0 ); m_oDocument.RemoveItem( 0 );
} }
////
//HANDLE hFile = ::CreateFile(m_sTempFile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0);
//DWORD dwBytesRead = 1;
//BYTE byteBuffer[ 4096 ];
//while( 0 != dwBytesRead )
//{
// ::ReadFile(hFile,byteBuffer ,4096, &dwBytesRead, NULL);
// m_oFileWriter->Write( (BYTE*)&byteBuffer, dwBytesRead );
//}
//CloseHandle( hFile );
////
//sRtf = CreateRtfEnd();
//RtfInternalEncoder::Decode( sRtf, *m_oFileWriter );
////m_oFileWriter->Write( (BYTE*)(LPCSTR)sRtf, sRtf.GetLength() );
//RELEASEOBJECT( m_oFileWriter );
// //
try try
{ {
...@@ -215,32 +178,38 @@ bool RtfWriter::SaveByItemEnd() ...@@ -215,32 +178,38 @@ bool RtfWriter::SaveByItemEnd()
for( int i = 0 ; i < (int)m_aTempFiles.size() && i < (int)m_aTempFilesSectPr.size(); i++ ) for( int i = 0 ; i < (int)m_aTempFiles.size() && i < (int)m_aTempFilesSectPr.size(); i++ )
{ {
// //
HANDLE hFile = ::CreateFile( m_aTempFilesSectPr[i], GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
if( INVALID_HANDLE_VALUE != hFile ) CFile file;
if (file.OpenFile(m_aTempFilesSectPr[i]) == S_OK)
{ {
DWORD dwBytesRead = 1; DWORD dwBytesRead = 1;
BYTE byteBuffer[ 4096 ]; BYTE byteBuffer[ 4096 ];
while( 0 != dwBytesRead ) while( 0 != dwBytesRead )
{ {
::ReadFile( hFile, byteBuffer, 4096, &dwBytesRead, NULL); dwBytesRead = file.GetPosition();
file.ReadFile( byteBuffer, 4096);
dwBytesRead = file.GetPosition() - dwBytesRead;
oTargetFileWriter.Write( byteBuffer, dwBytesRead ); oTargetFileWriter.Write( byteBuffer, dwBytesRead );
} }
CloseHandle( hFile ); file.CloseFile();
} }
// //
hFile = ::CreateFile( m_aTempFiles[i], GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ); if (file.OpenFile(m_aTempFiles[i]) == S_OK)
if( INVALID_HANDLE_VALUE != hFile )
{ {
DWORD dwBytesRead = 1; DWORD dwBytesRead = 1;
BYTE byteBuffer[ 4096 ]; BYTE byteBuffer[ 4096 ];
while( 0 != dwBytesRead ) while( 0 != dwBytesRead )
{ {
::ReadFile( hFile, byteBuffer, 4096, &dwBytesRead, NULL); dwBytesRead = file.GetPosition();
file.ReadFile(byteBuffer, 4096);
dwBytesRead = file.GetPosition() - dwBytesRead;
oTargetFileWriter.Write( byteBuffer, dwBytesRead ); oTargetFileWriter.Write( byteBuffer, dwBytesRead );
} }
CloseHandle( hFile ); file.CloseFile();
} }
} }
......
...@@ -266,161 +266,121 @@ public: ...@@ -266,161 +266,121 @@ public:
{ {
return (int)(pt * 20); return (int)(pt * 20);
} }
static float Twip2pt(int pt) static float Twip2pt(int pt)
{ {
return (float)(pt / 20.0); return (float)(pt / 20.0);
} }
static int pt2HalfPt(float pt) static int pt2HalfPt(float pt)
{ {
return (int)(pt * 2); return (int)(pt * 2);
} }
static int Twips2Emu(int pt) static int Twips2Emu(int pt)
{ {
return (int)(pt * 635); return (int)(pt * 635);
} }
static int Emu2Twips(int pt) static int Emu2Twips(int pt)
{ {
return (int)(pt / 635); return (int)(pt / 635);
} }
static float Emu2Pt(int emu) static float Emu2Pt(int emu)
{ {
return (float)(1.0 * emu / (635 * 20.0)); return (float)(1.0 * emu / (635 * 20.0));
} }
static void WriteDataToFileBinary(CString& sFilename, byte* pbData, int nLength) static void WriteDataToFileBinary(CString& sFilename, byte* pbData, int nLength)
{ {
if( NULL == pbData ) if( NULL == pbData )
return; return;
CFile file;
if (file.CreateFileW(sFilename) != S_OK) return;
DWORD dwBytesWritten; CFile file;
file.WriteFile(pbData ,nLength); if (file.CreateFileW(sFilename) != S_OK) return;
file.CloseFile();
}
static void WriteDataToFile(CString& sFilename, CString& sData)
{
CFile file;
if (file.CreateFileW(sFilename) != S_OK) return; DWORD dwBytesWritten;
file.WriteFile(pbData ,nLength);
file.CloseFile();
}
static void WriteDataToFile(CString& sFilename, CString& sData)
{
CFile file;
TCHAR * buf = sData.GetBuffer(); if (file.CreateFileW(sFilename) != S_OK) return;
int nLengthText = sData.GetLength();
int nLengthData = nLengthText/2;
BYTE * buf2 = new BYTE[ nLengthData];
BYTE nByte=0;
for( int i=0; i < nLengthData ; i++ )
{
nByte = ToByte( buf[2 * i] ) << 4;
nByte |= ToByte( buf[2 * i + 1] );
buf2[i] = nByte;
}
file.WriteFile(buf2 ,nLengthData);
sData.ReleaseBuffer();
delete[] buf2;
file.CloseFile();
} TCHAR * buf = sData.GetBuffer();
static void WriteDataToBinary( CString sData, BYTE** ppData, long& nSize) int nLengthText = sData.GetLength();
int nLengthData = nLengthText/2;
BYTE * buf2 = new BYTE[ nLengthData];
BYTE nByte=0;
for( int i=0; i < nLengthData ; i++ )
{ {
TCHAR * buf = sData.GetBuffer(); nByte = ToByte( buf[2 * i] ) << 4;
int nLengthText = sData.GetLength(); nByte |= ToByte( buf[2 * i + 1] );
nSize = nLengthText/2; buf2[i] = nByte;
BYTE * buf2 = new BYTE[ nSize];
(*ppData) = buf2;
BYTE nByte=0;
for( int i=0; i < nSize ; i++ )
{
nByte = ToByte(buf[ 2*i])<<4;
nByte |= ToByte(buf[ 2*i+1]);
buf2[i] = nByte;
}
sData.ReleaseBuffer();
} }
static void ReadDataFromFile(CString sName, CString& sData) file.WriteFile(buf2 ,nLengthData);
{ sData.ReleaseBuffer();
HANDLE hFile = ::CreateFile(sName, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0); delete[] buf2;
DWORD dwBytesRead = 0; file.CloseFile();
BYTE byteBuffer[ BUF_SIZE ];
::ReadFile(hFile,byteBuffer ,BUF_SIZE, &dwBytesRead, NULL); }
while( 0 != dwBytesRead ) static void WriteDataToBinary( CString sData, BYTE** ppData, long& nSize)
{ {
for( int i = 0; i < (int)dwBytesRead; i++ ) TCHAR * buf = sData.GetBuffer();
{ int nLengthText = sData.GetLength();
int n1 =(byteBuffer[i]&0xF0) >> 4; nSize = nLengthText/2;
int n2 = byteBuffer[i]&0x0F; BYTE * buf2 = new BYTE[ nSize];
sData.AppendFormat( _T("%x"), n1); (*ppData) = buf2;
sData.AppendFormat( _T("%x"), n2); BYTE nByte=0;
} for( int i=0; i < nSize ; i++ )
::ReadFile(hFile,byteBuffer ,BUF_SIZE, &dwBytesRead, NULL);
}
CloseHandle( hFile );
}
static CString DecodeHex( CString sText )
{
CString sHexText;
for( int i = 0; i < sText.GetLength(); i++ )
{
TBYTE byteChar = sText[i];
sHexText.AppendFormat( _T("%x"), byteChar );
}
return sHexText;
}
static CString EncodeHex( CString sHexText )
{
CString sText;
for( int i = 0; i < sHexText.GetLength() -1 ; i+=2 )
{
int byte1 = ToByte( sHexText[i] );
int byte2 = ToByte(sHexText[i + 1] );
int cChar = (byte1 << 4) + byte2;
sText.AppendFormat( _T("%c"), cChar );
}
return sText;
}
static byte ToByte( TCHAR cChar )
{ {
return (byte)(cChar > 'F' ? cChar - 0x57 : cChar > '9' ? cChar - 0x37 : cChar - 0x30); nByte = ToByte(buf[ 2*i])<<4;
nByte |= ToByte(buf[ 2*i+1]);
buf2[i] = nByte;
} }
static bool IsAlpha( int nChar ) sData.ReleaseBuffer();
}
static CString DecodeHex( CString sText )
{
CString sHexText;
for( int i = 0; i < sText.GetLength(); i++ )
{ {
return ( nChar >= 'a' && nChar <= 'z' || nChar >= 'A' && nChar <= 'Z' ); TBYTE byteChar = sText[i];
sHexText.AppendFormat( _T("%x"), byteChar );
} }
static bool IsDigit( int nChar ) return sHexText;
}
static CString EncodeHex( CString sHexText )
{
CString sText;
for( int i = 0; i < sHexText.GetLength() -1 ; i+=2 )
{ {
return nChar >= '0' && nChar <= '9'; int byte1 = ToByte( sHexText[i] );
int byte2 = ToByte(sHexText[i + 1] );
int cChar = (byte1 << 4) + byte2;
sText.AppendFormat( _T("%c"), cChar );
} }
return sText;
}
static byte ToByte( TCHAR cChar )
{
return (byte)(cChar > 'F' ? cChar - 0x57 : cChar > '9' ? cChar - 0x37 : cChar - 0x30);
}
static bool IsAlpha( int nChar )
{
return ( nChar >= 'a' && nChar <= 'z' || nChar >= 'A' && nChar <= 'Z' );
}
static bool IsDigit( int nChar )
{
return nChar >= '0' && nChar <= '9';
}
static CString Preserve( CString sText ) static CString Preserve( CString sText )
{ {
CString sResult = sText; CString sResult = sText;
// //
sResult.Trim(); sResult.Trim();
// //
while( sResult.Replace( _T(" "), _T(" ") ) > 0 ) while( sResult.Replace( _T(" "), _T(" ") ) > 0 )
; ;
return sResult; return sResult;
} }
static int GetFolderSize( CString sFolder )
{
HANDLE Handle;
WIN32_FIND_DATA FindData;
DWORDLONG Result=0;
int nCount = 0;
Handle = FindFirstFile(( sFolder + _T("\\*.*") ), &FindData);
if (Handle == INVALID_HANDLE_VALUE)
return 0;
do
{
if(( CString( FindData.cFileName) != _T("."))&&(CString(FindData.cFileName) != _T("..")))
nCount++;
}
while(FindNextFile(Handle, &FindData) != 0);
FindClose(Handle);
return nCount;
}
static int CharsetToCodepage( int nCharset ) static int CharsetToCodepage( int nCharset )
{ {
CHARSETINFO Info; CHARSETINFO Info;
...@@ -534,13 +494,18 @@ public: ...@@ -534,13 +494,18 @@ public:
private: private:
static void DecodeFromFile( CString& sFilename, NFileWriter::CBufferedFileWriter& oFileWriter ) static void DecodeFromFile( CString& sFilename, NFileWriter::CBufferedFileWriter& oFileWriter )
{ {
HANDLE hFile = ::CreateFile( sFilename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0); CFile file;
if (file.OpenFile(sFilename) != S_OK) return;
DWORD dwBytesRead = 0; DWORD dwBytesRead = 0;
BYTE byteBuffer[ BUF_SIZE ]; BYTE byteBuffer[ BUF_SIZE ];
char aLookup[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; char aLookup[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
::ReadFile(hFile,byteBuffer ,BUF_SIZE, &dwBytesRead, NULL); file.ReadFile(byteBuffer ,BUF_SIZE);
dwBytesRead = file.GetPosition();
while( 0 != dwBytesRead ) while( 0 != dwBytesRead )
{ {
for( int i = 0; i < (int)dwBytesRead; i++ ) for( int i = 0; i < (int)dwBytesRead; i++ )
...@@ -551,8 +516,10 @@ private: ...@@ -551,8 +516,10 @@ private:
oFileWriter.Write( &byteFirst, 1 ); oFileWriter.Write( &byteFirst, 1 );
oFileWriter.Write( &byteSecond, 1 ); oFileWriter.Write( &byteSecond, 1 );
} }
::ReadFile( hFile, byteBuffer, BUF_SIZE, &dwBytesRead, NULL ); dwBytesRead = file.GetPosition();
file.ReadFile(byteBuffer ,BUF_SIZE);
dwBytesRead = file.GetPosition() - dwBytesRead;
} }
CloseHandle( hFile ); file.CloseFile();
} }
}; };
...@@ -25,25 +25,18 @@ public: ...@@ -25,25 +25,18 @@ public:
} }
bool Save(CString sFolder) bool Save(CString sFolder)
{ {
HANDLE hFile = ::CreateFile(sFolder + _T("\\[Content_Types].xml"), CFile file;
GENERIC_WRITE,
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
//ATLASSERT( INVALID_HANDLE_VALUE != hFile );
if( INVALID_HANDLE_VALUE != hFile ) if (file.CreateFileW(sFolder + FILE_SEPARATOR_STR + _T("[Content_Types].xml")) != S_OK) return false;
{
DWORD dwBytesWritten; DWORD dwBytesWritten;
CString sXml = CreateXml(); CString sXml = CreateXml();
CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml ); CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );//todooo UTF32 !!!
::WriteFile( hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL );
CloseHandle( hFile ); file.WriteFile( sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
return true;
} file.CloseFile();
return false; return true;
} }
private: private:
......
...@@ -32,44 +32,27 @@ public: ...@@ -32,44 +32,27 @@ public:
} }
bool Save( CString sFolder) bool Save( CString sFolder)
{ {
//if( false == m_sContent.IsEmpty() ) CString pathDocProps = sFolder + FILE_SEPARATOR_STR + _T("docProps");
//{ FileSystem::Directory::CreateDirectoryW(pathDocProps) ;
// m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"), _T("docProps/app.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.extended-properties+xml"), _T("/docProps/app.xml") ); if( false == m_sContent.IsEmpty() )
{
m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"), _T("docProps/app.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.extended-properties+xml"), _T("/docProps/app.xml") );
// CreateDirectory(sFolder + _T("\\docProps"), NULL) ; CFile file;
// HANDLE hFile = ::CreateFile(sFolder + _T("\\docProps\\app.xml"), if (file.CreateFileW(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"))) return false;
// GENERIC_WRITE,
// 0,
// 0,
// CREATE_ALWAYS,
// FILE_ATTRIBUTE_NORMAL,
// 0);
// //ATLASSERT( INVALID_HANDLE_VALUE != hFile );
// if( INVALID_HANDLE_VALUE != hFile ) CString sXml = CreateXml();
// { CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
// DWORD dwBytesWritten; file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
// CString sXml = CreateXml(); file.CloseFile();
// CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml ); return true;
// ::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL); }
// CloseHandle( hFile ); else
// return true; {
// } //todooo - default app !!!
//} }
//else
//{
//CreateDirectory(sFolder + _T("\\docProps"), NULL) ;
//if( true == RtfUtility:: SaveResourceToFile( IDR_APP, L"XML", sFolder + _T("\\docProps\\app.xml") ) )
//{
// m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"), _T("docProps/app.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.extended-properties+xml"), _T("/docProps/app.xml") );
//}
//else
//{
// RemoveDirectory( sFolder + _T("\\docProps") );
//}
//}
return false; return false;
} }
bool IsEmpty() bool IsEmpty()
......
...@@ -30,43 +30,26 @@ public: ...@@ -30,43 +30,26 @@ public:
} }
bool Save( CString sFolder) bool Save( CString sFolder)
{ {
CString pathDocProps = sFolder + FILE_SEPARATOR_STR + _T("docProps");
FileSystem::Directory::CreateDirectoryW(pathDocProps) ;
if( false == m_sFileXml.IsEmpty() ) if( false == m_sFileXml.IsEmpty() )
{ {
m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"), _T("docProps/core.xml") ); m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"), _T("docProps/core.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-package.core-properties+xml"), _T("/docProps/core.xml") ); m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-package.core-properties+xml"), _T("/docProps/core.xml") );
//CreateDirectory(sFolder + _T("\\docProps"),NULL) ; CFile file;
//HANDLE hFile = ::CreateFile(sFolder + _T("\\docProps\\core.xml"), if (file.CreateFileW(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"))) return false;
// GENERIC_WRITE,
// 0, CString sXml = CreateXml();
// 0, CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
// CREATE_ALWAYS, file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
// FILE_ATTRIBUTE_NORMAL, file.CloseFile();
// 0); return true;
////ATLASSERT( INVALID_HANDLE_VALUE != hFile );
//if( INVALID_HANDLE_VALUE != hFile )
//{
// DWORD dwBytesWritten;
// CString sXml = CreateXml();
// CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
// ::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL);
// CloseHandle( hFile );
// return true;
//}
} }
else else
{ {
//FileSystem::Directory::CreateDirectory(sFolder + _T("\\docProps"), NULL) ; //todooo - default core !!!
//if( true == RtfUtility:: SaveResourceToFile( IDR_CORE, L"XML", sFolder + _T("\\docProps\\core.xml") ) )
//{
// m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"), _T("docProps/core.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-package.core-properties+xml"), _T("/docProps/core.xml") );
//}
//else
//{
// RemoveDirectory( sFolder + _T("\\docProps") );
//}
} }
return false; return false;
} }
......
...@@ -27,10 +27,12 @@ public: ...@@ -27,10 +27,12 @@ public:
bool SaveByItemStart( CString sFolder ) bool SaveByItemStart( CString sFolder )
{ {
CreateDirectory( sFolder + _T("\\word"), NULL); CString pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
FileSystem::Directory::CreateDirectoryW(pathWord) ;
try try
{ {
CString sFilename = sFolder + _T("\\word\\document.xml"); CString sFilename = pathWord + FILE_SEPARATOR_STR + _T("document.xml");
m_oFileWriter = new NFileWriter::CBufferedFileWriter( sFilename ); m_oFileWriter = new NFileWriter::CBufferedFileWriter( sFilename );
} }
catch(...) catch(...)
......
...@@ -18,37 +18,27 @@ public: ...@@ -18,37 +18,27 @@ public:
} }
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
CString pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
FileSystem::Directory::CreateDirectoryW(pathWord) ;
if( false == m_sFileXml.IsEmpty() ) if( false == m_sFileXml.IsEmpty() )
{ {
HANDLE hFile = ::CreateFile(sFolder + _T("\\word\\fontTable.xml"), CFile file;
GENERIC_WRITE, if (file.CreateFileW(pathWord + FILE_SEPARATOR_STR + _T("fontTable.xml"))) return false;
0,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
//ATLASSERT( INVALID_HANDLE_VALUE != hFile );
if( INVALID_HANDLE_VALUE != hFile ) m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"), _T("fontTable.xml") );
{ m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), _T("/word/fontTable.xml") );
m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"), _T("fontTable.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), _T("/word/fontTable.xml") );
DWORD dwBytesWritten; CString sXml = CreateXml();
CString sXml = CreateXml(); CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml ); file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL);
CloseHandle( hFile ); file.CloseFile();
return true; return true;
}
} }
else else
{ {
//if( true == RtfUtility:: SaveResourceToFile( IDR_FONT_TABLE, L"XML", sFolder + _T("\\word\\fontTable.xml") ) ) //todooo - default fontTable !!!
//{
// m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"), _T("fontTable.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"), _T("/word/fontTable.xml") );
//}
} }
return false; return false;
} }
......
...@@ -38,25 +38,20 @@ public: ...@@ -38,25 +38,20 @@ public:
} }
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
if( false == m_sFootnotes.IsEmpty() ) if( m_sFootnotes.IsEmpty() ) return false;
{
HANDLE hFile = ::CreateFile(sFolder + _T("\\footnotes.xml"), GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
//ATLASSERT( INVALID_HANDLE_VALUE != hFile );
if( INVALID_HANDLE_VALUE != hFile ) CFile file;
{ if (file.CreateFileW(sFolder + FILE_SEPARATOR_STR + _T("footnotes.xml"))) return false;
m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"), _T("footnotes.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"), _T("/word/footnotes.xml") ); m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"), _T("footnotes.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"), _T("/word/footnotes.xml") );
DWORD dwBytesWritten; CString sXml = CreateXml();
CString sXml = CreateXml(); CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL); file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
CloseHandle( hFile ); file.CloseFile();
return true; return true;
}
}
return false;
} }
private: private:
RtfDocument& m_oDocument; RtfDocument& m_oDocument;
...@@ -110,24 +105,19 @@ public: ...@@ -110,24 +105,19 @@ public:
} }
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
if( false == m_sEndnotes.IsEmpty() ) if( m_sEndnotes.IsEmpty() ) return false;
{
HANDLE hFile = ::CreateFile(sFolder + _T("\\endnotes.xml"), GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
//ATLASSERT( INVALID_HANDLE_VALUE != hFile );
if( INVALID_HANDLE_VALUE != hFile ) CFile file;
{ if (file.CreateFileW(sFolder + FILE_SEPARATOR_STR + _T("endnotes.xml"))) return false;
m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"), _T("endnotes.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"), _T("/word/endnotes.xml") );
DWORD dwBytesWritten; m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"), _T("endnotes.xml") );
CStringA sXml = CreateXml(); m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"), _T("/word/endnotes.xml") );
::WriteFile(hFile,sXml ,sXml.GetLength(), &dwBytesWritten, NULL);
CloseHandle(hFile); CStringA sXml = CreateXml();
return true;
} file.WriteFile(sXml.GetBuffer(), sXml.GetLength());
} file.CloseFile();
return false; return true;
} }
private: private:
RtfDocument& m_oDocument; RtfDocument& m_oDocument;
......
...@@ -49,24 +49,19 @@ public: ...@@ -49,24 +49,19 @@ public:
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
if( m_aTargets.size() > 0 ) if( m_aTargets.size() < 1 )return false;
{
CreateDirectory(sFolder + _T("\\_rels"),NULL) ; CString pathRels = sFolder + FILE_SEPARATOR_STR + _T("_rels");
FileSystem::Directory::CreateDirectoryW(pathRels) ;
HANDLE hFile = ::CreateFile(sFolder + _T("\\_rels\\") + m_sFileName + _T(".rels"), GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); CFile file;
//ATLASSERT( INVALID_HANDLE_VALUE != hFile ); if (file.CreateFileW(pathRels + FILE_SEPARATOR_STR + _T(".rels"))) return false;
if( INVALID_HANDLE_VALUE != hFile ) DWORD dwBytesWritten;
{ CString sXml = CreateXml();
DWORD dwBytesWritten; CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
CString sXml = CreateXml(); file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml ); file.CloseFile();
::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL);
CloseHandle( hFile );
return true;
}
}
return false;
} }
}; };
typedef boost::shared_ptr<OOXRelsWriter> OOXRelsWriterPtr; typedef boost::shared_ptr<OOXRelsWriter> OOXRelsWriterPtr;
\ No newline at end of file
...@@ -8,15 +8,15 @@ private: ...@@ -8,15 +8,15 @@ private:
OOXWriter& m_oWriter; OOXWriter& m_oWriter;
CString CreateXml() CString CreateXml()
{ {
CString sResult; CString sResult;
sResult.Append( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>") ); sResult.Append( _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>") );
sResult.Append( _T("\n") ); sResult.Append( _T("\n") );
sResult.Append( _T("<w:settings xmlns:w = \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m = \"http://schemas.openxmlformats.org/officeDocument/2006/math\">") ); sResult.Append( _T("<w:settings xmlns:w = \"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m = \"http://schemas.openxmlformats.org/officeDocument/2006/math\">") );
sResult.Append( m_sFileXml ); sResult.Append( m_sFileXml );
sResult.Append( _T("</w:settings>") ); sResult.Append( _T("</w:settings>") );
return sResult; return sResult;
} }
public: public:
OOXRelsWriterPtr m_oRelsWriter; OOXRelsWriterPtr m_oRelsWriter;
...@@ -31,11 +31,15 @@ public: ...@@ -31,11 +31,15 @@ public:
} }
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
CString pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
if( false == m_sFileXml.IsEmpty() ) if( false == m_sFileXml.IsEmpty() )
{ {
// xml // xml
CString sXml = CreateXml(); CString sXml = CreateXml();
//todoooo
//// xml //// xml
//CString sFilename = sFolder + _T("\\word\\settings.xml"); //CString sFilename = sFolder + _T("\\word\\settings.xml");
//if( true == RtfUtility:: SaveResourceToFile( IDR_SETTINGS, L"XML", sFilename ) ) //if( true == RtfUtility:: SaveResourceToFile( IDR_SETTINGS, L"XML", sFilename ) )
......
...@@ -21,38 +21,28 @@ public: ...@@ -21,38 +21,28 @@ public:
} }
bool Save( CString sFolder ) bool Save( CString sFolder )
{ {
//if( false == m_sFileXml.IsEmpty() ) CString pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
//{
// HANDLE hFile = ::CreateFile(sFolder + _T("\\word\\styles.xml"), if( false == m_sFileXml.IsEmpty() )
// GENERIC_WRITE, {
// 0, CFile file;
// 0, if (file.CreateFileW(pathWord + FILE_SEPARATOR_STR + _T("styles.xml"))) return false;
// CREATE_ALWAYS,
// FILE_ATTRIBUTE_NORMAL,
// 0);
// //ATLASSERT( INVALID_HANDLE_VALUE != hFile );
// if( INVALID_HANDLE_VALUE != hFile ) m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"), _T("styles.xml") );
// { m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), _T("/word/styles.xml") );
// m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"), _T("styles.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), _T("/word/styles.xml") );
// DWORD dwBytesWritten; DWORD dwBytesWritten;
// CString sXml = CreateXml(); CString sXml = CreateXml();
// CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml ); CStringA sXmlUTF = Convert::UnicodeToUtf8( sXml );
// ::WriteFile(hFile, sXmlUTF, sXmlUTF.GetLength(), &dwBytesWritten, NULL);
// CloseHandle( hFile ); file.WriteFile(sXmlUTF.GetBuffer(), sXmlUTF.GetLength());
// return true; file.CloseFile();
// } return true;
//} }
//else else
//{ {
// if( true == RtfUtility:: SaveResourceToFile( IDR_STYLES, L"XML", sFolder + _T("\\word\\styles.xml") ) ) //todooo default style !!
// { }
// m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"), _T("styles.xml") );
// m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"), _T("/word/styles.xml") );
// }
//}
return false; return false;
} }
private: private:
......
...@@ -12,8 +12,12 @@ public: ...@@ -12,8 +12,12 @@ public:
} }
bool Save( CString sFolder ) //todo bool Save( CString sFolder ) //todo
{ {
//CreateDirectory(sFolder + _T("\\word"), NULL); CString pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
//CreateDirectory(sFolder + _T("\\word\\theme"),NULL);
FileSystem::Directory::CreateDirectoryW(pathWord) ;
FileSystem::Directory::CreateDirectoryW(pathWord + FILE_SEPARATOR_STR + _T("theme")) ;
//todooo default theme !!!!!
// //
//if( true == RtfUtility:: SaveResourceToFile( IDR_THEME, L"XML", sFolder + _T("\\word\\theme\\theme1.xml") ) ) //if( true == RtfUtility:: SaveResourceToFile( IDR_THEME, L"XML", sFolder + _T("\\word\\theme\\theme1.xml") ) )
//{ //{
......
...@@ -59,37 +59,37 @@ bool OOXWriter::Save() ...@@ -59,37 +59,37 @@ bool OOXWriter::Save()
} }
bool OOXWriter::SaveByItemStart() bool OOXWriter::SaveByItemStart()
{ {
//((OOXFootnoteWriter*)m_poFootnoteWriter)->Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); ((OOXFootnoteWriter*)m_poFootnoteWriter)->Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
//((OOXEndnoteWriter*)m_poEndnoteWriter)->Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); ((OOXEndnoteWriter*)m_poEndnoteWriter)->Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
//if( m_oFootnoteSep->GetCount() ) if( m_oFootnoteSep->GetCount() )
//{ {
// oNewParam = oRenderParameter; oNewParam = oRenderParameter;
// oNewParam.poRels = &poFootnoteWriter->m_oRelsWriter; oNewParam.poRels = &poFootnoteWriter->m_oRelsWriter;
// oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
// poFootnoteWriter->AddFootnote( _T("separator"), -1, m_oFootnoteSep->RenderToOOX(oNewParam) ); poFootnoteWriter->AddFootnote( _T("separator"), -1, m_oFootnoteSep->RenderToOOX(oNewParam) );
//} }
//if( m_oFootnoteCon->GetCount() ) if( m_oFootnoteCon->GetCount() )
//{ {
// oNewParam = oRenderParameter; oNewParam = oRenderParameter;
// oNewParam.poRels = &poFootnoteWriter->m_oRelsWriter; oNewParam.poRels = &poFootnoteWriter->m_oRelsWriter;
// oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
// poFootnoteWriter->AddFootnote( _T("continuationSeparator"), 0, m_oFootnoteCon->RenderToOOX( oNewParam ) ); poFootnoteWriter->AddFootnote( _T("continuationSeparator"), 0, m_oFootnoteCon->RenderToOOX( oNewParam ) );
//} }
//if( m_oEndnoteSep->GetCount() ) if( m_oEndnoteSep->GetCount() )
//{ {
// oNewParam = oRenderParameter; oNewParam = oRenderParameter;
// oNewParam.poRels = &poEndnoteWriter->m_oRelsWriter; oNewParam.poRels = &poEndnoteWriter->m_oRelsWriter;
// oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
// poEndnoteWriter->AddEndnote( _T("separator"), -1, m_oEndnoteSep->RenderToOOX(oNewParam) ); poEndnoteWriter->AddEndnote( _T("separator"), -1, m_oEndnoteSep->RenderToOOX(oNewParam) );
//} }
//if( m_oEndnoteCon->GetCount() ) if( m_oEndnoteCon->GetCount() )
//{ {
// oNewParam = oRenderParameter; oNewParam = oRenderParameter;
// oNewParam.poRels = &poEndnoteWriter->m_oRelsWriter; oNewParam.poRels = &poEndnoteWriter->m_oRelsWriter;
// oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
// poEndnoteWriter->AddEndnote( _T("continuationSeparator"), 0, m_oEndnoteSep->RenderToOOX(oNewParam) ); poEndnoteWriter->AddEndnote( _T("continuationSeparator"), 0, m_oEndnoteSep->RenderToOOX(oNewParam) );
//} }
return ((OOXDocumentWriter*)m_poDocumentWriter)->SaveByItemStart( m_sTargetFolder ); return ((OOXDocumentWriter*)m_poDocumentWriter)->SaveByItemStart( m_sTargetFolder );
} }
...@@ -137,8 +137,8 @@ bool OOXWriter::SaveByItemEnd() ...@@ -137,8 +137,8 @@ bool OOXWriter::SaveByItemEnd()
((OOXDocumentWriter*)m_poDocumentWriter)->SaveByItemEnd(); ((OOXDocumentWriter*)m_poDocumentWriter)->SaveByItemEnd();
((OOXFootnoteWriter*)m_poFootnoteWriter)->Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); ((OOXFootnoteWriter*)m_poFootnoteWriter)->Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
((OOXEndnoteWriter*)m_poEndnoteWriter)->Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); ((OOXEndnoteWriter*)m_poEndnoteWriter)->Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
((OOXNumberingWriter*)m_poNumberingWriter)->Save(m_sTargetFolder); ((OOXNumberingWriter*)m_poNumberingWriter)->Save(m_sTargetFolder);
((OOXStylesWriter*)m_poStylesWriter)->Save(m_sTargetFolder); ((OOXStylesWriter*)m_poStylesWriter)->Save(m_sTargetFolder);
((OOXFontTableWriter*)m_poFontTableWriter)->Save(m_sTargetFolder); ((OOXFontTableWriter*)m_poFontTableWriter)->Save(m_sTargetFolder);
...@@ -149,8 +149,8 @@ bool OOXWriter::SaveByItemEnd() ...@@ -149,8 +149,8 @@ bool OOXWriter::SaveByItemEnd()
bool nResult = true; bool nResult = true;
nResult &= m_oContentTypes.Save(m_sTargetFolder); nResult &= m_oContentTypes.Save(m_sTargetFolder);
nResult &= m_oRels.Save(m_sTargetFolder); nResult &= m_oRels.Save(m_sTargetFolder);
nResult &= m_oDocRels.Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); nResult &= m_oDocRels.Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
for( int i = 0; i < (int)m_oCustomRelsWriter.size(); i++ ) for( int i = 0; i < (int)m_oCustomRelsWriter.size(); i++ )
m_oCustomRelsWriter[i]->Save(m_sTargetFolder + _T("\\") + m_sDocumentFolder); m_oCustomRelsWriter[i]->Save(m_sTargetFolder + FILE_SEPARATOR_STR + m_sDocumentFolder);
return nResult; return nResult;
} }
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//45 //47
#define INTVER 1,0,1,45 #define INTVER 1,0,1,47
#define STRVER "1,0,1,45\0" #define STRVER "1,0,1,47\0"
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