Commit 60d4762a authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52679 954022d7-b5bf-4e40-9824-e11837661b57
parent ed4888aa
// AVSOfficeOdpFile.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "OfficeODPFile.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{FA56A4F4-FCEA-47f8-BE80-B37C7FA95BBF}",
name = "AVSOfficeOdpFile",
helpstring = "AVSOfficeOdpFile 1.0 Type Library",
resource_name = "IDR_AVSOFFICEODPFILE") ];
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define COMPONENT_NAME "OfficeOdpFile"
#include "FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1251)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// 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
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "AVSOfficeOdpFile"
END
IDR_AVSOFFICEODPFILE REGISTRY "AVSOfficeOdpFile.rgs"
////////////////////////////////////////////////////////////////////////////
#endif
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'AVSOfficeOdpFile'
'AVSOfficeOdpFile.DLL'
{
val AppID = s '%APPID%'
}
}
}
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AVSOfficeOdpFile", "AVSOfficeOdpFile.vcproj", "{C1E5043D-4844-4893-980D-BD79CDCD05C1}"
ProjectSection(ProjectDependencies) = postProject
{FCF298F6-A7B5-4F35-9497-C4007C754E3C} = {FCF298F6-A7B5-4F35-9497-C4007C754E3C}
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B} = {69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ODPFormat", "ODPFormat\ODPFormat.vcproj", "{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Odp2DrawingXML", "Odp2DrawingXML\Odp2DrawingXML.vcproj", "{FCF298F6-A7B5-4F35-9497-C4007C754E3C}"
ProjectSection(ProjectDependencies) = postProject
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B} = {69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}
EndProjectSection
EndProject
Global
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
ReleaseASC|Win32 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.ActiveCfg = Debug|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.Build.0 = Debug|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.ActiveCfg = Release|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.Build.0 = Release|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.Debug|Win32.ActiveCfg = Debug|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.Debug|Win32.Build.0 = Debug|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.Release|Win32.ActiveCfg = Release|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.Release|Win32.Build.0 = Release|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
{69C5894A-4EFC-4D2C-BA4F-506DFE98F32B}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.Debug|Win32.ActiveCfg = Debug|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.Debug|Win32.Build.0 = Debug|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.Release|Win32.ActiveCfg = Release|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.Release|Win32.Build.0 = Release|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
{FCF298F6-A7B5-4F35-9497-C4007C754E3C}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="AVSOfficeOdpFile"
ProjectGUID="{C1E5043D-4844-4893-980D-BD79CDCD05C1}"
RootNamespace="AVSOfficeOdpFile"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="1"
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)/AVSOfficeOdpFile.tlb"
HeaderFileName="OfficeOdpFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficeOdpFile_i.c"
ProxyFileName="AVSOfficeOdpFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\ODPFormat\Source;..\AVSOfficeOdtFile\Source;..\Common;..\Common\AvsDocxFormat\Source\Common;..\Common\AvsDocxFormat\Source\Utility;..\Common\AvsDocxFormat\Source\XML;..\..\..\..\Addons\ZLib"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
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="..\Common\AvsDocxFormat\Lib\Debug\libboost_system-vc80-mt-gd-1_38.lib ..\Common\AvsDocxFormat\Lib\Debug\libboost_filesystem-vc80-mt-gd-1_38.lib"
LinkIncremental="2"
MergedIDLBaseFileName="_AVSOfficeOdpFile.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 &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="1"
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)/AVSOfficeOdpFile.tlb"
HeaderFileName="AVSOfficeOdpFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficeOdpFile_i.c"
ProxyFileName="AVSOfficeOdpFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=".\ODPFormat\Source;..\AVSOfficeOdtFile\Source;..\Common;..\Common\AvsDocxFormat\Source\Common;..\Common\AvsDocxFormat\Source\Utility;..\Common\AvsDocxFormat\Source\XML;..\..\..\..\Addons\ZLib"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
StringPooling="true"
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="..\Common\AvsDocxFormat\Lib\Release\libboost_system-vc80-mt-1_38.lib ..\Common\AvsDocxFormat\Lib\Release\libboost_filesystem-vc80-mt-1_38.lib"
OutputFile="$(OutDir)/$(ProjectName).dll"
LinkIncremental="1"
MergedIDLBaseFileName="_AVSOfficeOdpFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/$(TargetName).lib"
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 &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy $(TargetPath) ..\..\..\Redist\AVSOfficeStudio\AVSOfficeOdpFile.dll&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="ReleaseASC|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficeOdpFile.tlb"
HeaderFileName="AVSOfficeOdpFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficeOdpFile_i.c"
ProxyFileName="AVSOfficeOdpFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=".\ODPFormat\Source;..\AVSOfficeOdtFile\Source;..\Common;..\Common\AvsDocxFormat\Source\Common;..\Common\AvsDocxFormat\Source\Utility;..\Common\AvsDocxFormat\Source\XML;..\..\..\..\Addons\ZLib"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
StringPooling="true"
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="..\Common\AvsDocxFormat\Lib\Release\libboost_system-vc80-mt-1_38.lib ..\Common\AvsDocxFormat\Lib\Release\libboost_filesystem-vc80-mt-1_38.lib"
OutputFile="$(OutDir)/$(ProjectName).dll"
LinkIncremental="1"
MergedIDLBaseFileName="_AVSOfficeOdpFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/$(TargetName).lib"
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="copy $(TargetPath) ..\..\..\..\ASC\Redist\ASCOfficeStudio\ASCOfficeOdpFile.dll"
/>
</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=".\AVSOfficeOdpFile.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="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=".\AVSOfficeOdpFile.rc"
>
</File>
<File
RelativePath=".\AVSOfficeOdpFile.rgs"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\OfficeOdpFile.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
......@@ -4,7 +4,7 @@
#include "stdafx.h"
#include "Odp.h"
#include "..\..\AVSPresentationEditor\OfficeDrawing\Document.h"
#include "../../ASCPresentationEditor/OfficeDrawing/Document.h"
#include "nullable_property.h"
#include "property.h"
#include <vector>
......
......@@ -40,7 +40,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/ASCDocxFormat/Source/Utility;../../Common/ASCDocxFormat/Source/XML;../../Common/ASCDocxFormat/Source/Common;../../ASCOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -105,7 +105,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/ASCDocxFormat/Source/Utility;../../Common/ASCDocxFormat/Source/XML;../../Common/ASCDocxFormat/Source/Common;../../ASCOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
......@@ -142,70 +142,7 @@
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseASC|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="OdpFormat.lib"
AdditionalLibraryDirectories="../ReleaseASC"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configuration>
</Configurations>
<References>
</References>
......@@ -272,35 +209,35 @@
Name="Common"
>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Shapes\BaseShape\BaseShape.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\BaseShape.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Elements.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Elements.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Layout.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Layout.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Shapes\BaseShape\OdpShape\OdpShape.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\OdpShape\OdpShape.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Shapes\BaseShape\OdpShape\parser.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Shapes\BaseShape\OdpShape\parser.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\SVGConverter.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\SVGConverter.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\TextAttributesEx.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\TextAttributesEx.cpp"
>
</File>
<File
RelativePath="..\..\AVSPresentationEditor\OfficeDrawing\Theme.cpp"
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Theme.cpp"
>
</File>
</Filter>
......
......@@ -46,7 +46,7 @@
// TODO: reference additional headers your program requires here
using namespace ATL;
#define ODP_DEF
#define _USE_NULLABLE_PROPERTY_
#import "../../../../AVS/Redist/AVSMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT")
#import "../../../../AVS/Redist/AVSGraphics.dll" named_guids rename_namespace("AVSGraphics")
#import "../../../../AVS/Redist/AVSVideoFile3.dll" named_guids rename_namespace("VideoFile")
\ No newline at end of file
#import "../../Redist/ASCMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT")
#import "../../Redist/ASCGraphics.dll" named_guids rename_namespace("ASCGraphics")
#include "stdafx.h"
#include "Converter.h"
namespace Odp2DrawingXML
{
Converter::Converter()
{
}
Converter::~Converter()
{
}
DWORD Converter::Convert(const Odp::Folder& pFolder, CStringW& xml)
{
CDrawingDocument lDocument;
m_Folder = &pFolder;
double dDuration = 0.0;
size_t i;
for(i = 0; i < pFolder.Content->body->Slides->size(); i++)
{
SlideConvert(i, &dDuration, lDocument);
TransitionConvert(i, lDocument);
}
lDocument.ToXmlSource3();
xml = lDocument.m_strXmlVideoSource;
DWORD Result = lDocument.m_strXmlVideoSource.GetLength();
for(i = 0; i < lDocument.m_arPages.GetCount(); i++)
{
for(int j = 0; j < lDocument.m_arPages[i]->m_arElements.GetSize(); j++)
delete lDocument.m_arPages[i]->m_arElements[j];
lDocument.m_arPages[i]->m_arElements.RemoveAll();
delete lDocument.m_arPages[i];
}
lDocument.m_arPages.RemoveAll();
return Result;
}
} // namespace Odp2DrawingXML
\ No newline at end of file
#pragma once
#ifndef ODP2DRAWINGXML_CONVERTER_INCLUDE_H_
#define ODP2DRAWINGXML_CONVERTER_INCLUDE_H_
#include "stdafx.h"
#include "Odp.h"
#include "OfficeDrawing\Document.h"
#include "nullable_property.h"
#include "property.h"
#include <vector>
namespace Odp2DrawingXML
{
class Converter
{
public:
Converter();
~Converter();
public:
DWORD Convert(const Odp::Folder& pFolder, CStringW& xml);
private:
Odp::Folder const* m_Folder;
//static OOXMLShapes::ShapeType GetShapeTypeFromStr(const std::string& str);
static WORD GetTextAlignFromStr(const std::string& str);
static WORD GetTextAnchorFromStr(const std::string& str);
//static WORD GetFontAlignFromStr(const std::string& str);
//static WORD GetPattFillValFromStr(const std::string& str);
//static BYTE GetTransitionSpeedFromStr(const std::string& str);
//static DWORD GetTLRestartFromStr(const std::string& str);
//static DWORD GetTLPresetClassFromStr(const std::string& str);
//static DWORD GetTLNodeTypeFromStr(const std::string& str);
//static DWORD GetTLCalcModeFromStr(const std::string& str);
//static DWORD GetTLValueTypeFromStr(const std::string& str);
void FillPenBrush(const Odt::Logic::Properties& pProps, CShapeElement& pShape)const;
void FillBackground(const Odt::Logic::Properties& pProps, CShapeElement& pShape)const;
//static void LnToPen(const nullable_property<OOX::Logic::Ln>& Line, NSAttributes::CPen_& Pen);
//static void LnToPen(const property<OOX::Logic::Ln>& Line, NSAttributes::CPen_& Pen);
//static void LnToPen(const OOX::Logic::Ln& Line, DWORD BGRA, NSAttributes::CPen_& Pen);
//static void FillToBrush(const OOX::Logic::UniFill& Fill, NSAttributes::CBrush_& Brush);
//static void FillToBrush(const OOX::Logic::UniFill& Fill, DWORD BGRA, NSAttributes::CBrush_& Brush);
void SlideConvert(const DWORD SldNum, double* Duration, CDrawingDocument& pDocument)const;
void AddBackground(const std::string& MasterName, CElementsContainer& pEContainer)const;
void DrawingElementConvert(const Odp::Content::DrawingElement& pDrawElem, CElementsContainer& pEContainer, bool master)const;
void GroupConvert(const Odp::Content::Group& pGroup, CElementsContainer& pEContainer, bool master)const;
void FrameConvert(const Odp::Content::Frame& pFrame, CElementsContainer& pEContainer, bool master)const;
void LineConvert(const Odp::Content::Line& pLine, CElementsContainer& pEContainer, bool master)const;
void RectConvert(const Odp::Content::Rect& pRect, CElementsContainer& pEContainer, bool master)const;
void CustomShapeConvert(const Odp::Content::CustomShape& pCustShape, CElementsContainer& pEContainer, bool master)const;
void TextVectorConvert(const std::vector<Odt::Content::Text>& pTextBox, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, bool master)const;
void TextConvert(const Odt::Content::Text& pTextItem, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, const Odt::Logic::ListStyle listStyle, const int level, bool master)const;
void ParagraphConvert(const Odt::Content::Paragraph& pParagraph, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, const Odt::Logic::ListStyle listStyle, const int level, bool master)const;
void TableConvert(const Odt::Content::Table& pTable, CElementsContainer& pEContainer, const Odt::Logic::Properties& ParentProps, long x, long y, bool master)const;
void TableCellConvert(const Odt::Content::TableCell& pTableCell, CElementsContainer& pEContainer, const Odt::Logic::Properties& ParentProps, long x, long y, long w, long h, bool master)const;
//static void AddParentPics(OOX::Logic::SpTree& Group, CElementsContainer& pEContainer);
//static void GroupConvert(OOX::Logic::SpTree& Group, CElementsContainer& pEContainer);
//static void ShapeConvert(OOX::Logic::Shape& pShape, CElementsContainer& pEContainer);
//static void TextParse(const OOX::Logic::TxBody& pShapeText, CTextAttributesEx& pText, const OOX::Logic::ShapeProperties& TextProps, double AutoFit);
//static void PicConvert(const OOX::Logic::Pic& pPic, CElementsContainer& pEContainer);
//static void VideoElementConvert(const OOX::Logic::Pic& pPic, CElementsContainer& pEContainer);
//static void ConnectorConvert(const OOX::Logic::CxnSp& pCxn, CElementsContainer& pEContainer);
void TransitionConvert(const DWORD SldNum, CDrawingDocument& pDocument)const;
void TransitionParse(const Odp::Content::TransitionFilter& pTransition, const DWORD SldNum, const std::string& SlideId, CDrawingDocument& pDocument)const;
//static void TimingConvert(const DWORD SLdNum, const OOX::Logic::Timing& pTiming, CDrawingDocument& pDocument);
//static void TimeNodeListConvert(const OOX::Logic::TnLst& tnLst, Animations::ODExtTimeNodeContainer& tnContainer);
//static void TimeNodeBaseConvert(const OOX::Logic::TimeNodeBase& timeNode, Animations::ODExtTimeNodeContainer& tnContainer);
//static void CTN2TimeNodeAtom(const OOX::Logic::CTn& cTn, Animations::ODExtTimeNodeContainer& container);
//static void AddCondLst(const OOX::Logic::CondLst condLst, Animations::ODExtTimeNodeContainer& container);
//static void CBhvr2TimeBehaviorContainer(const OOX::Logic::CBhvr& bhvr, Animations::ODTimeBehaviorContainer& container);
//static int ParseTLTime(const std::string& str);
};
} // namespace Odp2DrawingXML
#endif //ODP2DRAWINGXML_CONVERTER_INCLUDE_H_
\ No newline at end of file
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="Odp2DrawingXML"
ProjectGUID="{FCF298F6-A7B5-4F35-9497-C4007C754E3C}"
RootNamespace="Odp2DrawingXML"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="OdpFormat.lib"
AdditionalLibraryDirectories="../DEBUG"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="OdpFormat.lib"
AdditionalLibraryDirectories="../Release"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseASC|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../Odp2DrawingXML;../../Common;../OdpFormat/Source;../../Common/AvsDocxFormat/Source/Utility;../../Common/AvsDocxFormat/Source/XML;../../Common/AvsDocxFormat/Source/Common;../../AVSOfficeOdtFile/Source"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="OdpFormat.lib"
AdditionalLibraryDirectories="../ReleaseASC"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</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=".\Converter.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=".\Converter.h"
>
</File>
<File
RelativePath=".\stdafx.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}"
>
</Filter>
<Filter
Name="Common"
>
<File
RelativePath="..\..\Common\OfficeDrawing\AnimationTypes.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\AnimationTypes.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Attributes.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\BinaryReader.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\CommonZLib.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Document.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Document.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Elements.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Elements.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\ElementsContainer.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\ElementSettings.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Enums.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\File.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\PropertyParcer.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Structures.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Structures.h"
>
</File>
<Filter
Name="Shapes"
>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\Shape.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\Shape.h"
>
</File>
<Filter
Name="BaseShape"
>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\BaseShape.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\BaseShape.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\Common.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\Draw.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\Metric.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\Path.h"
>
</File>
<Filter
Name="OdpShape"
>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\Formula.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\OdpShape.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\OdpShape.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\parser.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\parser.h"
>
</File>
<File
RelativePath="..\..\Common\OfficeDrawing\Shapes\BaseShape\OdpShape\PresetShapesHeader.h"
>
</File>
</Filter>
</Filter>
</Filter>
</Filter>
<Filter
Name="Source"
>
<File
RelativePath=".\Source\CustomShapeConvert.cpp"
>
</File>
<File
RelativePath=".\Source\FillPenBrush.cpp"
>
</File>
<File
RelativePath=".\Source\FrameConvert.cpp"
>
</File>
<File
RelativePath=".\Source\LineConvert.cpp"
>
</File>
<File
RelativePath=".\Source\RectConvert.cpp"
>
</File>
<File
RelativePath=".\Source\SlideConvert.cpp"
>
</File>
<File
RelativePath=".\Source\TableConvert.cpp"
>
</File>
<File
RelativePath=".\Source\TextAlign.cpp"
>
</File>
<File
RelativePath=".\Source\TextAnchor.cpp"
>
</File>
<File
RelativePath=".\Source\TextConvert.cpp"
>
</File>
<File
RelativePath=".\Source\TransitionConvert.cpp"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
void Converter::CustomShapeConvert(const Odp::Content::CustomShape& pCustShape, CElementsContainer& pEContainer, bool master)const
{
//CShapeElement* pShape = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCRect);
CShapeElement* pShape = new CShapeElement(CString(pCustShape.geometry->GetODString().c_str()));
pShape->m_dStartTime = 0;
pShape->m_dEndTime = pEContainer.m_dDuration;
pShape->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
pShape->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
/*
pShape->m_oShape.m_oBrush.m_Alpha1 = 255;
pShape->m_oShape.m_oBrush.m_Alpha2 = 255;
pShape->m_oShape.m_oPen.m_nAlpha = 255;
*/
pCustShape.GetMmRect(pShape->m_rcBoundsOriginal);
Odt::Logic::Properties TextProps;
Odt::Logic::Properties GraphicProps;
if(pCustShape.text_style_name.is_init())
{
std::string style = pCustShape.text_style_name.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pCustShape.style_name.is_init())
{
std::string style = pCustShape.style_name.get();
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
FillPenBrush(properties, *pShape);
TextVectorConvert(pCustShape.text.get(), pShape->m_oShape.m_oText, properties, master);
/*
double AutoFit = pShape.txBody->bodyPr->Fit.fontScale.get_value_or(100000)/100000.0;
TextParse(pShape.txBody.get(), lpShapeElement->m_oShape.m_oText, ShapeProps, AutoFit);
*/
pShape->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(pShape);
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
#include "Styles/FillImage.h"
#include "Styles/Gradient.h"
namespace Odp2DrawingXML
{
void Converter::FillPenBrush(const Odt::Logic::Properties& pProps, CShapeElement& pShape)const
{
if(pProps.Graphic.is_init())
{
std::string fill = pProps.Graphic->Fill.get_value_or("none");
long opacity = 255;
if(pProps.Graphic->Opacity.is_init())
opacity = (long)(255 * (100 - pProps.Graphic->Opacity->value())/100.0);
if(fill == "none")
{
pShape.m_oShape.m_oBrush.m_Alpha1 = 0;
pShape.m_oShape.m_oBrush.m_Alpha2 = 0;
}
else if(fill == "solid")
{
pShape.m_oShape.m_oBrush.m_nBrushType = (int)BrushTypeSolid;
if(pProps.Graphic->FillColor.is_init())
{
pShape.m_oShape.m_oBrush.m_oColor1.R = pProps.Graphic->FillColor->Red.get();
pShape.m_oShape.m_oBrush.m_oColor1.G = pProps.Graphic->FillColor->Green.get();
pShape.m_oShape.m_oBrush.m_oColor1.B = pProps.Graphic->FillColor->Blue.get();
pShape.m_oShape.m_oBrush.m_oColor2.R = pShape.m_oShape.m_oBrush.m_oColor1.R;
pShape.m_oShape.m_oBrush.m_oColor2.G = pShape.m_oShape.m_oBrush.m_oColor1.G;
pShape.m_oShape.m_oBrush.m_oColor2.B = pShape.m_oShape.m_oBrush.m_oColor1.B;
}
else
{
pShape.m_oShape.m_oBrush.m_oColor1.R = 255;
pShape.m_oShape.m_oBrush.m_oColor1.G = 255;
pShape.m_oShape.m_oBrush.m_oColor1.B = 255;
pShape.m_oShape.m_oBrush.m_oColor2.R = 255;
pShape.m_oShape.m_oBrush.m_oColor2.G = 255;
pShape.m_oShape.m_oBrush.m_oColor2.B = 255;
}
pShape.m_oShape.m_oBrush.m_Alpha1 = pShape.m_oShape.m_oBrush.m_Alpha2 = opacity;
}
else if((fill == "gradient") && (pProps.Graphic->FillGradientName.is_init()))
{
pShape.m_oShape.m_oBrush.m_nBrushType = (int)BrushTypeCenter;//TODO :
std::string gradient = pProps.Graphic->FillGradientName.get();
Odp::Styles::Gradient Gradient = m_Folder->Styles->Gradients->find(gradient);
pShape.m_oShape.m_oBrush.m_oColor1.R = Gradient.StartColor->Red.get();
pShape.m_oShape.m_oBrush.m_oColor1.G = Gradient.StartColor->Green.get();
pShape.m_oShape.m_oBrush.m_oColor1.B = Gradient.StartColor->Blue.get();
pShape.m_oShape.m_oBrush.m_oColor2.R = Gradient.EndColor->Red.get();
pShape.m_oShape.m_oBrush.m_oColor2.G = Gradient.EndColor->Green.get();
pShape.m_oShape.m_oBrush.m_oColor2.B = Gradient.EndColor->Blue.get();
pShape.m_oShape.m_oBrush.m_Alpha1 = pShape.m_oShape.m_oBrush.m_Alpha2 = opacity;
}
else if((fill == "bitmap") && (pProps.Graphic->FillImageName.is_init()))
{
pShape.m_oShape.m_oBrush.m_nBrushType = (int)BrushTypeTexture;
std::string image = pProps.Graphic->FillImageName.get();
Odp::Styles::FillImage FillImage = m_Folder->Styles->FillImages->find(image);
pShape.m_oShape.m_oBrush.m_sTexturePath = CStringW(m_Folder->GetPath().c_str()) + CStringW(FillImage.Href.get().c_str());
pShape.m_oShape.m_oBrush.m_nTextureMode = (int)BrushTextureModeTile;//:(int)BrushTextureModeStretch;
}
std::string stroke = pProps.Graphic->Stroke.get_value_or("none");
if(stroke == "none")
{
pShape.m_oShape.m_oPen.m_nAlpha = 0;
}
else if(stroke == "solid")
{
if(pProps.Graphic->StrokeColor.is_init())
{
pShape.m_oShape.m_oPen.m_oColor.R = pProps.Graphic->StrokeColor->Red.get();
pShape.m_oShape.m_oPen.m_oColor.G = pProps.Graphic->StrokeColor->Green.get();
pShape.m_oShape.m_oPen.m_oColor.B = pProps.Graphic->StrokeColor->Blue.get();
}
else
{
pShape.m_oShape.m_oPen.m_oColor.R = 0;
pShape.m_oShape.m_oPen.m_oColor.G = 0;
pShape.m_oShape.m_oPen.m_oColor.B = 0;
}
}
}
}
void Converter::FillBackground(const Odt::Logic::Properties& pProps, CShapeElement& pShape)const
{
std::string fill = pProps.DrawingPage->Fill.get_value_or("none");
if(fill == "none")
{
pShape.m_oShape.m_oBrush.m_Alpha1 = 0;
pShape.m_oShape.m_oBrush.m_Alpha2 = 0;
}
else if((fill == "bitmap") && (pProps.DrawingPage->FillImageName.is_init()))
{
std::string image = pProps.DrawingPage->FillImageName.get();
Odp::Styles::FillImage FillImage = m_Folder->Styles->FillImages->find(image);
pShape.m_oShape.m_oBrush.m_nBrushType = (int)BrushTypeTexture;
pShape.m_oShape.m_oBrush.m_sTexturePath = CStringW(m_Folder->GetPath().c_str()) + CStringW(FillImage.Href.get().c_str());
}
else if(fill == "solid")
{
pShape.m_oShape.m_oBrush.m_nBrushType = (int)BrushTypeSolid;
if(pProps.DrawingPage->FillColor.is_init())
{
pShape.m_oShape.m_oBrush.m_oColor1.R = pProps.DrawingPage->FillColor->Red.get();
pShape.m_oShape.m_oBrush.m_oColor1.G = pProps.DrawingPage->FillColor->Green.get();
pShape.m_oShape.m_oBrush.m_oColor1.B = pProps.DrawingPage->FillColor->Blue.get();
pShape.m_oShape.m_oBrush.m_oColor2.R = pShape.m_oShape.m_oBrush.m_oColor1.R;
pShape.m_oShape.m_oBrush.m_oColor2.G = pShape.m_oShape.m_oBrush.m_oColor1.G;
pShape.m_oShape.m_oBrush.m_oColor2.B = pShape.m_oShape.m_oBrush.m_oColor1.B;
}
else
{
pShape.m_oShape.m_oBrush.m_oColor1.R = 255;
pShape.m_oShape.m_oBrush.m_oColor1.G = 255;
pShape.m_oShape.m_oBrush.m_oColor1.B = 255;
pShape.m_oShape.m_oBrush.m_oColor2.R = 255;
pShape.m_oShape.m_oBrush.m_oColor2.G = 255;
pShape.m_oShape.m_oBrush.m_oColor2.B = 255;
}
}
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
void Converter::FrameConvert(const Odp::Content::Frame& pFrame, CElementsContainer& pEContainer, bool master)const
{
if((pFrame.image.is_init()) && (!pFrame.object.is_init()) && (!pFrame.Table.is_init()))
{
CImageElement* lpImageElement = new CImageElement();
lpImageElement->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
lpImageElement->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
lpImageElement->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
lpImageElement->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
lpImageElement->m_dStartTime = 0;
lpImageElement->m_dEndTime = pEContainer.m_dDuration;
pFrame.GetMmRect(lpImageElement->m_rcBoundsOriginal);
lpImageElement->m_strFileName = CString(m_Folder->GetPath().c_str()) + CString(pFrame.image->href.get().c_str());
//lpImageElement->SetUpProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(lpImageElement);
return;
}
else if(pFrame.text_box.is_init())
{
CShapeElement* pTextBox = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCRect);
pTextBox->m_dStartTime = 0;
pTextBox->m_dEndTime = pEContainer.m_dDuration;
pTextBox->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
pTextBox->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
pTextBox->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
pTextBox->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
pTextBox->m_oShape.m_oBrush.m_Alpha1 = 0;
pTextBox->m_oShape.m_oBrush.m_Alpha2 = 0;
pTextBox->m_oShape.m_oPen.m_nAlpha = 0;
pFrame.GetMmRect(pTextBox->m_rcBoundsOriginal);
Odt::Logic::Properties TextProps;
Odt::Logic::Properties GraphicProps;
Odt::Logic::Properties PresProps;
if(pFrame.text_style_name.is_init())
{
std::string style = pFrame.text_style_name.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pFrame.draw_style_name.is_init())
{
std::string style = pFrame.draw_style_name.get();
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pFrame.presentation_style_name.is_init())
{
std::string style = pFrame.presentation_style_name.get();
PresProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
properties = Odt::Logic::Properties::merge(PresProps, properties);
TextVectorConvert(pFrame.text_box->Items.get(), pTextBox->m_oShape.m_oText, properties, master);
/*
double AutoFit = pShape.txBody->bodyPr->Fit.fontScale.get_value_or(100000)/100000.0;
TextParse(pShape.txBody.get(), lpShapeElement->m_oShape.m_oText, ShapeProps, AutoFit);
*/
pTextBox->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(pTextBox);
}
else if(pFrame.Table.is_init())
{
RECT rect;
pFrame.GetMmRect(rect);
Odt::Logic::Properties TextProps;
Odt::Logic::Properties GraphicProps;
Odt::Logic::Properties PresProps;
if(pFrame.text_style_name.is_init())
{
std::string style = pFrame.text_style_name.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pFrame.draw_style_name.is_init())
{
std::string style = pFrame.draw_style_name.get();
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pFrame.presentation_style_name.is_init())
{
std::string style = pFrame.presentation_style_name.get();
PresProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
properties = Odt::Logic::Properties::merge(PresProps, properties);
TableConvert(pFrame.Table, pEContainer, properties, rect.left, rect.top, master);
}
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
void Converter::LineConvert(const Odp::Content::Line& pLine, CElementsContainer& pEContainer, bool master)const
{
CShapeElement* pShape = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCLine);
pShape->m_dStartTime = 0;
pShape->m_dEndTime = pEContainer.m_dDuration;
pShape->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
pShape->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
std::string style = pLine.StyleName.get();
Odt::Logic::Properties GraphicProps;
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
Odt::Logic::Properties TextProps;
if(pLine.TextStyleName.is_init())
{
style = pLine.TextStyleName.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
FillPenBrush(properties, *pShape);
pLine.GetMmRect(pShape->m_rcBoundsOriginal);
pShape->m_oShape.m_pShape->SetAdjustment(4, pEContainer.m_lOriginalWidth);
pShape->m_oShape.m_pShape->SetAdjustment(5, pEContainer.m_lOriginalHeight);
pShape->m_oShape.m_pShape->SetAdjustment(0, pShape->m_rcBoundsOriginal.left);
pShape->m_oShape.m_pShape->SetAdjustment(1, pShape->m_rcBoundsOriginal.top);
pShape->m_oShape.m_pShape->SetAdjustment(2, pShape->m_rcBoundsOriginal.right - pShape->m_rcBoundsOriginal.left);
pShape->m_oShape.m_pShape->SetAdjustment(3, pShape->m_rcBoundsOriginal.bottom - pShape->m_rcBoundsOriginal.top);
pShape->m_rcBoundsOriginal.left = 0;
pShape->m_rcBoundsOriginal.top = 0;
pShape->m_rcBoundsOriginal.right = pEContainer.m_lOriginalWidth;
pShape->m_rcBoundsOriginal.bottom = pEContainer.m_lOriginalHeight;
TextVectorConvert(pLine.Text.get(), pShape->m_oShape.m_oText, properties, master);
/*
double AutoFit = pShape.txBody->bodyPr->Fit.fontScale.get_value_or(100000)/100000.0;
TextParse(pShape.txBody.get(), lpShapeElement->m_oShape.m_oText, ShapeProps, AutoFit);
*/
pShape->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(pShape);
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
void Converter::RectConvert(const Odp::Content::Rect& pRect, CElementsContainer& pEContainer, bool master)const
{
CShapeElement* pShape = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCRect);
pShape->m_dStartTime = 0;
pShape->m_dEndTime = pEContainer.m_dDuration;
pShape->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
pShape->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
Odt::Logic::Properties TextProps;
Odt::Logic::Properties GraphicProps;
Odt::Logic::Properties PresProps;
if(pRect.TextStyleName.is_init())
{
std::string style = pRect.TextStyleName.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pRect.DrawStyleName.is_init())
{
std::string style = pRect.DrawStyleName.get();
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
}
if(pRect.PresentationStyleName.is_init())
{
std::string style = pRect.PresentationStyleName.get();
PresProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
properties = Odt::Logic::Properties::merge(PresProps, properties);
/*
std::string style = pRect.StyleName.get();
Odt::Logic::Properties GraphicProps;
GraphicProps = m_Folder->GetPropertiesFromStyle(style, master);
Odt::Logic::Properties TextProps;
if(pRect.TextStyleName.is_init())
{
style = pRect.TextStyleName.get();
TextProps = m_Folder->GetPropertiesFromStyle(style, master);
}
Odt::Logic::Properties properties;
properties = Odt::Logic::Properties::merge(GraphicProps, TextProps);
*/
FillPenBrush(properties, *pShape);
pRect.GetMmRect(pShape->m_rcBoundsOriginal);
TextVectorConvert(pRect.Text.get(), pShape->m_oShape.m_oText, properties, master);
/*
double AutoFit = pShape.txBody->bodyPr->Fit.fontScale.get_value_or(100000)/100000.0;
TextParse(pShape.txBody.get(), lpShapeElement->m_oShape.m_oText, ShapeProps, AutoFit);
*/
pShape->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(pShape);
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
#include "Utility.h"
namespace Odp2DrawingXML
{
void Converter::SlideConvert(const DWORD SldNum, double* Duration, CDrawingDocument& pDocument)const
{
std::string master = m_Folder->Content->body->Slides->at(SldNum).MasterPageName.get();
const Odp::Styles::MasterPage& MasterPage = m_Folder->GetMasterPage(master);
std::string layout = MasterPage.Layout.get();
const Odp::Styles::PageLayout& PageLayout = m_Folder->GetPageLayout(layout);
CElementsContainer* lEContainer = new CElementsContainer;
lEContainer->m_lOriginalWidth = (long)(PageLayout.Properties->page_width->value(UniversalUnit::Mm));
lEContainer->m_lOriginalHeight = (long)(PageLayout.Properties->page_height->value(UniversalUnit::Mm));
lEContainer->m_lWidth = lEContainer->m_lOriginalWidth;
lEContainer->m_lHeight = lEContainer->m_lOriginalHeight;
lEContainer->m_dStartTime = *Duration;
lEContainer->m_dDuration = 30000.0;
*Duration += 30000.0;
lEContainer->m_dEndTime = *Duration;
AddBackground(master, *lEContainer);
for(size_t i = 0; i < m_Folder->Content->body->Slides->at(SldNum).Elements->size(); i++)
{
DrawingElementConvert(m_Folder->Content->body->Slides->at(SldNum).Elements->at(i), *lEContainer, false);
}
lEContainer->NormalizeCoordinates();
pDocument.m_arPages.Add(lEContainer);
}
void Converter::AddBackground(const std::string& MasterName, CElementsContainer& pEContainer)const
{
const Odp::Styles::MasterPage& MasterPage = m_Folder->GetMasterPage(MasterName);
Odt::Logic::Properties properties = m_Folder->GetPropertiesFromStyle(MasterPage.StyleName.get(), true);
if((properties.DrawingPage.is_init()) && (properties.DrawingPage->Fill.get_value_or("none") != "none"))
{
CShapeElement* lpSlideBackground = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCRect);
lpSlideBackground->m_dStartTime = 0;
lpSlideBackground->m_dEndTime = pEContainer.m_dDuration;
lpSlideBackground->m_rcBoundsOriginal.top = 0;
lpSlideBackground->m_rcBoundsOriginal.left = 0;
lpSlideBackground->m_rcBoundsOriginal.right = pEContainer.m_lWidth;
lpSlideBackground->m_rcBoundsOriginal.bottom = pEContainer.m_lHeight;
lpSlideBackground->m_oMetric.m_lUnitsHor = pEContainer.m_lWidth;
lpSlideBackground->m_oMetric.m_lUnitsVer = pEContainer.m_lHeight;
lpSlideBackground->m_oMetric.m_lMillimetresHor = pEContainer.m_lWidth;
lpSlideBackground->m_oMetric.m_lMillimetresVer = pEContainer.m_lHeight;
lpSlideBackground->m_oShape.m_oPen.m_nAlpha = 0;
FillBackground(properties, *lpSlideBackground);
lpSlideBackground->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(lpSlideBackground);
}
for(size_t i = 0; i < MasterPage.Elements->size(); i++)
{
if(MasterPage.Elements->at(i).is<Odp::Content::Frame>())
{
if(!MasterPage.Elements->at(i).as<Odp::Content::Frame>().Class.is_init())
FrameConvert(MasterPage.Elements->at(i).as<Odp::Content::Frame>(), pEContainer, true);
}
else if(MasterPage.Elements->at(i).is<Odp::Content::CustomShape>())
{
CustomShapeConvert(MasterPage.Elements->at(i).as<Odp::Content::CustomShape>(), pEContainer, true);
}
else if(MasterPage.Elements->at(i).is<Odp::Content::Group>())
{
GroupConvert(MasterPage.Elements->at(i).as<Odp::Content::Group>(), pEContainer, true);
}
else if(MasterPage.Elements->at(i).is<Odp::Content::Line>())
{
LineConvert(MasterPage.Elements->at(i).as<Odp::Content::Line>(), pEContainer, true);
}
else if(MasterPage.Elements->at(i).is<Odp::Content::Rect>())
{
RectConvert(MasterPage.Elements->at(i).as<Odp::Content::Rect>(), pEContainer, true);
}
}
}
void Converter::DrawingElementConvert(const Odp::Content::DrawingElement& pDrawElem, CElementsContainer& pEContainer, bool master)const
{
if(pDrawElem.is<Odp::Content::Frame>())
FrameConvert(pDrawElem.as<Odp::Content::Frame>(), pEContainer, master);
else if(pDrawElem.is<Odp::Content::CustomShape>())
{
CustomShapeConvert(pDrawElem.as<Odp::Content::CustomShape>(), pEContainer, master);
}
else if(pDrawElem.is<Odp::Content::Group>())
{
GroupConvert(pDrawElem.as<Odp::Content::Group>(), pEContainer, master);
}
else if(pDrawElem.is<Odp::Content::Line>())
{
LineConvert(pDrawElem.as<Odp::Content::Line>(), pEContainer, master);
}
else if(pDrawElem.is<Odp::Content::Rect>())
{
RectConvert(pDrawElem.as<Odp::Content::Rect>(), pEContainer, master);
}
}
void Converter::GroupConvert(const Odp::Content::Group& pGroup, CElementsContainer& pEContainer, bool master)const
{
for(size_t i = 0; i < pGroup.Elements->size(); i++)
{
DrawingElementConvert(pGroup.Elements->at(i), pEContainer, master);
}
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
#include "nullable_property.h"
#include "OdtFormat/Content/CoveredTableCell.h"
namespace Odp2DrawingXML
{
void Converter::TableConvert(const Odt::Content::Table& pTable, CElementsContainer& pEContainer, const Odt::Logic::Properties& ParentProps, long x, long y, bool master)const
{
long xt = x;
long yt = y;
nullable_property<Odp::Styles::TableTemplate> TableStyle;
if(pTable.TemplateName.is_init())
TableStyle = m_Folder->GetTableTemplate(pTable.TemplateName.get());
size_t size = pTable.Rows->size() * pTable.Columns->size();
Odt::Logic::Properties* PropsTable = new Odt::Logic::Properties [size];
for(size_t i = 0; i < pTable.Rows->size(); i++)
{
bool UseStyle = false;
Odt::Logic::Properties RowProps = m_Folder->GetPropertiesFromStyle(pTable.Rows->at(i).StyleName.get_value_or(""), master);
RowProps = Odt::Logic::Properties::merge(ParentProps, RowProps);
if(TableStyle.is_init())
{
if((i == 0) && (TableStyle->FirstRow.is_init()) && (pTable.UseFirstRowStyles.get_value_or(false)))
{
Odt::Logic::Properties FirstRow = m_Folder->GetPropertiesFromStyle(TableStyle->FirstRow.get(), true);
RowProps = Odt::Logic::Properties::merge(RowProps, FirstRow);
UseStyle = true;
}
else if((i == pTable.Rows->size()-1) && (TableStyle->LastRow.is_init()) && (pTable.UseLastRowStyles.get_value_or(false)))
{
Odt::Logic::Properties LastRow = m_Folder->GetPropertiesFromStyle(TableStyle->LastRow.get(), true);
RowProps = Odt::Logic::Properties::merge(RowProps, LastRow);
UseStyle = true;
}
else if(((i % 2) == 1) && (TableStyle->OddRows.is_init()) && (pTable.UseBandingRowsStyles.get_value_or(false)))
{
Odt::Logic::Properties OddRow = m_Folder->GetPropertiesFromStyle(TableStyle->OddRows.get(), true);
RowProps = Odt::Logic::Properties::merge(RowProps, OddRow);
UseStyle = true;
}
//else if(TableStyle->Body.is_init())
//{
//}
}
for(size_t j = 0; j < pTable.Columns->size(); j++)
{
Odt::Logic::Properties ColProps = m_Folder->GetPropertiesFromStyle(pTable.Columns->at(j).Style.get(), master);
ColProps = Odt::Logic::Properties::merge(RowProps, ColProps);
if((TableStyle.is_init()) && (!UseStyle))
{
if((j == 0) && (TableStyle->FirstColumn.is_init()) && (pTable.UseFirstColumnStyles.get_value_or(false)))
{
Odt::Logic::Properties FirstColumn = m_Folder->GetPropertiesFromStyle(TableStyle->FirstColumn.get(), true);
ColProps = Odt::Logic::Properties::merge(ColProps, FirstColumn);
}
else if((j == pTable.Columns->size()-1) && (TableStyle->LastColumn.is_init()) && (pTable.UseLastColumnStyles.get_value_or(false)))
{
Odt::Logic::Properties LastColumn = m_Folder->GetPropertiesFromStyle(TableStyle->LastColumn.get(), true);
ColProps = Odt::Logic::Properties::merge(ColProps, LastColumn);
}
else if(((j % 2) == 1) && (TableStyle->OddColumns.is_init()) && (pTable.UseBandingColumnsStyles.get_value_or(false)))
{
Odt::Logic::Properties OddColumn = m_Folder->GetPropertiesFromStyle(TableStyle->OddColumns.get(), true);
ColProps = Odt::Logic::Properties::merge(ColProps, OddColumn);
}
else if(TableStyle->Body.is_init())
{
Odt::Logic::Properties Body = m_Folder->GetPropertiesFromStyle(TableStyle->Body.get(), true);
ColProps = Odt::Logic::Properties::merge(ColProps, Body);
}
}
PropsTable[i * pTable.Columns->size() + j] = ColProps;
}
}
//Odt::Logic::Properties properties = ParentProps;
for(size_t i = 0; i < pTable.Rows->size(); i++)
{
for(size_t j = 0; j < pTable.Rows->at(i).Cells->size(); j++)
{
if(pTable.Rows->at(i).Cells->at(j).is<Odt::Content::TableCell>())
{
long numCol = pTable.Rows->at(i).Cells->at(j).getNumCol();
Odt::Logic::Properties DefCellProps = m_Folder->GetPropertiesFromStyle(pTable.Rows->at(i).DefaultCellStyleName.get_value_or(""), master);
DefCellProps = Odt::Logic::Properties::merge(PropsTable[i * pTable.Columns->size() + numCol] , DefCellProps);
if(pTable.Rows->at(i).Cells->at(j).as<Odt::Content::TableCell>().Style.is_init())
{
Odt::Logic::Properties CellProps = m_Folder->GetPropertiesFromStyle(pTable.Rows->at(i).Cells->at(j).as<Odt::Content::TableCell>().Style.get(), master);
DefCellProps = Odt::Logic::Properties::merge(DefCellProps, CellProps);
}
long w = (long)(PropsTable[i * pTable.Columns->size() + numCol].TableColumn->Width->value() * 10);
long h = (long)(PropsTable[i * pTable.Columns->size() + numCol].TableRow->Height->value() * 10);
for(size_t k = 1; k < pTable.Rows->at(i).Cells->at(j).as<Odt::Content::TableCell>().ColumnsSpanned.get_value_or(0); k++)
{
w += (long)(PropsTable[i * pTable.Columns->size() + numCol + k].TableColumn->Width->value() * 10);
}
for(size_t k = 1; k < pTable.Rows->at(i).Cells->at(j).as<Odt::Content::TableCell>().RowsSpanned.get_value_or(0); k++)
{
h += (long)(PropsTable[(i + k) * pTable.Columns->size() + numCol].TableRow->Height->value() * 10);
}
TableCellConvert(pTable.Rows->at(i).Cells->at(j).as<Odt::Content::TableCell>(), pEContainer, DefCellProps, xt, yt, w, h, master);
xt += w;
}
else if(pTable.Rows->at(i).Cells->at(j).is<Odt::Content::CoveredTableCell>())
{
long numCol = pTable.Rows->at(i).Cells->at(j).getNumCol();
long w = (long)(PropsTable[i * pTable.Columns->size() + numCol].TableColumn->Width->value() * 10);
for(size_t k = 1; k < pTable.Rows->at(i).Cells->at(j).as<Odt::Content::CoveredTableCell>().CountHMerge.get(); k++)
{
w += (long)(PropsTable[i * pTable.Columns->size() + numCol - k + 1].TableColumn->Width->value() * 10);
}
xt += w;
}
}
xt = x;
yt += (long)(PropsTable[i * pTable.Columns->size()].TableRow->Height->value() * 10);
}
}
void Converter::TableCellConvert(const Odt::Content::TableCell& pTableCell, CElementsContainer& pEContainer, const Odt::Logic::Properties& ParentProps, long x, long y, long w, long h, bool master)const
{
CShapeElement* pShape = new CShapeElement(NSBaseShape::odp, (int)OdpShapes::sptCRect);
pShape->m_dStartTime = 0;
pShape->m_dEndTime = pEContainer.m_dDuration;
pShape->m_oMetric.m_lUnitsHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lUnitsVer = pEContainer.m_lOriginalHeight;
pShape->m_oMetric.m_lMillimetresHor = pEContainer.m_lOriginalWidth;
pShape->m_oMetric.m_lMillimetresVer = pEContainer.m_lOriginalHeight;
/*
pShape->m_oShape.m_oBrush.m_Alpha1 = 255;
pShape->m_oShape.m_oBrush.m_Alpha2 = 255;
pShape->m_oShape.m_oPen.m_nAlpha = 255;
*/
pShape->m_rcBoundsOriginal.left = x;
pShape->m_rcBoundsOriginal.top = y;
pShape->m_rcBoundsOriginal.right = x + w;//(long)(ParentProps.TableColumn->Width->value() * 10);
//pShape->m_rcBoundsOriginal.right += pShape->m_rcBoundsOriginal.left;
pShape->m_rcBoundsOriginal.bottom = y + h;//(long)(ParentProps.TableRow->Height->value() * 10);
//pShape->m_rcBoundsOriginal.bottom += pShape->m_rcBoundsOriginal.top;
FillPenBrush(ParentProps, *pShape);
TextVectorConvert(pTableCell.Texts.get(), pShape->m_oShape.m_oText, ParentProps, master);
/*
double AutoFit = pShape.txBody->bodyPr->Fit.fontScale.get_value_or(100000)/100000.0;
TextParse(pShape.txBody.get(), lpShapeElement->m_oShape.m_oText, ShapeProps, AutoFit);
*/
pShape->m_oShape.SetProperties(NULL, &pEContainer);
pEContainer.m_arElements.Add(pShape);
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
WORD Converter::GetTextAlignFromStr(const std::string& str)
{
if((str == "left") || (str == "begin"))return 0;
if(str == "center") return 1;
if(str == "end") return 2;
if(str == "justify") return 3;
// if(str == "dist") return 4;
// if(str == "thaiDist") return 5;
// if(str == "justLow") return 6;
return 0;
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
namespace Odp2DrawingXML
{
WORD Converter::GetTextAnchorFromStr(const std::string& str)
{
if(str == "top") return 0;
if((str == "center") || (str == "middle"))return 1;
if(str == "bottom") return 2;
return 0;
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
#include "OdtFormat/Content/List.h"
#include "OdtFormat/Content/Span.h"
#include "OdtFormat/Content/ParagraphItem.h"
#include "Utility.h"
namespace Odp2DrawingXML
{
void Converter::TextVectorConvert(const std::vector<Odt::Content::Text>& pTextBox, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, bool master)const
{
pText.m_sText = L"";
pText.m_oAttributes.m_nTextAlignVertical =
ParentProps.Graphic.is_init() ? GetTextAnchorFromStr(ParentProps.Graphic->TextareaVerticalAlign.get_value_or("top")) : GetTextAnchorFromStr("top");
Odt::Logic::ListStyle listStyle;
for(size_t i = 0; i < pTextBox.size(); i++)
{
TextConvert(pTextBox.at(i), pText, ParentProps, listStyle, 0, master);
}
}
void Converter::TextConvert(const Odt::Content::Text& pTextItem, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, const Odt::Logic::ListStyle listStyle , const int level, bool master)const
{
if(pTextItem.is<Odt::Content::Paragraph>())
{
Odt::Logic::Properties properties;
if(pTextItem.as<Odt::Content::Paragraph>().Style.is_init())
{
std::string style = pTextItem.as<Odt::Content::Paragraph>().Style.get();
properties = m_Folder->GetPropertiesFromStyle(style, master);
}
properties = Odt::Logic::Properties::merge(ParentProps, properties);
ParagraphConvert(pTextItem.as<Odt::Content::Paragraph>(), pText, properties, listStyle, level, master);
}
else if(pTextItem.is<Odt::Content::List>())
{
for(size_t items = 0; items < pTextItem.as<Odt::Content::List>().Items->size(); items++)
{
for(size_t i = 0; i < pTextItem.as<Odt::Content::List>().Items->at(items).Texts->size(); i++)
{
Odt::Logic::ListStyle lStyle = listStyle;
if(pTextItem.as<Odt::Content::List>().Style.is_init())
{
std::string style = pTextItem.as<Odt::Content::List>().Style.get();
lStyle = m_Folder->GetListStyle(style, master);
//properties = m_Folder->GetPropertiesFromListStyle(style, level + 1);
//ParentProps.ListLevel = properties.ListLevel;
}
// properties = Odt::Logic::Properties::merge(ParentProps, properties);
TextConvert(pTextItem.as<Odt::Content::List>().Items->at(items).Texts->at(i), pText, ParentProps, lStyle, level + 1, master);
}
}
}
}
void Converter::ParagraphConvert(const Odt::Content::Paragraph& pParagraph, CTextAttributesEx& pText, const Odt::Logic::Properties& ParentProps, const Odt::Logic::ListStyle listStyle, const int level, bool master)const
{
STextPFRun pfRun;
pfRun.lCount = 0;
pfRun.lIndentLevel = level;
pfRun.hasBullet_ = (level != 0);
pfRun.leftMargin = 0;
LONG lMinLabelOffset = 0;
if(pfRun.hasBullet_)
{
pfRun.bulletHasColor_ = true;
pfRun.bulletColor_ = true;
pfRun.bulletColor.FromValue(0x0);
pfRun.bulletHasSize_ = true;
pfRun.bulletSize_ = true;
pfRun.bulletSize = 100;
pfRun.bulletChar_ = true;
pfRun.bulletChar = L'*';
pfRun.bulletHasFont_ = true;
pfRun.bulletFlag = 0x0F;
try
{
if(listStyle.listLevelStyleProperties(level).ListLevel.is_init())
{
pfRun.leftMargin += listStyle.listLevelStyleProperties(level).ListLevel->SpaceBefore.is_init()?
listStyle.listLevelStyleProperties(level).ListLevel->SpaceBefore->value(UniversalUnit::Mm):0;
if (listStyle.listLevelStyleProperties(level).ListLevel->MinLabelWidth.is_init())
lMinLabelOffset = listStyle.listLevelStyleProperties(level).ListLevel->MinLabelWidth->value(UniversalUnit::Mm);
}
}
catch(...)
{
}
}
if(ParentProps.Paragraph.is_init())
{
pfRun.align_ = true;
pfRun.textAlignment = GetTextAlignFromStr(ParentProps.Paragraph->Align.is_init()?ParentProps.Paragraph->Align->ToString():"left");
pfRun.leftMargin_ = true;
pfRun.leftMargin += ParentProps.Paragraph->MarginLeft.is_init()? (ParentProps.Paragraph->MarginLeft->value(UniversalUnit::Mm)) : 0;
//pfRun.leftMargin *= 10;// TODO : UniversalUnit !!!
pfRun.indent_ = true;
pfRun.indent = ParentProps.Paragraph->TextIndent.is_init()? (ParentProps.Paragraph->TextIndent->value(UniversalUnit::Mm)) : 0;
//pfRun.indent *= 10;// TODO : UniversalUnit !!!
if (0 == pfRun.leftMargin && 0 == pfRun.indent)
{
pfRun.indent = -lMinLabelOffset;
pfRun.leftMargin = lMinLabelOffset;
}
// pfRun.defaultTabSize_ = true;
// pfRun.defaultTabSize = ParentProps.Paragraph->TabStopDistance.is_init()? (ParentProps.Paragraph->TabStopDistance->value() * 10) : 0;
//pfRun.defaultTabSize *= 10;// TODO : UniversalUnit !!!
/*
paragraph.fontAlign_ = true;
paragraph.fontAlign = GetFontAlignFromStr(TextProps.GetParagraphFontAlgn(level, *SpTextPar));
if(TextProps.GetParagraphLatinLnBrk(level, *SpTextPar))
{
paragraph.charWrap_ = true;
paragraph.wordWrap_ = false;
paragraph.wrapFlags &= 0xFD;
paragraph.wrapFlags |= 0x01;
paragraph.overflow_ = true;
}
else
{
*/
pfRun.charWrap_ = false;
pfRun.wordWrap_ = true;
pfRun.wrapFlags &= 0xFE;
pfRun.wrapFlags |= 0x02;
pfRun.overflow_ = true;
/*
}
paragraph.textDirection_ = true;
paragraph.textDirectional = (TextProps.GetParagraphRtl(level, *SpTextPar))?1:0;
*/
pfRun.lineSpacing_ = ParentProps.Paragraph->LineHeight.is_init();
if(pfRun.lineSpacing_)
{
if(ParentProps.Paragraph->LineHeight->Type == UniversalUnit::Percent)
pfRun.lineSpacing = ParentProps.Paragraph->LineHeight->value(UniversalUnit::Percent);
else
//pfRun.lineSpacing = -ParentProps.Paragraph->LineHeight->value(UniversalUnit::Mm);
pfRun.lineSpacing = 100;
}
pfRun.spaceBefore_ = true;
pfRun.spaceBefore = ParentProps.Paragraph->MarginTop.is_init() ? (-ParentProps.Paragraph->MarginTop->value(UniversalUnit::Mm)) : 0;
pfRun.spaceAfter_ = true;
pfRun.spaceAfter = ParentProps.Paragraph->MarginBottom.is_init() ? (-ParentProps.Paragraph->MarginBottom->value(UniversalUnit::Mm)) : 0;
}
for(size_t runs = 0; runs < pParagraph.Items->size(); runs++)
{
Odt::Logic::Properties properties;
if(pParagraph.Items->at(runs).is<Odt::Content::Span>())
{
if(pParagraph.Items->at(runs).as<Odt::Content::Span>().Style.is_init())
{
std::string style = pParagraph.Items->at(runs).as<Odt::Content::Span>().Style.get();
properties = m_Folder->GetPropertiesFromStyle(style, master);
}
}
properties = Odt::Logic::Properties::merge(ParentProps, properties);
STextCFRun cfRun;
std::wstring text = Encoding::utf82unicode(pParagraph.Items->at(runs).toTxt());
if (0 == text.length())
text = L"\n";
cfRun.lCount = text.length();
pfRun.lCount += cfRun.lCount;
if(properties.Text.is_init())
{
if(properties.Text->FontSize.is_init())
cfRun.fontSize = properties.Text->FontSize.get();
else
cfRun.fontSize = 12;
cfRun.hasSize = true;
cfRun.hasBold = properties.Text->Bold.get_value_or(false);
if(cfRun.hasBold)
cfRun.fontStyle |= 0x01;
cfRun.hasItalic = properties.Text->Italic.get_value_or(false);
if(cfRun.hasItalic)
cfRun.fontStyle |= 0x02;
//cfRun.hasUnderline = properties.Text->Under.get_value_or(false);
if(cfRun.hasUnderline)
cfRun.fontStyle |= 0x04;
cfRun.strFontName = CStringW(properties.Text->FontName.get_value_or(properties.Text->FontFamily.get_value_or("Times New Roman")).c_str());
int pos = cfRun.strFontName.Find(L"'");
while(pos >= 0)
{
cfRun.strFontName.Delete(pos);
pos = cfRun.strFontName.Find(L"'");
}
cfRun.hasColor = true;
if(properties.Text->FontColor.is_init())
{
cfRun.oColor.R = (BYTE)properties.Text->FontColor->Red.get();
cfRun.oColor.G = (BYTE)properties.Text->FontColor->Green.get();
cfRun.oColor.B = (BYTE)properties.Text->FontColor->Blue.get();
}
else
cfRun.oColor.FromValue(0, 0, 0);
}
pText.m_sText += CStringW(text.c_str());
pText.m_arCFs.Add(cfRun);
}
//pText.m_sText += L"\n";
//STextCFRun cfEnd;
//cfEnd.lCount = 1;
//pText.m_arCFs.Add(cfEnd);
//pfRun.lCount++;
if((pfRun.lCount == 1) && (level == 1))
{
pfRun.hasBullet_ = false;
pfRun.bulletHasColor_ = false;
pfRun.bulletColor_ = false;
pfRun.bulletHasSize_ = false;
pfRun.bulletSize_ = false;
pfRun.bulletChar_ = false;
pfRun.bulletHasFont_ = false;
pfRun.bulletFlag = 0;
}
pText.m_arPFs.Add(pfRun);
}
}
\ No newline at end of file
#include "stdafx.h"
#include "./../Converter.h"
#include "../OdpFormat/Source/Content/Slide.h"
#include "../OdpFormat/Source/Content/Animation/Par.h"
namespace Odp2DrawingXML
{
void Converter::TransitionConvert(const DWORD SldNum, CDrawingDocument& pDocument)const
{
bool converted = false;
const Odp::Content::Slide& pSlide = m_Folder->Content->body->Slides->at(SldNum);
std::string SlideId = pSlide.Id.get_value_or("");
if((SlideId != "") && (pSlide.Animation.is_init()))
{
for(size_t i = 0; i < pSlide.Animation->Childs->size(); i++)
{
if(pSlide.Animation->Childs->at(i).is<Odp::Content::Par>())
{
if(pSlide.Animation->Childs->at(i).as<Odp::Content::Par>().Begin.get_value_or("") == SlideId + ".begin")
{
for(size_t j = 0; j < pSlide.Animation->Childs->at(i).as<Odp::Content::Par>().Childs->size(); j++)
{
if(pSlide.Animation->Childs->at(i).as<Odp::Content::Par>().Childs->at(j).is<Odp::Content::TransitionFilter>())
{
TransitionParse(pSlide.Animation->Childs->at(i).as<Odp::Content::Par>().Childs->at(j).as<Odp::Content::TransitionFilter>(),
SldNum, SlideId, pDocument);
converted = true;
break;
}
}
}
}
if(converted)
break;
}
}
}
void Converter::TransitionParse(const Odp::Content::TransitionFilter& pTransition, const DWORD SldNum, const std::string& SlideId, CDrawingDocument& pDocument)const
{
std::string type = pTransition.Type.get_value_or("");
if(type != "")
{
ODCSlideShowSlideInfoAtom lDestTransition;
std::string subtype = pTransition.SubType.get_value_or("");
std::string direction = pTransition.Direction.get_value_or("forward");
if(type == "barWipe")
{
if(subtype == "fadeOverColor")
{
lDestTransition.m_nEffectType = 0;
lDestTransition.m_nEffectDirection = 1;
}
else
{
lDestTransition.m_nEffectType = 10;
if(subtype == "leftToRight")
lDestTransition.m_nEffectDirection = 0;
else
lDestTransition.m_nEffectDirection = 1;
if(direction == "reverse")
lDestTransition.m_nEffectDirection += 2;
}
}
else if(type == "pinWheelWipe")
{
lDestTransition.m_nEffectType = 26;
if(subtype == "oneBlade")
lDestTransition.m_nEffectDirection = 1;
else if(subtype == "twoBladeVertical")
lDestTransition.m_nEffectDirection = 2;
else if(subtype == "threeBlade")
lDestTransition.m_nEffectDirection = 3;
else if(subtype == "fourBlade")
lDestTransition.m_nEffectDirection = 4;
else if(subtype == "eightBlade")
lDestTransition.m_nEffectDirection = 8;
else lDestTransition.m_nEffectDirection = 2;
}
else if(type == "slideWipe")
{
if(direction == "reverse")
lDestTransition.m_nEffectType = 4;
else
lDestTransition.m_nEffectType = 7;
if(subtype == "fromTop")
lDestTransition.m_nEffectDirection = 1;
else if(subtype == "fromRight")
lDestTransition.m_nEffectDirection = 2;
else if(subtype == "fromLeft")
lDestTransition.m_nEffectDirection = 0;
else if(subtype == "fromBottom")
lDestTransition.m_nEffectDirection = 3;
else if(subtype == "fromTopRight")
lDestTransition.m_nEffectDirection = 5;
else if(subtype == "fromBottomRight")
lDestTransition.m_nEffectDirection = 7;
else if(subtype == "fromTopLeft")
lDestTransition.m_nEffectDirection = 4;
else if(subtype == "fromBottomLeft")
lDestTransition.m_nEffectDirection = 6;
else lDestTransition.m_nEffectDirection = 0;
}
else if(type == "randomBarWipe")
{
lDestTransition.m_nEffectType = 8;
lDestTransition.m_nEffectDirection = (subtype == "vertical")? 1 : 0;
}
else if(type == "checkerBoardWipe")
{
lDestTransition.m_nEffectType = 3;
lDestTransition.m_nEffectDirection = (subtype == "down")? 1 : 0;
}
else if((type == "fourBoxWipe") && (subtype == "cornersOut"))
{
lDestTransition.m_nEffectType = 18;
lDestTransition.m_nEffectDirection = 0;
}
else if((type == "irisWipe") && (subtype == "diamond"))
{
lDestTransition.m_nEffectType = 17;
lDestTransition.m_nEffectDirection = 0;
}
else if((type == "ellipseWipe") && (subtype == "circle"))
{
lDestTransition.m_nEffectType = 27;
lDestTransition.m_nEffectDirection = 0;
}
else if((type == "irisWipe") && (subtype == "rectangle"))
{
lDestTransition.m_nEffectType = 13;
lDestTransition.m_nEffectDirection = (direction == "reverse")?1:0;
}
else if((type == "fanWipe") && (subtype == "centerTop"))
{
lDestTransition.m_nEffectType = 19;
lDestTransition.m_nEffectDirection = 0;
}
else if(type == "blindsWipe")
{
lDestTransition.m_nEffectType = 2;
lDestTransition.m_nEffectDirection = (subtype == "vertical")?1:0;
}
else if(type == "fade")// && (subtype == "fadeOverColor")
{
lDestTransition.m_nEffectType = 6;
lDestTransition.m_nEffectDirection = 0;
}
else if(type == "dissolve")
{
lDestTransition.m_nEffectType = 5;
lDestTransition.m_nEffectDirection = 0;
}
else if(type == "random")
{
lDestTransition.m_nEffectType = 1;
lDestTransition.m_nEffectDirection = 0;
}
else if(type == "pushWipe")
{
lDestTransition.m_nEffectType = 21;
lDestTransition.m_nEffectDirection = (subtype == "combVertical")?1:0;
if(subtype == "fromTop")
{
lDestTransition.m_nEffectType = 20;
lDestTransition.m_nEffectDirection = 1;
}
else if(subtype == "fromRight")
{
lDestTransition.m_nEffectType = 20;
lDestTransition.m_nEffectDirection = 2;
}
else if(subtype == "fromLeft")
{
lDestTransition.m_nEffectType = 20;
lDestTransition.m_nEffectDirection = 0;
}
else if(subtype == "fromBottom")
{
lDestTransition.m_nEffectType = 20;
lDestTransition.m_nEffectDirection = 3;
}
}
else if(type == "waterfallWipe")
{
lDestTransition.m_nEffectType = 9;
if((subtype == "horizontalRight") && (direction == "reverse"))
lDestTransition.m_nEffectDirection = 4;
else if((subtype == "horizontalLeft") && (direction == "reverse"))
lDestTransition.m_nEffectDirection = 5;
else if(subtype == "horizontalLeft")
lDestTransition.m_nEffectDirection = 6;
else if(subtype == "horizontalRight")
lDestTransition.m_nEffectDirection = 7;
}
/*
else if(type == "barnDoorWipe")//subtype = "vertical"/"horizontal" + direction = "reverse"/""
*/
else
{
lDestTransition.m_nEffectType = 0;
lDestTransition.m_nEffectDirection = 0;
}
lDestTransition.m_nTime = 500;//1;//GetTransitionSpeedFromStr(pTransition.spd.get_value_or("fast"));
pDocument.m_mapTransitions.Add(SldNum, lDestTransition);
}
}
}
\ No newline at end of file
// stdafx.cpp : source file that includes just the standard includes
// Odp2DrawingXML.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// 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 95 and Windows NT 4 or later.
#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target Windows 2000 or later.
#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 4.0 or later.
#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
#endif
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atlcoll.h>
#define _USE_MATH_DEFINES
#include <math.h>
// TODO: reference additional headers your program requires here
using namespace ATL;
#define ODP_DEF
\ No newline at end of file
......@@ -3,11 +3,6 @@
#include "stdafx.h"
#include "resource.h" // main symbols
//#include "AVSUtils.h"
#import "..\..\..\Redist\AVSOfficeStudio\AVSOfficeUtils.dll" raw_interfaces_only
//using namespace AVSOfficeUtils;
#include "..\Common\OfficeFileTemplate.h"
#include "Odp.h"
......@@ -67,7 +62,7 @@ public:
{
Folder = NULL;
m_pOfficeUtils = NULL;
return CoCreateInstance( __uuidof(AVSOfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(AVSOfficeUtils::IOfficeUtils), (void **)&(this->m_pOfficeUtils) );
return CoCreateInstance( __uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils), (void **)&(this->m_pOfficeUtils) );
}
void FinalRelease()
......@@ -87,7 +82,7 @@ public:
private:
Odp::Folder* Folder;
CStringW m_strTempDirectory;
AVSOfficeUtils::IOfficeUtils* m_pOfficeUtils;
OfficeUtils::IOfficeUtils* m_pOfficeUtils;
CXMLEncoder m_oEncoder;
NSPresentationEditor::CDocument m_oDocument;
......@@ -97,30 +92,6 @@ public:
if(Folder == NULL)
return S_FALSE;
CString xml = m_oDocument.ToXmlVideoSource2();
BSTR bs = xml.AllocSysString();
CString str = (CString)bs;
SysFreeString(bs);
str = m_oEncoder.EncryptXML(str);
*pbstrXml = str.AllocSysString();
#ifdef _DEBUG
CFile oFile;
oFile.CreateFile(_T("C:\\VideoSourceODP.xml"));
oFile.WriteStringUTF8(xml);
oFile.CloseFile();
oFile.CreateFile(_T("C:\\odp_editor.xml"));
xml = m_oDocument.ToXmlEditor2();
oFile.WriteStringUTF8(xml);
oFile.CloseFile();
m_oDocument.SaveThemeThumbnail(m_strTempDirectory, 180, 135, true);
#endif
return S_OK;
}
......@@ -271,16 +242,6 @@ public:
{
CString xml = m_oDocument.ToXmlEditor2();
ParamValue->bstrVal = xml.AllocSysString();
if (TRUE)
m_oDocument.SaveThemeThumbnail(m_strTempDirectory, 180, 135, true);
#ifdef _DEBUG
CFile oFile;
oFile.CreateFile(_T("C:\\odp_editor.xml"));
oFile.WriteStringUTF8(xml);
oFile.CloseFile();
#endif
}
return S_OK;
}
......
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by AVSOfficeOdpFile.rc
// Used by ASCOfficeOdpFile.rc
//
#define IDS_PROJNAME 100
#define IDR_AVSOFFICEODPFILE 101
#define IDR_ASCOFFICEODPFILE 101
#define IDB_COFFICEODPFILE 102
#define IDB_OFFICEODPFILE 103
......
......@@ -49,5 +49,6 @@
#include <math.h>
using namespace ATL;
#import "../../../../AVS/Redist/AVSGraphics.dll" named_guids rename_namespace("AVSGraphics")
//#include "../Common/AVSATLError.h"
#import "../Redist/ASCOfficeUtils.dll" named_guids raw_interfaces_only rename_namespace("OfficeUtils")
#import "../../Redist/ASCGraphics.dll" named_guids rename_namespace("ASCGraphics")
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment