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

.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52771 954022d7-b5bf-4e40-9824-e11837661b57
parent eba54cb2
......@@ -34,7 +34,7 @@ HRESULT ConvertOdp2Pptx(cpdoccore::odf::odf_document & inputDoc, const std::wstr
{
cpdoccore::oox::package::pptx_document pptx;
cpdoccore::oox::pptx_conversion_context conversionContext(&pptx, &inputDoc);
//inputDoc.pptx_convert(conversionContext);
inputDoc.pptx_convert(conversionContext);
pptx.write(dstPath);
return S_OK;
......
// ASCOfficeOdtFile.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 = "{C20747BB-3DD7-4D1E-9611-DE0E693B6554}",
name = "ASCOfficeOdtFile",
helpstring = "ASCOfficeOdtFile 1.0 Type Library",
resource_name = "IDR_ASCOFFICEODTFILE") ]
class CASCOfficeOdtFileModule
{
public:
// Override CAtlDllModuleT members
};
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
#define COMPONENT_NAME "OfficeOdtFile"
#include "../../Common/FileInfo.h"
#include "version.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE 25, 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", 0x0409, 0x04B0
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "ASCOfficeOdtFile"
END
IDR_ASCOFFICEODTFILE REGISTRY "ASCOfficeOdtFile.rgs"
////////////////////////////////////////////////////////////////////////////
#endif
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'ASCOfficeOdtFile'
'ASCOfficeOdtFile.DLL'
{
val AppID = s '%APPID%'
}
}
}
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="ASCOfficeOdtFile"
ProjectGUID="{A2EB9389-498F-485D-8426-EDF788304615}"
RootNamespace="ASCOfficeOdtFile"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(SolutionDir)output/$(ConfigurationName)/$(ProjectName)"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<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)/ASCOfficeOdtFile.tlb"
HeaderFileName="ASCOfficeOdtFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeOdtFile_i.c"
ProxyFileName="ASCOfficeOdtFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
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="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="$(OutDir)/ASCOfficeOdtFile.dll"
LinkIncremental="2"
MergedIDLBaseFileName="_ASCOfficeOdtFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)/ASCOfficeOdtFile.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;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(SolutionDir)output/$(ConfigurationName)/$(ProjectName)"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeOdtFile.tlb"
HeaderFileName="ASCOfficeOdtFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeOdtFile_i.c"
ProxyFileName="ASCOfficeOdtFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
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="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="$(OutDir)/ASCOfficeOdtFile.dll"
LinkIncremental="1"
MergedIDLBaseFileName="_ASCOfficeOdtFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/ASCOfficeOdtFile.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;"
/>
</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=".\ASCOfficeOdtFile.cpp"
>
</File>
<File
RelativePath=".\OdtFile.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=".\OdtFile.h"
>
</File>
<File
RelativePath=".\Resource.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}"
>
<File
RelativePath=".\ASCOfficeOdtFile.rc"
>
</File>
<File
RelativePath=".\ASCOfficeOdtFile.rgs"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
// OdtFile.cpp : Implementation of COdtFile
#include "stdafx.h"
#include "OdtFile.h"
#import "../../Redist/ASCOfficeOdfFile.dll" rename_namespace("ASCOfficeOdfFile"), raw_interfaces_only
COdtFile::COdtFile()
{
}
COdtFile::~COdtFile()
{
}
HRESULT COdtFile::FinalConstruct()
{
HRESULT hr = odfFile_.CoCreateInstance(__uuidof(ASCOfficeOdfFile::COfficeOdfFile));
return hr;
}
void COdtFile::FinalRelease()
{
}
HRESULT COdtFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
{
SHORT val;
OnProgressEx(0, 0, &val);
HRESULT hr = odfFile_->LoadFromFile(sSrcFileName, sDstPath, sXMLOptions);
OnProgressEx(0, 1000000, &val);
return hr;
}
HRESULT COdtFile::SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
{
return odfFile_->SaveToFile(sDstFileName, sSrcPath, sXMLOptions);
}
// COdtFile
// OdtFile.h : Declaration of the COdtFile
#pragma once
#include "resource.h" // main symbols
////////////////////////////////////////////////////////////////
// IASCOfficeFileTemplate
[
object,
uuid("3FC4EC15-9467-4D66-AD6A-A0C0BAEDD3CD"),
dual, helpstring("IASCOfficeFileTemplate Interface"),
pointer_default(unique)
]
__interface IASCOfficeFileTemplate : IDispatch
{
[id(1), helpstring("method LoadFromFile")] HRESULT LoadFromFile([in] BSTR sSrcFileName, [in] BSTR sDstPath, [in] BSTR sXMLOptions);
[id(2), helpstring("method SaveToFile")] HRESULT SaveToFile([in] BSTR sDstFileName, [in] BSTR sSrcPath, [in] BSTR sXMLOptions);
};
////////////////////////////////////////////////////////////////
// _IASCOfficeFileTemplateEvents2
[
dispinterface,
uuid("9764153E-DAEB-40dd-94D4-A2C39218AF64"),
helpstring("_IASCOfficeFileTemplateEvents2 Interface")
]
__interface _IASCOfficeFileTemplateEvents2
{
//Max Value nPercent == 1000000
//Example 23,56 % == 235600
[id(2), helpstring("method OnProgressEx")] HRESULT OnProgressEx([in] LONG nID, [in] LONG nPercent, [in, out, ref] SHORT* Cancel);
};
#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
// IOdtFile
[
object,
uuid("7DEC2313-C482-4039-A5C6-083F1EDD86AB"),
dual, helpstring("IOdtFile Interface"),
pointer_default(unique)
]
__interface IOdtFile : IASCOfficeFileTemplate
{
};
// _IOdtFileEvents
[
dispinterface,
uuid("E001F8EB-4E63-4E33-A22E-51EB9BD53CC3"),
helpstring("_IOdtFileEvents Interface")
]
__interface _IOdtFileEvents
{
};
// COdtFile
[
coclass,
default(IOdtFile, _IASCOfficeFileTemplateEvents2),
threading(apartment),
support_error_info("IOdtFile"),
event_source(com),
vi_progid("ASCOdtFile.OdtFile"),
progid("ASCOdtFile.OdtFile.1"),
version(1.0),
uuid("04596A11-01C4-48D9-B020-B08E3F443F0F"),
helpstring("OdtFile Class")
]
class ATL_NO_VTABLE COdtFile :
public IOdtFile
{
public:
COdtFile();
~COdtFile();
__event __interface _IASCOfficeFileTemplateEvents2;
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);
private:
ATL::CComPtr<IASCOfficeFileTemplate> odfFile_;
};
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ASCOfficeOdtFile.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCOFFICEODTFILE 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
// stdafx.cpp : source file that includes just the standard includes
// ASCOfficeOdtFile.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// 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 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 0x0400 // 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_APARTMENT_THREADED
#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>
using namespace ATL;
\ No newline at end of file
......@@ -1574,6 +1574,14 @@
RelativePath=".\src\docx\pptx_slide_context.h"
>
</File>
<File
RelativePath=".\src\docx\pptx_text_context.cpp"
>
</File>
<File
RelativePath=".\src\docx\pptx_text_context.h"
>
</File>
</Filter>
</Filter>
<File
......
......@@ -265,18 +265,21 @@ void oox_serialize_shape(std::wostream & strm, _oox_drawing const & val)
odf::GetProperty(val.additional,L"fill-color",strVal);
if ((strVal) && (strVal->length()>0 && fillType.length()<1))fillType = L"a:solidFill";
CP_XML_NODE(fillType)
{
if (strVal && fillType != L"a:noFill")
{
CP_XML_NODE(L"a:srgbClr")
if (fillType.length()>0)
{
CP_XML_NODE(fillType)
{
if (strVal && fillType != L"a:noFill")
{
CP_XML_ATTR(L"val",strVal.get());
if (odf::GetProperty(val.additional,L"opacity",dVal))
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_NODE(L"a:alpha")
CP_XML_ATTR(L"val",strVal.get());
if (odf::GetProperty(val.additional,L"opacity",dVal))
{
CP_XML_ATTR(L"val",boost::lexical_cast<std::wstring>((int)(dVal.get())) + L"%");
CP_XML_NODE(L"a:alpha")
{
CP_XML_ATTR(L"val",boost::lexical_cast<std::wstring>((int)(dVal.get())) + L"%");
}
}
}
}
......
......@@ -32,7 +32,8 @@ namespace package
pptx_conversion_context::
pptx_conversion_context(::cpdoccore::oox::package::pptx_document * outputDocument,
::cpdoccore::odf::odf_document * odfDocument): output_document_(outputDocument),
odf_document_(odfDocument)
odf_document_(odfDocument),
pptx_text_context_(odf_document_->odf_context().styleContainer())
,pptx_slide_context_(*this/*, pptx_text_context_*/)
{
}
......
......@@ -4,7 +4,7 @@
#include <boost/shared_ptr.hpp>
#include "ooxconversioncontext.h"
//#include "xlsx_textcontext.h"
#include "pptx_text_context.h"
#include "pptx_slide_context.h"
//#include "xlsx_sharedstrings.h"
......@@ -88,7 +88,7 @@ public:
pptx_xml_theme & current_theme();
oox_chart_context & current_chart();
//xlsx_text_context & get_text_context() { return xlsx_text_context_; }
pptx_text_context & get_text_context() { return pptx_text_context_; }
// num_format_context & get_num_format_context() { return num_format_context_; }
......@@ -121,8 +121,9 @@ private:
odf::odf_document * odf_document_;
pptx_slide_context pptx_slide_context_;// - , ,
pptx_slide_context pptx_slide_context_;
pptx_text_context pptx_text_context_;
std::vector<pptx_xml_slide_ptr> slides_;
std::vector<pptx_xml_slideMaster_ptr> slideMasters_;
std::vector<pptx_xml_slideLayout_ptr> slideLayouts_;
......
......@@ -27,7 +27,7 @@ void pptx_serialize_text(std::wostream & strm, const std::vector<odf::_property>
{
_CP_OPT(std::wstring) strTextContent;
odf::GetProperty(properties,L"text-content",strTextContent);
if (strTextContent)//???
//if (strTextContent)//???
{
CP_XML_NODE(L"p:txBody")
{
......@@ -47,8 +47,11 @@ void pptx_serialize_text(std::wostream & strm, const std::vector<odf::_property>
{
CP_XML_ATTR(L"algn",L"ctr");
}
CP_XML_NODE(L"a:endParaRPr");
if (strTextContent){CP_XML_STREAM() << strTextContent.get();}
if (strTextContent)
{
std::wstring strTest = strTextContent.get();
CP_XML_STREAM() << strTextContent.get();
}
}
}
}
......@@ -129,6 +132,10 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing const & val)
if (shapeType.length()<1)
shapeType =L"rect";// ( ???)
/// ...
_CP_OPT(std::wstring) strTextContent;
odf::GetProperty(val.additional,L"text-content",strTextContent);
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"p:sp")
......@@ -155,12 +162,12 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing const & val)
{
oox_serialize_xfrm(CP_XML_STREAM(),val);
if (val.sub_type>0)//
if (!strTextContent)//
{
oox_serialize_shape(CP_XML_STREAM(),val);
oox_serialize_ln(CP_XML_STREAM(),val.additional);
}
oox_serialize_ln(CP_XML_STREAM(),val.additional);
} // p:spPr
pptx_serialize_text(CP_XML_STREAM(),val.additional);
......
......@@ -15,7 +15,7 @@ class pptx_drawings;
class pptx_slide_context
{
public:
pptx_slide_context(pptx_conversion_context & Context/*, xlsx_text_context & textCotnext*/);
pptx_slide_context(pptx_conversion_context & Context/*, pptx_text_context & textCotnext*/);
void start_slide();
void end_slide(){}
......
This diff is collapsed.
#pragma once
#include <string>
#include <boost/noncopyable.hpp>
#include <cpdoccore/CPScopedPtr.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
namespace odf
{
class styles_container;
typedef boost::shared_ptr<styles_container> styles_container_ptr;
};
namespace oox {
class pptx_conversion_context;
class pptx_text_context: boost::noncopyable
{
public:
pptx_text_context(odf::styles_container & styles_);
~pptx_text_context();
void set_local_styles_container(odf::styles_container* local_styles_);
void add_text(const std::wstring & text);
void start_paragraph(const std::wstring & styleName);
void end_paragraph();
void start_span(const std::wstring & styleName);
void end_span();
std::wstring end_span2();
void start_comment_content();
std::wstring end_comment_content();
void start_drawing_content();
std::wstring end_drawing_content();
void start_hyperlink();
void end_hyperlink(std::wstring hId);
bool is_drawing_context();
private:
class Impl;
_CP_SCOPED_PTR(Impl) impl_;
};
}
}
\ No newline at end of file
#ifndef _CPDOCCORE_XLSX_TEXT_CONTENT_H_
#define _CPDOCCORE_XLSX_TEXT_CONTENT_H_
#pragma once
#include <string>
#include <boost/noncopyable.hpp>
......@@ -61,7 +60,4 @@ private:
};
}
}
#endif
}
\ No newline at end of file
......@@ -123,10 +123,6 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_slide_context().set_placeHolder_type(common_presentation_attlist_.presentation_class_->get_type_ms());
}
////////////////////////////////////////////////
//BOOST_FOREACH(office_element_ptr const & elm, content_)
//{
// elm->pptx_convert(Context);
//}
int i=0;
int size = content_.size();
while(true)
......@@ -145,7 +141,7 @@ void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_slide_context().start_image(href);
//////////////////////////////////// ...
//////Context.get_text_context().start_drawing_content();//... -
Context.get_text_context().start_drawing_content();//... -
int i=0;
int size = content_.size();
......@@ -155,7 +151,7 @@ void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
content_[i]->pptx_convert(Context);
i++;
}
std::wstring text_content_;////// = Context.get_text_context().end_drawing_content();
std::wstring text_content_ = Context.get_text_context().end_drawing_content();
if (text_content_.length()>0)
{
......@@ -186,12 +182,8 @@ void draw_chart::pptx_convert(oox::pptx_conversion_context & Context)
void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_slide_context().start_shape(2);//rect
//Context.get_text_context().start_drawing_content();
Context.get_text_context().start_drawing_content();
//BOOST_FOREACH(office_element_ptr const & elm, content_)
//{
// elm->pptx_convert(Context);
//}
int i=0;
int size = content_.size();
while(true)
......@@ -200,7 +192,7 @@ void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
content_[i]->pptx_convert(Context);
i++;
}
std::wstring text_content_ ;//////= Context.get_text_context().end_drawing_content();
std::wstring text_content_ = Context.get_text_context().end_drawing_content();
if (text_content_.length()>0)
{
......@@ -253,15 +245,15 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
if (chartBuild.object_type_ == 2)//
{
Context.get_slide_context().start_shape(2);
//////Context.get_text_context().start_drawing_content();
Context.get_text_context().start_drawing_content();
//////// ... !!
//////Context.get_text_context().set_local_styles_container(&objectSubDoc.odf_context().styleContainer());
// ... !!
Context.get_text_context().set_local_styles_container(&objectSubDoc.odf_context().styleContainer());
chartBuild.office_text_->pptx_convert(Context);
std::wstring text_content_ ;//////= Context.get_text_context().end_drawing_content();
//////Context.get_text_context().set_local_styles_container(NULL);// ...
std::wstring text_content_ = Context.get_text_context().end_drawing_content();
Context.get_text_context().set_local_styles_container(NULL);// ...
if (text_content_.length()>0)
{
......
......@@ -106,5 +106,12 @@ void office_text::xlsx_convert(oox::xlsx_conversion_context & Context)
}
//Context.end_office_text();
}
void office_text::pptx_convert(oox::pptx_conversion_context & Context)
{
BOOST_FOREACH(const office_element_ptr & elm, text_content_)
{
elm->pptx_convert(Context);
}
}
}
}
......@@ -23,6 +23,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......
......@@ -66,6 +66,12 @@ void text::xlsx_convert(oox::xlsx_conversion_context & Context)
//Context.get_text_context().add_text(xml::utils::replace_text_to_xml(text_));
Context.get_text_context().add_text(text_);
}
void text::pptx_convert(oox::pptx_conversion_context & Context)
{
//Context.get_text_context().add_text(xml::utils::replace_text_to_xml(text_));
Context.get_text_context().add_text(text_);
}
office_element_ptr text::create(const std::wstring & Text)
{
......@@ -109,6 +115,12 @@ void s::xlsx_convert(oox::xlsx_conversion_context & Context)
this->text_to_stream(val);
Context.get_text_context().add_text(val.str());
}
void s::pptx_convert(oox::pptx_conversion_context & Context)
{
std::wstringstream val;
this->text_to_stream(val);
Context.get_text_context().add_text(val.str());
}
// text:tab
//////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -138,7 +150,10 @@ void tab::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_text_context().add_text(L"\t");
}
void tab::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_text_context().add_text(L"\t");
}
// text:line-break
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * line_break::ns = L"text";
......@@ -160,6 +175,10 @@ void line_break::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_text_context().add_text(L"\n");
}
void line_break::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_text_context().add_text(L"\n");
}
// text:bookmark
//////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -358,7 +377,15 @@ void span::xlsx_convert(oox::xlsx_conversion_context & Context)
}
Context.end_span();
}
void span::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_text_context().start_span(text_style_name_.style_name());
BOOST_FOREACH(const office_element_ptr & elm, paragraph_content_)
{
elm->pptx_convert(Context);
}
Context.get_text_context().end_span();
}
// text:a
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * a::ns = L"text";
......@@ -470,7 +497,15 @@ void a::xlsx_convert(oox::xlsx_conversion_context & Context)
}
Context.end_hyperlink(xlink_href_);
}
void a::pptx_convert(oox::pptx_conversion_context & Context)
{
// Context.start_hyperlink(text_style_name_.style_name());
BOOST_FOREACH(const office_element_ptr & elm, paragraph_content_)
{
elm->pptx_convert(Context);
}
// Context.end_hyperlink(xlink_href_);
}
// text:note
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * note::ns = L"text";
......
......@@ -46,6 +46,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -85,6 +86,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -121,6 +123,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -156,6 +159,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -367,6 +371,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -400,6 +405,7 @@ public:
public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -541,7 +547,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPlaceholder;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -566,7 +573,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageNumber;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -594,7 +602,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageCount;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -622,7 +631,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDate;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -650,7 +660,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTime;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -677,7 +688,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextFileName;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......@@ -705,7 +717,8 @@ public:
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequence;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......
......@@ -363,7 +363,15 @@ void paragraph::xlsx_convert(oox::xlsx_conversion_context & Context)
}
Context.end_paragraph();
}
void paragraph::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_text_context().start_paragraph(paragraph_attrs_.text_style_name_.style_name());
BOOST_FOREACH(const office_element_ptr & elm, paragraph_content_)
{
elm->pptx_convert(Context);
}
Context.get_text_context().end_paragraph();
}
//////////////////////////////////////////////
::std::wostream & h::text_to_stream(::std::wostream & _Wostream) const
......@@ -408,7 +416,10 @@ void h::xlsx_convert(oox::xlsx_conversion_context & Context)
{
paragraph_.xlsx_convert(Context);
}
void h::pptx_convert(oox::pptx_conversion_context & Context)
{
paragraph_.pptx_convert(Context);
}
// text:p
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * p::ns = L"text";
......@@ -449,6 +460,10 @@ void p::xlsx_convert(oox::xlsx_conversion_context & Context)
paragraph_.xlsx_convert(Context);
}
void p::pptx_convert(oox::pptx_conversion_context & Context)
{
paragraph_.pptx_convert(Context);
}
// text:list
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * list::ns = L"text";
......
......@@ -38,8 +38,10 @@ public:
}
void afterCreate(document_context * ctx);
void docx_convert(oox::docx_conversion_context & Context) ;
void docx_convert(oox::docx_conversion_context & Context) ;
void xlsx_convert(oox::xlsx_conversion_context & Context) ;
void pptx_convert(oox::pptx_conversion_context & Context) ;
void drop_cap_docx_convert(oox::docx_conversion_context & Context);
......@@ -69,6 +71,7 @@ public:
public:
void docx_convert(oox::docx_conversion_context & Context) ;
void xlsx_convert(oox::xlsx_conversion_context & Context) ;
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void afterCreate();
......@@ -113,7 +116,9 @@ public:
public:
void docx_convert(oox::docx_conversion_context & Context) ;
void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void afterCreate();
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void afterCreate();
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
......
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