[Libreoffice-commits] core.git: starmath/inc starmath/source
Caolán McNamara
caolanm at redhat.com
Sat Jan 6 15:10:28 UTC 2018
starmath/inc/node.hxx | 2 +-
starmath/source/mathmlimport.cxx | 7 +++----
starmath/source/node.cxx | 9 +++------
3 files changed, 7 insertions(+), 11 deletions(-)
New commits:
commit a5850ecec9ba72ab671154b351db6a423db83f76
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 5 18:37:21 2018 +0000
ofz#4765 Timeout
Change-Id: I15400165c5233277a171b19e69db7497ce525e7f
Reviewed-on: https://gerrit.libreoffice.org/47482
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 260eec9e8943..acef42a50cfd 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -1116,7 +1116,7 @@ public:
{
}
- void IncreaseBy(const SmToken &rToken);
+ void IncreaseBy(const SmToken &rToken, sal_uInt32 nMultiplyBy = 1);
void Clear() { mnNum = 0; }
sal_uInt16 GetBlankNum() const { return mnNum; }
void SetBlankNum(sal_uInt16 nNumber) { mnNum = nNumber; }
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 336c926bd62a..bf2caa0a8458 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1547,13 +1547,12 @@ void SmXMLSpaceContext_Impl::StartElement(
aToken.nGroup = TG::Blank;
aToken.nLevel = 5;
std::unique_ptr<SmBlankNode> pBlank(new SmBlankNode(aToken));
- for (sal_Int32 i = 0; i < nWide; i++)
- pBlank->IncreaseBy(aToken);
+ if (nWide > 0)
+ pBlank->IncreaseBy(aToken, nWide);
if (nNarrow > 0)
{
aToken.eType = TSBLANK;
- for (sal_Int32 i = 0; i < nNarrow; i++)
- pBlank->IncreaseBy(aToken);
+ pBlank->IncreaseBy(aToken, nNarrow);
}
GetSmImport().GetNodeStack().push_front(std::move(pBlank));
}
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index f725f5225995..e48de29b8950 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2725,22 +2725,19 @@ void SmErrorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
SmRect::operator = (SmRect(aTmpDev, &rFormat, rText, GetFont().GetBorderWidth()));
}
-
/**************************************************************************/
-
-void SmBlankNode::IncreaseBy(const SmToken &rToken)
+void SmBlankNode::IncreaseBy(const SmToken &rToken, sal_uInt32 nMultiplyBy)
{
switch(rToken.eType)
{
- case TBLANK: mnNum += 4; break;
- case TSBLANK: mnNum += 1; break;
+ case TBLANK: mnNum += (4 * nMultiplyBy); break;
+ case TSBLANK: mnNum += (1 * nMultiplyBy); break;
default:
break;
}
}
-
void SmBlankNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
{
SmNode::Prepare(rFormat, rDocShell);
More information about the Libreoffice-commits
mailing list