mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
delete ASCOfficeDocxFile
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64283 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
35dd3f13f4
commit
d107959bf3
@ -1,18 +0,0 @@
|
||||
// ASCDocxFile.cpp : Implementation of DLL Exports.
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
|
||||
[ module(dll, uuid = "{CBCEF68A-61B4-49FA-A35F-3BFF46FD3BE8}",
|
||||
name = "ASCDocxFile",
|
||||
helpstring = "ASCDocxFile 1.0 Type Library",
|
||||
resource_name = "IDR_ASCDOCXFILE") ]
|
||||
class CAVSDocxFileModule
|
||||
{
|
||||
public:
|
||||
// Override CAtlDllModuleT members
|
||||
};
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
#define COMPONENT_NAME "OfficeDocxFile"
|
||||
#include "../Common/FileInfo.h"
|
||||
#include "version.h"
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION INTVER
|
||||
PRODUCTVERSION INTVER
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", COMPANY_NAME
|
||||
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
|
||||
VALUE "FileVersion", STRVER
|
||||
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
|
||||
VALUE "LegalCopyright", LEGAL_COPYRIGHT
|
||||
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
|
||||
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
|
||||
VALUE "ProductVersion", STRVER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_ASCDOCXFILE REGISTRY "ASCOfficeDocxFile.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "ASCOfficeDocxFile"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
NoRemove AppID
|
||||
{
|
||||
'%APPID%' = s 'ASCOfficeDocxFile'
|
||||
'ASCOfficeDocxFile.DLL'
|
||||
{
|
||||
val AppID = s '%APPID%'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile", "ASCOfficeDocxFile.vcproj", "{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -1,315 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="ASCOfficeDocxFile"
|
||||
ProjectGUID="{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}"
|
||||
RootNamespace="ASCOfficeDocxFile"
|
||||
Keyword="AtlProj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfATL="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
|
||||
HeaderFileName="ASCOfficeDocxFile.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
|
||||
ProxyFileName="ASCOfficeDocxFile_p.c"
|
||||
ValidateParameters="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="true"
|
||||
IgnoreImportLibrary="true"
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
|
||||
IgnoreDefaultLibraryNames="LIBC.lib"
|
||||
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfATL="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
|
||||
HeaderFileName="ASCOfficeDocxFile.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
|
||||
ProxyFileName="ASCOfficeDocxFile_p.c"
|
||||
ValidateParameters="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="true"
|
||||
IgnoreImportLibrary="true"
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
OutputFile=".\..\Redist\$(ProjectName).dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
|
||||
IgnoreDefaultLibraryNames="LIBC.lib"
|
||||
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocxFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DocxFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OfficeEventsTemplate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OfficeFileTemplate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OfficeUtilsEvents.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\RelsReader.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SimpleDocxFormat.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\version.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.rgs"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@ -1,23 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile", "ASCOfficeDocxFile2005.vcproj", "{475B0C01-940F-4A7D-994A-969E5F9F412D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
ReleaseASC|Win32 = ReleaseASC|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Release|Win32.Build.0 = Release|Win32
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
|
||||
{475B0C01-940F-4A7D-994A-969E5F9F412D}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -1,423 +0,0 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="ASCOfficeDocxFile"
|
||||
ProjectGUID="{475B0C01-940F-4A7D-994A-969E5F9F412D}"
|
||||
RootNamespace="ASCOfficeDocxFile"
|
||||
Keyword="AtlProj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfATL="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
|
||||
HeaderFileName="ASCOfficeDocxFile.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
|
||||
ProxyFileName="ASCOfficeDocxFile_p.c"
|
||||
ValidateParameters="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="true"
|
||||
IgnoreImportLibrary="true"
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
|
||||
IgnoreDefaultLibraryNames="LIBC.lib"
|
||||
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfATL="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="..\Redist\VersionControl.exe $(ProjectDir)version.h"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
|
||||
HeaderFileName="ASCOfficeDocxFile.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
|
||||
ProxyFileName="ASCOfficeDocxFile_p.c"
|
||||
ValidateParameters="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="true"
|
||||
IgnoreImportLibrary="true"
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
OutputFile=".\..\Redist\$(ProjectName).dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
|
||||
IgnoreDefaultLibraryNames="LIBC.lib"
|
||||
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="ReleaseASC|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
UseOfATL="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="..\Redist\VersionControl.exe $(ProjectDir)version.h"
|
||||
ExcludedFromBuild="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
TargetEnvironment="1"
|
||||
GenerateStublessProxies="true"
|
||||
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
|
||||
HeaderFileName="ASCOfficeDocxFile.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
|
||||
ProxyFileName="ASCOfficeDocxFile_p.c"
|
||||
ValidateParameters="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;ASCBUILD"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
RegisterOutput="true"
|
||||
IgnoreImportLibrary="true"
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
OutputFile=".\..\Redist\ASCOfficeDocxFile.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
|
||||
IgnoreDefaultLibraryNames="LIBC.lib"
|
||||
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DocxFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="ReleaseASC|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\DocxFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OfficeEventsTemplate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\OfficeFileTemplate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\OfficeUtilsEvents.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SimpleDocxFormat.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\version.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDocxFile.rgs"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@ -1,78 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "DocxFile.h"
|
||||
#include "SimpleDocxFormat.h"
|
||||
|
||||
COfficeDocxFile::COfficeDocxFile()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
HRESULT COfficeDocxFile::FinalConstruct()
|
||||
{
|
||||
m_pOfficeUtils = NULL;
|
||||
return CoCreateInstance(__uuidof(COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(IOfficeUtils), (void **)&(this->m_pOfficeUtils));
|
||||
}
|
||||
|
||||
|
||||
void COfficeDocxFile::FinalRelease()
|
||||
{
|
||||
if (m_pOfficeUtils != NULL )
|
||||
{
|
||||
m_pOfficeUtils->Release();
|
||||
m_pOfficeUtils = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP COfficeDocxFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
|
||||
{
|
||||
OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >* oEventUtils = new OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >(this);
|
||||
oEventUtils->AddRef();
|
||||
oEventUtils->Advise( m_pOfficeUtils );
|
||||
|
||||
const HRESULT extractResult = m_pOfficeUtils->ExtractToDirectory(sSrcFileName, sDstPath, NULL, 0);
|
||||
|
||||
oEventUtils->UnAdvise( m_pOfficeUtils );
|
||||
oEventUtils->Release();
|
||||
|
||||
if ( extractResult != S_OK )
|
||||
{
|
||||
return extractResult;
|
||||
}
|
||||
|
||||
XmlUtils::CXmlReader oXmlReader;
|
||||
if( TRUE == oXmlReader.OpenFromXmlString( sXMLOptions ) )
|
||||
if( TRUE == oXmlReader.ReadRootNode( _T("Options") ) )
|
||||
if( TRUE == oXmlReader.ReadNode( _T("ExtractOption") ) )
|
||||
if( TRUE == oXmlReader.ReadNode( _T("Images") ) )
|
||||
{
|
||||
CString sResultPath = oXmlReader.ReadNodeAttribute( _T("path") );
|
||||
CString sSourcePath = sDstPath;
|
||||
|
||||
SimpleDocxFormat oSimpleDocxFormat;
|
||||
oSimpleDocxFormat.ExtractImages( sSourcePath, sResultPath );
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP COfficeDocxFile::SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
|
||||
{
|
||||
OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >* oEventUtils = new OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >(this);
|
||||
oEventUtils->AddRef();
|
||||
oEventUtils->Advise( m_pOfficeUtils );
|
||||
|
||||
const HRESULT compressResult = m_pOfficeUtils->CompressFileOrDirectory(sSrcPath, sDstFileName, ZIP_DEFAULT_COMPRESSION);
|
||||
|
||||
oEventUtils->UnAdvise( m_pOfficeUtils );
|
||||
oEventUtils->Release();
|
||||
|
||||
return compressResult;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP COfficeDocxFile::AddObjects(BSTR sSrcPath, BSTR sXMLOptions)
|
||||
{
|
||||
SimpleDocxFormat oSimpleDocxFormat;
|
||||
return oSimpleDocxFormat.AddObject( sSrcPath, sXMLOptions );
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
#pragma once
|
||||
#include "resource.h"
|
||||
#include "../Common/OfficeFileTemplate.h"
|
||||
#include "OfficeUtilsEvents.h"
|
||||
|
||||
|
||||
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
|
||||
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
|
||||
#endif
|
||||
|
||||
|
||||
#import "..\Redist\ASCOfficeUtils.dll" raw_interfaces_only
|
||||
|
||||
|
||||
using namespace ASCOfficeUtils;
|
||||
|
||||
/*
|
||||
Compression levels:
|
||||
|
||||
-1 - Default.
|
||||
0 - No compression.
|
||||
1 - Best speed.
|
||||
...
|
||||
9 - Best compression.
|
||||
*/
|
||||
|
||||
#define ZIP_NO_COMPRESSION 0
|
||||
#define ZIP_BEST_SPEED 1
|
||||
#define ZIP_BEST_COMPRESSION 9
|
||||
#define ZIP_DEFAULT_COMPRESSION (-1)
|
||||
|
||||
// IOfficeDocxFile
|
||||
[
|
||||
object,
|
||||
uuid("0FE32AEF-E7C5-42BD-A752-AC7F809D5E20"),
|
||||
dual, helpstring("IOfficeDocxFile Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
__interface IOfficeDocxFile : IAVSOfficeFileTemplate
|
||||
{
|
||||
[id(20), helpstring("method AddObjects")] HRESULT AddObjects([in] BSTR sSrcPath, [in]BSTR sXMLOptions);
|
||||
};
|
||||
|
||||
|
||||
// CDocxFile
|
||||
|
||||
[
|
||||
coclass,
|
||||
default(IOfficeDocxFile, _IAVSOfficeFileTemplateEvents),
|
||||
threading(apartment),
|
||||
event_source(com),
|
||||
vi_progid("AVSOfficeDocxFile.DocxFile"),
|
||||
progid("AVSOfficeDocxFile.DocxFile.1"),
|
||||
version(1.0),
|
||||
uuid("CF346C1A-8384-4516-9DD4-11219FB23799"),
|
||||
helpstring("OfficeDocxFile Class")
|
||||
]
|
||||
class ATL_NO_VTABLE COfficeDocxFile : public IOfficeDocxFile
|
||||
{
|
||||
public:
|
||||
COfficeDocxFile();
|
||||
|
||||
__event __interface _IAVSOfficeFileTemplateEvents;
|
||||
__event __interface _IAVSOfficeFileTemplateEvents2;
|
||||
|
||||
public:
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
HRESULT FinalConstruct();
|
||||
void FinalRelease();
|
||||
|
||||
public:
|
||||
STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions);
|
||||
STDMETHOD(SaveToFile)(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions);
|
||||
STDMETHOD(AddObjects)(BSTR sSrcPath, BSTR sXMLOptions);
|
||||
|
||||
private:
|
||||
IOfficeUtils* m_pOfficeUtils;
|
||||
};
|
||||
@ -1,100 +0,0 @@
|
||||
#pragma once
|
||||
#include "../Common/TemporaryCS.h"
|
||||
|
||||
template <class T, class Reciever>
|
||||
class COfficeEventTemplate : public T
|
||||
{
|
||||
protected: CRITICAL_SECTION m_csThread;
|
||||
public:
|
||||
COfficeEventTemplate(Reciever *pReciever)
|
||||
: m_pReciever(pReciever)
|
||||
{
|
||||
InitializeCriticalSection(&m_csThread);
|
||||
m_cnt = 0;
|
||||
m_dwAdvise = 0;
|
||||
};
|
||||
virtual ~COfficeEventTemplate(void)
|
||||
{
|
||||
DeleteCriticalSection(&m_csThread);
|
||||
}
|
||||
STDMETHOD(GetTypeInfoCount)(UINT*) { return E_NOTIMPL; }
|
||||
STDMETHOD(GetTypeInfo)(UINT, LCID, ITypeInfo**) { return E_NOTIMPL; }
|
||||
STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return E_NOTIMPL; }
|
||||
|
||||
STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppv) {
|
||||
if ((iid == __uuidof(T)) ||
|
||||
(iid == __uuidof(IDispatch)) ||
|
||||
(iid == __uuidof(IUnknown)))
|
||||
*ppv = this;
|
||||
else {
|
||||
*ppv = 0;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHOD_(ULONG,AddRef)() {
|
||||
return InterlockedIncrement(&m_cnt);
|
||||
}
|
||||
|
||||
STDMETHOD_(ULONG,Release)() {
|
||||
InterlockedDecrement(&m_cnt);
|
||||
if (m_cnt!=0) return m_cnt;
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL Advise(IUnknown *pFile)
|
||||
{
|
||||
CTemporaryCS oCS(&m_csThread);
|
||||
if (NULL==pFile)
|
||||
return FALSE;
|
||||
IConnectionPointContainer* pContainer;
|
||||
IConnectionPoint* pCP;
|
||||
HRESULT hr = pFile->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
|
||||
if (NULL!=pContainer)
|
||||
{
|
||||
pContainer->FindConnectionPoint(__uuidof(T), &pCP);
|
||||
if (NULL!=pCP)
|
||||
{
|
||||
pCP->Advise(this, &m_dwAdvise);
|
||||
pCP->Release();
|
||||
pCP = NULL;
|
||||
}
|
||||
pContainer->Release();
|
||||
pContainer = NULL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
BOOL UnAdvise(IUnknown *pFile)
|
||||
{
|
||||
CTemporaryCS oCS(&m_csThread);
|
||||
if ((NULL==pFile)||(0==m_dwAdvise))
|
||||
return FALSE;
|
||||
|
||||
IConnectionPointContainer* pContainer;
|
||||
IConnectionPoint* pCP;
|
||||
|
||||
HRESULT hr = pFile->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
|
||||
if (NULL!=pContainer)
|
||||
{
|
||||
hr = pContainer->FindConnectionPoint(__uuidof(T), &pCP);
|
||||
if (NULL!=pCP)
|
||||
{
|
||||
hr = pCP->Unadvise(m_dwAdvise);
|
||||
pCP->Release();
|
||||
pCP = NULL;
|
||||
}
|
||||
pContainer->Release();
|
||||
pContainer = NULL;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
public:
|
||||
Reciever* m_pReciever;
|
||||
protected:
|
||||
LONG m_cnt;
|
||||
DWORD m_dwAdvise;
|
||||
};
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
#pragma once
|
||||
#include "OfficeEventsTemplate.h"
|
||||
|
||||
template <class T, class Reciever>
|
||||
class OfficeUtilsEvents : public COfficeEventTemplate<T,Reciever>
|
||||
{
|
||||
public:
|
||||
OfficeUtilsEvents(Reciever *pReciever):COfficeEventTemplate(pReciever)
|
||||
{
|
||||
m_cnt = 0;
|
||||
m_dwAdvise = 0;
|
||||
};
|
||||
|
||||
HRESULT OnProgress( LONG nID, LONG nPercent, SHORT* Cancel)
|
||||
{
|
||||
m_pReciever->OnProgress( nID, nPercent );
|
||||
m_pReciever->OnProgressEx( nID, nPercent, Cancel );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
|
||||
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
|
||||
{
|
||||
HRESULT hr;
|
||||
VARIANTARG varg0;
|
||||
VARIANTARG varg1;
|
||||
VARIANTARG varg2;
|
||||
switch(dispIdMember) {
|
||||
case 1:
|
||||
VariantInit(&varg0);
|
||||
VariantInit(&varg1);
|
||||
VariantInit(&varg2);
|
||||
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
|
||||
hr = DispGetParam(pDispParams,1,VT_I4,&varg1,puArgErr);
|
||||
hr = DispGetParam(pDispParams,2,VT_I2,&varg2,puArgErr);
|
||||
OnProgress( varg0.lVal, varg1.lVal, &varg2.iVal );
|
||||
if (pDispParams->rgvarg[0].vt & VT_BYREF) // implemented now for last VT_I2 arg only
|
||||
{
|
||||
SHORT* p = (SHORT*)pDispParams->rgvarg[0].byref;
|
||||
if (p) *p = varg2.iVal;
|
||||
}
|
||||
return(S_OK);
|
||||
break;
|
||||
default:
|
||||
return(E_NOTIMPL);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1,17 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by ASCOfficeDocxFile.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_ASCDOCXFILE 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
||||
@ -1,434 +0,0 @@
|
||||
#pragma once
|
||||
#include "..\..\..\..\Common\XmlUtils.h"
|
||||
|
||||
#define USE_ATL_CSTRING
|
||||
#include "..\..\..\..\Common\StringUtils.h"
|
||||
|
||||
#include "../Common/OfficeFileErrorDescription.h"
|
||||
|
||||
class SimpleDocxFormat
|
||||
{
|
||||
private: CAtlArray<CString> m_aRelsWalked;
|
||||
private: CAtlArray<CString> m_aImagesToExtract;
|
||||
public: void ExtractImages( CString sSourcePath, CString sDestPath )
|
||||
{
|
||||
m_aRelsWalked.RemoveAll();
|
||||
m_aImagesToExtract.RemoveAll();
|
||||
|
||||
NormalizePath( sSourcePath, true );
|
||||
NormalizePath( sDestPath, true );
|
||||
ExtractImagesFromRels( sSourcePath + _T("_rels/.rels"), sSourcePath, sDestPath );
|
||||
}
|
||||
private: void ExtractImagesFromRels( CString sSourceRels, CString sSourcePath, CString& sDestPath )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
||||
TCHAR buffer[1024];
|
||||
GetFullPathName( sSourceRels, 1024, buffer, NULL );
|
||||
sSourceRels = CString( buffer );
|
||||
|
||||
if( ::GetFileAttributes( sSourceRels ) == INVALID_FILE_ATTRIBUTES )
|
||||
return;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
for( int i = 0; i < m_aRelsWalked.GetCount(); i++ )
|
||||
if( m_aRelsWalked[i] == sSourceRels )
|
||||
return;
|
||||
m_aRelsWalked.Add( sSourceRels );
|
||||
|
||||
XmlUtils::CXmlReader oXmlReader;
|
||||
if( TRUE == oXmlReader.OpenFromFile( sSourceRels ) )
|
||||
if( TRUE == oXmlReader.ReadRootNode( _T("Relationships") ) )
|
||||
if( TRUE == oXmlReader.ReadNodeList( _T("Relationship") ) )
|
||||
{
|
||||
for( int i = 0; i < oXmlReader.GetLengthList(); i++ )
|
||||
{
|
||||
CString sTargetMode = oXmlReader.ReadNodeAttribute( i, _T("TargetMode") );
|
||||
if( _T("External") != sTargetMode )
|
||||
{
|
||||
CString sType = oXmlReader.ReadNodeAttribute( i, _T("Type") );
|
||||
CString sTargetRel = oXmlReader.ReadNodeAttribute( i, _T("Target") );
|
||||
NormalizePath( sTargetRel, false );
|
||||
CString sTargetFile = sSourcePath + sTargetRel;
|
||||
|
||||
TCHAR tDrive[256];
|
||||
TCHAR tDir[256];
|
||||
TCHAR tFilename[256];
|
||||
TCHAR tExt[256];
|
||||
_tsplitpath( sTargetFile, tDrive, tDir, tFilename, tExt );
|
||||
CString sDrive = CString( tDrive );
|
||||
CString sDir = CString( tDir );
|
||||
CString sFilename = CString( tFilename );
|
||||
CString sExt = CString( tExt );
|
||||
|
||||
if( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") == sType )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
||||
GetFullPathName( sTargetFile, 1024, buffer, NULL );
|
||||
sTargetFile = CString( buffer );
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool bDuplicate = false;
|
||||
for( int j = 0; j < m_aImagesToExtract.GetCount(); j++ )
|
||||
if( m_aImagesToExtract[j] == sTargetFile )
|
||||
{
|
||||
bDuplicate = true;
|
||||
break;
|
||||
}
|
||||
if( false == bDuplicate )
|
||||
{
|
||||
m_aImagesToExtract.Add( sTargetFile );
|
||||
|
||||
CString sNewTarget = sDestPath + sFilename + sExt;
|
||||
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if( INVALID_FILE_ATTRIBUTES != ::GetFileAttributes( sNewTarget ) )
|
||||
{
|
||||
DWORD dwFileAtrr = !INVALID_FILE_ATTRIBUTES;
|
||||
int nCounter = 1;
|
||||
while( INVALID_FILE_ATTRIBUTES != dwFileAtrr )
|
||||
{
|
||||
CString sCounter;
|
||||
sCounter.AppendFormat( _T("%d"), nCounter );
|
||||
while( sCounter.GetLength() < 3 )
|
||||
sCounter.Insert( 0, '0' );
|
||||
sNewTarget = sDestPath + sFilename + _T("_") + sCounter + sExt;
|
||||
nCounter++;
|
||||
dwFileAtrr = ::GetFileAttributes( sNewTarget );
|
||||
}
|
||||
}
|
||||
CopyFile( sTargetFile, sNewTarget, FALSE );
|
||||
}
|
||||
|
||||
}
|
||||
else//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rels <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
ExtractImagesFromRels( sDrive + sDir + _T("_rels/") + sFilename + sExt + _T(".rels"), sDrive + sDir, sDestPath );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public: HRESULT AddObject( CString sPath, CString sOptions )
|
||||
{
|
||||
HRESULT hRes = S_FALSE;
|
||||
NormalizePath( sPath, true );
|
||||
|
||||
bool bNeedFindRels = false; // <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> document.xml.rels( <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rels)
|
||||
CString sDocumentPath = _T("");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> document.xml
|
||||
CString sDocumentRelsPath = _T("");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> document.xml.rels
|
||||
int nStartRelsIndex = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rIdN
|
||||
CString sDocumentAddition; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> document.xml
|
||||
CString sRelsAddition; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> document.xml.rels
|
||||
|
||||
bool bEmptyOptions = true; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - true;
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rels)
|
||||
XmlUtils::CXmlReader oXmlOptionsReader;
|
||||
if( TRUE == oXmlOptionsReader.OpenFromXmlString( sOptions ) )
|
||||
if( TRUE == oXmlOptionsReader.ReadRootNode( _T("AddObjects") ) )
|
||||
if( TRUE == oXmlOptionsReader.ReadNodeList( _T("Paragraph") ) )
|
||||
{
|
||||
bEmptyOptions = false;
|
||||
for( int i = 0; i < oXmlOptionsReader.GetLengthList(); i++ )
|
||||
{
|
||||
bool bContinue = true;
|
||||
XML::IXMLDOMNodePtr pXmlNode;
|
||||
if( TRUE == oXmlOptionsReader.GetNode( i, pXmlNode ) )
|
||||
{
|
||||
XmlUtils::CXmlReader oXmlSubReader;
|
||||
if( TRUE == oXmlSubReader.OpenFromXmlNode( pXmlNode ) )
|
||||
if( TRUE == oXmlSubReader.ReadNodeList( _T("*") ) )
|
||||
{
|
||||
for( int j = 0; j < oXmlSubReader.GetLengthList(); j++ )
|
||||
{
|
||||
CString sNodeName = oXmlSubReader.ReadNodeName( j );
|
||||
if( _T("Link") == sNodeName )
|
||||
{
|
||||
bNeedFindRels = true;
|
||||
bContinue = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if( false == bContinue )
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( true == bEmptyOptions )
|
||||
return S_OK;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rels
|
||||
XmlUtils::CXmlReader oXmlRelsReader;
|
||||
if( ::GetFileAttributes( sPath + _T("_rels/.rels") ) != INVALID_FILE_ATTRIBUTES )
|
||||
if( TRUE == oXmlRelsReader.OpenFromFile( sPath + _T("_rels/.rels") ) )
|
||||
if( TRUE == oXmlRelsReader.ReadRootNode( _T("Relationships") ) )
|
||||
if( TRUE == oXmlRelsReader.ReadNodeList( _T("Relationship") ) )
|
||||
{
|
||||
for( int i = 0; i < oXmlRelsReader.GetLengthList(); i++ )
|
||||
{
|
||||
CString sType = oXmlRelsReader.ReadNodeAttribute( i, _T("Type") );
|
||||
if( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") == sType )
|
||||
{
|
||||
CString sTargetRel = oXmlRelsReader.ReadNodeAttribute( i, _T("Target") );
|
||||
NormalizePath( sTargetRel, false );
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> document.xml
|
||||
sDocumentPath = sPath + sTargetRel;
|
||||
if( true == bNeedFindRels )//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rels <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
TCHAR tDrive[256];
|
||||
TCHAR tDir[256];
|
||||
TCHAR tFilename[256];
|
||||
TCHAR tExtension[256];
|
||||
_tsplitpath( sDocumentPath, tDrive, tDir, tFilename, tExtension );
|
||||
|
||||
sDocumentRelsPath = CString(tDrive) + CString(tDir) + _T("_rels/") + tFilename + tExtension + _T(".rels");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( _T("") == sDocumentPath )
|
||||
return AVS_ERROR_UNEXPECTED;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> document.xml.rels <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> nStartRelsIndex
|
||||
if( true == bNeedFindRels )
|
||||
{
|
||||
XmlUtils::CXmlReader oXmlReader;
|
||||
if( ::GetFileAttributes( sDocumentRelsPath ) != INVALID_FILE_ATTRIBUTES )
|
||||
if( TRUE == oXmlReader.OpenFromFile( sDocumentRelsPath ) )
|
||||
if( TRUE == oXmlReader.ReadRootNode( _T("Relationships") ) )
|
||||
if( TRUE == oXmlReader.ReadNodeList( _T("Relationship") ) )
|
||||
{
|
||||
for( int i = 0; i < oXmlReader.GetLengthList(); i++ )
|
||||
{
|
||||
CString sCurRID = oXmlReader.ReadNodeAttribute( i , _T("Id") );
|
||||
if( 0 == sCurRID.Find( _T("rId") ) )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> rId
|
||||
int nStartIndex = 3;// strlen("rId");
|
||||
CString sDigitAfter = _T("");
|
||||
int nCurRIDLen = sCurRID.GetLength();
|
||||
while( nStartIndex < nCurRIDLen && _istdigit( sCurRID[nStartIndex] ) )
|
||||
{
|
||||
sDigitAfter.AppendChar( sCurRID[nStartIndex] );
|
||||
nStartIndex++;
|
||||
}
|
||||
if( _T("") != sDigitAfter )
|
||||
{
|
||||
int nDigitAfter = Strings::ToInteger( sDigitAfter );
|
||||
if( nDigitAfter >= nStartRelsIndex )
|
||||
nStartRelsIndex = nDigitAfter + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> sOptions <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> document.xml.rels <20> document.xml
|
||||
XmlUtils::CXmlReader oXmlOptionsReader2;
|
||||
if( TRUE == oXmlOptionsReader2.OpenFromXmlString( sOptions ) )
|
||||
if( TRUE == oXmlOptionsReader2.ReadRootNode( _T("AddObjects") ) )
|
||||
if( TRUE == oXmlOptionsReader2.ReadNodeList( _T("Paragraph") ) )
|
||||
{
|
||||
XML::IXMLDOMDocumentPtr pXmlDocument;
|
||||
pXmlDocument.CreateInstance(CLSID_DOMDocument);
|
||||
if( NULL != pXmlDocument )
|
||||
{
|
||||
for( int i = 0; i < oXmlOptionsReader2.GetLengthList(); i++ )
|
||||
{
|
||||
CString sCurParagraph = _T("");
|
||||
bool bContinue = true;
|
||||
XML::IXMLDOMNodePtr pXmlNode;
|
||||
if( TRUE == oXmlOptionsReader2.GetNode( i, pXmlNode ) )
|
||||
{
|
||||
XmlUtils::CXmlReader oXmlSubReader;
|
||||
if( TRUE == oXmlSubReader.OpenFromXmlNode( pXmlNode ) )
|
||||
{
|
||||
if( TRUE == oXmlSubReader.ReadNodeList( _T("*") ) )
|
||||
{
|
||||
int nNodeListLen = oXmlSubReader.GetLengthList();
|
||||
if( 0 == i )
|
||||
sCurParagraph.Append( _T("<w:p><w:pPr><w:spacing w:after=\"200\" w:before=\"200\" w:line=\"276\" w:lineRule=\"auto\"/></w:pPr>") );
|
||||
else
|
||||
sCurParagraph.Append( _T("<w:p><w:pPr><w:spacing w:after=\"200\" w:line=\"276\" w:lineRule=\"auto\"/></w:pPr>") );
|
||||
if( nNodeListLen > 0 )
|
||||
{
|
||||
for( int j = 0; j < oXmlSubReader.GetLengthList(); j++ )
|
||||
{
|
||||
CString sNodeName = oXmlSubReader.ReadNodeName( j );
|
||||
CString sValue = oXmlSubReader.ReadNodeAttribute( j, _T("value") );
|
||||
CString sHref = oXmlSubReader.ReadNodeAttribute( j, _T("href") );
|
||||
|
||||
sHref = sHref.Trim();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> %20
|
||||
sHref.Replace( _T(" "), _T("%20") );
|
||||
|
||||
if( _T("Text") == sNodeName )
|
||||
sCurParagraph.AppendFormat( _T("<w:r><w:rPr><w:sz w:val=\"24\"/></w:rPr><w:t xml:space=\"preserve\">%s</w:t></w:r>"), sValue );
|
||||
else if( _T("Link") == sNodeName )
|
||||
{
|
||||
CString sCurRID = GenerateRID( nStartRelsIndex );
|
||||
if( _T("") != sCurRID )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <w:hyperlink> <20> document.xml
|
||||
sCurParagraph.AppendFormat( _T("<w:hyperlink r:id=\"%s\"><w:r><w:rPr><w:sz w:val=\"24\"/><w:u w:val=\"single\"/><w:color w:val=\"0000ff\"/></w:rPr><w:t xml:space=\"preserve\" >%s</w:t></w:r></w:hyperlink>"), sCurRID, sValue );
|
||||
sRelsAddition.AppendFormat( _T("<Relationship Id=\"%s\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Target=\"%s\" TargetMode=\"External\"/>"), sCurRID, sHref );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sCurParagraph.Append( _T("</w:p>") );
|
||||
}
|
||||
}
|
||||
}
|
||||
sDocumentAddition.Append( sCurParagraph );
|
||||
}
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> document.xml.rels
|
||||
bool bRelsSucceeded = false;
|
||||
if( _T("") != sRelsAddition )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> xml
|
||||
sRelsAddition = _T("<root xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">") + sRelsAddition +_T("</root>");
|
||||
XML::IXMLDOMDocumentPtr m_pXmlDocument;
|
||||
m_pXmlDocument.CreateInstance(CLSID_DOMDocument);
|
||||
if( NULL != m_pXmlDocument )
|
||||
{
|
||||
VARIANT vtLoad;
|
||||
vtLoad.vt = VT_BSTR;
|
||||
vtLoad.bstrVal = sDocumentRelsPath.AllocSysString();
|
||||
|
||||
try{
|
||||
if( VARIANT_TRUE == m_pXmlDocument->load( vtLoad ) )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oRootNode = m_pXmlDocument->selectSingleNode( _T("Relationships") );
|
||||
if( NULL != oRootNode )
|
||||
{
|
||||
XmlUtils::CXmlReader oRelationReader;
|
||||
if( TRUE == oRelationReader.OpenFromXmlString( sRelsAddition ) )
|
||||
if( TRUE == oRelationReader.ReadNodeList( _T("*") ) )
|
||||
{
|
||||
int nLengthList = oRelationReader.GetLengthList();
|
||||
for( int i = 0; i < nLengthList ; i++ )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oCurNode = NULL;
|
||||
oRelationReader.GetNode( i, oCurNode );
|
||||
if( NULL != oCurNode )
|
||||
XML::IXMLDOMNodePtr pBuf = oRootNode->appendChild( oCurNode );
|
||||
}
|
||||
}
|
||||
VARIANT vtSave;
|
||||
vtSave.vt = VT_BSTR;
|
||||
vtSave.bstrVal = sDocumentRelsPath.AllocSysString();
|
||||
m_pXmlDocument->save( vtSave );
|
||||
SysFreeString( vtSave.bstrVal );
|
||||
|
||||
bRelsSucceeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
SysFreeString( vtLoad.bstrVal );
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> document.xml
|
||||
if( _T("") != sDocumentAddition )
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> xml
|
||||
sDocumentAddition = _T("<root xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">") + sDocumentAddition +_T("</root>");
|
||||
|
||||
if( false == bNeedFindRels || true == bRelsSucceeded )
|
||||
{
|
||||
XML::IXMLDOMDocumentPtr m_pXmlDocument;
|
||||
m_pXmlDocument.CreateInstance(CLSID_DOMDocument);
|
||||
if( NULL != m_pXmlDocument )
|
||||
{
|
||||
VARIANT vtLoad;
|
||||
vtLoad.vt = VT_BSTR;
|
||||
vtLoad.bstrVal = sDocumentPath.AllocSysString();
|
||||
|
||||
try{
|
||||
if( VARIANT_TRUE == m_pXmlDocument->load( vtLoad ) )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oRootNode = m_pXmlDocument->selectSingleNode( _T("w:document") );
|
||||
if( NULL == oRootNode )
|
||||
XML::IXMLDOMNodePtr oRootNode = m_pXmlDocument->selectSingleNode( _T("w:wordDocument") );
|
||||
if( NULL != oRootNode )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oBodyNode = oRootNode->selectSingleNode( _T("w:body") );
|
||||
if( NULL != oBodyNode )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oLastNode = NULL;
|
||||
oBodyNode->get_lastChild( &oLastNode );
|
||||
if( NULL != oLastNode )
|
||||
{
|
||||
VARIANT vtInsert;
|
||||
vtInsert.vt = VT_UNKNOWN;
|
||||
vtInsert.punkVal = oLastNode;
|
||||
|
||||
XmlUtils::CXmlReader oRelationReader;
|
||||
if( TRUE == oRelationReader.OpenFromXmlString( sDocumentAddition ) )
|
||||
if( TRUE == oRelationReader.ReadNodeList( _T("*") ) )
|
||||
{
|
||||
int nLengthList = oRelationReader.GetLengthList();
|
||||
for( int i = 0; i < nLengthList ; i++ )
|
||||
{
|
||||
XML::IXMLDOMNodePtr oCurNode = NULL;
|
||||
oRelationReader.GetNode( i, oCurNode );
|
||||
if( NULL != oCurNode )
|
||||
XML::IXMLDOMNodePtr pBuf = oBodyNode->insertBefore( oCurNode, vtInsert );
|
||||
}
|
||||
}
|
||||
|
||||
VARIANT vtSave;
|
||||
vtSave.vt = VT_BSTR;
|
||||
vtSave.bstrVal = sDocumentPath.AllocSysString();
|
||||
m_pXmlDocument->save( vtSave );
|
||||
SysFreeString( vtSave.bstrVal );
|
||||
|
||||
hRes = S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
SysFreeString( vtLoad.bstrVal );
|
||||
}
|
||||
}
|
||||
}
|
||||
return hRes;
|
||||
}
|
||||
|
||||
private: CString GenerateRID( int& nRID )
|
||||
{
|
||||
CString sResult;
|
||||
sResult.AppendFormat( _T("rId%d"), nRID );
|
||||
nRID++;
|
||||
return sResult;
|
||||
}
|
||||
|
||||
// bEnd == true (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> '/' <20><><EFBFBD> '\'), bEnd == false (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> '/' <20><><EFBFBD> '\')
|
||||
private: void NormalizePath( CString& sPath, bool bEnd = true )
|
||||
{
|
||||
int nPathLen = sPath.GetLength();
|
||||
if( nPathLen > 0 ) // sPath <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '/' <20><><EFBFBD> '\'
|
||||
{
|
||||
if( true == bEnd )
|
||||
{
|
||||
TCHAR tcLastChar = sPath[ nPathLen - 1 ];
|
||||
if( '\\' != tcLastChar && '/' != tcLastChar )
|
||||
sPath.AppendChar( '/' );
|
||||
}
|
||||
else
|
||||
{
|
||||
TCHAR tcFirstChar = sPath[ 0 ];
|
||||
if( '\\' == tcFirstChar || '/' == tcFirstChar )
|
||||
sPath = sPath.Right( sPath.GetLength() - 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1,5 +0,0 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// AVSDocxFile.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
@ -1,44 +0,0 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef STRICT
|
||||
#define STRICT
|
||||
#endif
|
||||
|
||||
// Modify the following defines if you have to target a platform prior to the ones specified below.
|
||||
// Refer to MSDN for the latest info on corresponding values for different platforms.
|
||||
#ifndef WINVER // Allow use of features specific to Windows XP or later.
|
||||
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
|
||||
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
|
||||
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
|
||||
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
|
||||
#endif
|
||||
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
#include <atlwin.h>
|
||||
#include <atltypes.h>
|
||||
#include <atlctl.h>
|
||||
#include <atlhost.h>
|
||||
|
||||
|
||||
using namespace ATL;
|
||||
@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
//1
|
||||
//0
|
||||
//0
|
||||
//26
|
||||
#define INTVER 1,0,0,26
|
||||
#define STRVER "1,0,0,26\0"
|
||||
Reference in New Issue
Block a user