This commit is contained in:
Kamil Kerimov
2024-09-10 03:24:57 +05:00
parent f6c48c1edb
commit 6a2d3838ae
4 changed files with 63 additions and 2 deletions

View File

@ -201,6 +201,7 @@ struct odf_drawing_state
presentation_class_ = boost::none;
presentation_placeholder_id_ = boost::none;
placeholder_replacing = false;
rotateAngle_ = boost::none;
text_rotateAngle_ = boost::none;
@ -249,6 +250,7 @@ struct odf_drawing_state
_CP_OPT(presentation_class) presentation_class_;
_CP_OPT(std::wstring) presentation_placeholder_id_;
bool placeholder_replacing;
std::wstring program_;
std::wstring replacement_;
@ -294,6 +296,7 @@ public:
is_header_ = false;
is_footer_ = false;
is_background_ = false;
placeholder_replacing = false;
//некоторые свойства для объектов графики не поддерживаюися в редакторах Libre && OpenOffice.net
//в MS Office и в нашем - проблем таких нет.
}
@ -309,6 +312,7 @@ public:
bool is_footer_;
bool is_header_;
bool is_background_;
bool placeholder_replacing;
_CP_OPT(int) is_presentation_;
void create_draw_base(eOdfDrawElements type);
@ -2592,18 +2596,47 @@ void odf_drawing_context::set_paragraph_properties(paragraph_format_properties *
}
else
{
//??? find by name
/// find by name
if (!draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_text_style_name_->empty())
{
style* found_style;
impl_->styles_context_->find_odf_style(
*draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_text_style_name_,
odf_types::style_family::Paragraph,
found_style);
if (found_style)
impl_->current_paragraph_properties = found_style->content_.add_get_style_paragraph_properties();
}
}
}
}
if (impl_->current_paragraph_properties && paragraph_properties)
impl_->current_paragraph_properties ->apply_from(*paragraph_properties);
impl_->current_paragraph_properties->apply_from(*paragraph_properties);
}
void odf_drawing_context::set_graphic_properties(style_graphic_properties *graphic_properties)
{
if (impl_->current_graphic_properties && graphic_properties)
impl_->current_graphic_properties->apply_from(graphic_properties->content_);
}
void odf_drawing_context::set_graphic_properties(graphic_format_properties* graphic_properties)
{
if (impl_->current_graphic_properties && graphic_properties)
impl_->current_graphic_properties->apply_from(*graphic_properties);
}
void odf_drawing_context::placeholder_replacing(bool replacing)
{
impl_->current_drawing_state_.placeholder_replacing = replacing;
}
bool odf_drawing_context::placeholder_replacing()
{
return impl_->current_drawing_state_.placeholder_replacing;
}
graphic_format_properties* odf_drawing_context::get_graphic_properties()
{
return impl_->current_graphic_properties;

View File

@ -152,10 +152,13 @@ public:
bool is_wordart();
bool is_text_box();
bool is_placeholder();
void placeholder_replacing(bool replacing);
bool placeholder_replacing();
graphic_format_properties* get_graphic_properties();
void set_graphic_properties (style_graphic_properties *graphic_properties);
void set_graphic_properties (graphic_format_properties* graphic_properties);
void set_paragraph_properties (paragraph_format_properties *paragraph_properties);
void set_text_properties (style_text_properties *text_properties);
void set_text_properties (text_format_properties* text_properties);