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

расширение X2t до форматов Rtf, Doc (linux)

FileChecker для входных файлов  (linux)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62308 954022d7-b5bf-4e40-9824-e11837661b57
parent add4140c
/ svn_global_002dignores=SDK%0A
ASCHTMLRenderer/Mac svnc_tsvn_003alogminsize=5
ASCHTMLRenderer/Mac/ASCHTMLRendererLib svnc_tsvn_003alogminsize=5
ASCHTMLRenderer/Mac/ASCHTMLRendererLib.xcodeproj svnc_tsvn_003alogminsize=5
......
......@@ -160,7 +160,6 @@ namespace DocFileFormat
long Converter::LoadAndConvert(const CString& strSrcFile, const CString& strDstDirectory, const ProgressCallback* progress)
{
g_oCriticalSection.Enter();
long result = S_FALSE;
......@@ -190,8 +189,6 @@ namespace DocFileFormat
}
}
g_oCriticalSection.Leave();
return result;
}
}
......@@ -15,8 +15,6 @@
#include "WordprocessingDocument.h"
#include "ConversionContext.h"
extern ASCOfficeCriticalSection g_oCriticalSection;
namespace DocFileFormat
{
class Converter
......
......@@ -6,66 +6,17 @@
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../ASCOfficeUtils/ASCOfficeUtilsLib/OfficeUtils.h"
HRESULT COfficeDocFile::LoadFromFile(CString bsDocFile, CString bsDocx, CString bsXMLOptions, ProgressCallback *ffCallBack )
HRESULT COfficeDocFile::LoadFromFile(CString bsDocFile, CString bsDocxDirectory, CString bsXMLOptions, ProgressCallback *ffCallBack )
{
#if defined(_DEBUG) && defined (_WIN32)
//_CrtDumpMemoryLeaks();
//_CrtSetBreakAlloc(11001);
#endif
HRESULT hr = S_FALSE;
DocFileFormat::Converter docToDocx;
if (m_strTempDirectory.GetLength() < 1)
{
m_strTempDirectory = FileSystem::Directory::GetTempPath();
}
CString sDocxDirectory;
#if !defined(_WIN32) && !defined(_WIN64)
sDocxDirectory = FileSystem::Directory::CreateDirectoryWithUniqueName(m_strTempDirectory);
#else
sDocxDirectory = bsDocx;
FileSystem::Directory::CreateDirectory(sDocxDirectory);
#endif
hr= docToDocx.LoadAndConvert(bsDocFile,sDocxDirectory, ffCallBack);
#ifndef _WIN32
if (hr == S_OK)
{
//zipping
COfficeUtils oCOfficeUtils(NULL);
hr = oCOfficeUtils.CompressFileOrDirectory (string2std_string(sDocxDirectory), string2std_string(bsDocx), -1);
FileSystem::Directory::DeleteDirectory(sDocxDirectory);
}
#endif
#if defined(_DEBUG) && (defined(_WIN32) || defined(_WIN64))
//_CrtDumpMemoryLeaks();
#endif
hr= docToDocx.LoadAndConvert(bsDocFile, bsDocxDirectory, ffCallBack);
return hr;
}
HRESULT COfficeDocFile::SaveToFile (CString sDstFileName, CString sSrcFileName, CString sXMLOptions, ProgressCallback *ffCallBack )
{
HRESULT hr = S_OK;
//DOCXTODOC::CFileTransformer oTransformer;
#if defined(_DEBUG) && (defined(_WIN32) || defined(_WIN64))
//_CrtDumpMemoryLeaks();
#endif
//hr = oTransformer.Convert(sSrcPath, sDstFileName, ffCallBack);
#if defined(_DEBUG) && (defined(_WIN32) || defined(_WIN64))
//_CrtDumpMemoryLeaks();
#endif
return hr;
return S_OK;
}
......@@ -1228,14 +1228,6 @@
RelativePath="..\DocFormatLib.h"
>
</File>
<File
RelativePath="..\..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
>
</File>
<File
RelativePath="..\..\..\Common\DocxFormat\Source\XML\stringcommon.cpp"
>
</File>
</Files>
<Globals>
</Globals>
......
#include "stdafx.h"
#include "ASCDocFile.h"
#include "ASCOfficeCriticalSection.h"
//#include "ASCOfficeCriticalSection.h"
#include "../DocFormatLib/DocFormatLib.h"
#include "../Common/Callback.h"
......@@ -11,11 +11,9 @@
#include <crtdbg.h>
#endif
ASCOfficeCriticalSection g_oCriticalSection;
STDMETHODIMP CASCOfficeDocFile::LoadFromFile(BSTR bsDocFile, BSTR bsDocxFilePath, BSTR bsXMLOptions)
{
g_oCriticalSection.Enter();
#ifdef _DEBUG
//_CrtDumpMemoryLeaks();
......@@ -36,13 +34,11 @@ STDMETHODIMP CASCOfficeDocFile::LoadFromFile(BSTR bsDocFile, BSTR bsDocxFilePath
//_CrtDumpMemoryLeaks();
#endif
g_oCriticalSection.Leave();
return hr;
}
STDMETHODIMP CASCOfficeDocFile::SaveToFile (BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
{
g_oCriticalSection.Enter();
#ifdef _DEBUG
//_CrtDumpMemoryLeaks();
......@@ -62,27 +58,21 @@ STDMETHODIMP CASCOfficeDocFile::SaveToFile (BSTR sDstFileName, BSTR sSrcPath, BS
//_CrtDumpMemoryLeaks();
#endif
g_oCriticalSection.Leave();
return hr;
}
void CASCOfficeDocFile::OnProgressFunc (LPVOID lpParam, long nID, long nPercent)
{
g_oCriticalSection.Enter();
CASCOfficeDocFile* pDocFile = reinterpret_cast<CASCOfficeDocFile*>(lpParam);
if (pDocFile != NULL)
{
pDocFile->OnProgress(nID, nPercent);
}
g_oCriticalSection.Leave();
}
void CASCOfficeDocFile::OnProgressExFunc (LPVOID lpParam, long nID, long nPercent, short* pStop)
{
g_oCriticalSection.Enter();
CASCOfficeDocFile* pDocFile = reinterpret_cast<CASCOfficeDocFile*>(lpParam);
if (NULL != pDocFile)
......@@ -90,5 +80,4 @@ void CASCOfficeDocFile::OnProgressExFunc (LPVOID lpParam, long nID, long nPercen
pDocFile->OnProgressEx(nID, nPercent, pStop);
}
g_oCriticalSection.Leave();
}
\ No newline at end of file
......@@ -2,6 +2,6 @@
//1
//0
//1
//228
#define INTVER 1,0,1,228
#define STRVER "1,0,1,228\0"
//231
#define INTVER 1,0,1,231
#define STRVER "1,0,1,231\0"
This diff is collapsed.
......@@ -800,18 +800,6 @@
RelativePath="..\source\ConvertationManager.h"
>
</File>
<File
RelativePath="..\..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCOfficeDocFile\pole\pole.cpp"
>
</File>
<File
RelativePath="..\..\..\Common\DocxFormat\Source\XML\stringcommon.cpp"
>
</File>
</Files>
<Globals>
</Globals>
......
......@@ -23,7 +23,7 @@ public:
{
}
HRESULT ConvertRtfToOOX( CString sSrcFileName, CString sDstPath, CString sXMLOptions )
HRESULT ConvertRtfToOOX( std::wstring sSrcFileName, std::wstring sDstPath, CString sXMLOptions )
{
m_bParseFirstItem = true;
......@@ -64,7 +64,7 @@ public:
else
return S_FALSE;
}
HRESULT ConvertOOXToRtf( CString sDstFileName, CString sSrcPath, CString sXMLOptions )
HRESULT ConvertOOXToRtf( std::wstring sDstFileName, std::wstring sSrcPath, CString sXMLOptions )
{
m_bParseFirstItem = true;
......
......@@ -9,9 +9,9 @@
#include "OOXFootnotesReader.h"
#include "OOXThemeReader.h"
OOXReader::OOXReader( RtfDocument& oDocument,CString path ): m_oDocument(oDocument)
OOXReader::OOXReader( RtfDocument& oDocument, std::wstring path ): m_oDocument(oDocument)
{
m_sPath = path;
m_sPath = std_string2string(path);
m_nCurItap = 0;
m_convertationManager = NULL;
......
......@@ -41,7 +41,7 @@ public:
//TempFolder
CString m_sTempFolder;
OOXReader( RtfDocument& oDocument, CString path );
OOXReader( RtfDocument& oDocument, std::wstring path );
bool Parse();
private:
void ParseColorTable( RtfDocument& oDocument );
......
......@@ -33,13 +33,13 @@ public:
m_nSizeAbs = 0;
m_nPosAbs = -1;
}
void SetSource( CString sPath )
void SetSource( std::wstring sPath )
{
Clear();
CFile srcFile;
if (srcFile.OpenFile(sPath) != S_OK) return;
if (srcFile.OpenFile(sPath.c_str()) != S_OK) return;
__int64 totalFileSize = srcFile.GetFileSize();
......@@ -136,7 +136,7 @@ public:
{
return 1.0 * m_oStream.getCurPosition() / m_oStream.getSize();
}
void SetSource( CString sPath )
void SetSource( std::wstring sPath )
{
m_oStream.SetSource( sPath);
}
......
......@@ -3,7 +3,7 @@
#include "DestinationCommand.h"
RtfReader::RtfReader(RtfDocument& oDocument, CString sFilename ):m_oDocument(oDocument),m_sFilename(sFilename)
RtfReader::RtfReader(RtfDocument& oDocument, std::wstring sFilename ):m_oDocument(oDocument),m_sFilename(sFilename)
{
m_oState = ReaderStatePtr(new ReaderState());
m_nFootnote = PROP_DEF;
......
......@@ -46,7 +46,7 @@ public:
int m_nDefFont;
CString m_sTempFolder;
RtfReader(RtfDocument& oDocument, CString sFilename );
RtfReader(RtfDocument& oDocument, std::wstring sFilename );
~RtfReader()
{
}
......@@ -63,7 +63,7 @@ public:
}
private:
RtfDocument& m_oDocument;
CString m_sFilename;
std::wstring m_sFilename;
};
class RtfAbstractReader
......
......@@ -166,7 +166,7 @@ bool RtfWriter::SaveByItemEnd()
//формируем выходной файл
try
{
NFileWriter::CBufferedFileWriter oTargetFileWriter( m_sFilename );
NFileWriter::CBufferedFileWriter oTargetFileWriter(m_sFilename );
//пишем заголовок потом все содежимое
sRtf = CreateRtfStart();
......
......@@ -15,10 +15,10 @@ public:
std::vector<CString> m_aTempFiles;
std::vector<CString> m_aTempFilesSectPr;
RtfWriter( RtfDocument& oDocument , CString sFilename, CString sFolder ):m_oDocument(oDocument)
RtfWriter( RtfDocument& oDocument , std::wstring sFilename, std::wstring sFolder ):m_oDocument(oDocument)
{
m_sFilename = sFilename;
m_sTempFolder = sFolder;
m_sFilename = std_string2string(sFilename);
m_sTempFolder = std_string2string(sFolder);
m_bFirst = true;
m_oCurTempFileWriter = NULL;
m_oCurTempFileSectWriter = NULL;
......
......@@ -15,9 +15,9 @@
#include "../../../../ASCOfficeDocxFile2/BinReader/DefaultThemeWriter.h"
OOXWriter::OOXWriter( RtfDocument& oDocument, CString sPath ) :
OOXWriter::OOXWriter( RtfDocument& oDocument, std::wstring sPath ) :
m_oDocument(oDocument),
m_sTargetFolder(sPath),
m_sTargetFolder(sPath.c_str()),
m_oRels( _T(""), oDocument ),
m_oDocRels( _T("document.xml"), oDocument )
{
......
......@@ -31,11 +31,11 @@ public:
//TempFolder
CString m_sTempFolder;
CString m_sTargetFolder;
std::map<CString, int> m_aBookmarksId;
OOXWriter( RtfDocument& oDocument, CString sPath );
OOXWriter( RtfDocument& oDocument, std::wstring sPath );
~OOXWriter();
bool Save();
......
......@@ -82,12 +82,11 @@
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -103,12 +102,16 @@
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
Optimization="0"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\DocxFormat;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
......@@ -143,11 +146,12 @@
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
......@@ -163,16 +167,12 @@
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\DocxFormat;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
......@@ -278,6 +278,14 @@
<File
RelativePath="..\Source\Docx2Txt\Converter.cpp"
>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\Source\Docx2Txt\Converter.h"
......@@ -300,16 +308,17 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
......@@ -352,7 +361,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
......@@ -361,7 +370,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
......@@ -472,10 +481,6 @@
</File>
</Filter>
</Filter>
<File
RelativePath="..\..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
>
</File>
<File
RelativePath="..\Source\TxtXmlFile.cpp"
>
......
......@@ -438,12 +438,17 @@ namespace ZLibZipUtils
{
if (current_file_is_find(unzip_file_handle, filePathInZip) == true)
{
unz_file_info file_info;
unzGetCurrentFileInfo(unzip_file_handle, &file_info, NULL, 0, NULL, 0, NULL, 0);
nFileSize = file_info.uncompressed_size;
(*fileInBytes) = new BYTE[nFileSize];
get_file(unzip_file_handle, (*fileInBytes), nFileSize);
return true;
unz_file_info file_info;
unzGetCurrentFileInfo(unzip_file_handle, &file_info, NULL, 0, NULL, 0, NULL, 0);
if (nFileSize > 0)
nFileSize = (std::min)(nFileSize, file_info.uncompressed_size);
else
nFileSize = file_info.uncompressed_size;
(*fileInBytes) = new BYTE[nFileSize];
get_file(unzip_file_handle, (*fileInBytes), nFileSize);
return true;
}
// else just skip the erroneous file
} while (UNZ_OK == unzGoToNextFile(unzip_file_handle));
......
......@@ -511,7 +511,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -520,7 +520,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -528,7 +528,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -537,7 +537,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -569,7 +569,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -578,7 +578,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -586,7 +586,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -595,7 +595,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -651,7 +651,7 @@
>
<Tool
Name="VCCLCompilerTool"
AssemblerListingLocation="$(IntDir)\Docx\Logic\"
AssemblerListingLocation=""
/>
</FileConfiguration>
<FileConfiguration
......@@ -692,7 +692,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -700,7 +700,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -708,7 +708,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -717,7 +717,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -788,7 +788,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -796,7 +796,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -804,7 +804,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -853,7 +853,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -862,7 +862,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -870,7 +870,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -879,7 +879,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -911,7 +911,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -920,7 +920,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -928,7 +928,7 @@
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......@@ -937,7 +937,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
ObjectFile="$(IntDir)\Docx\Logic\"
ObjectFile="$(IntDir)\"
/>
</FileConfiguration>
<FileConfiguration
......
#pragma once
#include <string>
#include "OfficeFileFormats.h"
namespace POLE
{
class Storage;
}
class COfficeFileFormatChecker
{
public:
int nFileType;
COfficeFileFormatChecker()
{
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
}
COfficeFileFormatChecker(std::wstring sFileName)
{
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
isOfficeFile(sFileName);
}
bool isOfficeFile(const std::wstring & fileName);
std::wstring GetFormatExtension(const std::wstring & fileName);
std::wstring GetExtensionByType(int type);
private:
bool isOOXFormatFile (const std::wstring & fileName);
bool isOpenOfficeFormatFile (const std::wstring & fileName);
bool isOnlyOfficeFormatFile (const std::wstring & fileName);
bool isDocFormatFile (POLE::Storage *storage);
bool isXlsFormatFile (POLE::Storage *storage);
bool isPptFormatFile (POLE::Storage *storage);
bool isRtfFormatFile (unsigned char* pBuffer,int dwBytes);
bool isHtmlFormatFile (unsigned char* pBuffer,int dwBytes);
bool isPdfFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryDoctFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryXlstFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryPpttFormatFile (unsigned char* pBuffer,int dwBytes);
};
......@@ -70,3 +70,4 @@
#define AVS_OFFICESTUDIO_FILE_CANVAS_WORD AVS_OFFICESTUDIO_FILE_CANVAS + 0x0001
#define AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET AVS_OFFICESTUDIO_FILE_CANVAS + 0x0002
#define AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION AVS_OFFICESTUDIO_FILE_CANVAS + 0x0003
#define AVS_OFFICESTUDIO_FILE_CANVAS_PDF AVS_OFFICESTUDIO_FILE_CANVAS + 0x0004
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