void odp_conversion_context::start_master_slide(std::wstring name)
{
	slide_context_.set_styles_context(page_layout_context()->get_local_styles_context());
	
	page_layout_context()->add_master_page(name);	
	slide_context_.start_page(page_layout_context()->last_master()->get_root());
	
	drawing_context()->set_presentation(1);	
}
void odp_conversion_context::start_layout_slide()
{
	slide_context_.set_styles_context(page_layout_context()->get_local_styles_context());
	
	office_element_ptr elm = page_layout_context()->add_presentation_layout_page();	
	
	slide_context_.start_page(elm);
	
	drawing_context()->set_presentation(1);	
}
void odf_conversion_context::process_styles(_object & object, bool isRoot)
{		
	create_element(L"office", L"font-face-decls", object.content_styles, this, true);

	for (boost::unordered_map<std::wstring, int>::const_iterator it = object.mapFonts.begin(); it != object.mapFonts.end(); ++it)
	{
		office_element_ptr font_elm;
		create_element(L"style", L"font-face", font_elm, this, true);

		style_font_face* font = dynamic_cast<style_font_face*>(font_elm.get());
		
		if (font)
		{
			font->style_name_		= it->first;
			font->svg_font_family_	= it->first;

			object.content_styles.back()->add_child_element(font_elm);
		}
	}

	object.styles.push_back(object.content_styles.back()); //копия

	create_element(L"office", L"styles", object.styles, this, true);//общие стили
	
	object.style_context->process_office_styles(object.styles.back());
	page_layout_context()->process_office_styles(object.styles.back());

	if (isRoot)
	{	
		create_element(L"office", L"automatic-styles", object.styles, this, true);
		object.style_context->process_automatic_for_styles(object.styles.back());
		page_layout_context()->process_automatic_for_styles(object.styles.back());

		create_element(L"office", L"master-styles", object.styles, this, true);
		page_layout_context()->process_master_styles(object.styles.back());	
	}


	create_element(L"office", L"automatic-styles", object.content_styles, this, true);
	object.style_context->process_automatic_styles(object.content_styles.back());
}
void odp_conversion_context::start_note(bool bMaster)
{
	office_element_ptr note_elm;
	create_element(L"presentation", L"notes", note_elm, this);
	
	current_slide().drawing_context()->start_drawing();
	current_slide().drawing_context()->start_element(note_elm);
	
	slide_context_.start_page(note_elm);	

	if (bMaster)
	{
		page_layout_context()->create_layout_page();

		odf_writer::presentation_notes* notes = dynamic_cast<odf_writer::presentation_notes*>(note_elm.get());
		notes->attlist_.style_page_layout_name_ = page_layout_context()->last_layout()->get_name();
	
		drawing_context()->set_presentation(2);	
	}
	else
		drawing_context()->set_presentation(0);	
}