Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaSubbotina committed Jan 22, 2025
1 parent 66ea88b commit 5f5d74d
Showing 1 changed file with 40 additions and 16 deletions.
56 changes: 40 additions & 16 deletions OdfFile/Writer/Converter/MathConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,32 @@ namespace Oox2Odf
for (size_t i = 0; i < oox_math->m_arrItems.size(); ++i)
{
convert(oox_math->m_arrItems[i]);
}
}

StarMath::COOXml2Odf starMathConverter;
starMathConverter.StartConversion(oox_math);
if (bStart)
{
StarMath::COOXml2Odf starMathConverter;
starMathConverter.StartConversion(oox_math_para);

std::wstring annotation_text = starMathConverter.GetAnnotation();
std::wstring annotation_text = starMathConverter.GetAnnotation();

if (false == annotation_text.empty())
{
CREATE_MATH_TAG(L"annotation");
typedef odf_writer::math_annotation* T;
T tmp = dynamic_cast<T>(elm.get());
if (tmp)
if (false == annotation_text.empty())
{
tmp->encoding_ = L"StarMath 5.0";
CREATE_MATH_TAG(L"annotation");
typedef odf_writer::math_annotation* T;
T tmp = dynamic_cast<T>(elm.get());
if (tmp)
{
tmp->encoding_ = L"StarMath 5.0";
}
elm->add_text(annotation_text);

OPEN_MATH_TAG(elm);
CLOSE_MATH_TAG;
}
elm->add_text(annotation_text);

OPEN_MATH_TAG(elm);
CLOSE_MATH_TAG;
odf_context()->end_math();
}
if (bStart) odf_context()->end_math();
}

void OoxConverter::convert(OOX::Logic::CMathPr *oox_math_pr)
Expand Down Expand Up @@ -238,9 +242,29 @@ namespace Oox2Odf
{
convert(oox_math_para->m_arrItems[i]);
}

if (bStart)
{
StarMath::COOXml2Odf starMathConverter;
starMathConverter.StartConversion(oox_math_para);

std::wstring annotation_text = starMathConverter.GetAnnotation();

if (false == annotation_text.empty())
{
CREATE_MATH_TAG(L"annotation");
typedef odf_writer::math_annotation* T;
T tmp = dynamic_cast<T>(elm.get());
if (tmp)
{
tmp->encoding_ = L"StarMath 5.0";
}
elm->add_text(annotation_text);

OPEN_MATH_TAG(elm);
CLOSE_MATH_TAG;
}
odf_context()->end_math();
}
}

void OoxConverter::convert(OOX::Logic::COMathParaPr *oox_math_para_pr)
Expand Down

0 comments on commit 5f5d74d

Please sign in to comment.