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

DocFile

PPTFile
RtfFile

x64 win build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62002 954022d7-b5bf-4e40-9824-e11837661b57
parent db893510
...@@ -2982,9 +2982,12 @@ Redist/Repairing.exe svn_mime_002dtype=application%2Foctet-stream ...@@ -2982,9 +2982,12 @@ Redist/Repairing.exe svn_mime_002dtype=application%2Foctet-stream
Redist/VersionControl.exe svn_mime_002dtype=application%2Foctet-stream Redist/VersionControl.exe svn_mime_002dtype=application%2Foctet-stream
Redist/XlsxSerializerCom.dll svn_mime_002dtype=application%2Foctet-stream Redist/XlsxSerializerCom.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64 svnc_tsvn_003alogminsize=5 Redist/x64 svnc_tsvn_003alogminsize=5
Redist/x64/ASCOfficeDocFile.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64/ASCOfficeDocxFile2.dll svn_mime_002dtype=application%2Foctet-stream Redist/x64/ASCOfficeDocxFile2.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64/ASCOfficeOdfFile.dll svn_mime_002dtype=application%2Foctet-stream Redist/x64/ASCOfficeOdfFile.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64/ASCOfficeOdfFileW.dll svn_mime_002dtype=application%2Foctet-stream Redist/x64/ASCOfficeOdfFileW.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64/ASCOfficePPTFile.dll svn_mime_002dtype=application%2Foctet-stream
Redist/x64/ASCOfficeRtfFile.dll svn_mime_002dtype=application%2Foctet-stream
RedistOpenSource/ASCOfficeDocxFile2.dll svn_mime_002dtype=application%2Foctet-stream RedistOpenSource/ASCOfficeDocxFile2.dll svn_mime_002dtype=application%2Foctet-stream
RedistOpenSource/ASCOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream RedistOpenSource/ASCOfficePDFWriter.dll svn_mime_002dtype=application%2Foctet-stream
RedistOpenSource/ASCOfficePPTXFile.dll svn_mime_002dtype=application%2Foctet-stream RedistOpenSource/ASCOfficePPTXFile.dll svn_mime_002dtype=application%2Foctet-stream
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "resource.h" #include "resource.h"
#define COMPONENT_NAME "OfficeDocFile" #define COMPONENT_NAME "OfficeDocFile"
#include "../../Common/FileInfo.h" #include "../../Common/FileInfo.h"
#include "version.h" #include "../version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine="..\..\Redist\VersionControl.exe $(ProjectDir)version.h" CommandLine="$(SolutionDir)..\..\Redist\VersionControl.exe $(SolutionDir)..\version.h"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine="..\..\Redist\VersionControl.exe $(ProjectDir)version.h" CommandLine="$(SolutionDir)..\..\Redist\VersionControl.exe $(SolutionDir)..\version.h"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
......
...@@ -158,12 +158,13 @@ public: ...@@ -158,12 +158,13 @@ public:
std::list<std::string> GetAllStreams( const std::string& storageName ); std::list<std::string> GetAllStreams( const std::string& storageName );
Storage( const Storage& );
Storage& operator=( const Storage& );
private: private:
StorageIO* io; StorageIO* io;
// no copy or assign // no copy or assign
Storage( const Storage& );
Storage& operator=( const Storage& );
}; };
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//226 //228
#define INTVER 1,0,1,226 #define INTVER 1,0,1,228
#define STRVER "1,0,1,226\0" #define STRVER "1,0,1,228\0"
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//2 //2
//0 //0
//1 //1
//313 //314
#define INTVER 2,0,1,313 #define INTVER 2,0,1,314
#define STRVER "2,0,1,313\0" #define STRVER "2,0,1,314\0"
#pragma once #pragma once
#include "../../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h" #include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "PPTDocumentInfo.h" #include "PPTDocumentInfo.h"
......
#pragma once #pragma once
#include "../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.h" #include "../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.h"
#include "SlidePersist.h" #include "SlidePersist.h"
#include <zlib.h> #include <zlib.h>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "PPTFileDefines.h" #include "PPTFileDefines.h"
#include "../Reader/ReadStructures.h" #include "../Reader/ReadStructures.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTShape/Enums.h" #include "../../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTShape/Enums.h"
using namespace NSPresentationEditor; using namespace NSPresentationEditor;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <map> #include <map>
#include "../../Reader/Records.h" #include "../../Reader/Records.h"
#include "../../../../../ASCPresentationEditor/OfficeDrawing/Document.h" #include "../../../../ASCPresentationEditor/OfficeDrawing/Document.h"
#ifdef _DEBUG #ifdef _DEBUG
#define _DEBUG_LOG // _DEBUG_LOG #define _DEBUG_LOG // _DEBUG_LOG
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "TextSpecInfoAtom.h" #include "TextSpecInfoAtom.h"
#include "TextRulerAtom.h" #include "TextRulerAtom.h"
#include "TextInteractiveInfoAtom.h" #include "TextInteractiveInfoAtom.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Interactive.h" #include "../../../ASCPresentationEditor/OfficeDrawing/Interactive.h"
class CTextFullSettings class CTextFullSettings
{ {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
#include "resource.h" #include "resource.h"
#define COMPONENT_NAME "OfficePPTFile" #define COMPONENT_NAME "OfficePPTFile"
#include "../../../Common/FileInfo.h" #include "../../Common/FileInfo.h"
#include "version.h" #include "../version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
......
This diff is collapsed.
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h" CommandLine="..\..\Redist\VersionControl.exe $(ProjectDir)..\version.h"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Performing registration" Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\..\..\Redist&quot;&#x0D;&#x0A;" CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\..\Redist&quot;&#x0D;&#x0A;"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h" CommandLine="..\..\Redist\VersionControl.exe $(ProjectDir)..\version.h"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Performing registration" Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\..\..\Redist\x64&quot;&#x0D;&#x0A;" CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)..\..\Redist\x64&quot;&#x0D;&#x0A;"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
#pragma once #pragma once
#include "resource.h" // main symbols #include "resource.h" // main symbols
#include "../../../Common/OfficeFileTemplate.h" #include "../../Common/OfficeFileTemplate.h"
#include "../../../Common/ATLDefine.h" #include "../../Common/ATLDefine.h"
#include "../../../Common/ASCUtils.h" #include "../../Common/ASCUtils.h"
#include "../../../Common/VideoFileErrorDescription.h" #include "../../Common/VideoFileErrorDescription.h"
#include "../PPTFormatLib/PPTFormatLib.h" #include "../PPTFormatLib/PPTFormatLib.h"
......
...@@ -56,5 +56,5 @@ using namespace ATL; ...@@ -56,5 +56,5 @@ using namespace ATL;
#endif #endif
#include "../../../Common/ASCATLError.h" #include "../../Common/ASCATLError.h"
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//257 //264
#define INTVER 1,0,1,257 #define INTVER 1,0,1,264
#define STRVER "1,0,1,257\0" #define STRVER "1,0,1,264\0"
...@@ -81,12 +81,11 @@ ...@@ -81,12 +81,11 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win32" Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(ConfigurationName)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4" ConfigurationType="4"
CharacterSet="1" CharacterSet="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -102,11 +101,15 @@ ...@@ -102,11 +101,15 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED" Optimization="0"
RuntimeLibrary="2" PreprocessorDefinitions="_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
...@@ -141,11 +144,12 @@ ...@@ -141,11 +144,12 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|x64" Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4" ConfigurationType="4"
CharacterSet="1" CharacterSet="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -161,15 +165,11 @@ ...@@ -161,15 +165,11 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED" RuntimeLibrary="2"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
...@@ -816,10 +816,6 @@ ...@@ -816,10 +816,6 @@
RelativePath="..\..\..\Common\DocxFormat\Source\XML\stringcommon.cpp" RelativePath="..\..\..\Common\DocxFormat\Source\XML\stringcommon.cpp"
> >
</File> </File>
<File
RelativePath="..\source\test_h_any.cpp"
>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
......
#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"
#include "Basic.h" #include "Basic.h"
class StringStream class StringStream
{ {
private: LONGLONG m_nSizeAbs;// private:
private: LONGLONG m_nPosAbs;// LONGLONG m_nSizeAbs;//
LONGLONG m_nPosAbs;//
//private: CStringA m_sBuffer; //CStringA m_sBuffer;
private: unsigned char* m_aBuffer; unsigned char* m_aBuffer;
public:StringStream() public:
StringStream()
{ {
m_aBuffer = NULL; m_aBuffer = NULL;
Clear(); Clear();
} }
public:~StringStream() ~StringStream()
{ {
Clear(); Clear();
} }
public: void Clear() void Clear()
{ {
RELEASEARRAYOBJECTS( m_aBuffer ); RELEASEARRAYOBJECTS( m_aBuffer );
//m_sBuffer = _T(""); //m_sBuffer = _T("");
m_nSizeAbs = 0; m_nSizeAbs = 0;
m_nPosAbs = -1; m_nPosAbs = -1;
} }
public: void SetSource( CString sPath ) void SetSource( CString sPath )
{ {
Clear(); Clear();
HANDLE hSrc = CreateFile((LPCWSTR)sPath, // file to open HANDLE hSrc = CreateFile((LPCWSTR)sPath, // file to open
...@@ -47,7 +51,7 @@ public: void SetSource( CString sPath ) ...@@ -47,7 +51,7 @@ public: void SetSource( CString sPath )
ReadFile(hSrc, m_aBuffer, m_nSizeAbs, &dwBytesRead, NULL); ReadFile(hSrc, m_aBuffer, m_nSizeAbs, &dwBytesRead, NULL);
RELEASEHANDLE( hSrc ); RELEASEHANDLE( hSrc );
} }
public: void getBytes( int nCount, byte** pbData ) void getBytes( int nCount, byte** pbData )
{ {
if( m_nPosAbs + nCount < m_nSizeAbs ) if( m_nPosAbs + nCount < m_nSizeAbs )
{ {
...@@ -56,7 +60,7 @@ public: void getBytes( int nCount, byte** pbData ) ...@@ -56,7 +60,7 @@ public: void getBytes( int nCount, byte** pbData )
m_nPosAbs += nCount; m_nPosAbs += nCount;
} }
} }
public: int getc() int getc()
{ {
int nResult = EOF; int nResult = EOF;
if( m_nPosAbs + 1 < m_nSizeAbs ) if( m_nPosAbs + 1 < m_nSizeAbs )
...@@ -66,13 +70,13 @@ public: int getc() ...@@ -66,13 +70,13 @@ public: int getc()
} }
return nResult; return nResult;
} }
public: void ungetc() void ungetc()
{ {
// ungetc getc // ungetc getc
// 0 // 0
m_nPosAbs--; m_nPosAbs--;
} }
public: void putString( CStringA sText ) void putString( CStringA sText )
{ {
int nExtBufSize = sText.GetLength(); int nExtBufSize = sText.GetLength();
// //
...@@ -92,11 +96,11 @@ public: void putString( CStringA sText ) ...@@ -92,11 +96,11 @@ public: void putString( CStringA sText )
m_nSizeAbs += nExtBufSize; m_nSizeAbs += nExtBufSize;
} }
public: LONGLONG getCurPosition() LONGLONG getCurPosition()
{ {
return m_nPosAbs; return m_nPosAbs;
} }
public: LONGLONG getSize() LONGLONG getSize()
{ {
return m_nSizeAbs; return m_nSizeAbs;
} }
...@@ -104,45 +108,46 @@ public: LONGLONG getSize() ...@@ -104,45 +108,46 @@ public: LONGLONG getSize()
class RtfLex class RtfLex
{ {
private: StringStream m_oStream;
private: RtfToken m_oCurToken;
public: NFileWriter::CBufferedFileWriter* m_oFileWriter;
public: char* m_caReadBuffer;
public: int m_nReadBufSize;
private: private:
public: RtfLex() StringStream m_oStream;
RtfToken m_oCurToken;
public:
NFileWriter::CBufferedFileWriter* m_oFileWriter;
char* m_caReadBuffer;
int m_nReadBufSize;
RtfLex()
{ {
m_oFileWriter = NULL; m_oFileWriter = NULL;
m_nReadBufSize = 1024 * 1024 * 5; // 5 m_nReadBufSize = 1024 * 1024 * 5; // 5
m_caReadBuffer = (char*)::HeapAlloc(GetProcessHeap(), 0, m_nReadBufSize); m_caReadBuffer = (char*)::HeapAlloc(GetProcessHeap(), 0, m_nReadBufSize);
} }
public: ~RtfLex() ~RtfLex()
{ {
RELEASEHEAP( m_caReadBuffer ); RELEASEHEAP( m_caReadBuffer );
RELEASEOBJECT( m_oFileWriter ); RELEASEOBJECT( m_oFileWriter );
} }
public: double GetProgress() double GetProgress()
{ {
return 1.0 * m_oStream.getCurPosition() / m_oStream.getSize(); return 1.0 * m_oStream.getCurPosition() / m_oStream.getSize();
} }
public: void SetSource( CString sPath ) void SetSource( CString sPath )
{ {
m_oStream.SetSource( sPath); m_oStream.SetSource( sPath);
} }
public: void CloseSource() void CloseSource()
{ {
m_oStream.Clear(); m_oStream.Clear();
} }
public: RtfToken NextCurToken() RtfToken NextCurToken()
{ {
return m_oCurToken; return m_oCurToken;
} }
public: void ReadBytes( int nCount, byte** pbData ) void ReadBytes( int nCount, byte** pbData )
{ {
m_oStream.getBytes(nCount, pbData); m_oStream.getBytes(nCount, pbData);
} }
public: RtfToken NextToken() RtfToken NextToken()
{ {
int c; int c;
...@@ -183,8 +188,12 @@ public: RtfToken NextToken() ...@@ -183,8 +188,12 @@ public: RtfToken NextToken()
return m_oCurToken; return m_oCurToken;
} }
void putString( CStringA sText )
private: void parseKeyword(RtfToken& token) {
m_oStream.putString( sText );
}
private:
void parseKeyword(RtfToken& token)
{ {
CStringA palabraClave; CStringA palabraClave;
palabraClave.GetBuffer( 20 ); palabraClave.GetBuffer( 20 );
...@@ -300,7 +309,7 @@ private: void parseKeyword(RtfToken& token) ...@@ -300,7 +309,7 @@ private: void parseKeyword(RtfToken& token)
m_oStream.getc(); m_oStream.getc();
} }
} }
private: void parseText(int car, RtfToken& token) void parseText(int car, RtfToken& token)
{ {
int nTempBufPos = 0; //1 int nTempBufPos = 0; //1
...@@ -330,7 +339,7 @@ private: void parseText(int car, RtfToken& token) ...@@ -330,7 +339,7 @@ private: void parseText(int car, RtfToken& token)
token.Key.Append( m_caReadBuffer ); token.Key.Append( m_caReadBuffer );
} }
} }
private: bool GetNextChar( int& nChar ) bool GetNextChar( int& nChar )
{ {
int c = m_oStream.getc(); int c = m_oStream.getc();
m_oStream.ungetc(); m_oStream.ungetc();
...@@ -350,7 +359,7 @@ private: bool GetNextChar( int& nChar ) ...@@ -350,7 +359,7 @@ private: bool GetNextChar( int& nChar )
else else
return false; return false;
} }
private: void parseTextFile(int car, RtfToken& token) void parseTextFile(int car, RtfToken& token)
{ {
if( NULL != m_oFileWriter ) if( NULL != m_oFileWriter )
{ {
...@@ -381,9 +390,6 @@ private: void parseTextFile(int car, RtfToken& token) ...@@ -381,9 +390,6 @@ private: void parseTextFile(int car, RtfToken& token)
{ {
} }
} }
} }
public: void putString( CStringA sText )
{
m_oStream.putString( sText );
}
}; };
...@@ -32,7 +32,9 @@ CString RtfPicture::GenerateWMF(RenderParameter oRenderParameter) ...@@ -32,7 +32,9 @@ CString RtfPicture::GenerateWMF(RenderParameter oRenderParameter)
// //
RtfWriter * poWriter = static_cast<RtfWriter*>( oRenderParameter.poWriter ); RtfWriter * poWriter = static_cast<RtfWriter*>( oRenderParameter.poWriter );
//IUnknown* piTempPict = NULL; IUnknown* piTempPict = NULL;
//todooo ???
//if( true == LoadPicture( &piTempPict, m_sPicFilename ) ) //if( true == LoadPicture( &piTempPict, m_sPicFilename ) )
//{ //{
// CString sTempFile = Utils::CreateTempFile( poWriter->m_sTempFolder ); // CString sTempFile = Utils::CreateTempFile( poWriter->m_sTempFolder );
...@@ -40,11 +42,9 @@ CString RtfPicture::GenerateWMF(RenderParameter oRenderParameter) ...@@ -40,11 +42,9 @@ CString RtfPicture::GenerateWMF(RenderParameter oRenderParameter)
// { // {
// m_aTempFiles.push_back( sTempFile ); // m_aTempFiles.push_back( sTempFile );
// sResult.Append( RtfInternalEncoder::Encode( sTempFile ) ); // sResult.Append( RtfInternalEncoder::Encode( sTempFile ) );
// //RtfUtility::ReadDataFromFile( sTempFile, sResult );
// } // }
// //Utils::RemoveDirOrFile( sTempFile );
//} //}
//RELEASEINTERFACE( piTempPict ); RELEASEINTERFACE( piTempPict );
sResult.Append(_T("}")); sResult.Append(_T("}"));
return sResult; return sResult;
...@@ -82,9 +82,7 @@ CString RtfPicture::RenderToRtf(RenderParameter oRenderParameter) ...@@ -82,9 +82,7 @@ CString RtfPicture::RenderToRtf(RenderParameter oRenderParameter)
} }
sResult.Append( _T(" ")); sResult.Append( _T(" "));
//m_aTempFiles.push_back( m_sPicFilename );
sResult.Append( RtfInternalEncoder::Encode( m_sPicFilename ) ); sResult.Append( RtfInternalEncoder::Encode( m_sPicFilename ) );
//RtfUtility::ReadDataFromFile( m_sPicFilename, sResult );
sResult.Append(_T("}")); sResult.Append(_T("}"));
return sResult; return sResult;
......
...@@ -80,34 +80,6 @@ namespace Strings ...@@ -80,34 +80,6 @@ namespace Strings
return d; return d;
} }
//static BOOL ToBinary(const CString& strValue, BYTE*& pData, int& nSizeAllocated, int& nSizeArray)
//{
// pData = NULL;
// nSizeArray = 0;
// nSizeAllocated = Base64::Base64DecodeGetRequiredLength(strValue.GetLength());
// if (nSizeAllocated < 1)
// return FALSE;
//
// pData = new BYTE[nSizeAllocated];
// if (!pData)
// return FALSE;
// nSizeArray = nSizeAllocated;
// CT2A convert(strValue);
// if (!Base64::Base64Decode(convert, strValue.GetLength(), pData, &nSizeArray))
// {
// delete[] pData;
// pData = NULL;
// nSizeArray = 0;
// nSizeAllocated = 0;
// return FALSE;
// }
// return TRUE;
//}
static CString FromInteger(int Value, int Base = 10) static CString FromInteger(int Value, int Base = 10)
{ {
...@@ -132,113 +104,7 @@ namespace Strings ...@@ -132,113 +104,7 @@ namespace Strings
return _T("false"); return _T("false");
} }
//static CStringA FromBinary(const BYTE* pData, long lSize)
//{
// if ((NULL == pData) || (0 == lSize))
// return "";
// CStringA sResult;
// int nStrSize = Base64::Base64EncodeGetRequiredLength(lSize);
// LPSTR pStrData = sResult.GetBuffer(nStrSize + 1);
// BOOL bSuccess = Base64::Base64Encode(pData, lSize, pStrData, &nStrSize);
//
// pStrData[nStrSize] = '\0';
// sResult.ReleaseBuffer();
// return sResult;
//}
//static CString FromVariant(VARIANT val)
//{
// CString sVal = _T("");
// switch (VT_TYPEMASK & val.vt)
// {
// case VT_EMPTY:
// break;
// case VT_NULL:
// sVal = _T("");
// break;
// case VT_I2:
// sVal.Format(_T("%d"), val.iVal);
// break;
// case VT_I4:
// sVal.Format(_T("%d"), val.lVal);
// break;
// case VT_R4:
// sVal.Format(_T("%f"), val.fltVal);
// break;
// case VT_R8:
// sVal.Format(_T("%f"), val.dblVal);
// break;
// case VT_DATE:
// sVal.Format(_T("%f"), val.date);
// break;
// case VT_BSTR:
// sVal = val.bstrVal;
// break;
// case VT_BOOL:
// sVal = (VARIANT_TRUE == val.boolVal) ? _T("1") : _T("0");
// break;
// case VT_VARIANT:
// sVal = _T("");
// break;
// case VT_UNKNOWN:
// sVal = _T("");
// // IDispatch ,
// break;
// case VT_I1:
// sVal.Format(_T("%d"), val.cVal);
// break;
// case VT_UI1:
// sVal.Format(_T("%d"), val.bVal);
// break;
// case VT_UI2:
// sVal.Format(_T("%d"), val.uiVal);
// break;
// case VT_UI4:
// sVal.Format(_T("%d"), val.ulVal);
// break;
// case VT_I8:
// sVal.Format(_T("%d"), val.llVal);
// break;
// case VT_UI8:
// sVal.Format(_T("%d"), val.ullVal);
// break;
// case VT_INT:
// sVal.Format(_T("%d"), val.intVal);
// break;
// case VT_UINT:
// sVal.Format(_T("%d"), val.uintVal);
// break;
// case VT_DECIMAL:
// case VT_CY:
// case VT_SAFEARRAY:
// case VT_VOID:
// case VT_HRESULT:
// case VT_CARRAY:
// case VT_USERDEFINED:
// case VT_LPSTR:
// case VT_LPWSTR:
// case VT_RECORD:
// case VT_INT_PTR:
// case VT_UINT_PTR:
// case VT_FILETIME:
// case VT_BLOB:
// case VT_STREAM:
// case VT_STORAGE:
// case VT_STREAMED_OBJECT:
// case VT_STORED_OBJECT:
// case VT_BLOB_OBJECT:
// case VT_CF:
// case VT_CLSID:
// case VT_VERSIONED_STREAM:
// case VT_BSTR_BLOB:
// sVal = _T("");
// break;
// }
// return sVal;
//}
} }
class Convert class Convert
...@@ -272,6 +138,7 @@ public: ...@@ -272,6 +138,7 @@ public:
} }
static bool MultybyteToUnicode(CStringA sInputStr, CStringW& sOutputStr, int nCodepage) static bool MultybyteToUnicode(CStringA sInputStr, CStringW& sOutputStr, int nCodepage)
{ {
//todooo
sOutputStr = _T(""); sOutputStr = _T("");
int nBufSize = MultiByteToWideChar(nCodepage, 0, sInputStr, -1, NULL, NULL); int nBufSize = MultiByteToWideChar(nCodepage, 0, sInputStr, -1, NULL, NULL);
LPWSTR p = new WCHAR[ nBufSize + 1 ]; LPWSTR p = new WCHAR[ nBufSize + 1 ];
...@@ -288,6 +155,7 @@ public: ...@@ -288,6 +155,7 @@ public:
} }
static CStringW Utf8ToUnicode(CStringA sInputStr)//todo static CStringW Utf8ToUnicode(CStringA sInputStr)//todo
{ {
//todooo
CStringW sResult; CStringW sResult;
int nBufSize = MultiByteToWideChar(CP_UTF8, 0, sInputStr, -1, NULL, NULL); int nBufSize = MultiByteToWideChar(CP_UTF8, 0, sInputStr, -1, NULL, NULL);
LPWSTR p = new WCHAR[ nBufSize + 1 ]; LPWSTR p = new WCHAR[ nBufSize + 1 ];
...@@ -299,6 +167,7 @@ public: ...@@ -299,6 +167,7 @@ public:
} }
static CStringA UnicodeToUtf8(CStringW sInputStr)//todo static CStringA UnicodeToUtf8(CStringW sInputStr)//todo
{ {
//todooo
CStringA sResult; CStringA sResult;
int nBufSize = WideCharToMultiByte(CP_UTF8, 0, sInputStr, -1, NULL, NULL, NULL, NULL); int nBufSize = WideCharToMultiByte(CP_UTF8, 0, sInputStr, -1, NULL, NULL, NULL, NULL);
LPSTR p = new CHAR[ nBufSize + 1 ]; LPSTR p = new CHAR[ nBufSize + 1 ];
...@@ -421,17 +290,19 @@ public: ...@@ -421,17 +290,19 @@ public:
{ {
if( NULL == pbData ) if( NULL == pbData )
return; return;
HANDLE hFile = ::CreateFile( sFilename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL, 0);
CFile file;
if (file.CreateFileW(sFilename) != S_OK) return;
DWORD dwBytesWritten; DWORD dwBytesWritten;
::WriteFile(hFile,pbData ,nLength, &dwBytesWritten, NULL); file.WriteFile(pbData ,nLength);
CloseHandle( hFile ); file.CloseFile();
} }
static void WriteDataToFile(CString& sFilename, CString& sData) static void WriteDataToFile(CString& sFilename, CString& sData)
{ {
HANDLE hFile = ::CreateFile( sFilename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL, 0); CFile file;
DWORD dwBytesWritten; if (file.CreateFileW(sFilename) != S_OK) return;
TCHAR * buf = sData.GetBuffer(); TCHAR * buf = sData.GetBuffer();
int nLengthText = sData.GetLength(); int nLengthText = sData.GetLength();
...@@ -444,10 +315,11 @@ public: ...@@ -444,10 +315,11 @@ public:
nByte |= ToByte( buf[2 * i + 1] ); nByte |= ToByte( buf[2 * i + 1] );
buf2[i] = nByte; buf2[i] = nByte;
} }
::WriteFile(hFile,buf2 ,nLengthData, &dwBytesWritten, NULL); file.WriteFile(buf2 ,nLengthData);
sData.ReleaseBuffer(); sData.ReleaseBuffer();
delete[] buf2; delete[] buf2;
CloseHandle( hFile ); file.CloseFile();
} }
static void WriteDataToBinary( CString sData, BYTE** ppData, long& nSize) static void WriteDataToBinary( CString sData, BYTE** ppData, long& nSize)
{ {
......
...@@ -21,27 +21,21 @@ public: ...@@ -21,27 +21,21 @@ public:
{ {
if( false == m_sFileXml.IsEmpty() ) if( false == m_sFileXml.IsEmpty() )
{ {
HANDLE hFile = ::CreateFile(sFolder + _T("\\word\\numbering.xml"), CFile file;
GENERIC_WRITE,
0, if (file.CreateFileW(sFolder + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("numbering.xml")) != S_OK) return false;
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/numbering"), _T("numbering.xml") ); m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"), _T("numbering.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"), _T("/word/numbering.xml") ); m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"), _T("/word/numbering.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());
file.CloseFile();
return true; return true;
}
} }
return false; return false;
} }
......
This diff is collapsed.
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//42 //45
#define INTVER 1,0,0,42 #define INTVER 1,0,1,45
#define STRVER "1,0,0,42\0" #define STRVER "1,0,1,45\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