diff options
Diffstat (limited to 'starmath/source/mathml/import.cxx')
-rw-r--r-- | starmath/source/mathml/import.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx index 1da11b86fc76..a882e0b527cd 100644 --- a/starmath/source/mathml/import.cxx +++ b/starmath/source/mathml/import.cxx @@ -790,23 +790,23 @@ void SmMLImportContext::inheritStyleEnd() } // Mi: 1 char -> italic - if (m_pElement->getMlElementType() == SmMlElementType::MlMi) + if (m_pElement->getMlElementType() != SmMlElementType::MlMi) + return; + + // Inherit mathvariant + if (!m_pStyle->isAttributeSet(SmMlAttributeValueType::MlMathvariant)) { - // Inherit mathvariant - if (!m_pStyle->isAttributeSet(SmMlAttributeValueType::MlMathvariant)) + sal_Int32 nIndexUtf16 = 0; + // Check if there is only one code point + m_pElement->getText().iterateCodePoints(&nIndexUtf16, 1); + // Mathml says that 1 code point -> italic + if (nIndexUtf16 == m_pElement->getText().getLength()) { - sal_Int32 nIndexUtf16 = 0; - // Check if there is only one code point - m_pElement->getText().iterateCodePoints(&nIndexUtf16, 1); - // Mathml says that 1 code point -> italic - if (nIndexUtf16 == m_pElement->getText().getLength()) - { - SmMlAttribute aAttribute(SmMlAttributeValueType::MlMathvariant); - SmMlMathvariant aMathvariant = { SmMlAttributeValueMathvariant::italic }; - aAttribute.setMlMathvariant(&aMathvariant); - aAttribute.setSet(false); - m_pElement->setAttribute(aAttribute); - } + SmMlAttribute aAttribute(SmMlAttributeValueType::MlMathvariant); + SmMlMathvariant aMathvariant = { SmMlAttributeValueMathvariant::italic }; + aAttribute.setMlMathvariant(&aMathvariant); + aAttribute.setSet(false); + m_pElement->setAttribute(aAttribute); } } } |