Commit 93179b84 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.138): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58034 954022d7-b5bf-4e40-9824-e11837661b57
parent 2c6618dd
......@@ -903,6 +903,9 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
{
if (!impl_->current_graphic_properties)return;
if (hexColor.length() >0 && hexColor.substr(0,1) == std::wstring(L"#"))
hexColor = hexColor.substr(1,hexColor.length());
switch(impl_->current_drawing_part_)
{
case Area:
......@@ -913,8 +916,10 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
break;
case Line:
impl_->current_graphic_properties->content().svg_stroke_color_ = color(std::wstring(L"#") + hexColor);
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Solid);//default
impl_->current_graphic_properties->content().svg_stroke_width_ = length(length(0.08,length::pt).get_value_unit(length::cm),length::cm);//default
if (!impl_->current_graphic_properties->content().draw_stroke_)
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Solid);//default
if (!impl_->current_graphic_properties->content().svg_stroke_width_)
impl_->current_graphic_properties->content().svg_stroke_width_ = length(length(1,length::pt).get_value_unit(length::cm),length::cm);//default
break;
}
}
......@@ -1677,8 +1682,32 @@ void odf_drawing_context::end_image()
}
void odf_drawing_context::end_text_box()
{
if (impl_->current_drawing_state_.elements_.size() < 1) return;
draw_text_box* draw = dynamic_cast<draw_text_box*>(impl_->current_drawing_state_.elements_.back().elm.get());
if (!draw->draw_text_box_attlist_.fo_min_height_)
{
draw->draw_text_box_attlist_.fo_min_height_= impl_->current_drawing_state_.svg_height_;
}
end_element();
if (impl_->current_graphic_properties->content().svg_stroke_width_)
{
std::wstringstream ss;
ss << impl_->current_graphic_properties->content().svg_stroke_width_->get_length();
if (impl_->current_graphic_properties->content().draw_stroke_)
ss << L" " << *impl_->current_graphic_properties->content().draw_stroke_;
else ss << L" solid";
if (impl_->current_graphic_properties->content().svg_stroke_color_)
ss << L" " << *impl_->current_graphic_properties->content().svg_stroke_color_;
else ss << L" #000000";
impl_->current_graphic_properties->content().common_border_attlist_.fo_border_ = ss.str();
}
end_frame();
}
void odf_drawing_context::end_object()
......@@ -1752,8 +1781,11 @@ void odf_drawing_context::set_text(odf_text_context* text_context)
{
//line
impl_->current_graphic_properties->content().svg_stroke_color_ = color_;
impl_->current_graphic_properties->content().draw_stroke_ = line_style(line_style::Solid);
impl_->current_graphic_properties->content().svg_stroke_width_ = length(0.08,length::pt);
if (!impl_->current_graphic_properties->content().draw_stroke_)
impl_->current_graphic_properties->content().draw_stroke_ = line_style(line_style::Solid);
if (!impl_->current_graphic_properties->content().svg_stroke_width_)
impl_->current_graphic_properties->content().svg_stroke_width_ = length(1,length::pt);
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill(draw_fill::none);
}
else
......
......@@ -388,6 +388,10 @@ void odf_text_context::start_list(std::wstring style_name) //todoooo add new_num
}
list_state_.style_name = style_name;
}
else
{
level = level;
}
text_elements_list_.push_back(state);
if (current_level_.size()>0)
......
......@@ -463,24 +463,30 @@ void odt_conversion_context::start_list_item(int level, std::wstring style_name
{
text_context()->end_list();
}
if (text_context()->list_state_.levels.size() < 1)
{
text_context()->list_state_.started_list = false;
text_context()->list_state_.style_name = L"";
}
if (text_context()->list_state_.started_list == false)
{
text_context()->start_list(style_name);
//text_context()->set_list_continue(true); //??? ????
add_to_root();
text_context()->start_list_item();
}
else
text_context()->start_list_item();
if (text_context()->list_state_.style_name == style_name)
style_name = L"";
while (text_context()->list_state_.levels.size() < level)
{
text_context()->start_list(style_name);
text_context()->start_list_item();
while (text_context()->list_state_.levels.size() < level)
{
text_context()->start_list(L"");
text_context()->start_list_item();
}
}
}
}
void odt_conversion_context::end_list_item()
{
......@@ -791,6 +797,7 @@ void odt_conversion_context::start_table_cell(int col, bool covered, bool styled
}
void odt_conversion_context::end_table_cell()
{
set_no_list();
table_context()->end_cell();
text_context()->end_element();
}
......
......@@ -29,7 +29,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
//m_oPreferRelative//
for (long i=0 ; i < vml_shape_type->m_arrItems.GetSize();i++)
for (long i=0 ; i < vml_shape_type->m_arrItems.size();i++)
{
convert(vml_shape_type->m_arrItems[i]);
}
......@@ -137,7 +137,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
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);
odf_context()->drawing_context()->set_rotate(360 - vml_style->m_arrProperties[i].get_Value().dValue);
}break;
}
}
......@@ -173,10 +173,9 @@ void OoxConverter::convert(OOX::Vml::CShape *vml_shape)
odf_context()->drawing_context()->set_path(string2std_string(vml_shape->m_oPath->GetValue()));
}
for (long i=0 ; i < vml_shape->m_arrItems.GetSize();i++)
{
convert(vml_shape->m_arrItems[i]);
}
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_shape);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CImage *vml_image)
{
......@@ -231,8 +230,22 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
odf_context()->drawing_context()->start_area_properties();
if (vml_fill->m_oOpacity.GetValue() > 0)
odf_context()->drawing_context()->set_opacity(100 - vml_fill->m_oOpacity.GetValue() * 100);
if (vml_fill->m_oOpacity.IsInit() && vml_fill->m_oOpacity2.IsInit() )
{
odf_context()->drawing_context()->start_opacity_style();
odf_context()->drawing_context()->set_opacity_start(100 - vml_fill->m_oOpacity->GetValue() * 100);
odf_context()->drawing_context()->set_opacity_end (100 - vml_fill->m_oOpacity2->GetValue() * 100);
//.....
odf_context()->drawing_context()->end_opacity_style();
}
else if (vml_fill->m_oOpacity.IsInit())
{
odf_context()->drawing_context()->set_opacity(100 - vml_fill->m_oOpacity->GetValue() * 100);
}
else if (vml_fill->m_oOpacity2.IsInit())
{
odf_context()->drawing_context()->set_opacity(100 - vml_fill->m_oOpacity2->GetValue() * 100);
}
odf_context()->drawing_context()->end_area_properties();
}
......@@ -305,7 +318,9 @@ void OoxConverter::convert(OOX::Vml::CShadow *vml_shadow)
if (vml_shadow->m_oOn.GetValue() == false) return;
std::wstring hexColor = string2std_string(vml_shadow->m_oColor.ToString());
_CP_OPT(double) opacity = 100 - 100 * vml_shadow->m_oOpacity.GetValue();
_CP_OPT(double) opacity;
if (vml_shadow->m_oOpacity.IsInit()) opacity = 100 - 100 * vml_shadow->m_oOpacity->GetValue();
double offset_x = vml_shadow->m_oOffset.IsXinPoints() ? vml_shadow->m_oOffset.GetX() : -1;
double offset_y = vml_shadow->m_oOffset.IsYinPoints() ? vml_shadow->m_oOffset.GetY() : -1;
......@@ -337,7 +352,10 @@ void OoxConverter::convert(OOX::Vml::CStroke *vml_stroke)
odf_context()->drawing_context()->set_solid_fill(hexColor);
}
odf_context()->drawing_context()->set_opacity(100 - vml_stroke->m_oOpacity.GetValue() * 100);
if (vml_stroke->m_oOpacity.IsInit())
{
odf_context()->drawing_context()->set_opacity(100 - vml_stroke->m_oOpacity->GetValue() * 100);
}
odf_context()->drawing_context()->set_line_width(vml_stroke->m_oWeight.GetValue());
switch(vml_stroke->m_oStartArrow.GetValue())
......@@ -507,6 +525,26 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
odf_context()->drawing_context()->set_position(vml_common->m_oCoordSize->GetX(), vml_common->m_oCoordSize->GetY());
}
if (vml_common->m_oStrokeWeight.IsInit() || (vml_common->m_oStroked.IsInit() && vml_common->m_oStroked->GetValue()))
{
odf_context()->drawing_context()->start_line_properties();
if (vml_common->m_oStrokeWeight.IsInit())
odf_context()->drawing_context()->set_line_width(vml_common->m_oStrokeWeight->ToPoints());
odf_context()->drawing_context()->set_solid_fill(string2std_string(vml_common->m_oStrokeColor.ToString()));
odf_context()->drawing_context()->end_line_properties();
}
if (vml_common->m_oFillColor.IsInit() && vml_common->m_oFilled.GetValue())
{
odf_context()->drawing_context()->start_area_properties();
odf_context()->drawing_context()->set_solid_fill(string2std_string(vml_common->m_oFillColor->ToString()));
odf_context()->drawing_context()->end_area_properties();
}
for (long i=0 ; i < vml_common->m_arrItems.size();i++)
{
convert(vml_common->m_arrItems[i]);
}
}
void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
{
......
......@@ -253,7 +253,7 @@ void OoxConverter::convert(OOX::Drawing::CShape *oox_shape)
odf_context()->start_text_context();
convert(oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr.GetPointer());
for (long i=0 ; i < oox_shape->m_oTxSp->m_oTxBody->m_arrItems.GetSize();i++)
for (long i=0 ; i < oox_shape->m_oTxSp->m_oTxBody->m_arrItems.size();i++)
{
convert(oox_shape->m_oTxSp->m_oTxBody->m_arrItems[i]);
}
......@@ -281,7 +281,7 @@ void OoxConverter::convert(OOX::Drawing::CLockedCanvas *oox_canvas)
convert(oox_canvas->m_oGroupSpPr.GetPointer());
convert(oox_canvas->m_oSpPr.GetPointer());
for (long i=0; i < oox_canvas->m_arrItems.GetSize(); i++)
for (long i=0; i < oox_canvas->m_arrItems.size(); i++)
{
convert(oox_canvas->m_arrItems[i]);
}
......@@ -535,11 +535,11 @@ void OoxConverter::convert(OOX::Drawing::CCustomGeometry2D *oox_cust_geom)
{
if (!oox_cust_geom)return;
for (long i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.GetSize();i++)
for (long i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.size();i++)
{
convert(&oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
for (long i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.GetSize();i++)
for (long i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.size();i++)
{
convert(&oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
......@@ -606,7 +606,7 @@ void OoxConverter::convert(OOX::Drawing::CPresetGeometry2D *oox_prst_geom)
if (oox_prst_geom->m_oAvLst.IsInit())
{
for (long i=0; i<oox_prst_geom->m_oAvLst->m_arrGd.GetSize(); i++)
for (long i=0; i<oox_prst_geom->m_oAvLst->m_arrGd.size(); i++)
{
odf_context()->drawing_context()->add_modifier(string2std_string(oox_prst_geom->m_oAvLst->m_arrGd[i].m_oFmla.GetValue()));
}
......@@ -618,7 +618,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2D *oox_geom_path)
odf_context()->drawing_context()->set_viewBox(oox_geom_path->m_oW.GetValue(), oox_geom_path->m_oH.GetValue());
for (long i =0 ; i< oox_geom_path->m_arrItems.GetSize(); i++)
for (long i =0 ; i< oox_geom_path->m_arrItems.size(); i++)
{
convert(oox_geom_path->m_arrItems[i]);
}
......@@ -628,7 +628,7 @@ void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, CString *
{
if (oox_effect_list == NULL) return;
for (long i=0;i< oox_effect_list->m_arrEffects.GetSize(); i++)
for (long i=0;i< oox_effect_list->m_arrEffects.size(); i++)
{
switch(oox_effect_list->m_arrEffects[i]->getType())
{
......@@ -726,7 +726,7 @@ void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, C
sID = oox_bitmap_fill->m_oBlip->m_oLink.GetValue();
//...
}
for (long i=0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.GetSize(); i++)
for (long i=0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.size(); i++)
convert(oox_bitmap_fill->m_oBlip->m_arrEffects[i]);
}
if (oox_bitmap_fill->m_oSrcRect.IsInit() && Width >0 && Height >0)//
......@@ -797,7 +797,7 @@ void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill,
}
odf_context()->drawing_context()->set_gradient_type(grad_style);
if (oox_grad_fill->m_oGsLst.IsInit() && oox_grad_fill->m_oGsLst->m_arrGs.GetSize()>1)
if (oox_grad_fill->m_oGsLst.IsInit() && oox_grad_fill->m_oGsLst->m_arrGs.size()>1)
{
std::wstring hexColorStart, hexColorEnd;
_CP_OPT(double) opacityStart, opacityEnd;
......@@ -805,9 +805,9 @@ void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill,
if (change_sheme_color && oox_grad_fill->m_oGsLst->m_arrGs[0].m_eType == OOX::Drawing::colorSheme)
{
oox_grad_fill->m_oGsLst->m_arrGs[0].m_oShemeClr.m_oVal.FromString(*change_sheme_color);
oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.GetSize()-1].m_oShemeClr.m_oVal.FromString(*change_sheme_color);
oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.size()-1].m_oShemeClr.m_oVal.FromString(*change_sheme_color);
}
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.GetSize()-1]),hexColorStart, opacityStart);
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.size()-1]),hexColorStart, opacityStart);
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[0]),hexColorEnd, opacityEnd);
odf_context()->drawing_context()->set_gradient_start(hexColorStart, opacityStart);
......@@ -1069,7 +1069,7 @@ void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr)
}
if (oox_bodyPr->m_oFromWordArt.ToBool() && oox_bodyPr->m_oPrstTxWrap.IsInit())
{
for (long i=0; i< oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd.GetSize(); i++)
for (long i=0; i< oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd.size(); i++)
{
odf_context()->drawing_context()->add_modifier(string2std_string(oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd[i].m_oFmla.GetValue()));
}
......@@ -1328,7 +1328,7 @@ void OoxConverter::convert(OOX::Drawing::CParagraph *oox_paragraph)
odf_context()->text_context()->start_paragraph(styled);
for (long i=0; i< oox_paragraph->m_arrItems.GetSize();i++)
for (long i=0; i< oox_paragraph->m_arrItems.size();i++)
{
convert(oox_paragraph->m_arrItems[i]);
}
......
......@@ -700,7 +700,7 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
if (outline_level > 0) paragraph_properties->content().outline_level_ = outline_level /*+1*/;
odt_context->text_context()->set_outline_level (outline_level);
}
if (oox_paragraph_pr->m_oPageBreakBefore.IsInit())
if (oox_paragraph_pr->m_oPageBreakBefore.IsInit() && oox_paragraph_pr->m_oPageBreakBefore->m_oVal.ToBool())
{
paragraph_properties->content().fo_break_before_ = odf::fo_break(odf::fo_break::Page);
odt_context->text_context()->set_type_break(1, 0); //page, clear_all
......@@ -1364,7 +1364,13 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf::style_tex
else
text_properties->content().fo_font_weight_ = odf::font_weight(odf::font_weight::WNormal);
}
convert(oox_run_pr->m_oColor.GetPointer(),text_properties->content().fo_color_);
if (oox_run_pr->m_oColor.IsInit())
{
if(oox_run_pr->m_oColor->m_oVal.IsInit() && oox_run_pr->m_oColor->m_oVal->GetValue() == SimpleTypes::hexcolorAuto)
text_properties->content().fo_color_ = odf::color(L"#000000");
else
convert(oox_run_pr->m_oColor.GetPointer(),text_properties->content().fo_color_);
}
text_properties->content().style_text_underline_type_= odf::line_type(odf::line_type::None);
if (oox_run_pr->m_oU.IsInit())
......@@ -1837,6 +1843,19 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
else
odt_context->drawing_context()->set_horizontal_pos(SimpleTypes::alignhLeft);
}
if (oox_anchor->m_oBehindDoc.IsInit())
{
if (oox_anchor->m_oBehindDoc->ToBool())
{
odt_context->drawing_context()->set_object_background(true);
//odt_context->drawing_context()->set_object_foreground(true);
}
else
{
//z - order foreground
odt_context->drawing_context()->set_object_foreground(true);
}
}
if (oox_anchor->m_oWrapSquare.IsInit())
{
if (oox_anchor->m_oWrapSquare->m_oWrapText.IsInit() && oox_anchor->m_oWrapSquare->m_oWrapText->GetValue() == SimpleTypes::wraptextLargest)
......@@ -1860,25 +1879,6 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
{
odt_context->drawing_context()->set_overlap(oox_anchor->m_oAllowOverlap->ToBool());
}
if (oox_anchor->m_oBehindDoc.IsInit())
{
if (oox_anchor->m_oBehindDoc->ToBool())
{
odt_context->drawing_context()->set_object_background(true);
//odt_context->drawing_context()->set_object_foreground(true);
}
else
{
//z - order foreground
odt_context->drawing_context()->set_object_foreground(true);
}
}
else
{
//always ??? foreground ????
//odt_context->drawing_context()->set_object_background(true);
}
OoxConverter::convert(oox_anchor->m_oDocPr.GetPointer());
convert(oox_anchor->m_oGraphic.GetPointer());
}
......@@ -1917,7 +1917,7 @@ void DocxConverter::convert(OOX::Drawing::CGraphic *oox_graphic)
{
if (oox_graphic == NULL)return;
for (long i = 0 ; i < oox_graphic->m_arrItems.GetSize(); i++)
for (long i = 0 ; i < oox_graphic->m_arrItems.size(); i++)
{
convert(oox_graphic->m_arrItems[i]);
}
......@@ -2084,7 +2084,7 @@ void DocxConverter::convert(OOX::Drawing::CChart * oox_chart)
void DocxConverter::convert(OOX::Logic::CGroupShape *oox_group_shape)
{
if (oox_group_shape == NULL)return;
if (oox_group_shape->m_arrItems.GetSize() < 1) return;
if (oox_group_shape->m_arrItems.size() < 1) return;
odt_context->drawing_context()->start_group();
if (oox_group_shape->m_oCNvPr.IsInit())
......@@ -2096,7 +2096,7 @@ void DocxConverter::convert(OOX::Logic::CGroupShape *oox_group_shape)
}
OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
for (long i=0; i < oox_group_shape->m_arrItems.GetSize(); i++)
for (long i=0; i < oox_group_shape->m_arrItems.size(); i++)
{
convert(oox_group_shape->m_arrItems[i]);
}
......@@ -2111,7 +2111,7 @@ void DocxConverter::convert(OOX::Logic::CLockedCanvas *oox_canvas)
odf_context()->drawing_context()->set_group_position(0,0, 0, 0);
for (long i=0; i < oox_canvas->m_arrItems.GetSize(); i++)
for (long i=0; i < oox_canvas->m_arrItems.size(); i++)
{
convert(oox_canvas->m_arrItems[i]);
}
......@@ -2324,7 +2324,6 @@ void DocxConverter::convert_lists_styles()
//parent ???
//create_new_style (in automatic main document??? )
}
else
{
int abstr_num = 0;
if (lists_styles->m_arrNum[i].m_oAbstractNumId.IsInit() && lists_styles->m_arrNum[i].m_oAbstractNumId->m_oVal.IsInit())
......@@ -2596,7 +2595,10 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
{
convert(lists_styles->m_arrNumPicBullet[i]->m_oVmlDrawing.GetPointer());
}
odt_context->styles_context()->lists_styles().set_bullet_image(odt_context->mediaitems()->items().back().odf_ref);
if (odt_context->mediaitems()->items().size() > 0)
{
odt_context->styles_context()->lists_styles().set_bullet_image(odt_context->mediaitems()->items().back().odf_ref);
}
}
}
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//136
#define INTVER 1,2,0,136
#define STRVER "1,2,0,136\0"
//139
#define INTVER 1,2,0,139
#define STRVER "1,2,0,139\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