summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 12:31:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 14:58:51 +0200
commit29489b33b435683021b72cb2bce27aba8cb7a430 (patch)
tree8e4e1c59d56d5ed0d0ca4d088419067041e4553a /starmath
parenta4244c0f05b95ded277a3a7ed217bf0451daa996 (diff)
loplugin:flatten
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathml/import.cxx30
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);
}
}
}