diff options
Diffstat (limited to 'starmath/source/node.cxx')
-rw-r--r-- | starmath/source/node.cxx | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index e252b83ee308..957c91cb33c6 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1607,8 +1607,7 @@ void SmFontNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) { SmNode *pNode = GetSubNode(1); assert(pNode); - sal_Int32 nc; - Color col_perso_rgb_color = COL_AUTO; + sal_uInt32 nc; switch (GetToken().eType) { case TSIZE : @@ -1646,13 +1645,10 @@ void SmFontNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) case TAQUA : SetColor(COL_LIGHTCYAN); break; case TFUCHSIA : SetColor(COL_LIGHTMAGENTA); break; case TRGB : - nc = GetToken().aText.toInt32(); - col_perso_rgb_color.SetBlue(nc % 256); - nc /= 256; - col_perso_rgb_color.SetGreen(nc % 256); - nc /= 256; - col_perso_rgb_color.SetRed(nc % 256); - SetColor(col_perso_rgb_color); + case TRGBA : + case THEX : + nc = GetToken().aText.toUInt32(); + SetColor(Color(nc)); break; default: @@ -1855,28 +1851,13 @@ void SmTextNode::GetAccessibleText( OUStringBuffer &rText ) const void SmTextNode::AdjustFontDesc() { - if (GetToken().eType == TTEXT) - mnFontDesc = FNT_TEXT; - else if(GetToken().eType == TFUNC) - mnFontDesc = FNT_FUNCTION; + if (GetToken().nGroup == TG::Function) mnFontDesc = FNT_FUNCTION; + else if (GetToken().eType == TTEXT) mnFontDesc = FNT_TEXT; else { - const SmTokenTableEntry *pEntry = SmParser::GetTokenTableEntry( maText ); - if (pEntry && pEntry->nGroup == TG::Function) { - GetToken().eType = pEntry->eType; - mnFontDesc = FNT_FUNCTION; - } else { - sal_Unicode firstChar = maText[0]; - if( ('0' <= firstChar && firstChar <= '9') || firstChar == '.' || firstChar == ',') { - mnFontDesc = FNT_NUMBER; - GetToken().eType = TNUMBER; - } else if (maText.getLength() > 1) { - mnFontDesc = FNT_VARIABLE; - GetToken().eType = TIDENT; - } else { - mnFontDesc = FNT_VARIABLE; - GetToken().eType = TCHARACTER; - } - } + sal_Unicode firstChar = maText[0]; + if( ('0' <= firstChar && firstChar <= '9') || firstChar == '.' || firstChar == ',') + mnFontDesc = FNT_NUMBER; + else mnFontDesc = FNT_VARIABLE; } } |