Commit 25d7daf6 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.124): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57699 954022d7-b5bf-4e40-9824-e11837661b57
parent a257ae5e
......@@ -259,7 +259,7 @@ void odf_drawing_context::set_footer_header_state(bool Val)
impl_->is_footer_header_ = Val;
}
void odf_drawing_context::start_group(std::wstring name, int id)
void odf_drawing_context::start_group()
{
office_element_ptr & group_elm = impl_->create_draw_element(5000);
......@@ -280,10 +280,50 @@ void odf_drawing_context::start_group(std::wstring name, int id)
if (group== NULL)return;
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = name;
if (id >=0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = id;
// - -
if (impl_->current_drawing_state_.name_.length() > 0)
group->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)
group->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_;
impl_->current_drawing_state_.name_ = L"";
impl_->current_drawing_state_.z_order_ = -1;
////////////////////////////////////////////////////////////////////////////////////////
//////////
impl_->styles_context_->create_style(L"",style_family::Graphic, true, false, -1);
office_element_ptr & style_group_elm = impl_->styles_context_->last_state()->get_office_element();
std::wstring style_name;
style* style_ = dynamic_cast<style*>(style_group_elm.get());
if (style_)
{
style_name = style_->style_name_;
impl_->current_graphic_properties = style_->style_content_.get_style_graphic_properties();
}
group->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);
impl_->current_graphic_properties->content().style_wrap_ = impl_->anchor_settings_.style_wrap_;
impl_->current_graphic_properties->content().style_run_through_ = impl_->anchor_settings_.run_through_;
impl_->current_graphic_properties->content().common_vertical_pos_attlist_.style_vertical_pos_ = impl_->anchor_settings_.style_vertical_pos_;
impl_->current_graphic_properties->content().common_horizontal_pos_attlist_.style_horizontal_pos_ = impl_->anchor_settings_.style_horizontal_pos_;
impl_->current_graphic_properties->content().common_vertical_rel_attlist_.style_vertical_rel_ = impl_->anchor_settings_.style_vertical_rel_;
impl_->current_graphic_properties->content().common_horizontal_rel_attlist_.style_horizontal_rel_ = impl_->anchor_settings_.style_horizontal_rel_;
impl_->current_graphic_properties->content().common_horizontal_margin_attlist_.fo_margin_left_ = impl_->anchor_settings_.fo_margin_left_;
impl_->current_graphic_properties->content().common_vertical_margin_attlist_.fo_margin_top_ = impl_->anchor_settings_.fo_margin_top_;
impl_->current_graphic_properties->content().common_horizontal_margin_attlist_.fo_margin_right_ = impl_->anchor_settings_.fo_margin_right_;
impl_->current_graphic_properties->content().common_vertical_margin_attlist_.fo_margin_bottom_ = impl_->anchor_settings_.fo_margin_bottom_;
if (group)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_text_spreadsheet_shape_attlist_.common_text_anchor_attlist_.type_ = impl_->anchor_settings_.anchor_type_;
//
}
void odf_drawing_context::end_group()
{
......@@ -436,9 +476,11 @@ void odf_drawing_context::end_drawing()
if (draw)
draw->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_text_spreadsheet_shape_attlist_.common_text_anchor_attlist_.type_ = impl_->anchor_settings_.anchor_type_;
//if (impl_->current_drawing_state_.in_group == false)
//{
impl_->current_graphic_properties->content().style_wrap_ = impl_->anchor_settings_.style_wrap_;
impl_->current_graphic_properties->content().style_run_through_ = impl_->anchor_settings_.run_through_;
//}
///////////////////////////////////////////////////
impl_->drawing_list_.push_back(impl_->current_drawing_state_);
......@@ -713,9 +755,10 @@ void odf_drawing_context::start_frame()
if (impl_->current_graphic_properties)
{
impl_->anchor_settings_.run_through_ = run_through(run_through::Background);
if (!impl_->anchor_settings_.style_wrap_)
{
impl_->anchor_settings_.style_wrap_ = style_wrap(style_wrap::RunThrough);
}
impl_->current_graphic_properties->content().common_background_color_attlist_.fo_background_color_ = odf::background_color(odf::background_color::Transparent);
}
}
......@@ -848,10 +891,13 @@ void odf_drawing_context::set_z_order(int id)
{
if (id < 0)
id = 0x7fffffff + id;
if (impl_->current_drawing_state_.in_group)
impl_->current_drawing_state_.z_order_ = 0x7fffffff - id;
else
impl_->current_drawing_state_.z_order_ = id;
//if (impl_->current_drawing_state_.in_group)
//{
// id += (impl_->current_group_->level+1) *100;
//}
impl_->current_drawing_state_.z_order_ =id;
}
void odf_drawing_context::add_path_element(std::wstring command, std::wstring & strE)
{
......@@ -1052,7 +1098,11 @@ void odf_drawing_context::set_wrap_style(style_wrap::type type)
}
void odf_drawing_context::set_overlap (bool val)
{
if (val) impl_->anchor_settings_.style_wrap_ = style_wrap(style_wrap::RunThrough);//??
if (val)
{
impl_->anchor_settings_.style_wrap_ = style_wrap(style_wrap::RunThrough);//??
//impl_->anchor_settings_.run_through_ = run_through(run_through::Foreground);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void odf_drawing_context::set_group_position(double x, double y, double ch_x, double ch_y)
......@@ -1115,7 +1165,25 @@ void odf_drawing_context::set_group_flip_V(bool bVal)
impl_->current_group_->flipV= bVal;
}
void odf_drawing_context::set_group_z_order(int Val)
{
if (impl_->group_list_.size()<1)return;
draw_g* group = dynamic_cast<draw_g*>(impl_->current_group_->elm.get());
if (Val >= 0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = Val;
}
void odf_drawing_context::set_group_name(std::wstring name)
{
if (impl_->group_list_.size()<1)return;
draw_g* group = dynamic_cast<draw_g*>(impl_->current_group_->elm.get());
if (name.length() > 0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = name;
}
void odf_drawing_context::set_group_flip_H(bool bVal)
{
if (impl_->group_list_.size()<1)return;
......@@ -1463,6 +1531,10 @@ void odf_drawing_context::start_text_box()
if (impl_->is_footer_header_ ==false)
set_text_box_parent_style(L"Frame");
start_area_properties();
set_no_fill();
end_area_properties();
}
void odf_drawing_context::set_text_box_min_size(double w_pt, double h_pt)
{
......
......@@ -59,17 +59,15 @@ public:
void start_drawing();
void end_drawing();
void start_group(std::wstring name, int id);
//void set_group_size_koef( double cx, double cy);
//void set_group_position_delta(double x_pt, double y_pt);
//void set_group_child_position (double x_pt, double y_pt);
void set_group_flip_H(bool bVal);
void set_group_flip_V(bool bVal);
void set_group_rotate(int iVal);
void set_group_size( double cx, double cy, double ch_cx, double ch_cy);
void set_group_position(double x, double y, double ch_x, double ch_y);
void start_group();
void set_group_flip_H (bool bVal);
void set_group_flip_V (bool bVal);
void set_group_z_order (int Val);
void set_group_name (std::wstring name);
void set_group_rotate (int iVal);
void set_group_size (double cx, double cy, double ch_cx, double ch_cy);
void set_group_position (double x, double y, double ch_x, double ch_y);
void end_group();
void start_shape(int type);
......
......@@ -310,6 +310,7 @@ void OoxConverter::convert(OOX::Vml::CStroke *vml_stroke)
{
if (vml_stroke == NULL) return;
if (vml_stroke->m_oOn.GetValue() == false) return;
if (vml_stroke->m_oColor.IsInit() == false) return; // ?????
//nullable<SimpleTypes::CColorType<SimpleTypes::colortypeBlack>> m_oColor2;
//SimpleTypes::Vml::CVmlDashStyle<SimpleTypes::Vml::vmldashstyleSolid> m_oDahsStyle;
......@@ -322,9 +323,12 @@ void OoxConverter::convert(OOX::Vml::CStroke *vml_stroke)
//switch(vml_stroke->m_oFillType){}
std::wstring hexColor = string2std_string(vml_stroke->m_oColor.ToString());
if (hexColor.length() < 1)hexColor = L"000000";
odf_context()->drawing_context()->set_solid_fill(hexColor);
if (vml_stroke->m_oColor.IsInit())
{
std::wstring hexColor = string2std_string(vml_stroke->m_oColor->ToString());
if (hexColor.length() < 1)hexColor = L"000000";
odf_context()->drawing_context()->set_solid_fill(hexColor);
}
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());
......@@ -467,7 +471,7 @@ void OoxConverter::convert(OOX::Vml::CGroup * vml_group)
{
if (vml_group == NULL) return;
odf_context()->drawing_context()->start_group(L"",1);
odf_context()->drawing_context()->start_group();
if (vml_group->m_oShapeGroup.IsInit())
{
......
......@@ -164,6 +164,13 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
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);
......
......@@ -267,11 +267,6 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
OOX::Logic::CTc* pCell= static_cast<OOX::Logic::CTc*>(oox_unknown);
convert(pCell);
}break;
case OOX::et_w_proofErr:
case OOX::et_w_proofState:
{
//
}break;
default:
{
OoxConverter::convert(oox_unknown);
......@@ -1612,23 +1607,6 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
_CP_OPT(double) width, height;
_CP_OPT(double) x, y;
if (oox_anchor->m_oBehindDoc.IsInit())
{
if (oox_anchor->m_oBehindDoc->ToBool())
{
odt_context->drawing_context()->set_object_background(true);
}
else
{
//z - order foreground
}
}
else
{
//always ??? foreground ????
odt_context->drawing_context()->set_object_foreground(true);
}
if (oox_anchor->m_oExtent.IsInit()) //size
{
width = oox_anchor->m_oExtent->m_oCx.ToPoints();
......@@ -1688,6 +1666,25 @@ 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());
}
......@@ -1839,26 +1836,20 @@ void DocxConverter::convert(OOX::Logic::CGroupShape *oox_group_shape)
if (oox_group_shape == NULL)return;
if (oox_group_shape->m_arrItems.GetSize() < 1) return;
std::wstring name;
int id = -1;
if (oox_group_shape->m_oCNvPr.IsInit())
{
if (oox_group_shape->m_oCNvPr->m_sName.IsInit())
name = string2std_string(*oox_group_shape->m_oCNvPr->m_sName);
if (oox_group_shape->m_oCNvPr->m_oId.IsInit())
id = oox_group_shape->m_oCNvPr->m_oId->GetValue();
}
odt_context->drawing_context()->start_group(name,id);
OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
for (long i=0; i < oox_group_shape->m_arrItems.GetSize(); i++)
{
convert(oox_group_shape->m_arrItems[i]);
}
odt_context->drawing_context()->start_group();
if (oox_group_shape->m_oCNvPr.IsInit())
{
if (oox_group_shape->m_oCNvPr->m_sName.IsInit())
odt_context->drawing_context()->set_group_name(string2std_string(*oox_group_shape->m_oCNvPr->m_sName));
if (oox_group_shape->m_oCNvPr->m_oId.IsInit())
odt_context->drawing_context()->set_group_z_order(oox_group_shape->m_oCNvPr->m_oId->GetValue());
}
OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
for (long i=0; i < oox_group_shape->m_arrItems.GetSize(); i++)
{
convert(oox_group_shape->m_arrItems[i]);
}
odt_context->drawing_context()->end_group();
}
void DocxConverter::convert(OOX::Logic::CShape *oox_shape)
......@@ -1884,15 +1875,17 @@ void DocxConverter::convert(OOX::Logic::CShape *oox_shape)
type = 2000; //textBox
}
//if (type == SimpleTypes::shapetypeRect && oox_shape->m_oTxBody.IsInit() && oox_shape->m_oTxBodyProperties.IsInit() /*&&
// oox_shape->m_oTxBodyProperties->m_eAutoFitType == OOX::Drawing::textautofitShape*/)
//{
// type = 2000;// , , ...
//}
if (type == SimpleTypes::shapetypeRect && oox_shape->m_oTxBody.IsInit() && oox_shape->m_oTxBodyProperties.IsInit() /*&&
oox_shape->m_oTxBodyProperties->m_eAutoFitType == OOX::Drawing::textautofitShape*/)
{
type = 2000;// , , ...
// .
// - drawing_context -
//todooo
}
if (type < 0)return;
/////////////////////////////////////////////////////////////////////////////////
if (type == 2000) odt_context->drawing_context()->start_text_box();
else odt_context->drawing_context()->start_shape(type);
odt_context->drawing_context()->start_shape(type);
OoxConverter::convert(oox_shape->m_oSpPr.GetPointer(), oox_shape->m_oShapeStyle.GetPointer());
//, , ...
......@@ -1921,8 +1914,7 @@ void DocxConverter::convert(OOX::Logic::CShape *oox_shape)
}
OoxConverter::convert(oox_shape->m_oTxBodyProperties.GetPointer());
if (type == 2000) odt_context->drawing_context()->end_text_box();
else odt_context->drawing_context()->end_shape();
odt_context->drawing_context()->end_shape();
odt_context->drawing_context()->end_drawing();
}
......@@ -2026,6 +2018,9 @@ void DocxConverter::convert_settings()
//nullable<OOX::Settings::CCaptions> m_oCaptions;
//m_oFootnotePr;
}
//void DocxConverter::convert_styles_li()
//{
//}
void DocxConverter::convert_styles()
{
if (!odt_context) return;
......@@ -2042,7 +2037,6 @@ void DocxConverter::convert_styles()
{
convert(&docx_styles->m_arrStyle[i]);
}
}
void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
......@@ -2064,7 +2058,6 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
//nullable<SimpleTypes::COnOff<SimpleTypes::onoffFalse> > m_oHistory;
//nullable<CString > m_sTgtFrame;
//nullable<CString > m_sTooltip;
}
void DocxConverter::convert(OOX::CDocDefaults *def_style)
......
......@@ -1498,19 +1498,18 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGroupShape* oox_group_shape)
if (!oox_group_shape)return;
if (oox_group_shape->m_arrItems.GetSize() < 1) return;
std::wstring name;
int id = -1;
ods_context->drawing_context()->start_group();
if (oox_group_shape->m_oNvGroupSpPr.IsInit())
{
if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr.IsInit())
{
if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_sName.IsInit())
name = string2std_string(*oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_sName);
ods_context->drawing_context()->set_group_name(string2std_string(*oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_sName));
if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_oId.IsInit())
id = oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_oId->GetValue();
ods_context->drawing_context()->set_group_z_order(oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_oId->GetValue());
}
}
ods_context->drawing_context()->start_group(name,id);
OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//122
#define INTVER 1,2,0,122
#define STRVER "1,2,0,122\0"
//125
#define INTVER 1,2,0,125
#define STRVER "1,2,0,125\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