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

(1.2.0.108): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57562 954022d7-b5bf-4e40-9824-e11837661b57
parent 39bb3b84
......@@ -61,10 +61,10 @@ void odf_style_state::set_display_name(std::wstring & name)
style_->style_display_name_ = name;
}
std::wstring & odf_style_state::get_name()
std::wstring odf_style_state::get_name()
{
style* style_ = dynamic_cast<style*>(odf_style_.get());
if (!style_)return std::wstring();
if (!style_)return L"";
return style_->style_name_;
}
......@@ -77,6 +77,8 @@ style_family & odf_style_state::get_family()
}
void odf_style_state::set_parent_style_name(std::wstring & name)
{
if (name.length() < 1) return;
style* style_ = dynamic_cast<style*>(odf_style_.get());
if (!style_)return;
......
......@@ -46,7 +46,7 @@ public:
void add_child(office_element_ptr & child);
/////////////////////////////////////////////////////////////////////////////////////////
void set_name(std::wstring & name);
std::wstring & get_name();
std::wstring get_name();
style_family & get_family();
......
......@@ -202,7 +202,6 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
if (h)p->paragraph_.paragraph_attrs_.text_style_name_ = style_ref(parent_paragraph_style_);
}
if (paragraph_properties_)paragraph_properties_->content().fo_break_before_ = need_break_;
need_break_ = boost::none;
odf_element_state state={elm, style_name, style_elm,level};
text_elements_list_.push_back(state);
......@@ -220,6 +219,7 @@ void odf_text_context::end_paragraph()
current_level_.pop_back();
}
paragraph_properties_ = NULL;
need_break_ = boost::none;
}
void odf_text_context::start_element(office_element_ptr & elm, office_element_ptr style_elm ,std::wstring style_name)
......
......@@ -46,6 +46,8 @@ public:
void start_paragraph(office_element_ptr & elm, bool styled = false);
void end_paragraph();
bool is_need_break(){return bool(need_break_);}
void start_element(office_element_ptr & elm, office_element_ptr style_elm = office_element_ptr(),std::wstring style_name = L"");
void end_element();
......
......@@ -207,7 +207,7 @@ void odt_conversion_context::add_page_break()
office_element_ptr elm;
create_element(L"text", L"soft-page-break", elm, this);
if (current_root_elements_.size()>0)
if (current_root_elements_.size()>0/* && text_context()->is_need_break()*/)
{
text_p* para = NULL;
style * style_ = NULL;
......@@ -308,10 +308,11 @@ void odt_conversion_context::set_master_page_name(std::wstring master_name)
if (style_)style_->style_master_page_name_ = master_name;
}
void odt_conversion_context::add_section()
void odt_conversion_context::add_section(bool continuous)
{
odt_section_state state;
state.empty = true;
state.continuous = continuous;
//----------------------------------------------------------------
styles_context()->create_style(L"",odf::style_family::Section, true, false, -1);
......@@ -394,6 +395,24 @@ void odt_conversion_context::flush_section()
{
for (long i=0; i< current_root_elements_.size(); i++)
{
if (sections_.back().continuous && i<2)// - add_page_break
{
text_soft_page_break * break_ = dynamic_cast<text_soft_page_break*>(current_root_elements_[i].elm.get());
if (break_)
{
// ( , - ),
//int paragraph_break = i-1;
//if (paragraph_break < 0) paragraph_break = i+1;
//style *style_ = dynamic_cast<style*>(current_root_elements_[paragraph_break].style_elm.get());
//if (style_)
//{
// style_paragraph_properties *props = style_->style_content_.get_style_paragraph_properties();
// props->content().fo_break_before_ = fo_break(fo_break::Auto);
// props->content().fo_break_after_ = fo_break(fo_break::Auto);
//}
continue;
}
}
sections_.back().elm->add_child_element(current_root_elements_[i].elm);
}
current_root_elements_.clear();
......
......@@ -22,6 +22,7 @@ struct odt_section_state
std::wstring style_name;
bool empty;
bool continuous;
};
class odt_conversion_context : public odf_conversion_context
......@@ -65,7 +66,7 @@ public:
void start_run(bool styled = false);
void end_run();
void add_section();
void add_section(bool continuous);
void add_section_columns(int count, double space_pt, bool separator );
void add_section_column(std::vector<std::pair<double,double>> width_space);
void flush_section();
......
......@@ -1153,8 +1153,8 @@ void style_master_page::serialize(std::wostream & strm)
{
style_master_page_attlist_.serialize( CP_GET_XML_NODE());
if (style_header_) style_footer_->serialize(CP_XML_STREAM());
if (style_footer_) style_header_->serialize(CP_XML_STREAM());
if (style_footer_) style_footer_->serialize(CP_XML_STREAM());
if (style_header_) style_header_->serialize(CP_XML_STREAM());
if (style_header_left_) style_header_left_->serialize(CP_XML_STREAM());
if (style_header_first_) style_header_first_->serialize(CP_XML_STREAM());
......
......@@ -604,6 +604,23 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
{
if (oox_section_pr == NULL) return;
bool continuous = false;
if (oox_section_pr->m_oType.IsInit() && oox_section_pr->m_oType->m_oVal.IsInit())
{
switch(oox_section_pr->m_oType->m_oVal->GetValue())
{
case SimpleTypes::sectionmarkContinious :
continuous = true; //
break;
case SimpleTypes::sectionmarkNextColumn :
case SimpleTypes::sectionmarkEvenPage :
case SimpleTypes::sectionmarkNextPage :
case SimpleTypes::sectionmarkOddPage :
//
break;
}
}
odt_context->page_layout_context()->create_master_page(root ? L"Standart" : L"");
odt_context->set_master_page_name(odt_context->page_layout_context()->last_master().get_name());
......@@ -704,19 +721,8 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
// style name master page -> 0-
//--------------------------------------------------------------------------------------------------------------------------------------------
//
if (oox_section_pr->m_oType.IsInit() && oox_section_pr->m_oType->m_oVal.IsInit())
{
switch(oox_section_pr->m_oType->m_oVal->GetValue())
{
case SimpleTypes::sectionmarkNextColumn :
case SimpleTypes::sectionmarkContinious :
case SimpleTypes::sectionmarkEvenPage :
case SimpleTypes::sectionmarkNextPage :
case SimpleTypes::sectionmarkOddPage :
break;
}
}
if (!root)odt_context->add_section();
if (!root)odt_context->add_section(continuous);
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBidi;
//nullable<ComplexTypes::Word::CDocGrid > m_oDocGrid;
......@@ -735,7 +741,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
if ((oox_section_pr->m_oCols.IsInit()) && (oox_section_pr->m_oCols->m_oNum.IsInit()) && (oox_section_pr->m_oCols->m_oNum->GetValue() > 1))//
{
if (root)odt_context->add_section();
if (root)odt_context->add_section(continuous);
int count = oox_section_pr->m_oCols->m_oNum->GetValue();
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//105
#define INTVER 1,2,0,105
#define STRVER "1,2,0,105\0"
//108
#define INTVER 1,2,0,108
#define STRVER "1,2,0,108\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