summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-04-01 19:35:19 +0900
committerNoel Grandin <noelgrandin@gmail.com>2015-04-02 08:43:10 +0000
commit11a52df2216bf96a3869ac894513959098dc14da (patch)
treeaa3440ea45227f7649f92037dda791e0fc9649f0 /starmath/source
parent00bf3a4259c1f960eff05b17649cc734c275950f (diff)
Replace FNTSIZ_* with a scoped enumeration FontSizeType
Change-Id: Ia6bcaaac60c18abda803f6a40db8a5c5076b9427 Reviewed-on: https://gerrit.libreoffice.org/15101 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/mathmlexport.cxx8
-rw-r--r--starmath/source/mathmlimport.cxx6
-rw-r--r--starmath/source/node.cxx24
-rw-r--r--starmath/source/parse.cxx14
-rw-r--r--starmath/source/visitors.cxx10
5 files changed, 31 insertions, 31 deletions
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 8cc9dc0522aa..3466e51149f2 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -1368,17 +1368,17 @@ void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
OUStringBuffer sStrBuf;
switch(pFontNode->GetSizeType())
{
- case FNTSIZ_MULTIPLY:
+ case FontSizeType::MULTIPLY:
::sax::Converter::convertDouble(sStrBuf,
static_cast<double>(aFrac*Fraction(100.00)));
sStrBuf.append('%');
break;
- case FNTSIZ_DIVIDE:
+ case FontSizeType::DIVIDE:
::sax::Converter::convertDouble(sStrBuf,
static_cast<double>(Fraction(100.00)/aFrac));
sStrBuf.append('%');
break;
- case FNTSIZ_ABSOLUT:
+ case FontSizeType::ABSOLUT:
::sax::Converter::convertDouble(sStrBuf,
static_cast<double>(aFrac));
sStrBuf.append(
@@ -1395,7 +1395,7 @@ void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
Fraction aTemp = Sm100th_mmToPts(pFontNode->GetFont().
GetSize().Height());
- if (pFontNode->GetSizeType() == FNTSIZ_MINUS)
+ if (pFontNode->GetSizeType() == FontSizeType::MINUS)
aTemp-=aFrac;
else
aTemp+=aFrac;
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index d5ddd2ed5f26..0691339809f2 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -710,13 +710,13 @@ void SmXMLContext_Helper::ApplyAttrs()
{
if (nFontSize < 100.00)
pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
- FNTSIZ_DIVIDE);
+ FontSizeType::DIVIDE);
else
pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
- FNTSIZ_MULTIPLY);
+ FontSizeType::MULTIPLY);
}
else
- pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
+ pFontNode->SetSizeParameter(Fraction(nFontSize),FontSizeType::ABSOLUT);
pFontNode->SetSubNodes(0,popOrZero(rNodeStack));
rNodeStack.push_front(pFontNode);
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 80bba2cf1e54..9f413ee2bd4a 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -164,7 +164,7 @@ void SmNode::SetFont(const SmFace &rFace)
}
-void SmNode::SetFontSize(const Fraction &rSize, sal_uInt16 nType)
+void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType)
//! 'rSize' is in units of pts
{
Size aFntSize;
@@ -179,23 +179,23 @@ void SmNode::SetFontSize(const Fraction &rSize, sal_uInt16 nType)
aFntSize.Width() = 0;
switch(nType)
{
- case FNTSIZ_ABSOLUT:
+ case FontSizeType::ABSOLUT:
aFntSize.Height() = nHeight;
break;
- case FNTSIZ_PLUS:
+ case FontSizeType::PLUS:
aFntSize.Height() += nHeight;
break;
- case FNTSIZ_MINUS:
+ case FontSizeType::MINUS:
aFntSize.Height() -= nHeight;
break;
- case FNTSIZ_MULTIPLY:
+ case FontSizeType::MULTIPLY:
aFntSize.Height() = (long) (Fraction(aFntSize.Height()) * rSize);
break;
- case FNTSIZ_DIVIDE:
+ case FontSizeType::DIVIDE:
if (rSize != Fraction(0L))
aFntSize.Height() = (long) (Fraction(aFntSize.Height()) / rSize);
break;
@@ -2038,19 +2038,19 @@ void SmFontNode::CreateTextFromNode(OUString &rText)
rText += "size ";
switch (nSizeType)
{
- case FNTSIZ_PLUS:
+ case FontSizeType::PLUS:
rText += "+";
break;
- case FNTSIZ_MINUS:
+ case FontSizeType::MINUS:
rText += "-";
break;
- case FNTSIZ_MULTIPLY:
+ case FontSizeType::MULTIPLY:
rText += "*";
break;
- case FNTSIZ_DIVIDE:
+ case FontSizeType::DIVIDE:
rText += "/";
break;
- case FNTSIZ_ABSOLUT:
+ case FontSizeType::ABSOLUT:
default:
break;
}
@@ -2205,7 +2205,7 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
}
-void SmFontNode::SetSizeParameter(const Fraction& rValue, sal_uInt16 Type)
+void SmFontNode::SetSizeParameter(const Fraction& rValue, FontSizeType Type)
{
nSizeType = Type;
aFontSize = rValue;
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index cb47ab9228b7..5881c378c6f0 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1925,18 +1925,18 @@ void SmParser::FontSize()
{
OSL_ENSURE(m_aCurToken.eType == TSIZE, "Sm : Ooops...");
- sal_uInt16 Type;
+ FontSizeType Type;
SmFontNode *pFontNode = new SmFontNode(m_aCurToken);
NextToken();
switch (m_aCurToken.eType)
{
- case TNUMBER: Type = FNTSIZ_ABSOLUT; break;
- case TPLUS: Type = FNTSIZ_PLUS; break;
- case TMINUS: Type = FNTSIZ_MINUS; break;
- case TMULTIPLY: Type = FNTSIZ_MULTIPLY; break;
- case TDIVIDEBY: Type = FNTSIZ_DIVIDE; break;
+ case TNUMBER: Type = FontSizeType::ABSOLUT; break;
+ case TPLUS: Type = FontSizeType::PLUS; break;
+ case TMINUS: Type = FontSizeType::MINUS; break;
+ case TMULTIPLY: Type = FontSizeType::MULTIPLY; break;
+ case TDIVIDEBY: Type = FontSizeType::DIVIDE; break;
default:
delete pFontNode;
@@ -1944,7 +1944,7 @@ void SmParser::FontSize()
return;
}
- if (Type != FNTSIZ_ABSOLUT)
+ if (Type != FontSizeType::ABSOLUT)
{
NextToken();
if (m_aCurToken.eType != TNUMBER)
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index ed1cf979c90e..fc7decf70143 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -2113,19 +2113,19 @@ void SmNodeToTextVisitor::Visit( SmFontNode* pNode )
Append( "size " );
switch ( pNode->GetSizeType( ) )
{
- case FNTSIZ_PLUS:
+ case FontSizeType::PLUS:
Append( "+" );
break;
- case FNTSIZ_MINUS:
+ case FontSizeType::MINUS:
Append( "-" );
break;
- case FNTSIZ_MULTIPLY:
+ case FontSizeType::MULTIPLY:
Append( "*" );
break;
- case FNTSIZ_DIVIDE:
+ case FontSizeType::DIVIDE:
Append( "/" );
break;
- case FNTSIZ_ABSOLUT:
+ case FontSizeType::ABSOLUT:
default:
break;
}