Commit 95899e23 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormat - fix after testing

parent 234e19d6
...@@ -54,7 +54,7 @@ int _tmain(int argc, _TCHAR* argv[]) ...@@ -54,7 +54,7 @@ int _tmain(int argc, _TCHAR* argv[])
HRESULT hr = S_OK; HRESULT hr = S_OK;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1]; std::wstring srcFileName = argv[1];
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.pptx"; //xlsx pptx docx std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx docx
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath); std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
......
...@@ -453,6 +453,7 @@ void draw_enhanced_geometry_attlist::add_attributes( const xml::attributes_wc_pt ...@@ -453,6 +453,7 @@ void draw_enhanced_geometry_attlist::add_attributes( const xml::attributes_wc_pt
CP_APPLY_ATTR(L"draw:modifiers" , draw_modifiers_); CP_APPLY_ATTR(L"draw:modifiers" , draw_modifiers_);
CP_APPLY_ATTR(L"draw:text-path" , draw_text_path_); CP_APPLY_ATTR(L"draw:text-path" , draw_text_path_);
CP_APPLY_ATTR(L"draw:enhanced-path" , draw_enhanced_path_); CP_APPLY_ATTR(L"draw:enhanced-path" , draw_enhanced_path_);
CP_APPLY_ATTR(L"drawooo:enhanced-path" , drawooo_enhanced_path_);
CP_APPLY_ATTR(L"drawooo:sub-view-size" , drawooo_sub_view_size_); CP_APPLY_ATTR(L"drawooo:sub-view-size" , drawooo_sub_view_size_);
} }
// draw:enhanced_geometry // draw:enhanced_geometry
...@@ -485,6 +486,9 @@ void draw_enhanced_geometry::add_child_element( xml::sax * Reader, const std::ws ...@@ -485,6 +486,9 @@ void draw_enhanced_geometry::add_child_element( xml::sax * Reader, const std::ws
} }
void draw_enhanced_geometry::find_draw_type_oox() void draw_enhanced_geometry::find_draw_type_oox()
{ {
word_art_ = false;
bOoxType_ = false;
if (draw_enhanced_geometry_attlist_.draw_text_path_ && if (draw_enhanced_geometry_attlist_.draw_text_path_ &&
*draw_enhanced_geometry_attlist_.draw_text_path_ == true) *draw_enhanced_geometry_attlist_.draw_text_path_ == true)
{ {
...@@ -501,7 +505,7 @@ void draw_enhanced_geometry::find_draw_type_oox() ...@@ -501,7 +505,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
{ {
int count = sizeof(_OO_OOX_wordart) / sizeof(_shape_converter); int count = sizeof(_OO_OOX_wordart) / sizeof(_shape_converter);
for (long i=0; i< count; i++) for (int i = 0; i < count; i++)
{ {
if (_OO_OOX_wordart[i].odf_reader == odf_type) if (_OO_OOX_wordart[i].odf_reader == odf_type)
{ {
...@@ -518,7 +522,7 @@ void draw_enhanced_geometry::find_draw_type_oox() ...@@ -518,7 +522,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
if (pos < 0) if (pos < 0)
{ {
for (long i=0; i< count; i++) for (long i = 0; i< count; i++)
{ {
if (_OO_OOX_custom_shapes[i].odf_reader == odf_type) if (_OO_OOX_custom_shapes[i].odf_reader == odf_type)
{ {
...@@ -529,8 +533,9 @@ void draw_enhanced_geometry::find_draw_type_oox() ...@@ -529,8 +533,9 @@ void draw_enhanced_geometry::find_draw_type_oox()
} }
else else
{ {
bOoxType_ = true;
std::wstring oox_type = odf_type.substr(pos + 6); std::wstring oox_type = odf_type.substr(pos + 6);
for (long i=0; i< count; i++) for (long i = 0; i< count; i++)
{ {
if (_OO_OOX_custom_shapes[i].oox == oox_type) if (_OO_OOX_custom_shapes[i].oox == oox_type)
{ {
...@@ -547,18 +552,18 @@ void draw_enhanced_geometry::find_draw_type_oox() ...@@ -547,18 +552,18 @@ void draw_enhanced_geometry::find_draw_type_oox()
} }
std::wstringstream str; std::wstringstream str;
BOOST_FOREACH(const office_element_ptr & parElement, draw_handle_) for (size_t i = 0; i < draw_handle_.size(); i++)
{ {
draw_handle * handle = dynamic_cast<draw_handle *>(parElement.get()); draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
if (!handle) continue;
int min = -1;
int max = -1; int min = -1, max = -1;
try try
{ {
min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
if (min<0)min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_); if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
if (min<0)min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_); if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
} }
catch(...) catch(...)
{ {
...@@ -574,7 +579,7 @@ void draw_enhanced_geometry::find_draw_type_oox() ...@@ -574,7 +579,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
catch(...) catch(...)
{ {
} }
draw_handle_geometry elm={min, max}; draw_handle_geometry elm = {min, max};
draw_handle_geometry_.push_back(elm); draw_handle_geometry_.push_back(elm);
} }
} }
......
...@@ -437,6 +437,7 @@ public: ...@@ -437,6 +437,7 @@ public:
_CP_OPT(std::wstring) draw_modifiers_; _CP_OPT(std::wstring) draw_modifiers_;
_CP_OPT(bool) draw_text_path_; _CP_OPT(bool) draw_text_path_;
_CP_OPT(std::wstring) draw_enhanced_path_; _CP_OPT(std::wstring) draw_enhanced_path_;
_CP_OPT(std::wstring) drawooo_enhanced_path_;
_CP_OPT(std::wstring) drawooo_sub_view_size_; _CP_OPT(std::wstring) drawooo_sub_view_size_;
}; };
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
...@@ -464,7 +465,9 @@ public: ...@@ -464,7 +465,9 @@ public:
_CP_OPT(int) sub_type_; _CP_OPT(int) sub_type_;
_CP_OPT(int) draw_type_oox_index_; _CP_OPT(int) draw_type_oox_index_;
_CP_OPT(std::wstring) svg_viewbox_; _CP_OPT(std::wstring) svg_viewbox_;
bool word_art_; bool word_art_;
bool bOoxType_;
typedef std::pair<std::wstring,std::wstring> pair_string_value; typedef std::pair<std::wstring,std::wstring> pair_string_value;
......
...@@ -253,13 +253,19 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context ...@@ -253,13 +253,19 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
set_shape = true; set_shape = true;
} }
if (sub_type_) if (sub_type_)
{ {
shape->sub_type_ = sub_type_.get(); shape->sub_type_ = sub_type_.get();
set_shape = true; set_shape = true;
} }
std::wstring odf_path;
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_) if (!odf_path.empty())
{ {
std::vector<::svg_path::_polyline> o_Polyline; std::vector<::svg_path::_polyline> o_Polyline;
...@@ -267,7 +273,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context ...@@ -267,7 +273,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
try try
{ {
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true); res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
} }
catch(...) catch(...)
{ {
...@@ -316,8 +322,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context ...@@ -316,8 +322,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
{ {
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max) if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
{ {
shape->additional_.push_back(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min)); shape->additional_.push_back(_property(L"draw-modifiers-min", draw_handle_geometry_[0].min));
shape->additional_.push_back(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max)); shape->additional_.push_back(_property(L"draw-modifiers-max", draw_handle_geometry_[0].max));
} }
} }
} }
...@@ -326,7 +332,6 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context ...@@ -326,7 +332,6 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
{ {
shape->bad_shape_ = true; shape->bad_shape_ = true;
} }
} }
} }
} }
\ No newline at end of file
...@@ -1260,7 +1260,8 @@ _CP_OPT(odf_types::color) odf_drawing_context::get_line_color() ...@@ -1260,7 +1260,8 @@ _CP_OPT(odf_types::color) odf_drawing_context::get_line_color()
} }
void odf_drawing_context::set_solid_fill(std::wstring hexColor) void odf_drawing_context::set_solid_fill(std::wstring hexColor)
{ {
if (!impl_->current_graphic_properties)return; if (!impl_->current_graphic_properties) return;
if (hexColor.empty()) return;
int res = 0; int res = 0;
if ((res = hexColor.find(L"#")) < 0) hexColor = std::wstring(L"#") + hexColor; if ((res = hexColor.find(L"#")) < 0) hexColor = std::wstring(L"#") + hexColor;
...@@ -2177,27 +2178,47 @@ void odf_drawing_context::set_textarea_writing_mode(int mode) ...@@ -2177,27 +2178,47 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
paragraph_properties = style_->content_.get_style_paragraph_properties(); paragraph_properties = style_->content_.get_style_paragraph_properties();
} }
} }
if (paragraph_properties == NULL && impl_->current_paragraph_properties == NULL)return;
switch(mode) if (paragraph_properties)
{ {
case 5://textverticaltypeWordArtVert: switch(mode)
case 6://textverticaltypeWordArtVertRtl: {
case 4://SimpleTypes::textverticaltypeVert270: //нужно отзеркалить по горизонтали текст case 5://textverticaltypeWordArtVert:
case 3://SimpleTypes::textverticaltypeVert: case 6://textverticaltypeWordArtVertRtl:
case 2://SimpleTypes::textverticaltypeMongolianVert: case 4://SimpleTypes::textverticaltypeVert270: //нужно отзеркалить по горизонтали текст
paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl); case 3://SimpleTypes::textverticaltypeVert:
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl); case 2://SimpleTypes::textverticaltypeMongolianVert:
break;
case 0://SimpleTypes::textverticaltypeEaVert: paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl);
paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl); break;
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl); case 0://SimpleTypes::textverticaltypeEaVert:
break; paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl);
case 1://SimpleTypes::textverticaltypeHorz: break;
default: case 1://SimpleTypes::textverticaltypeHorz:
paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::LrTb); default:
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::LrTb); paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::LrTb);
break; break;
}
}
if (impl_->current_paragraph_properties)
{
switch(mode)
{
case 5://textverticaltypeWordArtVert:
case 6://textverticaltypeWordArtVertRtl:
case 4://SimpleTypes::textverticaltypeVert270: //нужно отзеркалить по горизонтали текст
case 3://SimpleTypes::textverticaltypeVert:
case 2://SimpleTypes::textverticaltypeMongolianVert:
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl);
break;
case 0://SimpleTypes::textverticaltypeEaVert:
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbRl);
break;
case 1://SimpleTypes::textverticaltypeHorz:
default:
impl_->current_paragraph_properties->content_.style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::LrTb);
break;
}
} }
} }
void odf_drawing_context::set_paragraph_properties(style_paragraph_properties *paragraph_properties) void odf_drawing_context::set_paragraph_properties(style_paragraph_properties *paragraph_properties)
......
...@@ -266,8 +266,11 @@ void odt_conversion_context::end_drawings() ...@@ -266,8 +266,11 @@ void odt_conversion_context::end_drawings()
} }
else else
{ {
text_context()->start_element(elm); if (elm)
text_context()->end_element(); {
text_context()->start_element(elm);
text_context()->end_element();
}
drawing_context()->clear(); drawing_context()->clear();
drawing_context_.pop_back(); drawing_context_.pop_back();
......
...@@ -207,6 +207,8 @@ void text_list::create_child_element(const std::wstring & Ns, const std::wstring ...@@ -207,6 +207,8 @@ void text_list::create_child_element(const std::wstring & Ns, const std::wstring
} }
void text_list::add_child_element( const office_element_ptr & child_element) void text_list::add_child_element( const office_element_ptr & child_element)
{ {
if (!child_element) return;
ElementType type = child_element->get_type(); ElementType type = child_element->get_type();
if (type == typeTextListHeader) if (type == typeTextListHeader)
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
* *
*/ */
#include "PptxConverter.h" #include "PptxConverter.h"
#include "DocxConverter.h"
#include "../utils.h" #include "../utils.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h" #include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h"
...@@ -450,15 +452,20 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape) ...@@ -450,15 +452,20 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
type = preset.GetValue(); type = preset.GetValue();
} }
if (type == SimpleTypes::shapetypeRect && oox_shape->txBody.IsInit()) if (type == SimpleTypes::shapetypeRect && (oox_shape->txBody.IsInit() || oox_shape->oTextBoxShape.IsInit()))
type = 2000; type = 2000;
if (type == 2000 && oox_shape->txBody->bodyPr.IsInit() if (type == 2000)
&& oox_shape->txBody->bodyPr->fromWordArt.get_value_or(false))
{ {
int wordart_type = convert(oox_shape->txBody->bodyPr->prstTxWarp.GetPointer()); PPTX::Logic::BodyPr *bodyPr = NULL;
if (oox_shape->txBody.IsInit()) bodyPr = oox_shape->txBody->bodyPr.GetPointer();
if (wordart_type > 0) type = wordart_type; else bodyPr = oox_shape->oTextBoxBodyPr.GetPointer();
if (bodyPr && bodyPr->fromWordArt.get_value_or(false))
{
int wordart_type = convert(bodyPr->prstTxWarp.GetPointer());
if (wordart_type > 0) type = wordart_type;
}
} }
} }
else if (oox_shape->nvSpPr.nvPr.ph.is_init()) else if (oox_shape->nvSpPr.nvPr.ph.is_init())
...@@ -476,7 +483,24 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape) ...@@ -476,7 +483,24 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
if (oox_shape->txXfrm.IsInit() == false) if (oox_shape->txXfrm.IsInit() == false)
{ {
convert(oox_shape->txBody.GetPointer(), oox_shape->style.GetPointer()); if (oox_shape->oTextBoxShape.IsInit()) //docx sdt
{
DocxConverter *docx_converter = dynamic_cast<DocxConverter*>(this);
if (docx_converter)
{
odf_context()->start_text_context();
docx_converter->convert(oox_shape->oTextBoxShape.GetPointer());
odf_context()->drawing_context()->set_text( odf_context()->text_context());
convert(oox_shape->oTextBoxBodyPr.GetPointer());
if (oox_shape->style.IsInit())
convert(&oox_shape->style->fontRef);
odf_context()->end_text_context();
}
}
else
convert(oox_shape->txBody.GetPointer(), oox_shape->style.GetPointer());
} }
odf_context()->drawing_context()->end_shape(); odf_context()->drawing_context()->end_shape();
...@@ -887,12 +911,19 @@ void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexStri ...@@ -887,12 +911,19 @@ void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexStri
if (!color) return; if (!color) return;
convert(color, nARGB); convert(color, nARGB);
hexString = XmlUtils::IntToString(nARGB & 0x00FFFFFF, L"#%06X");
if ((nARGB >> 24) != 0xff) if (nARGB != 0)
{
hexString = XmlUtils::IntToString(nARGB & 0x00FFFFFF, L"#%06X");
if ((nARGB >> 24) != 0xff)
{
opacity = ((nARGB >> 24) /255.) * 100.;
}
}
else
{ {
opacity = ((nARGB >> 24) /255.) * 100.; //not found in theme
} }
} }
......
...@@ -70,7 +70,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type) ...@@ -70,7 +70,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
} }
//m_oPreferRelative//типо можно менять размер //m_oPreferRelative//типо можно менять размер
for (unsigned int i=0 ; i < vml_shape_type->m_arrItems.size();i++) for (size_t i = 0; i < vml_shape_type->m_arrItems.size(); i++)
{ {
convert(vml_shape_type->m_arrItems[i]); convert(vml_shape_type->m_arrItems[i]);
} }
...@@ -86,6 +86,18 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type) ...@@ -86,6 +86,18 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
//m_arrItems //m_arrItems
//CVmlCommonElements //CVmlCommonElements
} }
void OoxConverter::convert(OOX::Vml::CFormulas *vml_formulas)
{
if (vml_formulas == NULL) return;
for (size_t i = 0; i < vml_formulas->m_arrItems.size(); i++)
{
OOX::Vml::CF *cf = dynamic_cast<OOX::Vml::CF *>(vml_formulas->m_arrItems[i]);
if (cf == NULL) continue;
//odf_context()->drawing_context()->add_formula(L"", cf->m_sEqn);
}
}
void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group) void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
{ {
...@@ -95,7 +107,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group) ...@@ -95,7 +107,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
_CP_OPT(int) anchor_type_x, anchor_type_y; _CP_OPT(int) anchor_type_x, anchor_type_y;
for (unsigned int i=0; i < vml_style->m_arrProperties.size(); i++) for (size_t i = 0; i < vml_style->m_arrProperties.size(); i++)
{ {
if (vml_style->m_arrProperties[i] == NULL) continue; if (vml_style->m_arrProperties[i] == NULL) continue;
...@@ -693,17 +705,18 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox) ...@@ -693,17 +705,18 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
odf_context()->drawing_context()->set_textarea_wrap(true); odf_context()->drawing_context()->set_textarea_wrap(true);
DocxConverter *docx_converter = dynamic_cast<DocxConverter*>(this); DocxConverter *docx_converter = dynamic_cast<DocxConverter*>(this);
if (docx_converter)
odf_context()->start_text_context();
{ {
for (unsigned int i=0 ; i < vml_textbox->m_oTxtbxContent->m_arrItems.size();i++) odf_context()->start_text_context();
{ {
if (docx_converter) for (size_t i = 0; i < vml_textbox->m_oTxtbxContent->m_arrItems.size(); i++)
{
docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]); docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]);
}
odf_context()->drawing_context()->set_text( odf_context()->text_context());
} }
odf_context()->drawing_context()->set_text( odf_context()->text_context()); odf_context()->end_text_context();
} }
odf_context()->end_text_context();
} }
void OoxConverter::convert(OOX::Vml::CTextPath *vml_textpath) void OoxConverter::convert(OOX::Vml::CTextPath *vml_textpath)
...@@ -869,7 +882,7 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common) ...@@ -869,7 +882,7 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
delete oRgbColor; delete oRgbColor;
} }
} }
for (unsigned int i=0 ; i < vml_common->m_arrItems.size();i++) for (size_t i = 0; i < vml_common->m_arrItems.size(); i++)
{ {
convert(vml_common->m_arrItems[i]); convert(vml_common->m_arrItems[i]);
} }
...@@ -899,7 +912,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group) ...@@ -899,7 +912,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
odf_context()->drawing_context()->set_group_shift(vml_group->m_oCoordOrigin->GetX(), vml_group->m_oCoordOrigin->GetY()); odf_context()->drawing_context()->set_group_shift(vml_group->m_oCoordOrigin->GetX(), vml_group->m_oCoordOrigin->GetY());
} }
for (unsigned int i=0; i < vml_group->m_arrItems.size(); i++) for (size_t i = 0; i < vml_group->m_arrItems.size(); i++)
{ {
if (vml_group->m_arrItems[i] == NULL) continue; if (vml_group->m_arrItems[i] == NULL) continue;
......
...@@ -145,18 +145,15 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -145,18 +145,15 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
{ {
case OOX::et_graphicFrame: case OOX::et_graphicFrame:
{ {
PPTX::Logic::GraphicFrame* pGraphicFrame= dynamic_cast<PPTX::Logic::GraphicFrame*>(oox_unknown); convert(dynamic_cast<PPTX::Logic::GraphicFrame*>(oox_unknown));
convert(pGraphicFrame);
}break; }break;
case OOX::et_pic: case OOX::et_pic:
{ {
PPTX::Logic::Pic* pPic= dynamic_cast<PPTX::Logic::Pic*>(oox_unknown); convert(dynamic_cast<PPTX::Logic::Pic*>(oox_unknown));
convert(pPic);
}break; }break;
case OOX::et_dgm_DiagrammParts: case OOX::et_dgm_DiagrammParts:
{ {
PPTX::Logic::SmartArt* pDiagrammParts = dynamic_cast<PPTX::Logic::SmartArt*>(oox_unknown); convert(dynamic_cast<PPTX::Logic::SmartArt*>(oox_unknown));
convert(pDiagrammParts);
}break; }break;
case OOX::et_a_Shape: case OOX::et_a_Shape:
case OOX::et_p_Shape: case OOX::et_p_Shape:
...@@ -268,18 +265,19 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -268,18 +265,19 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
}break; }break;
case OOX::et_v_fill: case OOX::et_v_fill:
{ {
OOX::Vml::CFill *vml = dynamic_cast<OOX::Vml::CFill*>(oox_unknown); convert(dynamic_cast<OOX::Vml::CFill*>(oox_unknown));
convert(vml);
}break; }break;
case OOX::et_v_stroke: case OOX::et_v_stroke:
{ {
OOX::Vml::CStroke *vml = dynamic_cast<OOX::Vml::CStroke*>(oox_unknown); convert(dynamic_cast<OOX::Vml::CStroke*>(oox_unknown));
convert(vml); }break;
case OOX::et_v_formulas:
{
convert(dynamic_cast<OOX::Vml::CFormulas*>(oox_unknown));
}break; }break;
case OOX::et_v_shadow: case OOX::et_v_shadow:
{ {
OOX::Vml::CShadow *vml = dynamic_cast<OOX::Vml::CShadow*>(oox_unknown); convert(dynamic_cast<OOX::Vml::CShadow*>(oox_unknown));
convert(vml);
}break; }break;
case OOX::et_v_image: case OOX::et_v_image:
{ {
......
...@@ -245,6 +245,7 @@ namespace OOX ...@@ -245,6 +245,7 @@ namespace OOX
class CTextPath; class CTextPath;
class CGroup; class CGroup;
class CVmlCommonElements; class CVmlCommonElements;
class CFormulas;
} }
namespace VmlWord namespace VmlWord
{ {
...@@ -510,6 +511,7 @@ public: ...@@ -510,6 +511,7 @@ public:
void convert(OOX::VmlWord::CWrap *vml_wrap); void convert(OOX::VmlWord::CWrap *vml_wrap);
void convert(OOX::Vml::CGroup *vml_group); void convert(OOX::Vml::CGroup *vml_group);
void convert(OOX::Vml::CVmlCommonElements *vml_attr); void convert(OOX::Vml::CVmlCommonElements *vml_attr);
void convert(OOX::Vml::CFormulas *vml_formulas);
}; };
} // namespace Oox2Odf } // namespace Oox2Odf
...@@ -317,16 +317,16 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -317,16 +317,16 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
// OOX::Logic::CShape* pShape = dynamic_cast<OOX::Logic::CShape*>(oox_unknown); // OOX::Logic::CShape* pShape = dynamic_cast<OOX::Logic::CShape*>(oox_unknown);
// convert(pShape); // convert(pShape);
//}break; //}break;
//case OOX::et_w_pict: case OOX::et_w_pict:
//{ {
// OOX::Logic::CPicture* pPic = dynamic_cast<OOX::Logic::CPicture*>(oox_unknown); OOX::Logic::CPicture* pPic = dynamic_cast<OOX::Logic::CPicture*>(oox_unknown);
// convert(pPic); convert(pPic);
//}break; }break;
//case OOX::et_w_object: case OOX::et_w_object:
//{ {
// OOX::Logic::CObject* pObj = dynamic_cast<OOX::Logic::CObject*>(oox_unknown); OOX::Logic::CObject* pObj = dynamic_cast<OOX::Logic::CObject*>(oox_unknown);
// convert(pObj); convert(pObj);
//}break; }break;
case OOX::et_pic_pic: case OOX::et_pic_pic:
case OOX::et_pic: case OOX::et_pic:
case OOX::et_p_pic: case OOX::et_p_pic:
...@@ -353,23 +353,27 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -353,23 +353,27 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
}break; }break;
case OOX::et_w_commentReference: case OOX::et_w_commentReference:
{ {
OOX::Logic::CCommentReference* pCommRef = dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown); convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown)); //если нет Start - означает начало с предыдущего Run
convert(pCommRef); //если нет Start - означает начало с предыдущего Run
}break; }break;
case OOX::et_w_footnoteReference: case OOX::et_w_footnoteReference:
{ {
OOX::Logic::CFootnoteReference* pRef= dynamic_cast<OOX::Logic::CFootnoteReference*>(oox_unknown); convert(dynamic_cast<OOX::Logic::CFootnoteReference*>(oox_unknown));
convert(pRef);
}break; }break;
case OOX::et_w_endnoteReference: case OOX::et_w_endnoteReference:
{ {
OOX::Logic::CEndnoteReference* pRef= dynamic_cast<OOX::Logic::CEndnoteReference*>(oox_unknown); convert(dynamic_cast<OOX::Logic::CEndnoteReference*>(oox_unknown));
convert(pRef); }break;
case OOX::et_w_endnoteRef:
{
//add ref ??? todoooo
}break;
case OOX::et_w_footnoteRef:
{
//add ref
}break; }break;
case OOX::et_w_tbl: case OOX::et_w_tbl:
{ {
OOX::Logic::CTbl* pTable= dynamic_cast<OOX::Logic::CTbl*>(oox_unknown); convert(dynamic_cast<OOX::Logic::CTbl*>(oox_unknown));
convert(pTable);
}break; }break;
case OOX::et_w_tr: case OOX::et_w_tr:
{ {
...@@ -381,6 +385,12 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -381,6 +385,12 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
OOX::Logic::CTc* pCell= dynamic_cast<OOX::Logic::CTc*>(oox_unknown); OOX::Logic::CTc* pCell= dynamic_cast<OOX::Logic::CTc*>(oox_unknown);
convert(pCell); convert(pCell);
}break; }break;
case OOX::et_w_bookmarkStart:
{
}break;
case OOX::et_w_bookmarkEnd:
{
}break;
default: default:
{ {
OoxConverter::convert(oox_unknown); OoxConverter::convert(oox_unknown);
...@@ -394,12 +404,15 @@ void DocxConverter::convert(OOX::Logic::CSdt *oox_sdt) ...@@ -394,12 +404,15 @@ void DocxConverter::convert(OOX::Logic::CSdt *oox_sdt)
//nullable<OOX::Logic::CSdtEndPr > m_oSdtEndPr; //nullable<OOX::Logic::CSdtEndPr > m_oSdtEndPr;
//nullable<OOX::Logic::CSdtPr > m_oSdtPr; //nullable<OOX::Logic::CSdtPr > m_oSdtPr;
if (oox_sdt->m_oSdtContent.IsInit()) convert(oox_sdt->m_oSdtContent.GetPointer());
}
void DocxConverter::convert(OOX::Logic::CSdtContent *oox_sdt)
{
if (oox_sdt == NULL) return;
for (size_t i = 0; i < oox_sdt->m_arrItems.size(); i++)
{ {
for (unsigned int i=0; i< oox_sdt->m_oSdtContent->m_arrItems.size(); i++) convert(oox_sdt->m_arrItems[i]);
{
convert(oox_sdt->m_oSdtContent->m_arrItems[i]);
}
} }
} }
void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
...@@ -3017,7 +3030,7 @@ void DocxConverter::convert(OOX::Numbering::CAbstractNum* oox_num_style) ...@@ -3017,7 +3030,7 @@ void DocxConverter::convert(OOX::Numbering::CAbstractNum* oox_num_style)
if (oox_num_style->m_oAbstractNumId.IsInit() == false) return; if (oox_num_style->m_oAbstractNumId.IsInit() == false) return;
odt_context->styles_context()->lists_styles().start_style(false, oox_num_style->m_oAbstractNumId->GetValue()); odt_context->styles_context()->lists_styles().start_style(true, oox_num_style->m_oAbstractNumId->GetValue());
//// Childs //// Childs
//std::vector<OOX::Numbering::CLvl > m_arrLvl; //std::vector<OOX::Numbering::CLvl > m_arrLvl;
//nullable<ComplexTypes::Word::CMultiLevelType > m_oMultiLevelType; //nullable<ComplexTypes::Word::CMultiLevelType > m_oMultiLevelType;
......
...@@ -95,6 +95,7 @@ namespace OOX ...@@ -95,6 +95,7 @@ namespace OOX
class CTcBorders; class CTcBorders;
class CTblBorders; class CTblBorders;
class CSdt; class CSdt;
class CSdtContent;
class CBackground; class CBackground;
class CLockedCanvas; class CLockedCanvas;
...@@ -151,7 +152,8 @@ namespace Oox2Odf ...@@ -151,7 +152,8 @@ namespace Oox2Odf
virtual std::wstring find_link_by_id (std::wstring sId, int t); virtual std::wstring find_link_by_id (std::wstring sId, int t);
virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(std::wstring sId); virtual NSCommon::smart_ptr<OOX::File> find_file_by_id(std::wstring sId);
void convert(OOX::WritingElement *oox_unknown); void convert(OOX::WritingElement *oox_unknown);
void convert(OOX::Logic::CSdtContent *oox_sdt);
private: private:
struct _section struct _section
{ {
...@@ -220,7 +222,7 @@ namespace Oox2Odf ...@@ -220,7 +222,7 @@ namespace Oox2Odf
void convert(OOX::Drawing::CAnchor *oox_anchor); void convert(OOX::Drawing::CAnchor *oox_anchor);
void convert(OOX::Drawing::CInline *oox_inline); void convert(OOX::Drawing::CInline *oox_inline);
void convert(SimpleTypes::CTheme<> *oox_font_theme,_CP_OPT(std::wstring) & odf_font_name); void convert(SimpleTypes::CTheme<> *oox_font_theme,_CP_OPT(std::wstring) & odf_font_name);
void convert(ComplexTypes::Word::CColor *color, _CP_OPT(odf_types::color) & odf_color); void convert(ComplexTypes::Word::CColor *color, _CP_OPT(odf_types::color) & odf_color);
void convert(SimpleTypes::CUniversalMeasure *oox_size, _CP_OPT(odf_types::length) & odf_size); void convert(SimpleTypes::CUniversalMeasure *oox_size, _CP_OPT(odf_types::length) & odf_size);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
QT -= core QT -= core
QT -= gui QT -= gui
VERSION = 2.4.450.0 VERSION = 2.4.451.0
DEFINES += INTVER=$$VERSION DEFINES += INTVER=$$VERSION
TARGET = x2t TARGET = x2t
......
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