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

ASCOfficeOdfFileW

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57971 954022d7-b5bf-4e40-9824-e11837661b57
parent 92027a2c
......@@ -349,8 +349,6 @@ void odf_drawing_context::clear()
void odf_drawing_context::start_drawing()
{
//impl_->current_drawing_state_.clear();
//if (impl_->current_level_.size() < 1)
{
impl_->current_drawing_state_.svg_x_ = impl_->anchor_settings_.svg_x_;
......@@ -722,8 +720,6 @@ void odf_drawing_context::end_shape()
if (shape_define)
{
//impl_->current_drawing_state_.rotateAngle = boost::none; ??? ???
enhanced->svg_viewbox_ = shape_define->view_box;
enhanced->draw_enhanced_geometry_attlist_.draw_type_ = shape_define->odf_type_name;
enhanced->draw_enhanced_geometry_attlist_.draw_text_areas_ = shape_define->text_areas;
......@@ -1731,7 +1727,7 @@ void odf_drawing_context::set_text(odf_text_context* text_context)
//
impl_->current_graphic_properties->content().draw_auto_grow_height_ = false;
impl_->current_graphic_properties->content().draw_auto_grow_width_ = false;
impl_->current_graphic_properties->content().draw_fit_to_size_ = false;//???
//impl_->current_graphic_properties->content().draw_fit_to_size_ = false;//???
}
......
......@@ -40,6 +40,7 @@ public:
style_list_level_label_alignment * get_list_level_alignment_properties();
style_text_properties * get_text_properties();
void set_bullet_image (std::wstring ref);
void set_bullet_char (std::wstring val);
void set_start_number (int val);
void set_text_style_name(std::wstring val);
......
......@@ -21,31 +21,6 @@
namespace Oox2Odf
{
void OoxConverter::convert(OOX::Vml::CVmlShapeElements *unknown)
{
if (unknown == NULL) return;
switch(unknown->getType())
{
case OOX::et_v_image:
{
OOX::Vml::CImage *vml = static_cast<OOX::Vml::CImage*>(unknown);
convert(vml);
}break;
//et_v_f, // <v:f>
//et_v_formulas, // <v:formulas>
//et_v_group, // <v:group>
//et_v_h, // <v:h>
//et_v_handles, // <v:handles>
//et_v_shadow, // <v:shadow>
default:
{
std::wstringstream ss;
ss << L"[warning] : no convert vml element(" << unknown->getType() << L")\n";
_CP_LOG(error) << ss.str();
}
}
}
void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
{
if (vml_shape_type == NULL) return;
......@@ -68,7 +43,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
//m_arrItems
//CVmlAttributes
//CVmlCommonElements
}
void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
......@@ -186,7 +161,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
}
void OoxConverter::convert(OOX::Vml::CShape *vml_shape)
{
if (vml_shape == NULL) return;
if (vml_shape == NULL) return;
if (vml_shape->m_oAllowInCell.GetValue())
{
......@@ -242,7 +217,8 @@ void OoxConverter::convert(OOX::Vml::CArc *vml_arc)
{
if (vml_arc == NULL) return;
convert(vml_arc->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_arc);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CBackground *vml_background)
{
......@@ -264,14 +240,15 @@ void OoxConverter::convert(OOX::Vml::CLine *vml_line)
{
if (vml_line == NULL) return;
convert(vml_line->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_line);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::COval *vml_oval)
{
if (vml_oval == NULL) return;
convert(vml_oval->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_oval);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CPath *vml_path)
{
......@@ -296,28 +273,31 @@ void OoxConverter::convert(OOX::Vml::CPolyLine *vml_polyline)
{
if (vml_polyline == NULL) return;
convert(vml_polyline->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_polyline);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CRect *vml_rect)
{
if (vml_rect == NULL) return;
convert(vml_rect->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_rect);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CRoundRect *vml_roundrect)
{
if (vml_roundrect == NULL) return;
convert(vml_roundrect->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_roundrect);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CCurve *vml_curve)
{
if (vml_curve == NULL) return;
convert(vml_curve->m_oStyle.GetPointer());
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_curve);
convert(vml_common);
}
void OoxConverter::convert(OOX::Vml::CShadow *vml_shadow)
{
......@@ -400,8 +380,17 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
if (vml_textbox->m_oTxtbxContent.IsInit() == false) return;
if (vml_textbox->m_oTxtbxContent->m_arrItems.GetSize() < 1) return;
convert(vml_textbox->m_oStyle.GetPointer());
if (vml_textbox->m_oInsetMode.GetValue() == SimpleTypes::insetmodeCustom)
{
odf_context()->drawing_context()->set_textarea_padding(odf::length(vml_textbox->m_oInset.GetLeft(0), odf::length::pt).get_value_unit(odf::length::cm),
odf::length(vml_textbox->m_oInset.GetTop(0), odf::length::pt).get_value_unit(odf::length::cm),
odf::length(vml_textbox->m_oInset.GetRight(0), odf::length::pt).get_value_unit(odf::length::cm),
odf::length(vml_textbox->m_oInset.GetBottom(0), odf::length::pt).get_value_unit(odf::length::cm));
}
odf_context()->drawing_context()->set_textarea_wrap(true);
DocxConverter *docx_converter = dynamic_cast<DocxConverter*>(this);
......@@ -413,10 +402,6 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
odf_context()->drawing_context()->set_text( odf_context()->text_context());
odf_context()->end_text_context();
odf_context()->drawing_context()->set_textarea_wrap(true);
}
void OoxConverter::convert(OOX::Vml::CTextPath *vml_textpath)
{
......@@ -511,16 +496,23 @@ void OoxConverter::convert(OOX::VmlWord::CWrap *vml_wrap)
}
}
}
void OoxConverter::convert(OOX::Vml::CVmlAttributes *vml_attr)
void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
{
if (vml_attr == NULL) return;
if (vml_common == NULL) return;
convert(vml_attr->m_oStyle.GetPointer());
convert(vml_common->m_oStyle.GetPointer());
if (vml_attr->m_oCoordSize.IsInit())
if (vml_common->m_oCoordSize.IsInit())
{
odf_context()->drawing_context()->set_position(vml_attr->m_oCoordSize->GetX(), vml_attr->m_oCoordSize->GetY());
odf_context()->drawing_context()->set_position(vml_common->m_oCoordSize->GetX(), vml_common->m_oCoordSize->GetY());
}
if (vml_common->m_oInsetMode.GetValue() == SimpleTypes::insetmodeCustom)
{
//odf_context()->drawing_context()->set_textarea_padding(vml_common->m_oInset.GetLeft(0), vml_common->m_oInset.GetTop(0),
// vml_common->m_oInset.GetRight(0), vml_common->m_oInset.GetBottom(0));
}
}
void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
{
......@@ -543,21 +535,21 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
continue;
}
OOX::Vml::CVmlAttributes * vml_attr = dynamic_cast<OOX::Vml::CVmlAttributes*>(vml_group->m_arrItems[i]);
OOX::Vml::CVmlCommonElements * vml_common = static_cast<OOX::Vml::CVmlCommonElements*>(vml_group->m_arrItems[i]);
if (vml_attr == NULL) continue; //
if (vml_common == NULL) continue; //
convert(vml_attr);
convert(vml_common);
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);
//OOX::Vml::CVmlShapeElements * vml_elm = static_cast<OOX::Vml::CVmlShapeElements*>(oox_unknown);
//if (vml_elm) vml_elm-> convert(vml_common);
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]);
OOX::Vml::CShape * vml = static_cast<OOX::Vml::CShape*>(vml_group->m_arrItems[i]);
bool bSet = false;
if (vml)
{
......@@ -590,7 +582,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
}break;
case OOX::et_v_shapetype:
{
OOX::Vml::CShapeType * vml = dynamic_cast<OOX::Vml::CShapeType*>(vml_group->m_arrItems[i]);
OOX::Vml::CShapeType * vml = static_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);
......@@ -598,28 +590,28 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
}break;
case OOX::et_v_oval:
{
OOX::Vml::COval * vml = dynamic_cast<OOX::Vml::COval*>(vml_group->m_arrItems[i]);
OOX::Vml::COval * vml = static_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]);
OOX::Vml::CRect * vml = static_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]);
OOX::Vml::CLine * vml = static_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]);
OOX::Vml::CCurve * vml = static_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();
......
......@@ -176,6 +176,11 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
OOX::Vml::CStroke *vml = static_cast<OOX::Vml::CStroke*>(oox_unknown);
convert(vml);
}break;
case OOX::et_v_image:
{
OOX::Vml::CImage *vml = static_cast<OOX::Vml::CImage*>(oox_unknown);
convert(vml);
}break;
case OOX::et_wd_wrap:
{
OOX::VmlWord::CWrap *vml = static_cast<OOX::VmlWord::CWrap*>(oox_unknown);
......@@ -191,15 +196,10 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
default:
{
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();
}
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(...)
......
......@@ -249,7 +249,6 @@ namespace OOX
}
namespace Vml
{
class CVmlShapeElements;
class CShapeType;
class CShape;
class CImage;
......@@ -269,7 +268,7 @@ namespace OOX
class CTextbox;
class CTextPath;
class CGroup;
class CVmlAttributes;
class CVmlCommonElements;
}
namespace VmlWord
{
......@@ -412,8 +411,6 @@ public:
//.vml............................................................................................................................
void convert(OOX::Vml::CVmlShapeElements *vml);
void convert(OOX::Vml::CShapeType *vml_shape_type);
void convert(OOX::Vml::CShape *vml_shape);
void convert(OOX::Vml::CImage *vml_image);
......@@ -435,7 +432,7 @@ public:
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);
void convert(OOX::Vml::CVmlCommonElements *vml_attr);
};
class Converter
......
......@@ -111,6 +111,7 @@ CString DocxConverter::find_link_by_id (CString sId, int type)
}
}
}
smart_ptr<OOX::File> oFile = docx_document->GetDocument()->Find(sId);
if (ref.GetLength() < 1 && oFile.IsInit())
{
......@@ -2245,6 +2246,8 @@ void DocxConverter::convert_lists_styles()
OOX::CNumbering * lists_styles = docx_document->GetNumbering();
if (!lists_styles)return;
oox_current_child_document = dynamic_cast<OOX::IFileContainer*>(lists_styles);
//
for (long i=0; i < lists_styles->m_arrAbstractNum.GetSize(); i++)
{
......@@ -2271,6 +2274,7 @@ void DocxConverter::convert_lists_styles()
convert(&lists_styles->m_arrNum[i]);//for override ???
}
oox_current_child_document = NULL;
//nullable<ComplexTypes::Word::CDecimalNumber > m_oNumIdMacAtCleanup;
}
void DocxConverter::convert_styles()
......@@ -2502,10 +2506,17 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
for (long i = 0; (lists_styles) && (i< lists_styles->m_arrNumPicBullet.GetSize()); i++)
{
if (lists_styles->m_arrNumPicBullet[i].m_oNumPicBulletId.GetValue() == id)
if ((lists_styles->m_arrNumPicBullet[i]) && (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 (lists_styles->m_arrNumPicBullet[i]->m_oDrawing.IsInit())
{
convert(lists_styles->m_arrNumPicBullet[i]->m_oDrawing.GetPointer());
}
else
{
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);
}
}
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//134
#define INTVER 1,2,0,134
#define STRVER "1,2,0,134\0"
//135
#define INTVER 1,2,0,135
#define STRVER "1,2,0,135\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