Commit 84824631 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - presentation styled list

parent dc3ecb1f
......@@ -262,6 +262,7 @@ void odf_conversion_context::process_settings(_object & object, bool isRoot)
void odf_conversion_context::process_styles(_object & object, bool isRoot)
{
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());
......
......@@ -55,7 +55,7 @@ struct list_format_state
std::vector<office_element_ptr> elements;
std::wstring odf_list_style_name;
bool automatic;
};
class odf_lists_styles_context
......@@ -64,7 +64,7 @@ public:
odf_lists_styles_context();
void set_odf_context(odf_conversion_context * Context);
void start_style(int abstract_number);
void start_style(int abstract_number = -1);
int start_style_level(int level, int type);
style_list_level_properties * get_list_level_properties();
style_list_level_label_alignment * get_list_level_alignment_properties();
......@@ -84,9 +84,9 @@ public:
void add_style(int oox_style_num, int oox_based_num);
void process_styles(office_element_ptr root );
void process_styles(office_element_ptr root, bool automatic);
std::wstring get_style_name(int oox_style_num);
std::wstring get_style_name(int oox_style_num = -1);
std::wstring get_style_name1(int oox_style_num);
private:
std::vector<list_format_state> lists_format_array_;
......
......@@ -161,6 +161,7 @@ void odf_style_context::process_automatic_styles(office_element_ptr root )
if (/*it->automatic_== true && */style_state_list_[i]->root_== false && style_state_list_[i]->odf_style_)
root->add_child_element(style_state_list_[i]->odf_style_);
}
lists_styles_context_.process_styles(root, true);
}
void odf_style_context::process_office_styles(office_element_ptr root )
......@@ -175,7 +176,7 @@ void odf_style_context::process_office_styles(office_element_ptr root )
root->add_child_element(style_state_list_[i]->odf_style_);
}
lists_styles_context_.process_styles(root );
lists_styles_context_.process_styles(root, false);
}
std::wstring odf_style_context::find_odf_style_name(int oox_id_style, style_family::type family, bool root, bool automatic)
{
......
......@@ -263,6 +263,7 @@ namespace PPTX
class Theme;
namespace Logic
{
class Bullet;
class ClrMap;
class SpTreeElem;
class GraphicFrame;
......@@ -403,7 +404,10 @@ public:
void convert(PPTX::Logic::NvCxnSpPr *oox_nvSpPr);
void convert(PPTX::Logic::NvGrpSpPr *oox_nvSpPr);
void convert(PPTX::Logic::NvPr *oox_nvPr);
void convert(PPTX::Logic::Paragraph *oox_para, PPTX::Logic::TextListStyle *oox_list_style = NULL);
void convert(PPTX::Logic::Paragraph *oox_para, PPTX::Logic::TextListStyle *oox_list_style = NULL);
void convert_list_level (PPTX::Logic::TextParagraphPr *oox_para_props, int level);
void convert_list (PPTX::Logic::TextListStyle *oox_list_style);
void convert(PPTX::Logic::TextListStyle *oox_list_style, int level, cpdoccore::odf_writer::style_paragraph_properties *paragraph_properties,
cpdoccore::odf_writer::style_text_properties *text_properties);
......
......@@ -3049,7 +3049,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
int type_list = odt_context->styles_context()->lists_styles().start_style_level(oox_num_lvl->m_oIlvl->GetValue(), oox_type_list );
if (type_list < 0) return;
odf_writer::style_list_level_properties * level_props = odt_context->styles_context()->lists_styles().get_list_level_properties();
odf_writer::style_list_level_properties * level_props = odt_context->styles_context()->lists_styles().get_list_level_properties();
odf_writer::style_list_level_label_alignment * aligment_props = odt_context->styles_context()->lists_styles().get_list_level_alignment_properties();
if (level_props == NULL)return;
......@@ -3101,8 +3101,8 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
}
}else
{
aligment_props->fo_text_indent_ = odf_types::length(0,odf_types::length::cm);
aligment_props->fo_margin_left_ = odf_types::length(0,odf_types::length::cm);
aligment_props->fo_text_indent_ = odf_types::length(0, odf_types::length::cm);
aligment_props->fo_margin_left_ = odf_types::length(0, odf_types::length::cm);
}
}
......@@ -3114,7 +3114,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
convert(oox_num_lvl->m_oRPr.GetPointer(), text_props);
//create text style for symbols list НА ЛОКАЛЬНОМ контексте - иначе пересечение имен стилей (todoo вытащить генерацию имен в общую часть)
styles_context->create_style(L"",odf_types::style_family::Text, false, true, -1);
styles_context->create_style(L"", odf_types::style_family::Text, false, true, -1);
odf_writer::odf_style_state_ptr style_state = styles_context->last_state(odf_types::style_family::Text);
if (style_state)
{
......
......@@ -986,9 +986,16 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
}
update_shape.txBody->lstStyle.reset(newListStyle);
}
pShape->Merge(update_shape);
//if (pShape->IsListStyleEmpty() == false)
//{
// //create list style
//}else if (listMasterStyle)
//{
//}
OoxConverter::convert(&update_shape);
}
else
......
......@@ -437,7 +437,6 @@ namespace PPTX
pWriter->EndRecord();
}
void Shape::FillLevelUp()
{
if ((m_pLevelUp == NULL) && (nvSpPr.nvPr.ph.IsInit()))
......@@ -452,6 +451,21 @@ namespace PPTX
}
}
bool Shape::IsListStyleEmpty()
{
if ((m_pLevelUp) && (m_pLevelUp->IsListStyleEmpty() == false)) return false;
if (txBody.IsInit() == false) return true;
if (txBody->lstStyle.IsInit() == false) return true;
for (int i = 0; i < 10; i++)
{
if (txBody->lstStyle->levels[i].IsInit())
return false;
}
return true;
}
void Shape::Merge(Shape& shape, bool bIsSlidePlaceholder)
{
if (m_pLevelUp)
......
......@@ -303,6 +303,7 @@ namespace PPTX
void FillLevelUp();
void Merge(Shape& shape, bool bIsSlidePlaceholder = false);
bool IsListStyleEmpty();
void SetLevelUpElement( Shape* p){m_pLevelUp = p;};
......
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