Commit 34ca8670 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@55698 954022d7-b5bf-4e40-9824-e11837661b57
parent daca4db4
......@@ -220,7 +220,6 @@ office_element_ptr odf_drawing_context::Impl::create_draw_element(int type)
case 9:
create_element(L"draw", L"connector", element, odf_context_);
break;
}
return element;
......@@ -268,10 +267,14 @@ void odf_drawing_context::start_shape(int type)
{
impl_->create_draw_base(Shape_Types_Mapping[type].second);
}
else
else if (type == 1000)
{
impl_->create_draw_base(7);// .. path,
}
else if (type == 2000)
{
impl_->create_draw_base(10);//text-box
}
}
void odf_drawing_context::end_shape()
{
......@@ -563,6 +566,7 @@ void odf_drawing_context::set_line_width(double pt)
void odf_drawing_context::set_line_head(int type, int len, int width)
{
if (!impl_->current_graphic_properties)return;
// ,
//impl_->current_graphic_properties->content().draw_marker_start_ = marker_style(marker_style::from_ms(type));
}
......@@ -570,13 +574,42 @@ void odf_drawing_context::set_line_tail(int type, int len, int width)
{
if (!impl_->current_graphic_properties)return;
// ,
//impl_->current_graphic_properties->content().draw_marker_end_ = marker_style(marker_style::from_ms(type));
}
void odf_drawing_context::set_line_dash_preset(int style)
{
if (!impl_->current_graphic_properties)return;
switch(style) //+ ,
{
case 0://presetlinedashvalDash
case 7://presetlinedashvalSysDash
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Dash); break;
case 1://presetlinedashvalDashDot
case 8://presetlinedashvalSysDashDot
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::DotDash); break;
case 2://presetlinedashvalDot
case 10://presetlinedashvalSysDot
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Dotted); break;
case 3://presetlinedashvalLgDash
case 4://presetlinedashvalLgDashDot
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::LongDash); break;
case 5://presetlinedashvalLgDashDotDot
case 9://presetlinedashvalSysDashDotDot
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::DotDotDash);break;
case 6://presetlinedashvalSolid
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Solid); break;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
void odf_drawing_context::start_image(std::wstring & path)
{
{
start_frame();
office_element_ptr image_elm;
create_element(L"draw", L"image", image_elm, impl_->odf_context_);
......@@ -590,11 +623,33 @@ void odf_drawing_context::start_image(std::wstring & path)
start_element(image_elm);
}
void odf_drawing_context::start_text_box()
{
start_frame();
if (impl_->current_graphic_properties)
{
//
impl_->current_graphic_properties->content().draw_auto_grow_height_ = false;
impl_->current_graphic_properties->content().draw_auto_grow_width_ = false;
}
office_element_ptr text_box_elm;
create_element(L"draw", L"text-box", text_box_elm, impl_->odf_context_);
start_element(text_box_elm);
}
void odf_drawing_context::end_image()
{
end_element();
end_frame();
}
void odf_drawing_context::end_text_box()
{
end_element();
end_frame();
}
bool odf_drawing_context::is_exist_content()
{
......
......@@ -30,15 +30,15 @@ public:
void start_drawing();
void end_drawing();
void start_frame();
void end_frame();
void start_shape(int type);
void end_shape();
void start_image(std::wstring & path);
void end_image();
void start_text_box();
void end_text_box();
void start_element(office_element_ptr & elm);
void end_element();
......@@ -76,6 +76,7 @@ public:
void start_line_properies();
void set_line_width(double pt);
void set_line_dash_preset(int style);
void set_line_head(int type, int len, int width);
void set_line_tail(int type, int len, int width);
......@@ -85,6 +86,9 @@ public:
void end_shadow_properies();
private:
void start_frame();
void end_frame();
class Impl;
_CP_PTR(Impl) impl_;
......
......@@ -26,6 +26,8 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
CP_XML_ATTR_OPT(L"draw:wrap-influence-on-position", draw_wrap_influence_on_position_);
CP_XML_ATTR_OPT(L"draw:textarea-horizontal-align", draw_textarea_horizontal_align_);
CP_XML_ATTR_OPT(L"draw:textarea-vertical-align", draw_textarea_vertical_align_);
CP_XML_ATTR_OPT(L"draw:auto-grow-height", draw_auto_grow_height_);
CP_XML_ATTR_OPT(L"draw:auto-grow-width", draw_auto_grow_width_);
CP_XML_ATTR_OPT(L"draw:stroke", draw_stroke_);
CP_XML_ATTR_OPT(L"draw:stroke-dash",draw_stroke_dash_);
......
......@@ -36,90 +36,72 @@ public:
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
public:
common_draw_rel_size_attlist common_draw_rel_size_attlist_;
_CP_OPT(length_or_percent) fo_min_width_;
_CP_OPT(length_or_percent) fo_min_height_;
public:
_CP_OPT(length_or_percent) fo_min_width_;
_CP_OPT(length_or_percent) fo_min_height_;
_CP_OPT(length_or_percent) fo_max_width_;
_CP_OPT(length_or_percent) fo_max_height_;
_CP_OPT(length_or_percent) fo_max_width_;
_CP_OPT(length_or_percent) fo_max_height_;
///////////////////////////////
_CP_OPT(color) svg_stroke_color_;
_CP_OPT(length_or_percent) svg_stroke_opacity_;
_CP_OPT(line_style) draw_stroke_;
_CP_OPT(std::wstring) draw_stroke_dash_;
_CP_OPT(length_or_percent) svg_stroke_width_;
_CP_OPT(color) svg_stroke_color_;
_CP_OPT(length_or_percent) svg_stroke_opacity_;
_CP_OPT(line_style) draw_stroke_;
_CP_OPT(std::wstring) draw_stroke_dash_;
_CP_OPT(length_or_percent) svg_stroke_width_;
_CP_OPT(marker_style) draw_marker_end_;
_CP_OPT(marker_style) draw_marker_start_;
_CP_OPT(marker_style) draw_marker_end_;
_CP_OPT(marker_style) draw_marker_start_;
_CP_OPT(text_align) draw_textarea_horizontal_align_;
_CP_OPT(vertical_align) draw_textarea_vertical_align_;
_CP_OPT(text_align) draw_textarea_horizontal_align_;
_CP_OPT(vertical_align) draw_textarea_vertical_align_;
_CP_OPT(Bool) draw_auto_grow_height_;
_CP_OPT(Bool) draw_auto_grow_width_;
common_draw_fill_attlist common_draw_fill_attlist_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_;
common_draw_rel_size_attlist common_draw_rel_size_attlist_;
common_horizontal_pos_attlist common_horizontal_pos_attlist_;
common_horizontal_rel_attlist common_horizontal_rel_attlist_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_;
common_vertical_pos_attlist common_vertical_pos_attlist_;
common_vertical_rel_attlist common_vertical_rel_attlist_;
common_vertical_margin_attlist common_vertical_margin_attlist_;
common_text_anchor_attlist common_text_anchor_attlist_;
common_margin_attlist common_margin_attlist_;
_CP_OPT(Bool) style_print_content_;
_CP_OPT(std::wstring) style_protect_;
common_horizontal_pos_attlist common_horizontal_pos_attlist_;
common_text_animation_attlist common_text_animation_attlist_;
common_horizontal_rel_attlist common_horizontal_rel_attlist_;
common_vertical_pos_attlist common_vertical_pos_attlist_;
common_vertical_rel_attlist common_vertical_rel_attlist_;
common_text_anchor_attlist common_text_anchor_attlist_;
common_text_animation_attlist common_text_animation_attlist_;
common_border_attlist common_border_attlist_;
common_border_line_width_attlist common_border_line_width_attlist_;
common_border_attlist common_border_attlist_;
common_border_line_width_attlist common_border_line_width_attlist_;
common_padding_attlist common_padding_attlist_;
common_shadow_attlist common_shadow_attlist_;
common_padding_attlist common_padding_attlist_;
common_background_color_attlist common_background_color_attlist_;
common_shadow_attlist common_shadow_attlist_;
_CP_OPT(Bool) style_editable_;
_CP_OPT(Bool) draw_fit_to_size_;
_CP_OPT(style_wrap) style_wrap_;
_CP_OPT(unsigned int) style_wrap_dynamic_treshold_;
common_background_color_attlist common_background_color_attlist_;
_CP_OPT(style_wrap) style_wrap_;
_CP_OPT(Bool) style_print_content_;
_CP_OPT(std::wstring) style_protect_;
_CP_OPT(Bool) style_editable_;
_CP_OPT(unsigned int) style_wrap_dynamic_treshold_;
_CP_OPT(integer_or_nolimit) style_number_wrapped_paragraphs_;
_CP_OPT(Bool) style_wrap_contour_;
_CP_OPT(wrap_contour_mode) style_wrap_contour_mode_;
_CP_OPT(run_through) style_run_through_;
_CP_OPT(Bool) style_flow_with_text_;
_CP_OPT(std::wstring) style_overflow_behavior_;
_CP_OPT(std::wstring) style_mirror_;
_CP_OPT(std::wstring) fo_clip_;
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
office_element_ptr style_background_image_;
_CP_OPT(Bool) style_wrap_contour_;
_CP_OPT(wrap_contour_mode) style_wrap_contour_mode_;
_CP_OPT(run_through) style_run_through_;
_CP_OPT(Bool) style_flow_with_text_;
_CP_OPT(std::wstring) style_overflow_behavior_;
_CP_OPT(std::wstring) style_mirror_;
_CP_OPT(Bool) draw_fit_to_size_;
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
_CP_OPT(std::wstring) fo_clip_;
////////////////////////////////////////////////////////////////////////
office_element_ptr style_background_image_;
};
/// \class style_graphic_properties
......
......@@ -221,11 +221,11 @@ void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop)
if (oox_line_prop->m_oCustDash.IsInit())
{
//custom not support
//
}
if (oox_line_prop->m_oPrstDash.IsInit())
if (oox_line_prop->m_oPrstDash.IsInit() && oox_line_prop->m_oPrstDash->m_oVal.IsInit())
{
odf_context()->drawing_context().set_line_dash_preset(oox_line_prop->m_oPrstDash->m_oVal->GetValue());
}
//nullable<SimpleTypes::CPenAlignment<>> m_oAlgn;
//nullable<SimpleTypes::CLineCap<>> m_oCap;
......@@ -347,12 +347,16 @@ void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::ws
switch(theme_ind)
{
case SimpleTypes::shemecolorvalLt1:
case SimpleTypes::shemecolorvalBg1:
result = theme->m_oThemeElements.m_oClrScheme.m_oLt1.tryGetRgb(ucR, ucG, ucB, ucA); break;
case SimpleTypes::shemecolorvalLt2:
case SimpleTypes::shemecolorvalBg2:
result = theme->m_oThemeElements.m_oClrScheme.m_oLt2.tryGetRgb(ucR, ucG, ucB, ucA); break;
case SimpleTypes::shemecolorvalDk1:
case SimpleTypes::shemecolorvalTx1:
result = theme->m_oThemeElements.m_oClrScheme.m_oDk1.tryGetRgb(ucR, ucG, ucB, ucA); break;
case SimpleTypes::shemecolorvalDk2:
case SimpleTypes::shemecolorvalTx2:
result = theme->m_oThemeElements.m_oClrScheme.m_oDk2.tryGetRgb(ucR, ucG, ucB, ucA); break;
case SimpleTypes::shemecolorvalAccent1:
result = theme->m_oThemeElements.m_oClrScheme.m_oAccent1.tryGetRgb(ucR, ucG, ucB, ucA); break;
......
......@@ -984,9 +984,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellAnchor *oox_anchor)
//
if (oox_anchor->m_oPicture.IsInit())//picture
{
ods_context->drawing_context().start_frame();
convert(oox_anchor->m_oPicture.GetPointer());
ods_context->drawing_context().end_frame();
convert(oox_anchor->m_oPicture.GetPointer());
}
else if (oox_anchor->m_oShape.IsInit())
{
......@@ -998,9 +996,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellAnchor *oox_anchor)
}
else if (oox_anchor->m_oGraphicFrame.IsInit())//chart
{
ods_context->drawing_context().start_frame();
//m_oChartGraphic
ods_context->drawing_context().end_frame();
}
}
......@@ -1045,31 +1041,34 @@ void XlsxConverter::convert(OOX::Spreadsheet::CShape* oox_shape)
type =(geometry->m_oPrst.GetValue());
}
if ((oox_shape->m_oNvSpPr.IsInit()) && (oox_shape->m_oNvSpPr->m_oCNvSpPr.IsInit()))
{
if (oox_shape->m_oNvSpPr->m_oCNvSpPr->m_otxBox.GetValue() == 1)
type = 2000; //textBox
}
if (type < 0)return;
/////////////////////////////////////////////////////////////////////////////////
ods_context->drawing_context().start_shape(type);
if (type == 2000)ods_context->drawing_context().start_text_box();
else ods_context->drawing_context().start_shape(type);
{
convert_SpPr(oox_shape->m_oSpPr.GetPointer());
if (oox_shape->m_oNvSpPr.IsInit())
{
if (oox_shape->m_oNvSpPr->m_oCNvPr.IsInit())
{
convert_CNvPr(oox_shape->m_oNvSpPr->m_oCNvPr.GetPointer());
}
if (oox_shape->m_oNvSpPr->m_oCNvSpPr.IsInit())
{
}
convert_CNvPr(oox_shape->m_oNvSpPr->m_oCNvPr.GetPointer()); //, , ...
convert(oox_shape->m_oNvSpPr->m_oCNvSpPr.GetPointer()); //
}
if (oox_shape->m_oShapeStyle.IsInit())
{
//
}
}
ods_context->drawing_context().end_shape();
if (type == 2000)ods_context->drawing_context().end_text_box();
else ods_context->drawing_context().end_shape();
}
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//18
#define INTVER 1,2,0,18
#define STRVER "1,2,0,18\0"
//19
#define INTVER 1,2,0,19
#define STRVER "1,2,0,19\0"
......@@ -7,6 +7,7 @@
#include "../DocxFormat/Drawing/DrawingCoreInfo.h"
#include "../DocxFormat/Drawing/DrawingEffects.h"
#include "../DocxFormat/Drawing/DrawingBody.h"
#include "ComplexTypes_Spreadsheet.h"
#include "FileTypes_Spreadsheet.h"
......
......@@ -3,11 +3,77 @@
#define OOX_SHAPE_FILE_INCLUDE_H_
#include "../CommonInclude.h"
//#include "../../DocxFormat/Logic/Paragraph.h"
namespace OOX
{
namespace Spreadsheet
{
//--------------------------------------------------------------------------------
// 20.5.2.34 txBody (Shape Text Body)
//--------------------------------------------------------------------------------
class CTextBody : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CTextBody)
CTextBody()
{
}
virtual ~CTextBody()
{
}
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("a:bodyPr") == sName )
m_oBodyPr = oReader;
//if ( _T("a:lstStyle") == sName )
// m_oLstStyle = oReader;
//if ( _T("a:p") == sName )
//{
// // .. OOX::Logic namespace "a", !!! "w"
// OOX::WritingElement *pItem = new OOX::Logic::CParagraph( oReader );
// if ( pItem ) m_arrItems.Add( pItem );
//}
}
}
virtual EElementType getType () const
{
return et_ShapeTextBody;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<OOX::Drawing::CTextBodyProperties> m_oBodyPr;
//nullable<OOX::Drawing::CTextListStyle> m_oLstStyle;
//CSimpleArray<OOX::WritingElement*> m_arrItems;
//lstStyle (Text List Styles) 21.1.2.4.12
//p (Text Paragraphs)
};
//--------------------------------------------------------------------------------
// 20.5.2.9 cNvSpPr (Connection Non-Visual Shape Properties)
//--------------------------------------------------------------------------------
......@@ -43,8 +109,8 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
sName = oReader.GetName();
if ( _T("a:picLocks") == sName )
m_oPicLocks = oReader;
if ( _T("a:spLocks") == sName )
m_oSpLocks = oReader;
else if ( _T("a:extLst") == sName )
m_oExtLst = oReader;
}
......@@ -59,17 +125,16 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("preferRelativeResize"), m_oPreferRelativeResize )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("txBox"), m_otxBox )
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Attributes
SimpleTypes::COnOff<SimpleTypes::onoffTrue> m_oPreferRelativeResize;
SimpleTypes::COnOff<SimpleTypes::onoffFalse> m_otxBox;
// Childs
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
nullable<OOX::Drawing::CPictureLocking> m_oPicLocks;
nullable<OOX::Drawing::CPictureLocking> m_oSpLocks;//todo CShapeLocking
};
//--------------------------------------------------------------------------------
......@@ -125,7 +190,6 @@ namespace OOX
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Childs
nullable<CConnectionNonVisualShapeProps> m_oCNvSpPr;
nullable<OOX::Drawing::CNonVisualDrawingProps> m_oCNvPr;
......@@ -186,7 +250,7 @@ namespace OOX
nullable<CShapeNonVisual> m_oNvSpPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<OOX::Drawing::CShapeStyle> m_oShapeStyle;
//txBody (Shape Text Body)
nullable<OOX::Spreadsheet::CTextBody> m_oTxBody;
};
//--------------------------------------------------------------------------------
......@@ -244,7 +308,6 @@ namespace OOX
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Attributes
SimpleTypes::COnOff<SimpleTypes::onoffTrue> m_oPreferRelativeResize;
......@@ -306,7 +369,6 @@ namespace OOX
WritingElement_ReadAttributes_End( oReader )
}
public:
EElementType m_eType;
// Childs
nullable<CConnectionNonVisualConnShapeProps> m_oCNvConnSpPr;
nullable<OOX::Drawing::CNonVisualDrawingProps> m_oCNvPr;
......@@ -368,7 +430,6 @@ namespace OOX
nullable<CConnShapeNonVisual> m_oNvConnSpPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<OOX::Drawing::CShapeStyle> m_oShapeStyle;
//txBody (Shape Text Body)
};
} //Spreadsheet
} // namespace OOX
......
......@@ -311,6 +311,7 @@ et_alternatecontentfallback,
et_ShapeStyle,
et_Shape,
et_ConnShape,
et_ShapeTextBody,
et_ConnShapeNonVisual,
et_ConnectionNonVisualConnShapeProps
......
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