diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-03 21:36:26 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-04 07:33:41 +0100 |
commit | 8548e3caa8ed6d4e77d136e1b8d3c3b18cf074bb (patch) | |
tree | e05dc9f564fb0f788a355e375eb81ebfc1917d63 /starmath/source/mathml/mathmlexport.cxx | |
parent | 807888b849187eaf5d1c0e4a064f66702180a8e9 (diff) |
Use o3tl::convert in Mathcp-22.05.8-1
... and use our standard definition of pt.
Change-Id: I5a162b137360210335b84de33606dc7404cfc2de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142204
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit a37a979107a8643136ff3733b5b350b6b1be2bb7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142208
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'starmath/source/mathml/mathmlexport.cxx')
-rw-r--r-- | starmath/source/mathml/mathmlexport.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index d0f5089e241c..ca9453d8d0ab 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -1171,12 +1171,12 @@ void SmXMLExport::ExportFont(const SmNode* pNode, int nLevel) { case FontSizeType::MULTIPLY: ::sax::Converter::convertDouble(sStrBuf, - static_cast<double>(aFrac * Fraction(100.00))); + static_cast<double>(aFrac * Fraction(100, 1))); sStrBuf.append('%'); break; case FontSizeType::DIVIDE: ::sax::Converter::convertDouble(sStrBuf, - static_cast<double>(Fraction(100.00) / aFrac)); + static_cast<double>(Fraction(100, 1) / aFrac)); sStrBuf.append('%'); break; case FontSizeType::ABSOLUT: @@ -1191,14 +1191,14 @@ void SmXMLExport::ExportFont(const SmNode* pNode, int nLevel) //value specified in points. //Must fix StarMath to retain the original pt values - Fraction aTemp = Sm100th_mmToPts(pFontNode->GetFont().GetFontSize().Height()); + double mytest + = o3tl::convert<double>(pFontNode->GetFont().GetFontSize().Height(), + o3tl::Length::mm100, o3tl::Length::pt); if (pFontNode->GetSizeType() == FontSizeType::MINUS) - aTemp -= aFrac; + mytest -= static_cast<double>(aFrac); else - aTemp += aFrac; - - double mytest = static_cast<double>(aTemp); + mytest += static_cast<double>(aFrac); mytest = ::rtl::math::round(mytest, 1); ::sax::Converter::convertDouble(sStrBuf, mytest); |