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

небольшие правки

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57355 954022d7-b5bf-4e40-9824-e11837661b57
parent 59d0902f
......@@ -2,6 +2,6 @@
//1
//0
//1
//204
#define INTVER 1,0,1,204
#define STRVER "1,0,1,204\0"
//205
#define INTVER 1,0,1,205
#define STRVER "1,0,1,205\0"
......@@ -163,9 +163,13 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", j++);
double val = 0;
try { val = boost::lexical_cast<double>(v);}
catch(...){}
CP_XML_NODE(L"c:v")
{
CP_XML_CONTENT(boost::lexical_cast<double>(v));
CP_XML_CONTENT(val);
}
}
}
......
......@@ -265,40 +265,48 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
current->set_name(s.name_);
chart.set_content_series(s);
}
bool x_enabled = false;
bool y_enabled = false;
bool z_enabled = false;
BOOST_FOREACH(axis & a, axises_)
{
if (a.chart_name_.find(L"primary")==0)// xl - .
if (a.dimension_ == L"x" && x_enabled)continue;
if (a.dimension_ == L"y" && y_enabled)continue;
if (a.dimension_ == L"z" && z_enabled)continue;
int type =3;
if (a.dimension_ == L"x")
{
int type =3;
if (a.dimension_ == L"x" )
{
type=1;
if (last_set_type == chart_scatter ||
last_set_type == chart_bubble)type = 2;
// 1, 2, 3, 4
type=1;
if (last_set_type == chart_scatter ||
last_set_type == chart_bubble)type = 2;
//if (last_set_type == chart_stock)type = 4; // .
}
else if (a.dimension_ == L"y")
{
type=2;
if (last_set_type == chart_bar)
{
// ???? ( ???)
// ???
//overlap & gap-width
oox::oox_chart_ptr current = chart.get_current_chart();
current->set_additional_properties(a.properties_);
}
}
else if (a.dimension_ == L"z")
//if (last_set_type == chart_stock)type = 4; // .
x_enabled = true;
}
else if (a.dimension_ == L"y")
{
type=2;
if (last_set_type == chart_bar)
{
// :(
continue;
// ???? ( ???)
// ???
//overlap & gap-width
oox::oox_chart_ptr current = chart.get_current_chart();
current->set_additional_properties(a.properties_);
}
chart.add_axis(type);
chart.set_content_axis(a);
y_enabled = true;
}
else if (a.dimension_ == L"z")
{
type=2;
z_enabled = true;
continue;
}
chart.add_axis(type);
chart.set_content_axis(a);
}
}
void process_build_chart::ApplyChartProperties(std::wstring style,std::vector<_property> & propertiesOut)
......
......@@ -284,7 +284,7 @@ void text_list_level_style_number::docx_convert(oox::docx_conversion_context & C
}
CP_XML_NODE(L"w:numFmt")
{
CP_XML_ATTR(L"w:val",GetNumFormat( text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ ));
CP_XML_ATTR(L"w:val",GetNumFormat( text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_.get_value_or(L"") ));
}
CP_XML_NODE(L"w:suff")
{
......@@ -329,7 +329,7 @@ void text_list_level_style_number::docx_convert(oox::docx_conversion_context & C
double minLabelDistanceTwip = 0.0;
if (listLevelProperties &&
!text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_.empty() &&
text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ &&
listLevelProperties->text_min_label_distance_)
{
minLabelDistanceTwip = 20.0 * listLevelProperties->text_min_label_distance_->get_value_unit(length::pt);
......@@ -397,18 +397,21 @@ void text_list_level_style_number::pptx_convert(oox::pptx_conversion_context & C
std::wstring num_format;
if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"1")
num_format= L"arabic";
else if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"I")
num_format= L"romanUc";
else if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"i")
num_format= L"romanLc";
else if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"A")
num_format= L"alphaUc";
else if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"a")
num_format= L"alphaLc";
else
num_format= L"arabic";
if (text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_)
{
if (*text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"1")
num_format= L"arabic";
else if (*text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"I")
num_format= L"romanUc";
else if (*text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"i")
num_format= L"romanLc";
else if (*text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"A")
num_format= L"alphaUc";
else if (*text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_ == L"a")
num_format= L"alphaLc";
else
num_format= L"arabic";
}else num_format= L"arabic";
if (text_list_level_style_number_attr_.common_num_format_prefix_suffix_attlist_.style_num_prefix_)
{
......
......@@ -88,6 +88,7 @@ public:
{
styles_context_ = NULL;
current_series_count_= 0;
local_table_enabled_ = false;
}
......@@ -173,7 +174,7 @@ odf_chart_context::odf_chart_context(odf_conversion_context *odf_context)
odf_chart_context::~odf_chart_context()
{
}
}
void odf_chart_context::set_styles_context(odf_style_context * style_context)
{
impl_->styles_context_ = style_context;
......
......@@ -106,6 +106,19 @@ void odf_style_state::set_conditional(bool val)
{
conditional_ = val;
}
void odf_style_state::apply_from(style* other_style)
{
if (other_style == NULL)return;
style* style_ = dynamic_cast<style*>(odf_style_.get());
if (!style_)return;
//style_->style_parent_style_name_ = other_style->style_parent_style_name_;
//style_paragraph_properties * props = style_->style_content_.get_style_text_properties();
//if (props)props->apply_from(other_style->style_content_.get_style_paragraph_properties());
}
//////////////////////////////////////////////////////////////////
style_text_properties * odf_style_state::get_text_properties()
{
......
......@@ -11,6 +11,7 @@
namespace cpdoccore {
namespace odf {
class style;
class odf_conversion_context;
class odf_style_context;
......@@ -38,6 +39,8 @@ public:
office_element_ptr & get_office_element();
void apply_from(style* other_style);
void add_child(office_element_ptr & child);
/////////////////////////////////////////////////////////////////////////////////////////
void set_name(std::wstring & name);
......
......@@ -198,10 +198,13 @@ void odt_conversion_context::add_page_break()
if (current_root_elements_.size()>0)
{
text_p* para = NULL;
style * style_ = NULL;
//http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415190_253892949
// !! span, ... !!
if (para = dynamic_cast<text_p*>(current_root_elements_.back().elm.get()))
{
style_ = dynamic_cast<style*>(current_root_elements_.back().style_elm.get());
end_paragraph();
}
text_context()->start_element(elm);
......@@ -210,10 +213,16 @@ void odt_conversion_context::add_page_break()
if (para)
{
std::wstring parent_style_name = para->paragraph_.paragraph_attrs_.text_style_name_.get_value_or(style_ref(L"")).style_name();
styles_context()->create_style(L"",odf::style_family::Paragraph, true, false, -1);
styles_context()->last_state().set_parent_style_name(parent_style_name);
//styles_context()->last_state().apply_from(style_);
if (style_ )
{
style_paragraph_properties * new_props = styles_context()->last_state().get_paragraph_properties();
if (new_props)new_props->apply_from(style_->style_content_.get_style_paragraph_properties());
if (style_->style_parent_style_name_)
styles_context()->last_state().set_parent_style_name(*style_->style_parent_style_name_);
}
start_paragraph(true);
}
}
......
......@@ -282,8 +282,8 @@ public:
_CP_OPT(std::wstring) style_default_outline_level_;
style_content style_content_;
office_element_ptr_array style_map_;
style_content style_content_;
office_element_ptr_array style_map_;
};
......
......@@ -290,8 +290,15 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
{
if (oox_run == NULL) return;
bool styled = false;
//test for break - 2 first element !!!
for(int i = 0; i < min (2,oox_run->m_arrItems.GetSize()); ++i)
{
if (oox_run->m_arrItems[i]->getType() == OOX::et_w_lastRenderedPageBreak)
{
odt_context->add_page_break();
}
}
bool styled = false;
if (oox_run->m_oRunProperty)
{
styled = true;
......@@ -301,14 +308,7 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
convert(oox_run->m_oRunProperty, text_properties);
}
//test for break - 2 first element !!!
for(int i = 0; i < min (2,oox_run->m_arrItems.GetSize()); ++i)
{
if (oox_run->m_arrItems[i]->getType() == OOX::et_w_lastRenderedPageBreak)
{
odt_context->add_page_break();
}
}
odt_context->start_run(styled);
for(int i = 0; i < oox_run->m_arrItems.GetSize(); ++i)
......@@ -1321,6 +1321,7 @@ void DocxConverter::convert(OOX::Logic::CShape *oox_shape)
odf_context()->drawing_context()->set_no_fill();
odf_context()->drawing_context()->end_area_properies();
}
if (oox_shape->m_oTxBody.IsInit() && oox_shape->m_oTxBody->m_oTxtbxContent.IsInit())
{
odt_context->start_text_context();
......@@ -1331,6 +1332,7 @@ void DocxConverter::convert(OOX::Logic::CShape *oox_shape)
odt_context->drawing_context()->set_text( odt_context->text_context());
odt_context->end_text_context();
}
OoxConverter::convert(oox_shape->m_oTxBodyProperties.GetPointer());
if (type == 2000) odt_context->drawing_context()->end_text_box();
else odt_context->drawing_context()->end_shape();
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//93
#define INTVER 1,2,0,93
#define STRVER "1,2,0,93\0"
//96
#define INTVER 1,2,0,96
#define STRVER "1,2,0,96\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