Commit 7c8602d9 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - expansion custom shape convert

parent a8a684bf
......@@ -304,13 +304,68 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
{
find_draw_type_oox();
if (draw_type_oox_index_)
{
Context.get_slide_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
if (word_art_ == true)
Context.get_slide_context().set_property(_property(L"wordArt", true));
}
if (sub_type_)
{
Context.get_slide_context().start_shape(sub_type_.get());
}
if (draw_type_oox_index_)
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
{
Context.get_slide_context().set_property(_property(L"odf-custom-draw-index",draw_type_oox_index_.get()));
std::vector<svg_path::_polyline> o_Polyline;
bool res = false;
try
{
res = svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
}
catch(...)
{
res = false;
}
if (o_Polyline.size() > 1 && res )
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline);
Context.get_slide_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (splitted.size() == 2)
{
int w = boost::lexical_cast<int>(splitted[0]);
int h = boost::lexical_cast<int>(splitted[1]);
Context.get_slide_context().set_property(odf_reader::_property(L"custom_path_w", w));
Context.get_slide_context().set_property(odf_reader::_property(L"custom_path_h", h));
}
else if (splitted.size() == 4)
{///???? rect ???
int l = boost::lexical_cast<int>(splitted[0]);
int t = boost::lexical_cast<int>(splitted[1]);
int r = boost::lexical_cast<int>(splitted[2]);
int b = boost::lexical_cast<int>(splitted[3]);
}
}
}
else if (!draw_type_oox_index_)
{
draw_type_oox_index_ = 0;
}
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
{
......
......@@ -107,7 +107,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
const double a_x_pt = common_draw_attlist_.common_text_spreadsheet_shape_attlist_.table_end_x_.get_value_or(length(0)).get_value_unit(length::pt);
const double a_y_pt = common_draw_attlist_.common_text_spreadsheet_shape_attlist_.table_end_y_.get_value_or(length(0)).get_value_unit(length::pt);
Context.get_drawing_context().set_anchor(Anchor,a_x_pt,a_y_pt);
Context.get_drawing_context().set_anchor(Anchor, a_x_pt, a_y_pt);
}
/////////////////////////////////////////////////////////////////////////////////
std::vector<const odf_reader::style_instance *> instances;
......@@ -260,13 +260,68 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
{
find_draw_type_oox();
if (draw_type_oox_index_)
{
Context.get_drawing_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
if (word_art_ == true)
Context.get_drawing_context().set_property(_property(L"wordArt", true));
}
if (sub_type_)
{
Context.get_drawing_context().start_shape(sub_type_.get());
}
if (draw_type_oox_index_)
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
{
Context.get_drawing_context().set_property(_property(L"odf-custom-draw-index",draw_type_oox_index_.get()));
std::vector<svg_path::_polyline> o_Polyline;
bool res = false;
try
{
res = svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
}
catch(...)
{
res = false;
}
if (o_Polyline.size() > 1 && res )
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline);
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (splitted.size() == 2)
{
int w = boost::lexical_cast<int>(splitted[0]);
int h = boost::lexical_cast<int>(splitted[1]);
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path_w", w));
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path_h", h));
}
else if (splitted.size() == 4)
{///???? rect ???
int l = boost::lexical_cast<int>(splitted[0]);
int t = boost::lexical_cast<int>(splitted[1]);
int r = boost::lexical_cast<int>(splitted[2]);
int b = boost::lexical_cast<int>(splitted[3]);
}
}
}
else if (!draw_type_oox_index_)
{
draw_type_oox_index_ = 0;
}
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
{
......
......@@ -110,8 +110,6 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
elements_.pop_back();
count--;
}
global_info->cellStyleDxfs_count = m_arDXF.size(); // + будут юзерские
//----------------------------------------------------------------------------------------------------
if (proc.optional<STYLES>())
{
......
......@@ -110,6 +110,7 @@ public:
const bool loadContent(BinProcessor& proc)
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return false;
}
......@@ -138,6 +139,7 @@ BaseObjectPtr OBJECTS::clone()
const bool OBJECTS::loadContent(BinProcessor& proc)
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return false;
}
......
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