office_element_ptr odf_notes_context::get_note_content() { text_note* note = dynamic_cast<text_note*>(impl_->notes_.back().element.get()); if (!note) return office_element_ptr(); return note->text_note_body_; }
odf_layout_state::odf_layout_state(office_element_ptr & layout_elm ) { size_t level = 0; odf_element_state state = {layout_elm,L"",office_element_ptr(),level}; elements_.push_back(state); current_level_.push_back(layout_elm); }
odf_master_state::odf_master_state(office_element_ptr & master_elm ) { size_t level =0; odf_element_state state = {master_elm, L"", office_element_ptr(), level}; elements_.push_back(state); current_level_.push_back(master_elm); }
void odf_master_state::add_header(office_element_ptr & elm) { style_master_page* style_ = dynamic_cast<style_master_page*>(elements_[0].elm.get()); if (!style_)return; style_->add_child_element(elm); odf_element_state state = {elm, L"", office_element_ptr(), 1}; elements_.push_back(state); }
office_element_ptr styles_lite_container::find_by_style_name(const std::wstring & style_name) { styles_lite_container::Impl::map_t::const_iterator i = impl_->map_.find(style_name); if (i != impl_->map_.end()) { return impl_->array_[i->second].style; } else { return office_element_ptr(); } }
office_element_ptr office_element_creator::create(const std::wstring & ns, const std::wstring & name, odf_conversion_context * Context, bool isRoot) const { const std::wstring fullName = ns + (ns.size() > 0 ? L":" : L"") + name; MapType::const_iterator i = map_.find( fullName ); if (i != map_.end() ) { office_element_ptr element = (i->second)(); if (element) { element->setContext(Context); } if (element && isRoot) element->set_root(true); return element; } else { return office_element_ptr(); } }
void draw_page::pptx_convert(oox::pptx_conversion_context & Context) { const std::wstring pageStyleName = draw_page_attr_.draw_style_name_.get_value_or(L""); const std::wstring pageName = draw_page_attr_.draw_name_.get_value_or(L""); const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L""); const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L""); _CP_LOG << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl; Context.start_page(pageName, pageStyleName, layoutName,masterName); if (draw_page_attr_.draw_style_name_) { style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName,style_family::DrawingPage,false); if ((style_inst) && (style_inst->content())) { const style_drawing_page_properties * properties = style_inst->content()->get_style_drawing_page_properties(); if (properties) { oox::_oox_fill fill; Compute_GraphicFill(properties->content().common_draw_fill_attlist_, office_element_ptr(), Context.root()->odf_context().drawStyles() ,fill); Context.get_slide_context().add_background(fill); //часть свойств переходов между слайдами тута if (properties->content().presentation_transition_type_) { if (properties->content().presentation_transition_type_.get() == L"automatic" || properties->content().presentation_transition_type_.get() == L"semi-automatic") { Context.get_slide_context().set_transitionAction(false); }else Context.get_slide_context().set_transitionAction(true);//manual (default) } if (properties->content().presentation_transition_speed_) { Context.get_slide_context().set_transitionSpeed(properties->content().presentation_transition_speed_.get()); } //////////////////////////////////////////////// if ((properties->content().presentation_display_footer_) && (*properties->content().presentation_display_footer_)) Context.get_slide_context().set_footer(); if ((properties->content().presentation_display_header_) && (*properties->content().presentation_display_header_)) Context.get_slide_context().set_header(); if ((properties->content().presentation_display_page_number_) && (*properties->content().presentation_display_page_number_)) Context.get_slide_context().set_page_number(); if ((properties->content().presentation_display_date_time_) && (*properties->content().presentation_display_date_time_)) Context.get_slide_context().set_date_time(); } } } //сначала анимашки .. потому что объекты используют анимацию не нанапрямую (как бы ) а с общей кучи //animation_context на slide_context завести if (animation_) { animation_->pptx_convert(Context); } ///////////////////////// BOOST_FOREACH(const office_element_ptr& elm, content_) { elm->pptx_convert(Context); }