This commit is contained in:
ElenaSubbotina
2025-05-15 15:43:41 +03:00
parent 9c9ac53475
commit 5210ffbd50
3 changed files with 16 additions and 2 deletions

View File

@ -1197,6 +1197,8 @@ void DocxConverter::convert(OOX::Logic::CFldSimple *oox_fld)
//SimpleTypes::COnOff<SimpleTypes::onoffFalse> m_oDirty;
//SimpleTypes::COnOff<SimpleTypes::onoffFalse> m_oFldLock;
bool run_state = odt_context->text_context()->in_span();
odt_context->start_field(true);
{
if (oox_fld->m_sInstr.IsInit())
@ -1210,6 +1212,11 @@ void DocxConverter::convert(OOX::Logic::CFldSimple *oox_fld)
}
}
odt_context->end_field();
if (!run_state)
{
odt_context->end_run();
}
}
void DocxConverter::convert(OOX::Logic::CInstrText *oox_instrText)
{

View File

@ -428,7 +428,13 @@ void odf_text_context::start_span(bool styled)
current_level_.push_back(state);
}
bool odf_text_context::in_span()
{
if (false == current_level_.empty() && dynamic_cast<text_span*>(current_level_.back().elm.get()))
return true;
return false;
}
void odf_text_context::end_span()
{
if (styles_context_ == NULL || single_paragraph_)return;

View File

@ -116,8 +116,9 @@ public:
office_element_ptr start_field(int type, const std::wstring& value, const std::wstring& format);
void end_field();
void start_span (bool styled = false);
void end_span ();
void start_span (bool styled = false);
void end_span ();
bool in_span();
void start_list_item ();
void end_list_item ();