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

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63161 954022d7-b5bf-4e40-9824-e11837661b57
parent 67bd390a
......@@ -38,19 +38,20 @@ odf_page_layout_context::~odf_page_layout_context()
}
odf_layout_state & odf_page_layout_context::last_layout()
odf_layout_state * odf_page_layout_context::last_layout()
{
if (layout_state_list_.size() >0)
return layout_state_list_.back();
return &layout_state_list_.back();
else
throw;
return NULL;
}
odf_master_state & odf_page_layout_context::last_master()
odf_master_state * odf_page_layout_context::last_master()
{
if (master_state_list_.size() >0)
return master_state_list_.back();
return &master_state_list_.back();
else
throw;
return NULL;
}
void odf_page_layout_context::start_master_page(std::wstring page_name)
......@@ -672,4 +673,4 @@ void odf_page_layout_context::set_page_orientation(int type)
}
}
}
\ No newline at end of file
}
......@@ -39,8 +39,8 @@ public:
void process_automatic_for_styles (office_element_ptr root );
void process_office_styles (office_element_ptr root );//, , ...
odf_layout_state & last_layout();
odf_master_state & last_master();
odf_layout_state * last_layout();
odf_master_state * last_master();
odf_style_context* get_local_styles_context() //
{return local_style_context_.get();}
......
......@@ -432,11 +432,13 @@ void odf_text_context::start_field(int type)
{
page_numb->text_select_page_ = L"current";
if ((odf_context_->page_layout_context()) && (odf_context_->page_layout_context()->last_layout().page_number_format))
{
page_numb->common_num_format_attlist_.style_num_format_ = odf_context_->page_layout_context()->last_layout().page_number_format;
}
if ( (odf_context_->page_layout_context()) &&
(odf_context_->page_layout_context()->last_layout()) &&
(odf_context_->page_layout_context()->last_layout()->page_number_format))
{
page_numb->common_num_format_attlist_.style_num_format_ = odf_context_->page_layout_context()->last_layout()->page_number_format;
}
}
}
if (type == 3)
......
......@@ -93,7 +93,8 @@ void ods_conversion_context::start_sheet()
page_layout_context()->start_master_page(L"");
current_table().set_table_master_page(page_layout_context()->last_master().get_name());
current_table().set_table_master_page(page_layout_context()->last_master() ?
page_layout_context()->last_master()->get_name() : L"");
}
void ods_conversion_context::set_sheet_dimension(const std::wstring & ref)
......
......@@ -865,11 +865,13 @@ void odt_conversion_context::end_table()
bool odt_conversion_context::start_header(int type)
{
if (page_layout_context()->add_header(type) == false) return false;
if (page_layout_context()->add_header(type) == false) return false;
if (page_layout_context()->last_master() == NULL) return false;
start_text_context();
text_context()->set_styles_context(page_layout_context()->get_local_styles_context());
text_context()->start_element(page_layout_context()->last_master().get_last_element());
text_context()->start_element(page_layout_context()->last_master()->get_last_element());
is_header_ = true;
......@@ -894,12 +896,13 @@ void odt_conversion_context::set_background(_CP_OPT(color) & color, int type)
bool odt_conversion_context::start_footer(int type)
{
if (page_layout_context()->add_footer(type) == false) return false;
if (page_layout_context()->add_footer(type) == false) return false;
if (page_layout_context()->last_master() == NULL) return false;
start_text_context();
text_context()->set_styles_context(page_layout_context()->get_local_styles_context());
text_context()->start_element(page_layout_context()->last_master().get_last_element());
text_context()->start_element(page_layout_context()->last_master()->get_last_element());
is_footer_ = true;
......
......@@ -940,7 +940,8 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
odt_context->page_layout_context()->start_master_page(root ? L"Standard" : L"");
odt_context->set_master_page_name(odt_context->page_layout_context()->last_master().get_name());
odt_context->set_master_page_name(odt_context->page_layout_context()->last_master() ?
odt_context->page_layout_context()->last_master()->get_name() : L"");
bool present_header = false;
bool present_footer = 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