Commit 64c2cef6 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.134): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57906 954022d7-b5bf-4e40-9824-e11837661b57
parent e9603c8e
......@@ -1358,7 +1358,7 @@ void odf_chart_context::set_series_pie_explosion(int val)//
// impl_->cash_.push_back(state);
//}
void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring> & data_str,bool label)
void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring> & data_str, bool label)
{
if (data_str.size() <1) return;
if (impl_->data_cell_ranges_.size()<1) return;
......
......@@ -351,7 +351,7 @@ void odf_drawing_context::start_drawing()
{
//impl_->current_drawing_state_.clear();
if (impl_->current_level_.size() < 1)
//if (impl_->current_level_.size() < 1)
{
impl_->current_drawing_state_.svg_x_ = impl_->anchor_settings_.svg_x_;
impl_->current_drawing_state_.svg_y_ = impl_->anchor_settings_.svg_y_;
......@@ -370,7 +370,8 @@ void odf_drawing_context::start_drawing()
impl_->current_drawing_state_.svg_width_ = impl_->anchor_settings_.svg_width_;
impl_->current_drawing_state_.svg_height_ = impl_->anchor_settings_.svg_height_;
}
else
//else
if (impl_->current_level_.size() > 0)
{
impl_->current_drawing_state_.in_group = true;
}
......@@ -406,10 +407,12 @@ void odf_drawing_context::end_drawing()
{
if (impl_->current_drawing_state_.in_group)
{
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
{
strTransform += std::wstring(L" translate(-") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_width_.get()/2)
+ std::wstring(L",-") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_height_.get()/2)
+ std::wstring(L")" );
}
}
strTransform += std::wstring(L"rotate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.rotateAngle.get()) + std::wstring(L")");
......@@ -417,11 +420,11 @@ void odf_drawing_context::end_drawing()
if (impl_->current_drawing_state_.svg_x_ && impl_->current_drawing_state_.svg_y_)
{
strTransform += std::wstring(L" translate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_x_.get() +
(impl_->current_drawing_state_.svg_width_.get()/2))
+ std::wstring(L",") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_y_.get() +
(impl_->current_drawing_state_.svg_height_.get()/2))
+ std::wstring(L")") ;
strTransform += std::wstring(L" translate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_x_.get() +
(impl_->current_drawing_state_.svg_width_ ? (impl_->current_drawing_state_.svg_width_.get()/2) : 0))
+ std::wstring(L",") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.svg_y_.get() +
(impl_->current_drawing_state_.svg_height_ ? (impl_->current_drawing_state_.svg_height_.get()/2) : 0))
+ std::wstring(L")") ;
impl_->current_drawing_state_.svg_x_ = boost::none;
impl_->current_drawing_state_.svg_y_ = boost::none;
}
......
......@@ -87,16 +87,41 @@ void odf_page_layout_context::end_master_page()
if (f_header && !f_footer && footer)
{
add_footer(2);
office_element_ptr blank_p_elm;
create_element(L"text", L"p", blank_p_elm, odf_context_);
master_state_list_.back().elements_.back().elm->add_child_element(blank_p_elm);
f_footer = true;
}
if (!f_header && f_footer && header)
{
add_header(2);
office_element_ptr blank_p_elm;
create_element(L"text", L"p", blank_p_elm, odf_context_);
master_state_list_.back().elements_.back().elm->add_child_element(blank_p_elm);
f_header = true;
}
// Libra Apach -
if (!header && (f_header || l_header))
{
add_header(0);
office_element_ptr blank_p_elm;
create_element(L"text", L"p", blank_p_elm, odf_context_);
master_state_list_.back().elements_.back().elm->add_child_element(blank_p_elm);
header = true;
}
if (!footer && (f_footer || l_footer))
{
add_footer(0);
office_element_ptr blank_p_elm;
create_element(L"text", L"p", blank_p_elm, odf_context_);
master_state_list_.back().elements_.back().elm->add_child_element(blank_p_elm);
footer = true;
}
......@@ -120,6 +145,7 @@ void odf_page_layout_context::process_master_styles(office_element_ptr root )
void odf_page_layout_context::process_automatic_for_styles(office_element_ptr root )
{
//local_style_context_->process_automatic_for_styles(root);
local_style_context_->process_automatic_styles(root);
}
void odf_page_layout_context::process_office_styles(office_element_ptr root )
......
......@@ -80,6 +80,7 @@ enum ElementType
typeStyleDefaultStyle,
typeStyleStyle,
typeTextListStyle,
typeTextListLevelStyleImage,
typeTextListLevelStyleNumber,
typeTextListLevelStyleBullet,
typeStyleListLevelProperties,
......
......@@ -39,7 +39,12 @@ void text_list_level_style_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR(L"text:level", text_level_);
}
void text_list_level_style_image_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"text:style-name", text_style_name_);
common_xlink_attlist_.serialize(CP_GET_XML_NODE());
}
// text:list-style
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_style::ns = L"text";
......@@ -244,5 +249,49 @@ void text_list_level_style_bullet::serialize(std::wostream & strm)
}
}
}
// text:list-level-style-image
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_level_style_image::ns = L"text";
const wchar_t * text_list_level_style_image::name = L"list-level-style-image";
void text_list_level_style_image::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
else if (L"style" == Ns && L"text-properties" == Name)
CP_CREATE_ELEMENT(style_text_properties_);
else
{
CP_NOT_APPLICABLE_ELM();
}
}
void text_list_level_style_image::add_child_element( office_element_ptr & child)
{
ElementType type = child->get_type();
if (type == typeStyleListLevelProperties)
style_list_level_properties_ = child;
else if (type == typeStyleTextProperties)
style_text_properties_ = child;
else
{
}
}
void text_list_level_style_image::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
text_list_level_style_attr_.serialize(CP_GET_XML_NODE());
text_list_level_style_image_attr_.serialize(CP_GET_XML_NODE());
if (style_list_level_properties_) style_list_level_properties_->serialize(CP_XML_STREAM());
if (style_text_properties_) style_text_properties_->serialize(CP_XML_STREAM());
}
}
}
}
}
......@@ -169,7 +169,6 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_number);
/// \class text_list_level_style_bullet_attr
/// text-list-level-style-bullet-attr
class text_list_level_style_bullet_attr
{
......@@ -184,7 +183,6 @@ public:
void serialize(CP_ATTR_NODE);
};
/// \class text_list_level_style_bullet
/// text:list-level-style-bullet
class text_list_level_style_bullet : public office_element_impl<text_list_level_style_bullet>
{
......@@ -209,6 +207,38 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_bullet);
/// text-list-level-style-image-attr
class text_list_level_style_image_attr
{
public:
_CP_OPT(style_ref) text_style_name_;
common_xlink_attlist common_xlink_attlist_;
void serialize(CP_ATTR_NODE);
};
/// text:list-level-style-image
class text_list_level_style_image : public office_element_impl<text_list_level_style_image>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleImage;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(office_element_ptr & child);
virtual void serialize(std::wostream & strm);
text_list_level_style_attr text_list_level_style_attr_;
text_list_level_style_image_attr text_list_level_style_image_attr_;
office_element_ptr style_text_properties_;
office_element_ptr style_list_level_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_image);
}
}
......@@ -51,10 +51,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
if (vml_shape_type == NULL) return;
//custom shape
if (vml_shape_type->m_oCoordSize.IsInit())
{
odf_context()->drawing_context()->set_position(vml_shape_type->m_oCoordSize->GetX(), vml_shape_type->m_oCoordSize->GetY());
}
//m_oPreferRelative//
for (long i=0 ; i < vml_shape_type->m_arrItems.GetSize();i++)
......@@ -74,7 +71,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
//CVmlAttributes
}
void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style)
void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
{
if (vml_style == NULL) return;
......@@ -162,11 +159,27 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style)
}break;
case SimpleTypes::Vml::cssptRotation:
{
odf_context()->drawing_context()->set_rotate(180 + vml_style->m_arrProperties[i].get_Value().dValue);
if (group)
odf_context()->drawing_context()->set_group_rotate(180 + vml_style->m_arrProperties[i].get_Value().dValue);
else
odf_context()->drawing_context()->set_rotate(180 + vml_style->m_arrProperties[i].get_Value().dValue);
}break;
}
}
odf_context()->drawing_context()->set_drawings_rect(x, y, width_pt, height_pt);
if (group)
{
double w = width_pt ? *width_pt:0;
double h = height_pt ? *height_pt:0;
odf_context()->drawing_context()->set_group_size(w, h, 1. ,1. );
}
else
{
odf_context()->drawing_context()->set_drawings_rect(x, y, width_pt, height_pt);
//odf_context()->drawing_context()->set_size(width_pt.get_value_or(0), height_pt.get_value_or(0));
//
//odf_context()->drawing_context()->set_position(x.get_value_or(0), y.get_value_or(0));
}
//if (width_pt && height_pt)
// odf_context()->drawing_context()->set_viewBox(width_pt.get(), height_pt.get());
......@@ -498,95 +511,123 @@ void OoxConverter::convert(OOX::VmlWord::CWrap *vml_wrap)
}
}
}
void OoxConverter::convert(OOX::Vml::CGroup * vml_group)
void OoxConverter::convert(OOX::Vml::CVmlAttributes *vml_attr)
{
if (vml_attr == NULL) return;
convert(vml_attr->m_oStyle.GetPointer());
if (vml_attr->m_oCoordSize.IsInit())
{
odf_context()->drawing_context()->set_position(vml_attr->m_oCoordSize->GetX(), vml_attr->m_oCoordSize->GetY());
}
}
void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
{
if (vml_group == NULL) return;
odf_context()->drawing_context()->start_group();
if (vml_group->m_oShapeGroup.IsInit())
{
convert(vml_group->m_oShapeGroup.GetPointer());
}
else
{
odf_context()->drawing_context()->start_drawing();
if (vml_group->m_oShapeOval.IsInit())
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeEllipse);
convert(vml_group->m_oShapeOval.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapeLine.IsInit())
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeLine);
convert(vml_group->m_oShapeLine.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapePolyLine.IsInit())
if (vml_group->m_oCoordSize.IsInit())
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeLine);
convert(vml_group->m_oShapePolyLine.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapeArc.IsInit())
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeLine);
convert(vml_group->m_oShapeArc.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapeRoundRect.IsInit())
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRoundRect);
convert(vml_group->m_oShapeRoundRect.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapeCurve.IsInit())
odf_context()->drawing_context()->set_group_position(vml_group->m_oCoordSize->GetX(), vml_group->m_oCoordSize->GetY(),0,0);
}
convert(vml_group->m_oStyle.GetPointer(), true);
for (long i=0; i < vml_group->m_arrItems.GetSize(); i++)
{
odf_context()->drawing_context()->start_shape(1000);
convert(vml_group->m_oShapeCurve.GetPointer());
convert(vml_group->m_oShape.GetPointer());
if (vml_group->m_arrItems[i]->getType() == OOX::et_v_group)
{
OOX::Vml::CGroup * vml = static_cast<OOX::Vml::CGroup*>(vml_group->m_arrItems[i]);
convert(vml);
continue;
}
odf_context()->drawing_context()->end_shape();
}
else if (vml_group->m_oShapeType.IsInit())
{
OOX::Vml::SptType sptType = static_cast<OOX::Vml::SptType>(vml_group->m_oShapeType->m_oSpt.GetValue());
OOX::Vml::CVmlAttributes * vml_attr = dynamic_cast<OOX::Vml::CVmlAttributes*>(vml_group->m_arrItems[i]);
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
convert(vml_group->m_oShapeType.GetPointer());
convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
else // and oox_pic->m_oShapeRect
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRect);
OoxConverter::convert(vml_group->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
if (vml_attr == NULL) continue; //
odf_context()->drawing_context()->end_drawing();
}
convert(vml_attr);
odf_context()->drawing_context()->start_drawing();
//OOX::Vml::CVmlShapeElements * vml_elm = dynamic_cast<OOX::Vml::CVmlShapeElements*>(oox_unknown);
//if (vml_elm) vml_elm-> convert(vml_attr);
switch(vml_group->m_arrItems[i]->getType())
{
case OOX::et_v_shape:
{
OOX::Vml::CShape * vml = dynamic_cast<OOX::Vml::CShape*>(vml_group->m_arrItems[i]);
bool bSet = false;
if (vml)
{
OOX::Vml::SptType sptType = static_cast<OOX::Vml::SptType>(vml->m_oSpt.GetValue());
if (sptType != OOX::Vml::SptType::sptNotPrimitive)
{
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
bSet = true;
}
else if (vml->m_oConnectorType.GetValue() != SimpleTypes::connectortypeNone)
{
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeStraightConnector1);
odf_context()->drawing_context()->set_line_width(1.);
bSet = true;
}
else if (vml->m_oPath.IsInit())
{
odf_context()->drawing_context()->start_shape(1001);
odf_context()->drawing_context()->set_line_width(1.);
bSet = true;
}
}
if (!bSet)
{
odf_context()->drawing_context()->set_name(L"Rect");
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRect);
}
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
case OOX::et_v_shapetype:
{
OOX::Vml::CShapeType * vml = dynamic_cast<OOX::Vml::CShapeType*>(vml_group->m_arrItems[i]);
OOX::Vml::SptType sptType = static_cast<OOX::Vml::SptType>(vml->m_oSpt.GetValue());
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
case OOX::et_v_oval:
{
OOX::Vml::COval * vml = dynamic_cast<OOX::Vml::COval*>(vml_group->m_arrItems[i]);
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeEllipse);
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
case OOX::et_v_rect:
{
OOX::Vml::CRect * vml = dynamic_cast<OOX::Vml::CRect*>(vml_group->m_arrItems[i]);
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeRect);
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
case OOX::et_v_line:
{
OOX::Vml::CLine * vml = dynamic_cast<OOX::Vml::CLine*>(vml_group->m_arrItems[i]);
odf_context()->drawing_context()->start_shape(SimpleTypes::shapetypeLine);
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
case OOX::et_v_curve:
{
OOX::Vml::CCurve * vml = dynamic_cast<OOX::Vml::CCurve*>(vml_group->m_arrItems[i]);
odf_context()->drawing_context()->start_shape(1000);
OoxConverter::convert(vml);
odf_context()->drawing_context()->end_shape();
}break;
default: convert(vml_group->m_arrItems[i]);
}
odf_context()->drawing_context()->end_drawing();
}
odf_context()->drawing_context()->end_group();
}
}
\ No newline at end of file
......@@ -72,132 +72,141 @@ BOOL OoxConverter::UpdateProgress(long nComplete)
void OoxConverter::convert(OOX::WritingElement *oox_unknown)
{
if (oox_unknown == NULL)return;
switch(oox_unknown->getType())
try
{
case OOX::et_a_Shape:
{
OOX::Drawing::CShape* pShape = static_cast<OOX::Drawing::CShape*>(oox_unknown);
convert(pShape);
}break;
case OOX::et_a_LockedCanvas:
{
OOX::Drawing::CLockedCanvas* pLockedCanvas = static_cast<OOX::Drawing::CLockedCanvas*>(oox_unknown);
convert(pLockedCanvas);
}break;
case OOX::et_a_prstGeom:
{
OOX::Drawing::CPresetGeometry2D* pPresetGeom = static_cast<OOX::Drawing::CPresetGeometry2D*>(oox_unknown);
convert(pPresetGeom);
}break;
case OOX::et_a_custGeom:
{
OOX::Drawing::CCustomGeometry2D* pCustomGeom = static_cast<OOX::Drawing::CCustomGeometry2D*>(oox_unknown);
convert(pCustomGeom);
}break;
case OOX::et_a_lnTo:
{
OOX::Drawing::CPath2DLineTo* pLineTo = static_cast<OOX::Drawing::CPath2DLineTo*>(oox_unknown);
convert(pLineTo);
}break;
case OOX::et_a_moveTo:
{
OOX::Drawing::CPath2DMoveTo* pMoveTo = static_cast<OOX::Drawing::CPath2DMoveTo*>(oox_unknown);
convert(pMoveTo);
}break;
case OOX::et_a_arcTo:
{
OOX::Drawing::CPath2DArcTo* pArcTo = static_cast<OOX::Drawing::CPath2DArcTo*>(oox_unknown);
convert(pArcTo);
}break;
case OOX::et_a_quadBezTo:
{
OOX::Drawing::CPath2DQuadBezierTo* pQuadBezierTo = static_cast<OOX::Drawing::CPath2DQuadBezierTo*>(oox_unknown);
convert(pQuadBezierTo);
}break;
case OOX::et_a_cubicBezTo:
{
OOX::Drawing::CPath2DCubicBezierTo* pCubicBezierT = static_cast<OOX::Drawing::CPath2DCubicBezierTo*>(oox_unknown);
convert(pCubicBezierT);
}break;
case OOX::et_a_close:
{
OOX::Drawing::CPath2DClose* pClose= static_cast<OOX::Drawing::CPath2DClose*>(oox_unknown);
convert(pClose);
}break;
case OOX::et_a_r:
{
OOX::Drawing::CRun* pRun= static_cast<OOX::Drawing::CRun*>(oox_unknown);
convert(pRun);
}break;
case OOX::et_a_alphaModFix:
if (oox_unknown == NULL)return;
switch(oox_unknown->getType())
{
OOX::Drawing::CAlphaModulateFixedEffect* pAlpha= static_cast<OOX::Drawing::CAlphaModulateFixedEffect*>(oox_unknown);
if (pAlpha)
case OOX::et_a_Shape:
{
odf_context()->drawing_context()->set_opacity(pAlpha->m_oAmt.GetValue());
}
}break;
case OOX::et_v_imagedata:
{
OOX::Vml::CImageData *vml = static_cast<OOX::Vml::CImageData*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_textbox:
{
OOX::Vml::CTextbox *vml = static_cast<OOX::Vml::CTextbox*>(oox_unknown);
convert(vml);
}break;
//case OOX::et_v_background:
//{
// OOX::Vml::CBackground *vml = static_cast<OOX::Vml::CBackground*>(oox_unknown);
// convert(vml);
//}break;
case OOX::et_v_path:
{
OOX::Vml::CPath *vml = static_cast<OOX::Vml::CPath*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_textpath:
{
OOX::Vml::CTextPath *vml = static_cast<OOX::Vml::CTextPath*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_fill:
{
OOX::Vml::CFill *vml = static_cast<OOX::Vml::CFill*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_stroke:
{
OOX::Vml::CStroke *vml = static_cast<OOX::Vml::CStroke*>(oox_unknown);
convert(vml);
}break;
case OOX::et_wd_wrap:
{
OOX::VmlWord::CWrap *vml = static_cast<OOX::VmlWord::CWrap*>(oox_unknown);
convert(vml);
}break;
// ""
case OOX::et_w_softHyphen:
case OOX::et_w_proofErr:
case OOX::et_w_proofState:
{
//
}break;
default:
{
OOX::Vml::CVmlShapeElements *vml = dynamic_cast<OOX::Vml::CVmlShapeElements*>(oox_unknown);
if (vml)convert( vml);
else
OOX::Drawing::CShape* pShape = static_cast<OOX::Drawing::CShape*>(oox_unknown);
convert(pShape);
}break;
case OOX::et_a_LockedCanvas:
{
OOX::Drawing::CLockedCanvas* pLockedCanvas = static_cast<OOX::Drawing::CLockedCanvas*>(oox_unknown);
convert(pLockedCanvas);
}break;
case OOX::et_a_prstGeom:
{
OOX::Drawing::CPresetGeometry2D* pPresetGeom = static_cast<OOX::Drawing::CPresetGeometry2D*>(oox_unknown);
convert(pPresetGeom);
}break;
case OOX::et_a_custGeom:
{
OOX::Drawing::CCustomGeometry2D* pCustomGeom = static_cast<OOX::Drawing::CCustomGeometry2D*>(oox_unknown);
convert(pCustomGeom);
}break;
case OOX::et_a_lnTo:
{
OOX::Drawing::CPath2DLineTo* pLineTo = static_cast<OOX::Drawing::CPath2DLineTo*>(oox_unknown);
convert(pLineTo);
}break;
case OOX::et_a_moveTo:
{
OOX::Drawing::CPath2DMoveTo* pMoveTo = static_cast<OOX::Drawing::CPath2DMoveTo*>(oox_unknown);
convert(pMoveTo);
}break;
case OOX::et_a_arcTo:
{
OOX::Drawing::CPath2DArcTo* pArcTo = static_cast<OOX::Drawing::CPath2DArcTo*>(oox_unknown);
convert(pArcTo);
}break;
case OOX::et_a_quadBezTo:
{
OOX::Drawing::CPath2DQuadBezierTo* pQuadBezierTo = static_cast<OOX::Drawing::CPath2DQuadBezierTo*>(oox_unknown);
convert(pQuadBezierTo);
}break;
case OOX::et_a_cubicBezTo:
{
OOX::Drawing::CPath2DCubicBezierTo* pCubicBezierT = static_cast<OOX::Drawing::CPath2DCubicBezierTo*>(oox_unknown);
convert(pCubicBezierT);
}break;
case OOX::et_a_close:
{
OOX::Drawing::CPath2DClose* pClose= static_cast<OOX::Drawing::CPath2DClose*>(oox_unknown);
convert(pClose);
}break;
case OOX::et_a_r:
{
OOX::Drawing::CRun* pRun= static_cast<OOX::Drawing::CRun*>(oox_unknown);
convert(pRun);
}break;
case OOX::et_a_alphaModFix:
{
OOX::Drawing::CAlphaModulateFixedEffect* pAlpha= static_cast<OOX::Drawing::CAlphaModulateFixedEffect*>(oox_unknown);
if (pAlpha)
{
odf_context()->drawing_context()->set_opacity(pAlpha->m_oAmt.GetValue());
}
}break;
case OOX::et_v_imagedata:
{
OOX::Vml::CImageData *vml = static_cast<OOX::Vml::CImageData*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_textbox:
{
OOX::Vml::CTextbox *vml = static_cast<OOX::Vml::CTextbox*>(oox_unknown);
convert(vml);
}break;
//case OOX::et_v_background:
//{
// OOX::Vml::CBackground *vml = static_cast<OOX::Vml::CBackground*>(oox_unknown);
// convert(vml);
//}break;
case OOX::et_v_path:
{
OOX::Vml::CPath *vml = static_cast<OOX::Vml::CPath*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_textpath:
{
OOX::Vml::CTextPath *vml = static_cast<OOX::Vml::CTextPath*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_fill:
{
OOX::Vml::CFill *vml = static_cast<OOX::Vml::CFill*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_stroke:
{
OOX::Vml::CStroke *vml = static_cast<OOX::Vml::CStroke*>(oox_unknown);
convert(vml);
}break;
case OOX::et_wd_wrap:
{
OOX::VmlWord::CWrap *vml = static_cast<OOX::VmlWord::CWrap*>(oox_unknown);
convert(vml);
}break;
// ""
case OOX::et_w_softHyphen:
case OOX::et_w_proofErr:
case OOX::et_w_proofState:
{
//
}break;
default:
{
int ttt = (int) oox_unknown->getType();
std::wstringstream ss;
ss << L"[warning] : no convert element(" << oox_unknown->getType() << L")\n";
_CP_LOG(error) << ss.str();
OOX::Vml::CVmlShapeElements *vml = dynamic_cast<OOX::Vml::CVmlShapeElements*>(oox_unknown);
if (vml)convert( vml);
else
{
int ttt = (int) oox_unknown->getType();
std::wstringstream ss;
ss << L"[warning] : no convert element(" << oox_unknown->getType() << L")\n";
_CP_LOG(error) << ss.str();
}
}
}
}catch(...)
{
std::wstringstream ss;
ss << L"[error] : no convert element(" << (oox_unknown ? oox_unknown->getType() : -1 ) << L")\n";
_CP_LOG(error) << ss.str();
}
}
......
......@@ -269,6 +269,7 @@ namespace OOX
class CTextbox;
class CTextPath;
class CGroup;
class CVmlAttributes;
}
namespace VmlWord
{
......@@ -431,9 +432,10 @@ public:
void convert(OOX::Vml::CStroke *vml_stroke);
void convert(OOX::Vml::CTextbox *vml_textbox);
void convert(OOX::Vml::CTextPath *vml_textpath);
void convert(SimpleTypes::Vml::CCssStyle *vml_style);
void convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group = false);
void convert(OOX::VmlWord::CWrap *vml_wrap);
void convert(OOX::Vml::CGroup *vml_group);
void convert(OOX::Vml::CVmlAttributes *vml_attr);
};
class Converter
......
......@@ -984,7 +984,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_AxDataSource* cat, int type)
{
if (cat->m_strRef->m_f)odf_context()->chart_context()->set_category_axis_formula(string2std_string(*cat->m_strRef->m_f),type);
convert(cat->m_strRef->m_strCache/*, type == 1 ? true:false*/);
convert(cat->m_strRef->m_strCache,true/*, type == 1 ? true:false*/);
}
else if (cat->m_numRef)
{
......
......@@ -796,7 +796,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
oox_section_pr = last_setion_properties;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
odt_context->page_layout_context()->start_master_page(root ? L"Standart" : L"");
odt_context->page_layout_context()->start_master_page(root ? L"Standard" : L"");
odt_context->set_master_page_name(odt_context->page_layout_context()->last_master().get_name());
......@@ -1484,6 +1484,9 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf::style_tex
}
if (oox_run_pr->m_oOutline.IsInit())
text_properties->content().style_text_outline_ = true; //
if (oox_run_pr->m_oVanish.IsInit())
text_properties->content().text_display_ = odf::text_display(odf::text_display::None);
}
void DocxConverter::convert(SimpleTypes::CTheme<>* oox_font_theme, _CP_OPT(std::wstring) & odf_font_name)
......@@ -1583,6 +1586,14 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
odt_context->start_drawings();
if (odt_context->table_context()->empty())
odf_context()->drawing_context()->set_anchor(odf::anchor_type::AsChar);//default
else
{
odf_context()->drawing_context()->set_anchor(odf::anchor_type::Paragraph);
odf_context()->drawing_context()->set_object_background(true);
}
int type = 1; // shape .. default
if (oox_pic->m_oShapeGroup.IsInit())
{
......@@ -1590,14 +1601,6 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
}
else
{
if (odt_context->table_context()->empty())
odf_context()->drawing_context()->set_anchor(odf::anchor_type::AsChar);//default
else
{
odf_context()->drawing_context()->set_anchor(odf::anchor_type::Paragraph);
odf_context()->drawing_context()->set_object_background(true);
}
if (oox_pic->m_oShape.IsInit())
OoxConverter::convert(oox_pic->m_oShape->m_oStyle.GetPointer());
......@@ -2405,7 +2408,10 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
if (oox_num_lvl->m_oNumFmt->m_oVal.IsInit()== false) return; //???
int type_list = odt_context->styles_context()->lists_styles().start_style_level(oox_num_lvl->m_oIlvl->GetValue(), oox_num_lvl->m_oNumFmt->m_oVal->GetValue());
int oox_type_list = oox_num_lvl->m_oNumFmt->m_oVal->GetValue();
if (oox_num_lvl->m_oLvlPicBulletId.IsInit()) oox_type_list = 1000;
int type_list = odt_context->styles_context()->lists_styles().start_style_level(oox_num_lvl->m_oIlvl->GetValue(), oox_type_list );
if (type_list < 0) return;
odf::style_list_level_properties * level_props = odt_context->styles_context()->lists_styles().get_list_level_properties();
......@@ -2465,17 +2471,19 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
}
if (oox_num_lvl->m_oRPr.IsInit())//
{
odf::odf_style_context* styles_context = /*odt_context->styles_context();*/odf_context()->page_layout_context()->get_local_styles_context();
odf::style_text_properties *text_props = odt_context->styles_context()->lists_styles().get_text_properties();
convert(oox_num_lvl->m_oRPr.GetPointer(), text_props);
//create text style for symbols list
odt_context->styles_context()->create_style(L"",odf::style_family::Text, true, true, -1);
odf::odf_style_state_ptr style_state = odt_context->styles_context()->last_state(odf::style_family::Text);
//create text style for symbols list - (todoo )
styles_context->create_style(L"",odf::style_family::Text, false, true, -1);
odf::odf_style_state_ptr style_state = styles_context->last_state(odf::style_family::Text);
if (style_state)
{
odt_context->styles_context()->lists_styles().set_text_style_name( style_state->get_name());
odf::style_text_properties * text_props_2 = odt_context->styles_context()->last_state()->get_text_properties();
odf::style_text_properties * text_props_2 = style_state->get_text_properties();
if (text_props_2)text_props_2->apply_from(text_props);
}
}
......@@ -2487,9 +2495,20 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
{
odt_context->styles_context()->lists_styles().set_bullet_char(string2std_string(oox_num_lvl->m_oLvlText->m_sVal.get()));
}
if (oox_num_lvl->m_oLvlPicBulletId.IsInit() && type_list == 2)
if (oox_num_lvl->m_oLvlPicBulletId.IsInit() && oox_num_lvl->m_oLvlPicBulletId->m_oVal.IsInit())
{
// bullet
int id = oox_num_lvl->m_oLvlPicBulletId->m_oVal->GetValue();
OOX::CNumbering * lists_styles = docx_document->GetNumbering();
for (long i = 0; (lists_styles) && (i< lists_styles->m_arrNumPicBullet.GetSize()); i++)
{
if (lists_styles->m_arrNumPicBullet[i].m_oNumPicBulletId.GetValue() == id)
{
//convert(lists_styles->m_arrNumPicBullet[i].m_oDrawing.GetPointer());
//convert(lists_styles->m_arrNumPicBullet[i].m_oVmlDrawing.GetPointer());
}
}
}
if (oox_num_lvl->m_oLvlRestart.IsInit() && oox_num_lvl->m_oLvlRestart->m_oVal.IsInit() && type_list == 1)
{
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//133
#define INTVER 1,2,0,133
#define STRVER "1,2,0,133\0"
//134
#define INTVER 1,2,0,134
#define STRVER "1,2,0,134\0"
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