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

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55504 954022d7-b5bf-4e40-9824-e11837661b57
parent 330fcd11
......@@ -2,6 +2,7 @@
#include "object_package.h"
#include "odf_style_context.h"
#include "odf_drawing_context.h"
#include "mediaitems.h"
namespace cpdoccore {
......@@ -21,6 +22,8 @@ public:
virtual void start_document() = 0 ;
void end_document();
virtual odf_drawing_context& drawing_context() = 0;
office_element_ptr & getCurrentElement();
std::vector<office_element_ptr> content_;
......@@ -36,7 +39,6 @@ public:
odf_number_styles_context & numbers_styles_context() {return style_context_.numbers_styles();}
private:
rels rels_;
void process_styles();
......
......@@ -48,6 +48,10 @@ struct odf_drawing_state
name_ = L"";
z_order_ = -1;
rotateAngle = boost::none;
flipH = false;
flipV = false;
}
std::vector<odf_element_state> elements_;
......@@ -58,6 +62,10 @@ struct odf_drawing_state
std::wstring name_;
int z_order_;
bool flipH;
bool flipV;
_CP_OPT(double) rotateAngle;
};
class odf_drawing_context::Impl
......@@ -113,10 +121,6 @@ void odf_drawing_context::start_frame()
if (style_)
{
style_name = style_->style_name_;
style_graphic_properties * gr_properties = style_->style_content_.get_style_graphic_properties();
if (gr_properties)
{
}
}
frame->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_style_name_attlist_.draw_style_name_ = style_ref(style_name);
......@@ -147,7 +151,7 @@ void odf_drawing_context::end_frame()
{
end_element();
}
void odf_drawing_context::end_drawing()
void odf_drawing_context::end_drawing()// ..
{
// - ...
if (impl_->current_drawing_state_.elements_.size() > 0)
......@@ -159,6 +163,15 @@ void odf_drawing_context::end_drawing()
frame->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
if (impl_->current_drawing_state_.z_order_ >= 0)
frame->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
std::wstring strTransform;
if (impl_->current_drawing_state_.rotateAngle)
{
strTransform = strTransform + std::wstring(L"rotate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.rotateAngle.get()) + std::wstring(L")");
}
if (strTransform.length()>0)
frame->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_transform_attlist_.draw_transform_ = strTransform;
}
draw_shape* shape = dynamic_cast<draw_shape*>(impl_->current_drawing_state_.elements_[0].elm.get());
if (shape)
......@@ -167,8 +180,31 @@ void odf_drawing_context::end_drawing()
shape->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
if (impl_->current_drawing_state_.z_order_ >= 0)
shape->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
std::wstring strTransform;
if (impl_->current_drawing_state_.rotateAngle!=0)
{
strTransform = strTransform + std::wstring(L"rotate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.rotateAngle.get()) + std::wstring(L")");
}
if (strTransform.length()>0)
frame->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_transform_attlist_.draw_transform_ = strTransform;
}
style* style_ = dynamic_cast<style*>(impl_->current_drawing_state_.elements_[0].style_elm.get());
if (style_)
{
style_graphic_properties * gr_properties = style_->style_content_.get_style_graphic_properties();
if (gr_properties)
{
if (impl_->current_drawing_state_.flipH)
gr_properties->content().style_mirror_ = std::wstring(L"horizontal");
if (impl_->current_drawing_state_.flipV)
gr_properties->content().style_mirror_ = std::wstring(L"vertical");
//fo:clip
//draw:image-opacity
}
}
}
impl_->drawing_list_.push_back(impl_->current_drawing_state_);// frame, shape, ???
......@@ -183,6 +219,20 @@ void odf_drawing_context::set_z_order(int id)
impl_->current_drawing_state_.z_order_ = id;
}
void odf_drawing_context::set_flip_H(bool bVal)
{
impl_->current_drawing_state_.flipH= true;
}
void odf_drawing_context::set_flip_V(bool bVal)
{
impl_->current_drawing_state_.flipV= true;
}
void odf_drawing_context::set_rotate(int iVal)
{
double dRotate = iVal/60000.;
impl_->current_drawing_state_.rotateAngle = (360 - dRotate)/180. * 3.14159265358979323846;
}
void odf_drawing_context::start_image(std::wstring & path)
{
office_element_ptr image_elm;
......
......@@ -50,6 +50,12 @@ public:
///////////////////////////////////////////////////
void set_name(std::wstring name);
void set_z_order(int id);
void set_flip_H(bool bVal);
void set_flip_V(bool bVal);
void set_rotate(int iVal);
private:
class Impl;
......
......@@ -45,7 +45,7 @@ public:
void start_text_context();
void end_text_context();
odf_drawing_context& drawing_context(){return current_table().drawing_context();}
virtual odf_drawing_context& drawing_context(){return current_table().drawing_context();}
void start_drawing(){drawing_context().start_drawing();}
void end_drawing(){drawing_context().end_drawing();}
......
......@@ -6,6 +6,11 @@
#include "XlsxConverter.h"
#include "DocxConverter.h"
#include "odf_conversion_context.h"
#include "odf_text_context.h"
#include "odf_drawing_context.h"
namespace Oox2Odf
{
Converter::Converter(const std::wstring & path)
......@@ -30,4 +35,67 @@ namespace Oox2Odf
return impl_->write(path);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert_SpPr(OOX::Drawing::CShapeProperties * oox_spPr)
{
if (!oox_spPr) return;
if (oox_spPr->m_oXfrm.IsInit())//CTransform2D
{
//
if (oox_spPr->m_oXfrm->m_oFlipH.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context().set_flip_H(true);
if (oox_spPr->m_oXfrm->m_oFlipV.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context().set_flip_V(true);
if (oox_spPr->m_oXfrm->m_oRot.GetValue() > 0)
odf_context()->drawing_context().set_rotate(oox_spPr->m_oXfrm->m_oRot.GetValue());
}
//// Attributes
//nullable<SimpleTypes::CBlackWhiteMode<>> m_oBwMode;
//// Childs
//EFillType m_eFillType; //
//nullable<OOX::Drawing::CBlipFillProperties> m_oBlipFill;
//nullable<OOX::Drawing::CGradientFillProperties> m_oGradFill;
//nullable<OOX::Drawing::CGroupFillProperties> m_oGrpFill;
//nullable<OOX::Drawing::CNoFillProperties> m_oNoFill;
//nullable<OOX::Drawing::CPatternFillProperties> m_oPattFill;
//nullable<OOX::Drawing::CSolidColorFillProperties> m_oSolidFill;
//EGeomType m_eGeomType; //
//nullable<OOX::Drawing::CCustomGeometry2D> m_oCustGeom;
//nullable<OOX::Drawing::CPresetGeometry2D> m_oPrstGeom;
//EEffectType m_eEffectType; //
//nullable<OOX::Drawing::CEffectContainer> m_oEffectDag;
//nullable<OOX::Drawing::CEffectList> m_oEffectList;
//nullable<OOX::Drawing::CLineProperties> m_oLn;
//nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
//nullable<OOX::Drawing::CScene3D> m_oScene3D;
//nullable<OOX::Drawing::CShape3D> m_oSp3D;
}
void OoxConverter::convert_CNvPr(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr)
{
if (!oox_cnvPr) return;
if (oox_cnvPr->m_sName.IsInit())
{
std::wstring name = string2std_string(oox_cnvPr->m_sName.get());
odf_context()->drawing_context().set_name(name);
}
if (oox_cnvPr->m_oId.IsInit())
{
int id =oox_cnvPr->m_oId->GetValue();
odf_context()->drawing_context().set_z_order(id);
}
//nullable<CString> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<CString> m_sTitle;
}
} // namespace Docx2Odt
\ No newline at end of file
......@@ -6,6 +6,22 @@ static std::wstring string2std_string(CString val)
{
return std::wstring(val.GetBuffer());
}
namespace cpdoccore
{
namespace odf
{
class odf_conversion_context;
}
}
namespace OOX
{
namespace Drawing
{
class CNonVisualDrawingProps;
class CShapeProperties;
}
}
namespace Oox2Odf
{
......@@ -14,7 +30,13 @@ namespace Oox2Odf
public:
virtual void convert() = 0;
virtual void write(const std::wstring & path) = 0;
OoxConverter(){}
virtual cpdoccore::odf::odf_conversion_context* odf_context() = 0;
void convert_CNvPr(OOX::Drawing::CNonVisualDrawingProps* oox_cnvPr);
void convert_SpPr(OOX::Drawing::CShapeProperties* oox_spPr);
};
class Converter
......@@ -33,5 +55,6 @@ public:
private:
OoxConverter* impl_;
};
} // namespace Oox2Odf:Convert
......@@ -29,7 +29,10 @@ void DocxConverter::write(const std::wstring & path)
output_document->write(path);
}
odf::odf_conversion_context* DocxConverter::odf_context()
{
return NULL;//odt_context;
}
void DocxConverter::convert()
{
if (!docx_document)return;
......
......@@ -15,8 +15,10 @@ namespace cpdoccore
class odf_document;
}
class ods_conversion_context;
class odf_conversion_context;
}
}
using namespace cpdoccore;
namespace Oox2Odf
{
......@@ -27,6 +29,8 @@ namespace Oox2Odf
virtual void convert();
virtual void write(const std::wstring & path);
virtual odf::odf_conversion_context* odf_context();
private:
OOX::CDocx *docx_document;
......
......@@ -36,6 +36,10 @@ void XlsxConverter::write(const std::wstring & path)
if (!output_document)return;
output_document->write(path);
}
odf::odf_conversion_context* XlsxConverter::odf_context()
{
return ods_context;
}
void XlsxConverter::convert()
{
......@@ -1022,6 +1026,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po
if (oox_from_to->m_oColOff.IsInit()) pos->col_off = oox_from_to->m_oColOff->GetValue();//pt
}
void XlsxConverter::convert(OOX::Spreadsheet::CPic* oox_picture)
{
if (!oox_picture)return;
......@@ -1051,45 +1056,45 @@ void XlsxConverter::convert(OOX::Spreadsheet::CPic* oox_picture)
}
}
ods_context->start_image(string2std_string(pathImage));
///////////////////////////////////////////////////////////////////////////////////////////////////////
std::wstring name;
int id=0;
if (oox_picture->m_oNvPicPr.IsInit())
{
//OOX::Drawing::CNonVisualPictureProperties m_oCNvPicPr;
//OOX::Drawing::CNonVisualDrawingProps m_oCNvPr;
//
if(oox_picture->m_oNvPicPr->m_oCNvPr.IsInit())
if (oox_picture->m_oNvPicPr->m_oCNvPr.IsInit())
{
name = string2std_string(oox_picture->m_oNvPicPr->m_oCNvPr->m_sName.get());
ods_context->drawing_context().set_name(name);
id = oox_picture->m_oNvPicPr->m_oCNvPr->m_oId->GetValue();
ods_context->drawing_context().set_z_order(id);
//nullable<CString> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<CString> m_sTitle;
convert_CNvPr(oox_picture->m_oNvPicPr->m_oCNvPr.GetPointer());
}
if (oox_picture->m_oNvPicPr->m_oCNvPicPr.IsInit())
{
if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks.IsInit())
{
//if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoChangeAspect)
//{
//}
//if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoCrop))
//{
//}
//if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoResize)
//{
//}
}
//m_oExtLst
}
//if (oox_picture->m_oCNvPicPr.IsInit() && oox_picture->m_oCNvPicPr->m_oPicLocks.IsInit())
//{
// if (oox_picture->m_oCNvPicPr->m_oPicLocks->m_oNoChangeAspect.IsInit())
// {
// }
// if (oox_picture->m_oCNvPicPr->m_oPicLocks->m_oNoCrop.IsInit())
// {
// }
// if (oox_picture->m_oCNvPicPr->m_oPicLocks->m_oNoResize.IsInit())
// {
// }
//}
}
//if (oox_picture->m_oSpPr.IsInit())
//{
//}
if (oox_picture->m_oSpPr.IsInit())
{
convert_SpPr(oox_picture->m_oSpPr.GetPointer());
}
if (oox_picture->m_oShapeStyle.IsInit())
{
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
ods_context->start_image(string2std_string(pathImage));
ods_context->end_image();
}
......
......@@ -35,6 +35,7 @@ namespace odf
{
class odf_document;
}
class odf_conversion_context;
class ods_conversion_context;
class color;
class background_color;
......@@ -55,6 +56,8 @@ namespace Oox2Odf
virtual void convert();
virtual void write(const std::wstring & path);
virtual odf::odf_conversion_context* odf_context();
private:
OOX::Spreadsheet::CXlsx *xlsx_document;
......@@ -106,5 +109,6 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_position * pos);
void convert(OOX::Spreadsheet::CPic* oox_picture);
};
}
\ No newline at end of file
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="DocxFormat"
ProjectGUID="{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
RootNamespace="DocxFormat"
......@@ -1084,15 +1084,15 @@
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Chart\FromTo.h"
RelativePath="..\Source\XlsxFormat\Chart\ChartSerialize.cpp"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Chart\ChartSerialize.cpp"
RelativePath="..\Source\XlsxFormat\Chart\ChartSerialize.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Chart\ChartSerialize.h"
RelativePath="..\Source\XlsxFormat\Chart\FromTo.h"
>
</File>
<File
......@@ -1151,6 +1151,10 @@
RelativePath="..\Source\XlsxFormat\Drawing\Pos.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Drawing\Shape.h"
>
</File>
</Filter>
<Filter
Name="SharedStrings"
......
......@@ -92,6 +92,8 @@ namespace OOX
m_eType = et_p_cNvPr;
else if ( _T("pic:cNvPr") == sName )
m_eType = et_pic_cNvPr;
else if ( _T("xdr:cNvPr") == sName )
m_eType = et_xdr_cNvPr;
else
return;
......@@ -120,6 +122,8 @@ namespace OOX
sResult += _T("<p:cNvPr ");
else if ( et_pic_cNvPr == m_eType )
sResult = _T("<pic:cNvPr ");
else if ( et_xdr_cNvPr == m_eType )
sResult = _T("<xdr:cNvPr ");
else
return _T("");
......@@ -159,7 +163,8 @@ namespace OOX
sResult += _T("</p:cNvPr>");
else if ( et_pic_cNvPr == m_eType )
sResult += _T("</pic:cNvPr>");
else if ( et_xdr_cNvPr == m_eType )
sResult += _T("</xdr:cNvPr>");
return sResult;
}
//--------------------------------------------------------------------------------
......
......@@ -789,6 +789,8 @@ namespace OOX
m_eType = et_a_spPr;
else if ( _T("pic:spPr") == sName )
m_eType = et_pic_spPr;
else if ( _T("xdr:spPr") == sName )
m_eType = et_xdr_spPr;
else
return;
......@@ -871,6 +873,8 @@ namespace OOX
sResult = _T("<a:spPr ");
else if ( et_pic_spPr == m_eType )
sResult = _T("<pic:spPr ");
else if ( et_xdr_spPr == m_eType )
sResult = _T("<xdr:spPr ");
else
return _T("");
......@@ -970,7 +974,8 @@ namespace OOX
sResult += _T("</a:spPr>");
else if ( et_pic_spPr == m_eType )
sResult = _T("</pic:spPr>");
else if ( et_xdr_spPr == m_eType )
sResult = _T("</xdr:spPr>");
return sResult;
}
virtual EElementType getType() const
......
......@@ -452,6 +452,9 @@ namespace OOX
et_pic_spPr, // <pic:spPr>
et_pic_pic, // <pic:pic>
et_xdr_cNvPr, // <xdr:cNvPr>
et_xdr_spPr, // <xdr:spPr>
et_c_chart, // <c:chart>
et_sl_schema, // <sl:shema>
......
......@@ -8,6 +8,7 @@
#include "Pic.h"
#include "GraphicFrame.h"
#include "Pos.h"
#include "Shape.h"
namespace OOX
{
......@@ -98,7 +99,9 @@ namespace OOX
m_oGraphicFrame = oReader;
else if (_T("xdr:pic") == sName )
m_oPicture = oReader;
else if (_T("xdr:sp") == sName || _T("xdr:grpSp") == sName || _T("xdr:cxnSp") == sName || _T("mc:AlternateContent") == sName)
else if (_T("xdr:sp") == sName)
m_oShape = oReader;
else if (_T("xdr:grpSp") == sName || _T("xdr:cxnSp") == sName || _T("mc:AlternateContent") == sName)
m_oXml = oReader.GetOuterXml();
}
}
......@@ -137,6 +140,7 @@ namespace OOX
nullable<OOX::Spreadsheet::CExt> m_oExt;
nullable<OOX::Spreadsheet::CGraphicFrame> m_oGraphicFrame;
nullable<OOX::Spreadsheet::CPic> m_oPicture;
nullable<OOX::Spreadsheet::CShape> m_oShape;
nullable<CString> m_oXml;
};
} //Spreadsheet
......
......@@ -9,6 +9,8 @@
namespace OOX
{
using namespace Drawing;
namespace Spreadsheet
{
class CDrawingWorksheet : public WritingElement
......
......@@ -6,21 +6,19 @@
namespace OOX
{
using namespace Drawing;
namespace Spreadsheet
{
//--------------------------------------------------------------------------------
// Non-Visual Properties for a Picture 20.5.2.22
// 20.5.2.7 cNvPicPr (Non-Visual Picture Drawing Properties)
//--------------------------------------------------------------------------------
class CNonVisualDrawingProps : public WritingElement
class CNonVisualPictureDrawingProps : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CNonVisualDrawingProps)
CNonVisualDrawingProps()
WritingElementSpreadsheet_AdditionConstructors(CNonVisualPictureDrawingProps)
CNonVisualPictureDrawingProps()
{
}
virtual ~CNonVisualDrawingProps()
virtual ~CNonVisualPictureDrawingProps()
{
}
......@@ -44,45 +42,38 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
//if ( _T("xdr:cNvPicPr") == sName )
// m_oCNvPicPr = oReader;
//else if ( _T("xdr:cNvPr") == sName )
// m_oCNvPr = oReader;
sName = oReader.GetName();
if ( _T("a:picLocks") == sName )
m_oPicLocks = oReader;
else if ( _T("a:extLst") == sName )
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_NonVisualDrawingProps;
return et_NonVisualPictureDrawingProps;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("descr"), m_sDescr )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("hidden"), m_oHidden )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("id"), m_oId )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("name"), m_sName )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("title"), m_sTitle )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("preferRelativeResize"), m_oPreferRelativeResize )
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Attributes
nullable<CString> m_sDescr;
nullable<SimpleTypes::COnOff<>> m_oHidden;
nullable<SimpleTypes::CDrawingElementId<>> m_oId;
nullable<CString> m_sName;
nullable<CString> m_sTitle;
SimpleTypes::COnOff<SimpleTypes::onoffTrue> m_oPreferRelativeResize;
// Childs
//nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
//nullable<OOX::Drawing::CHyperlink > m_oHlinkClick;
//nullable<OOX::Drawing::CHyperlink > m_oHlinkHover;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
nullable<OOX::Drawing::CPictureLocking> m_oPicLocks;
};
//--------------------------------------------------------------------------------
// Non-Visual Picture Drawing Properties 20.5.2.5
// 20.5.2.22 nvPicPr (Non-Visual Properties for a Picture)
//--------------------------------------------------------------------------------
class CPictureNonVisual : public WritingElement
{
......@@ -115,9 +106,9 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
/* if ( _T("xdr:cNvPicPr") == sName )
if ( _T("xdr:cNvPicPr") == sName )
m_oCNvPicPr = oReader;
else */if ( _T("xdr:cNvPr") == sName )
else if ( _T("xdr:cNvPr") == sName )
m_oCNvPr = oReader;
}
}
......@@ -136,8 +127,8 @@ namespace OOX
public:
EElementType m_eType;
// Childs
//nullable<CNonVisualPictureProperties> m_oCNvPicPr;
nullable<CNonVisualDrawingProps> m_oCNvPr;
nullable<CNonVisualPictureDrawingProps> m_oCNvPicPr;
nullable<OOX::Drawing::CNonVisualDrawingProps> m_oCNvPr;
};
class CBlipFill : public WritingElement
......@@ -200,11 +191,15 @@ namespace OOX
nullable<SimpleTypes::CDecimalNumber<>> m_oDpi;
nullable<SimpleTypes::COnOff<>> m_oRotWithShape;
// Childs
nullable<CBlip> m_oBlip;
nullable<OOX::Drawing::CBlip> m_oBlip;
nullable<OOX::Drawing::CRelativeRect> m_oSrcRect;
nullable<OOX::Drawing::CTileInfoProperties> m_oTile;
nullable<OOX::Drawing::CStretchInfoProperties> m_oStretch;
};
//--------------------------------------------------------------------------------
// 20.5.2.25 pic (Picture)
//--------------------------------------------------------------------------------
class CPic : public WritingElement
{
public:
......@@ -246,8 +241,10 @@ namespace OOX
m_oBlipFill = oReader;
if ( _T("xdr:nvPicPr") == sName )
m_oNvPicPr = oReader;
//if ( _T("xdr:spPr") == sName )
// m_oBlipFill = oReader;
if ( _T("xdr:spPr") == sName )
m_oSpPr = oReader;
if ( _T("xdr:style") == sName )
m_oShapeStyle = oReader;
}
}
......@@ -261,9 +258,10 @@ namespace OOX
{
}
public:
nullable<CBlipFill> m_oBlipFill;
nullable<CPictureNonVisual> m_oNvPicPr;
//nullable<CNonVisualDrawingProps> m_oCSpPr;
nullable<CBlipFill> m_oBlipFill;
nullable<CPictureNonVisual> m_oNvPicPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<OOX::Drawing::CShapeStyle> m_oShapeStyle;
};
} //Spreadsheet
} // namespace OOX
......
#pragma once
#ifndef OOX_SHAPE_FILE_INCLUDE_H_
#define OOX_SHAPE_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
//--------------------------------------------------------------------------------
// 20.5.2.9 cNvSpPr (Connection Non-Visual Shape Properties)
//--------------------------------------------------------------------------------
class CConnectionNonVisualShapeProps : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CConnectionNonVisualShapeProps)
CConnectionNonVisualShapeProps()
{
}
virtual ~CConnectionNonVisualShapeProps()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
sName = oReader.GetName();
if ( _T("a:picLocks") == sName )
m_oPicLocks = oReader;
else if ( _T("a:extLst") == sName )
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_ConnectionNonVisualShapeProps;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("preferRelativeResize"), m_oPreferRelativeResize )
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Attributes
SimpleTypes::COnOff<SimpleTypes::onoffTrue> m_oPreferRelativeResize;
// Childs
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
nullable<OOX::Drawing::CPictureLocking> m_oPicLocks;
};
//--------------------------------------------------------------------------------
// 20.5.2.23 nvSpPr (Non-Visual Properties for a Shape)
//--------------------------------------------------------------------------------
class CShapeNonVisual : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CShapeNonVisual)
CShapeNonVisual()
{
}
virtual ~CShapeNonVisual()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:cNvSpPr") == sName )
m_oCNvSpPr = oReader;
else if ( _T("xdr:cNvPr") == sName )
m_oCNvPr = oReader;
}
}
virtual EElementType getType () const
{
return et_ShapeNonVisual;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Childs
nullable<CConnectionNonVisualShapeProps> m_oCNvSpPr;
nullable<OOX::Drawing::CNonVisualDrawingProps> m_oCNvPr;
};
//--------------------------------------------------------------------------------
// 20.5.2.29 sp (Shape)
//--------------------------------------------------------------------------------
class CShape : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CShape)
CShape()
{
}
virtual ~CShape()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:nvSpPr") == sName )
m_oNvSpPr = oReader;
if ( _T("xdr:spPr") == sName )
m_oSpPr = oReader;
if ( _T("xdr:style") == sName )
m_oShapeStyle = oReader; }
}
virtual EElementType getType () const
{
return et_Shape;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CShapeNonVisual> m_oNvSpPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<OOX::Drawing::CShapeStyle> m_oShapeStyle;
//txBody (Shape Text Body)
};
} //Spreadsheet
} // namespace OOX
#endif // OOX_SHAPE_FILE_INCLUDE_H_
\ No newline at end of file
......@@ -303,7 +303,13 @@ et_alternatecontentfallback,
et_Pane,
et_PictureNonVisual,
et_NonVisualDrawingProps
et_NonVisualDrawingProperies,
et_NonVisualPictureDrawingProps,
et_ConnectionNonVisualShapeProps,
et_ShapeProperties,
et_ShapeNonVisual,
et_ShapeStyle,
et_Shape
};
......
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