Skip to content

Commit

Permalink
Merge pull request 'Fix bug #72414' (#225) from fix/bug72414 into hot…
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaSubbotina committed Feb 11, 2025
2 parents b26e3e2 + 6913cae commit 4b4845c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 3 additions & 1 deletion OdfFile/Reader/Format/style_paragraph_properties_docx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context, bool c

length def_tab = length(1.0, length::cm);// в ms значение 0.8 не корректно оО

double tab_pos = 20.0 * style_position_.get_value_unit(length::pt);
double tab_pos_offset = (!Context.get_paragraph_state() || Context.is_table_content()) ? margin_left : 0;

double tab_pos = 20.0 * style_position_.get_value_unit(length::pt) + tab_pos_offset;
double min_tab_pos = 20.0 * def_tab.get_value_unit(length::pt) ;

if (tab_pos < min_tab_pos)
Expand Down
13 changes: 1 addition & 12 deletions OdfFile/Reader/Format/text_elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ void paragraph::process_list_bullet_style(oox::docx_conversion_context& Context)
if (!span_style_content)
return;

std::wstringstream ss;
style_text_properties* text_props = span_style_content->get_style_text_properties();

if (text_props)
Expand All @@ -280,20 +279,10 @@ void paragraph::process_list_bullet_style(oox::docx_conversion_context& Context)
style_instance* paragraph_style = Context.root()->odf_context().styleContainer().style_by_name(attrs_.text_style_name_, style_family::Paragraph, false);
if (paragraph_style && paragraph_style->content())
{
paragraph_style->content()->get_style_text_properties(true)->content_.apply_from(text_props->content_);
paragraph_style->content()->get_style_text_properties(true)->content_.fo_color_ = text_props->content_.fo_color_;
}
}

const _CP_OPT(odf_types::font_weight)& font_weight = text_props->content_.fo_font_weight_;
const _CP_OPT(odf_types::font_style)& font_style = text_props->content_.fo_font_style_;

if (font_weight && font_weight->get_type() == odf_types::font_weight::WBold)
ss << "<w:b/>";
if (font_style && font_style->get_type() == odf_types::font_style::Italic)
ss << "<w:i/>";
}

Context.get_text_tracked_context().dumpRPrInsDel_ = ss.str();
}

void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std::wstring) next_element_style_name)
Expand Down

0 comments on commit 4b4845c

Please sign in to comment.