diff options
Diffstat (limited to 'starmath/source/node.cxx')
-rwxr-xr-x | starmath/source/node.cxx | 296 |
1 files changed, 148 insertions, 148 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index b1d7d9e69210..c4e731de932c 100755 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -79,7 +79,7 @@ class SmTmpDevice Color Impl_GetColor( const Color& rColor ); public: - SmTmpDevice(OutputDevice &rTheDev, BOOL bUseMap100th_mm); + SmTmpDevice(OutputDevice &rTheDev, sal_Bool bUseMap100th_mm); ~SmTmpDevice() { rOutDev.Pop(); } void SetFont(const Font &rNewFont); @@ -92,7 +92,7 @@ public: }; -SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, BOOL bUseMap100th_mm) : +SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, sal_Bool bUseMap100th_mm) : rOutDev(rTheDev) { rOutDev.Push( PUSH_FONT | PUSH_MAPMODE | @@ -155,19 +155,19 @@ SmNode::~SmNode() } -BOOL SmNode::IsVisible() const +sal_Bool SmNode::IsVisible() const { - return FALSE; + return sal_False; } -USHORT SmNode::GetNumSubNodes() const +sal_uInt16 SmNode::GetNumSubNodes() const { return 0; } -SmNode * SmNode::GetSubNode(USHORT /*nIndex*/) +SmNode * SmNode::GetSubNode(sal_uInt16 /*nIndex*/) { return NULL; } @@ -185,14 +185,14 @@ SmNode * SmNode::GetLeftMost() } -void SmNode::SetPhantom(BOOL bIsPhantomP) +void SmNode::SetPhantom(sal_Bool bIsPhantomP) { if (! (Flags() & FLG_VISIBLE)) bIsPhantom = bIsPhantomP; SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetPhantom(bIsPhantom); } @@ -204,14 +204,14 @@ void SmNode::SetColor(const Color& rColor) GetFont().SetColor(rColor); SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetColor(rColor); } -void SmNode::SetAttribut(USHORT nAttrib) +void SmNode::SetAttribut(sal_uInt16 nAttrib) { if ( (nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD)) || @@ -222,14 +222,14 @@ void SmNode::SetAttribut(USHORT nAttrib) } SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetAttribut(nAttrib); } -void SmNode::ClearAttribut(USHORT nAttrib) +void SmNode::ClearAttribut(sal_uInt16 nAttrib) { if ( (nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD)) || @@ -240,8 +240,8 @@ void SmNode::ClearAttribut(USHORT nAttrib) } SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->ClearAttribut(nAttrib); } @@ -253,14 +253,14 @@ void SmNode::SetFont(const SmFace &rFace) GetFont() = rFace; SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetFont(rFace); } -void SmNode::SetFontSize(const Fraction &rSize, USHORT nType) +void SmNode::SetFontSize(const Fraction &rSize, sal_uInt16 nType) //! 'rSize' is in units of pts { Size aFntSize; @@ -309,8 +309,8 @@ void SmNode::SetFontSize(const Fraction &rSize, USHORT nType) } SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetFontSize(rSize, nType); } @@ -321,14 +321,14 @@ void SmNode::SetSize(const Fraction &rSize) GetFont() *= rSize; SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetSize(rSize); } -void SmNode::SetRectHorAlign(RectHorAlign eHorAlign, BOOL bApplyToSubTree ) +void SmNode::SetRectHorAlign(RectHorAlign eHorAlign, sal_Bool bApplyToSubTree ) { if (!(Flags() & FLG_HORALIGN)) eRectHorAlign = eHorAlign; @@ -336,8 +336,8 @@ void SmNode::SetRectHorAlign(RectHorAlign eHorAlign, BOOL bApplyToSubTree ) if (bApplyToSubTree) { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->SetRectHorAlign(eHorAlign); } @@ -354,11 +354,11 @@ void SmNode::PrepareAttributes() void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) { #if OSL_DEBUG_LEVEL > 1 - bIsDebug = TRUE; + bIsDebug = sal_True; #else - bIsDebug = FALSE; + bIsDebug = sal_False; #endif - bIsPhantom = FALSE; + bIsPhantom = sal_False; nFlags = 0; nAttributes = 0; @@ -376,8 +376,8 @@ void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) GetFont().SetItalic(ITALIC_NONE); SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->Prepare(rFormat, rDocShell); } @@ -389,11 +389,11 @@ void SmNode::ToggleDebug() const { SmNode *pThis = (SmNode *) this; - pThis->bIsDebug = bIsDebug ? FALSE : TRUE; + pThis->bIsDebug = bIsDebug ? sal_False : sal_True; SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = pThis->GetSubNode(i))) pNode->ToggleDebug(); } @@ -408,8 +408,8 @@ void SmNode::Move(const Point& rPosition) SmRect::Move(rPosition); SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->Move(rPosition); } @@ -418,8 +418,8 @@ void SmNode::Move(const Point& rPosition) void SmNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->Arrange(rDev, rFormat); } @@ -427,10 +427,10 @@ void SmNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) void SmNode::CreateTextFromNode(String &rText) { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); + sal_uInt16 nSize = GetNumSubNodes(); if (nSize > 1) rText.Append('{'); - for (USHORT i = 0; i < nSize; i++) + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->CreateTextFromNode(rText); if (nSize > 1) @@ -441,12 +441,12 @@ void SmNode::CreateTextFromNode(String &rText) } -void SmNode::AdaptToX(const OutputDevice &/*rDev*/, ULONG /*nWidth*/) +void SmNode::AdaptToX(const OutputDevice &/*rDev*/, sal_uLong /*nWidth*/) { } -void SmNode::AdaptToY(const OutputDevice &/*rDev*/, ULONG /*nHeight*/) +void SmNode::AdaptToY(const OutputDevice &/*rDev*/, sal_uLong /*nHeight*/) { } @@ -457,8 +457,8 @@ void SmNode::Draw(OutputDevice &rDev, const Point &rPosition) const return; const SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - for (USHORT i = 0; i < nSize; i++) + sal_uInt16 nSize = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) { Point aOffset (pNode->GetTopLeft() - GetTopLeft()); pNode->Draw(rDev, rPosition + aOffset); @@ -473,7 +473,7 @@ void SmNode::Draw(OutputDevice &rDev, const Point &rPosition) const #endif } -const SmNode * SmNode::FindTokenAt(USHORT nRow, USHORT nCol) const +const SmNode * SmNode::FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const // returns (first) ** visible ** (sub)node with the tokens text at // position 'nRow', 'nCol'. //! (there should be exactly one such node if any) @@ -484,8 +484,8 @@ const SmNode * SmNode::FindTokenAt(USHORT nRow, USHORT nCol) const return this; else { - USHORT nNumSubNodes = GetNumSubNodes(); - for (USHORT i = 0; i < nNumSubNodes; i++) + sal_uInt16 nNumSubNodes = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nNumSubNodes; i++) { const SmNode *pNode = GetSubNode(i); if (!pNode) @@ -510,8 +510,8 @@ const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const pResult = this; else { - USHORT nNumSubNodes = GetNumSubNodes(); - for (USHORT i = 0; i < nNumSubNodes; i++) + sal_uInt16 nNumSubNodes = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nNumSubNodes; i++) { const SmNode *pNode = GetSubNode(i); if (!pNode) @@ -557,8 +557,8 @@ const SmNode * SmNode::FindNodeWithAccessibleIndex(xub_StrLen nAccIdx) const pResult = this; else { - USHORT nNumSubNodes = GetNumSubNodes(); - for (USHORT i = 0; i < nNumSubNodes; i++) + sal_uInt16 nNumSubNodes = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nNumSubNodes; i++) { const SmNode *pNode = GetSubNode(i); if (!pNode) @@ -585,12 +585,12 @@ long SmNode::GetFormulaBaseline() const SmStructureNode::SmStructureNode( const SmStructureNode &rNode ) : SmNode( rNode.GetType(), rNode.GetToken() ) { - ULONG i; + sal_uLong i; for (i = 0; i < aSubNodes.size(); i++) delete aSubNodes[i]; aSubNodes.resize(0); - ULONG nSize = rNode.aSubNodes.size(); + sal_uLong nSize = rNode.aSubNodes.size(); aSubNodes.resize( nSize ); for (i = 0; i < nSize; ++i) { @@ -604,7 +604,7 @@ SmStructureNode::~SmStructureNode() { SmNode *pNode; - for (USHORT i = 0; i < GetNumSubNodes(); i++) + for (sal_uInt16 i = 0; i < GetNumSubNodes(); i++) if (NULL != (pNode = GetSubNode(i))) delete pNode; } @@ -614,12 +614,12 @@ SmStructureNode & SmStructureNode::operator = ( const SmStructureNode &rNode ) { SmNode::operator = ( rNode ); - ULONG i; + sal_uLong i; for (i = 0; i < aSubNodes.size(); i++) delete aSubNodes[i]; aSubNodes.resize(0); - ULONG nSize = rNode.aSubNodes.size(); + sal_uLong nSize = rNode.aSubNodes.size(); aSubNodes.resize( nSize ); for (i = 0; i < nSize; ++i) { @@ -650,19 +650,19 @@ void SmStructureNode::SetSubNodes(const SmNodeArray &rNodeArray) } -BOOL SmStructureNode::IsVisible() const +sal_Bool SmStructureNode::IsVisible() const { - return FALSE; + return sal_False; } -USHORT SmStructureNode::GetNumSubNodes() const +sal_uInt16 SmStructureNode::GetNumSubNodes() const { - return (USHORT) aSubNodes.size(); + return (sal_uInt16) aSubNodes.size(); } -SmNode * SmStructureNode::GetSubNode(USHORT nIndex) +SmNode * SmStructureNode::GetSubNode(sal_uInt16 nIndex) { return aSubNodes[nIndex]; } @@ -670,8 +670,8 @@ SmNode * SmStructureNode::GetSubNode(USHORT nIndex) void SmStructureNode::GetAccessibleText( String &rText ) const { - USHORT nNodes = GetNumSubNodes(); - for (USHORT i = 0; i < nNodes; ++i) + sal_uInt16 nNodes = GetNumSubNodes(); + for (sal_uInt16 i = 0; i < nNodes; ++i) { const SmNode *pNode = ((SmStructureNode *) this)->GetSubNode(i); if (pNode) @@ -688,19 +688,19 @@ void SmStructureNode::GetAccessibleText( String &rText ) const /////////////////////////////////////////////////////////////////////////// -BOOL SmVisibleNode::IsVisible() const +sal_Bool SmVisibleNode::IsVisible() const { - return TRUE; + return sal_True; } -USHORT SmVisibleNode::GetNumSubNodes() const +sal_uInt16 SmVisibleNode::GetNumSubNodes() const { return 0; } -SmNode * SmVisibleNode::GetSubNode(USHORT /*nIndex*/) +SmNode * SmVisibleNode::GetSubNode(sal_uInt16 /*nIndex*/) { return NULL; } @@ -719,10 +719,10 @@ void SmGraphicNode::GetAccessibleText( String &rText ) const void SmExpressionNode::CreateTextFromNode(String &rText) { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); + sal_uInt16 nSize = GetNumSubNodes(); if (nSize > 1) rText.Append('{'); - for (USHORT i = 0; i < nSize; i++) + for (sal_uInt16 i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) { pNode->CreateTextFromNode(rText); @@ -749,7 +749,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) Point rPosition; SmNode *pNode; - USHORT nSize = GetNumSubNodes(); + sal_uInt16 nSize = GetNumSubNodes(); // make distance depend on font size long nDist = +(rFormat.GetDistance(DIS_VERTICAL) @@ -761,7 +761,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) // arrange subnodes and get maximum width of them long nMaxWidth = 0, nTmp; - USHORT i; + sal_uInt16 i; for (i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) { pNode->Arrange(rDev, rFormat); @@ -791,7 +791,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) nFormulaBaseline = GetBaseline(); else { - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect aRect = (SmRect(aTmpDev, &rFormat, C2S("a"), @@ -838,13 +838,13 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) // arranges all subnodes in one row with some extra space between { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); - USHORT i; + sal_uInt16 nSize = GetNumSubNodes(); + sal_uInt16 i; for (i = 0; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) pNode->Arrange(rDev, rFormat); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); if (nSize < 1) @@ -898,7 +898,7 @@ void SmExpressionNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat // copy alignment of leftmost subnode if any SmNode *pNode = GetLeftMost(); if (pNode) - SetRectHorAlign(pNode->GetRectHorAlign(), FALSE); + SetRectHorAlign(pNode->GetRectHorAlign(), sal_False); } @@ -907,7 +907,7 @@ void SmExpressionNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat void SmUnHorNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { - BOOL bIsPostfix = GetToken().eType == TFACT; + sal_Bool bIsPostfix = GetToken().eType == TFACT; SmNode *pOper = GetSubNode(bIsPostfix ? 1 : 0), *pBody = GetSubNode(bIsPostfix ? 0 : 1); @@ -1021,7 +1021,7 @@ void SmRootNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmRect::operator = (*pBody); ExtendBy(*pRootSym, RCP_THIS); if (pExtra) - ExtendBy(*pExtra, RCP_THIS, (BOOL) TRUE); + ExtendBy(*pExtra, RCP_THIS, (sal_Bool) sal_True); } @@ -1090,7 +1090,7 @@ void SmBinVerNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) DBG_ASSERT(pLine, "Sm : NULL pointer"); DBG_ASSERT(pDenom, "Sm : NULL pointer"); - BOOL bIsTextmode = rFormat.IsTextmode(); + sal_Bool bIsTextmode = rFormat.IsTextmode(); if (bIsTextmode) { Fraction aFraction(rFormat.GetRelSize(SIZ_INDEX), 100); @@ -1166,14 +1166,14 @@ double Det(const Point &rHeading1, const Point &rHeading2) } -BOOL IsPointInLine(const Point &rPoint1, +sal_Bool IsPointInLine(const Point &rPoint1, const Point &rPoint2, const Point &rHeading2) - // ergibt TRUE genau dann, wenn der Punkt 'rPoint1' zu der Gerade gehoert die + // ergibt sal_True genau dann, wenn der Punkt 'rPoint1' zu der Gerade gehoert die // durch den Punkt 'rPoint2' geht und den Richtungsvektor 'rHeading2' hat { DBG_ASSERT(rHeading2 != Point(), "Sm : 0 vector"); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; const double eps = 5.0 * DBL_EPSILON; double fLambda; @@ -1192,14 +1192,14 @@ BOOL IsPointInLine(const Point &rPoint1, } -USHORT GetLineIntersectionPoint(Point &rResult, +sal_uInt16 GetLineIntersectionPoint(Point &rResult, const Point& rPoint1, const Point &rHeading1, const Point& rPoint2, const Point &rHeading2) { DBG_ASSERT(rHeading1 != Point(), "Sm : 0 vector"); DBG_ASSERT(rHeading2 != Point(), "Sm : 0 vector"); - USHORT nRes = 1; + sal_uInt16 nRes = 1; const double eps = 5.0 * DBL_EPSILON; // sind die Richtumgsvektoren linear abhaengig ? @@ -1228,7 +1228,7 @@ USHORT GetLineIntersectionPoint(Point &rResult, SmBinDiagonalNode::SmBinDiagonalNode(const SmToken &rNodeToken) : SmStructureNode(NBINDIAGONAL, rNodeToken) { - bAscending = FALSE; + bAscending = sal_False; SetNumSubNodes(3); } @@ -1378,7 +1378,7 @@ void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rForma //! some routines being called extract some info from the OutputDevice's //! font (eg the space to be used for borders OR the font name(!!)). //! Thus the font should reflect the needs and has to be set! - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); pLeft->Arrange(aTmpDev, rFormat); @@ -1471,7 +1471,7 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) // (as would be in "a_{1_{2_{3_4}}}") if (GetFont().GetSize().Height() > rFormat.GetBaseSize().Height() / 3) { - USHORT nIndex = (eSubSup == CSUB || eSubSup == CSUP) ? + sal_uInt16 nIndex = (eSubSup == CSUB || eSubSup == CSUP) ? SIZ_LIMITS : SIZ_INDEX; Fraction aFraction ( rFormat.GetRelSize(nIndex), 100 ); pSubSup->SetSize(aFraction); @@ -1479,7 +1479,7 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pSubSup->Arrange(rDev, rFormat); - BOOL bIsTextmode = rFormat.IsTextmode(); + sal_Bool bIsTextmode = rFormat.IsTextmode(); nDist = 0; //! be sure that CSUB, CSUP are handled before the other cases! @@ -1527,12 +1527,12 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) aPos.Y() -= nDist; break; default : - DBG_ASSERT(FALSE, "Sm: unbekannter Fall"); + DBG_ASSERT(sal_False, "Sm: unbekannter Fall"); break; } pSubSup->MoveTo(aPos); - ExtendBy(*pSubSup, RCP_THIS, (BOOL) TRUE); + ExtendBy(*pSubSup, RCP_THIS, (sal_Bool) sal_True); // update rectangle to which RSUB, RSUP, LSUB, LSUP // will be aligned to @@ -1645,7 +1645,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pBody->Arrange(rDev, rFormat); - BOOL bIsScaleNormal = rFormat.IsScaleNormalBrackets(), + sal_Bool bIsScaleNormal = rFormat.IsScaleNormalBrackets(), bScale = pBody->GetHeight() > 0 && (GetScaleMode() == SCALE_HEIGHT || bIsScaleNormal), bIsABS = GetToken().eType == TABS; @@ -1653,10 +1653,10 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) long nFaceHeight = GetFont().GetSize().Height(); // Uebergroesse in % ermitteln - USHORT nPerc = 0; + sal_uInt16 nPerc = 0; if (!bIsABS && bScale) { // im Fall von Klammern mit Uebergroesse... - USHORT nIndex = GetScaleMode() == SCALE_HEIGHT ? + sal_uInt16 nIndex = GetScaleMode() == SCALE_HEIGHT ? DIS_BRACKETSIZE : DIS_NORMALBRACKETSIZE; nPerc = rFormat.GetDistance(nIndex); } @@ -1727,12 +1727,12 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) void SmBracebodyNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { - USHORT nNumSubNodes = GetNumSubNodes(); + sal_uInt16 nNumSubNodes = GetNumSubNodes(); if (nNumSubNodes == 0) return; // arrange arguments - USHORT i; + sal_uInt16 i; for (i = 0; i < nNumSubNodes; i += 2) GetSubNode(i)->Arrange(rDev, rFormat); @@ -1749,11 +1749,11 @@ void SmBracebodyNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) nBodyHeight = aRefRect.GetHeight(); // scale separators to required height and arrange them - BOOL bScale = GetScaleMode() == SCALE_HEIGHT || rFormat.IsScaleNormalBrackets(); + sal_Bool bScale = GetScaleMode() == SCALE_HEIGHT || rFormat.IsScaleNormalBrackets(); long nHeight = bScale ? aRefRect.GetHeight() : GetFont().GetSize().Height(); - USHORT nIndex = GetScaleMode() == SCALE_HEIGHT ? + sal_uInt16 nIndex = GetScaleMode() == SCALE_HEIGHT ? DIS_BRACKETSIZE : DIS_NORMALBRACKETSIZE; - USHORT nPerc = rFormat.GetDistance(nIndex); + sal_uInt16 nPerc = rFormat.GetDistance(nIndex); if (bScale) nHeight += 2 * (nHeight * nPerc / 100L); for (i = 1; i < nNumSubNodes; i += 2) @@ -1771,7 +1771,7 @@ void SmBracebodyNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmRect::operator = (*pLeft); for (i = 1; i < nNumSubNodes; i++) { - BOOL bIsSeparator = i % 2 != 0; + sal_Bool bIsSeparator = i % 2 != 0; RectVerAlign eVerAlign = bIsSeparator ? RVA_CENTERY : RVA_BASELINE; SmNode *pRight = GetSubNode(i); @@ -1799,7 +1799,7 @@ void SmVerticalBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFor DBG_ASSERT(pBrace, "Sm: NULL pointer!"); DBG_ASSERT(pScript, "Sm: NULL pointer!"); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); pBody->Arrange(aTmpDev, rFormat); @@ -1984,7 +1984,7 @@ void SmAttributNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pAttr->MoveTo(aPos); SmRect::operator = (*pBody); - ExtendBy(*pAttr, RCP_THIS, (BOOL) TRUE); + ExtendBy(*pAttr, RCP_THIS, (sal_Bool) sal_True); } @@ -2095,7 +2095,7 @@ void SmFontNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) break; } if (nFnt != -1) - { GetFont() = rFormat.GetFont( sal::static_int_cast< USHORT >(nFnt) ); + { GetFont() = rFormat.GetFont( sal::static_int_cast< sal_uInt16 >(nFnt) ); SetFont(GetFont()); } @@ -2121,7 +2121,7 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) break; case TUNKNOWN : break; // no assertion on "font <?> <?>" - case TPHANTOM : SetPhantom(TRUE); break; + case TPHANTOM : SetPhantom(sal_True); break; case TBOLD : SetAttribut(ATTR_BOLD); break; case TITALIC : SetAttribut(ATTR_ITALIC); break; case TNBOLD : ClearAttribut(ATTR_BOLD); break; @@ -2137,7 +2137,7 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) case TYELLOW : SetColor(Color(COL_YELLOW)); break; default: - DBG_ASSERT(FALSE, "Sm: unbekannter Fall"); + DBG_ASSERT(sal_False, "Sm: unbekannter Fall"); } pNode->Arrange(rDev, rFormat); @@ -2146,7 +2146,7 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) } -void SmFontNode::SetSizeParameter(const Fraction& rValue, USHORT Type) +void SmFontNode::SetSizeParameter(const Fraction& rValue, sal_uInt16 Type) { nSizeType = Type; aFontSize = rValue; @@ -2164,13 +2164,13 @@ SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken) } -void SmPolyLineNode::AdaptToX(const OutputDevice &/*rDev*/, ULONG nNewWidth) +void SmPolyLineNode::AdaptToX(const OutputDevice &/*rDev*/, sal_uLong nNewWidth) { aToSize.Width() = nNewWidth; } -void SmPolyLineNode::AdaptToY(const OutputDevice &/*rDev*/, ULONG nNewHeight) +void SmPolyLineNode::AdaptToY(const OutputDevice &/*rDev*/, sal_uLong nNewHeight) { GetFont().FreezeBorderWidth(); aToSize.Height() = nNewHeight; @@ -2182,7 +2182,7 @@ void SmPolyLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) //! some routines being called extract some info from the OutputDevice's //! font (eg the space to be used for borders OR the font name(!!)). //! Thus the font should reflect the needs and has to be set! - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); long nBorderwidth = GetFont().GetBorderWidth(); @@ -2233,7 +2233,7 @@ void SmPolyLineNode::Draw(OutputDevice &rDev, const Point &rPosition) const aPos (rPosition + aOffset); ((Polygon &) aPoly).Move(aPos.X(), aPos.Y()); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, FALSE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_False); aTmpDev.SetLineColor( GetFont().GetColor() ); rDev.DrawPolyLine(aPoly, aInfo); @@ -2250,13 +2250,13 @@ void SmPolyLineNode::Draw(OutputDevice &rDev, const Point &rPosition) const /**************************************************************************/ -void SmRootSymbolNode::AdaptToX(const OutputDevice &/*rDev*/, ULONG nWidth) +void SmRootSymbolNode::AdaptToX(const OutputDevice &/*rDev*/, sal_uLong nWidth) { nBodyWidth = nWidth; } -void SmRootSymbolNode::AdaptToY(const OutputDevice &rDev, ULONG nHeight) +void SmRootSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) { // etwas extra Laenge damit der horizontale Balken spaeter ueber dem // Argument positioniert ist @@ -2272,7 +2272,7 @@ void SmRootSymbolNode::Draw(OutputDevice &rDev, const Point &rPosition) const // draw root-sign itself SmMathSymbolNode::Draw(rDev, rPosition); - SmTmpDevice aTmpDev( (OutputDevice &) rDev, TRUE ); + SmTmpDevice aTmpDev( (OutputDevice &) rDev, sal_True ); aTmpDev.SetFillColor(GetFont().GetColor()); rDev.SetLineColor(); aTmpDev.SetFont( GetFont() ); @@ -2310,13 +2310,13 @@ void SmRootSymbolNode::Draw(OutputDevice &rDev, const Point &rPosition) const /**************************************************************************/ -void SmRectangleNode::AdaptToX(const OutputDevice &/*rDev*/, ULONG nWidth) +void SmRectangleNode::AdaptToX(const OutputDevice &/*rDev*/, sal_uLong nWidth) { aToSize.Width() = nWidth; } -void SmRectangleNode::AdaptToY(const OutputDevice &/*rDev*/, ULONG nHeight) +void SmRectangleNode::AdaptToY(const OutputDevice &/*rDev*/, sal_uLong nHeight) { GetFont().FreezeBorderWidth(); aToSize.Height() = nHeight; @@ -2333,15 +2333,15 @@ void SmRectangleNode::Arrange(const OutputDevice &rDev, const SmFormat &/*rForma if (nWidth == 0) nWidth = nFontHeight / 3; - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); // add some borderspace - ULONG nTmpBorderWidth = GetFont().GetBorderWidth(); + sal_uLong nTmpBorderWidth = GetFont().GetBorderWidth(); //nWidth += nTmpBorderWidth; nHeight += 2 * nTmpBorderWidth; - //! use this method in order to have 'SmRect::HasAlignInfo() == TRUE' + //! use this method in order to have 'SmRect::HasAlignInfo() == sal_True' //! and thus having the attribut-fences updated in 'SmRect::ExtendBy' SmRect::operator = (SmRect(nWidth, nHeight)); } @@ -2352,12 +2352,12 @@ void SmRectangleNode::Draw(OutputDevice &rDev, const Point &rPosition) const if (IsPhantom()) return; - SmTmpDevice aTmpDev ((OutputDevice &) rDev, FALSE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_False); aTmpDev.SetFillColor(GetFont().GetColor()); rDev.SetLineColor(); aTmpDev.SetFont(GetFont()); - ULONG nTmpBorderWidth = GetFont().GetBorderWidth(); + sal_uLong nTmpBorderWidth = GetFont().GetBorderWidth(); // get rectangle and remove borderspace Rectangle aTmp (AsRectangle() + rPosition - GetTopLeft()); @@ -2391,14 +2391,14 @@ void SmRectangleNode::Draw(OutputDevice &rDev, const Point &rPosition) const /**************************************************************************/ -SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP ) : +SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP ) : SmVisibleNode(eNodeType, rNodeToken) { nFontDesc = nFontDescP; } -SmTextNode::SmTextNode( const SmToken &rNodeToken, USHORT nFontDescP ) : +SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP ) : SmVisibleNode(NTEXT, rNodeToken) { nFontDesc = nFontDescP; @@ -2435,11 +2435,11 @@ void SmTextNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { PrepareAttributes(); - USHORT nSizeDesc = GetFontDesc() == FNT_FUNCTION ? + sal_uInt16 nSizeDesc = GetFontDesc() == FNT_FUNCTION ? SIZ_FUNCTION : SIZ_TEXT; GetFont() *= Fraction (rFormat.GetRelSize(nSizeDesc), 100); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect::operator = (SmRect(aTmpDev, &rFormat, aText, GetFont().GetBorderWidth())); @@ -2447,17 +2447,17 @@ void SmTextNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) void SmTextNode::CreateTextFromNode(String &rText) { - BOOL bQuoted=FALSE; + sal_Bool bQuoted=sal_False; if (GetToken().eType == TTEXT) { rText.Append('\"'); - bQuoted=TRUE; + bQuoted=sal_True; } else { SmParser aParseTest; SmNode *pTable = aParseTest.Parse(GetToken().aText); - bQuoted=TRUE; + bQuoted=sal_True; if ( (pTable->GetType() == NTABLE) && (pTable->GetNumSubNodes() == 1) ) { SmNode *pResult = pTable->GetSubNode(0); @@ -2470,7 +2470,7 @@ void SmTextNode::CreateTextFromNode(String &rText) { pResult = pResult->GetSubNode(0); if (pResult->GetType() == NTEXT) - bQuoted=FALSE; + bQuoted=sal_False; } } } @@ -2501,7 +2501,7 @@ void SmTextNode::Draw(OutputDevice &rDev, const Point& rPosition) const if (IsPhantom() || aText.Len() == 0 || aText.GetChar(0) == xub_Unicode('\0')) return; - SmTmpDevice aTmpDev ((OutputDevice &) rDev, FALSE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_False); aTmpDev.SetFont(GetFont()); Point aPos (rPosition); @@ -2536,9 +2536,9 @@ void SmTextNode::GetAccessibleText( String &rText ) const void SmMatrixNode::CreateTextFromNode(String &rText) { APPEND(rText,"matrix {"); - for (USHORT i = 0; i < nNumRows; i++) + for (sal_uInt16 i = 0; i < nNumRows; i++) { - for (USHORT j = 0; j < nNumCols; j++) + for (sal_uInt16 j = 0; j < nNumCols; j++) { SmNode *pNode = GetSubNode(i * nNumCols + j); pNode->CreateTextFromNode(rText); @@ -2558,7 +2558,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) Point aPosition, aOffset; SmNode *pNode; - USHORT i, j; + sal_uInt16 i, j; // initialize array that is to hold the maximum widhts of all // elements (subnodes) in that column. @@ -2567,10 +2567,10 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pColWidth[j] = 0; // arrange subnodes and calculate the aboves arrays contents - USHORT nNodes = GetNumSubNodes(); + sal_uInt16 nNodes = GetNumSubNodes(); for (i = 0; i < nNodes; i++) { - USHORT nIdx = nNodes - 1 - i; + sal_uInt16 nIdx = nNodes - 1 - i; if (NULL != (pNode = GetSubNode(nIdx))) { pNode->Arrange(rDev, rFormat); @@ -2654,7 +2654,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) } -void SmMatrixNode::SetRowCol(USHORT nMatrixRows, USHORT nMatrixCols) +void SmMatrixNode::SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols) { nNumRows = nMatrixRows; nNumCols = nMatrixCols; @@ -2678,7 +2678,7 @@ SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken) SetText( cChar ); } -void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, ULONG nWidth) +void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, sal_uLong nWidth) { // Since there is no function to do this, we try to approximate it: Size aFntSize (GetFont().GetSize()); @@ -2687,7 +2687,7 @@ void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, ULONG nWidth) aFntSize.Width() = nWidth; GetFont().SetSize(aFntSize); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); // get denominator of error factor for width @@ -2701,7 +2701,7 @@ void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, ULONG nWidth) GetFont().SetSize(aFntSize); } -void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, ULONG nHeight) +void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) { GetFont().FreezeBorderWidth(); Size aFntSize (GetFont().GetSize()); @@ -2723,7 +2723,7 @@ void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, ULONG nHeight) aFntSize.Height() = nHeight; GetFont().SetSize(aFntSize); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); // get denominator of error factor for height @@ -2767,7 +2767,7 @@ void SmMathSymbolNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat GetFont() *= Fraction (rFormat.GetRelSize(SIZ_TEXT), 100); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect::operator = (SmRect(aTmpDev, &rFormat, rText, GetFont().GetBorderWidth())); @@ -2801,7 +2801,7 @@ void SmRectangleNode::CreateTextFromNode(String &rText) void SmAttributNode::CreateTextFromNode(String &rText) { SmNode *pNode; - USHORT nSize = GetNumSubNodes(); + sal_uInt16 nSize = GetNumSubNodes(); DBG_ASSERT(nSize == 2, "Node missing members"); rText.Append('{'); sal_Unicode nLast=0; @@ -2871,7 +2871,7 @@ bool lcl_IsFromGreekSymbolSet( const String &rTokenText ) } -SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc) : +SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 _nFontDesc) : SmTextNode(eNodeType, rNodeToken, _nFontDesc) { bIsFromGreekSymbolSet = lcl_IsFromGreekSymbolSet( rNodeToken.aText ); @@ -2926,7 +2926,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell { DBG_ASSERT( GetText().Len() == 1, "a symbol should only consist of 1 char!" ); bool bItalic = false; - INT16 nStyle = rFormat.GetGreekCharStyle(); + sal_Int16 nStyle = rFormat.GetGreekCharStyle(); DBG_ASSERT( nStyle >= 0 && nStyle <= 2, "unexpected value for GreekCharStyle" ); if (nStyle == 1) bItalic = true; @@ -2955,7 +2955,7 @@ void SmSpecialNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { PrepareAttributes(); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect::operator = (SmRect(aTmpDev, &rFormat, GetText(), GetFont().GetBorderWidth())); @@ -2979,7 +2979,7 @@ void SmGlyphSpecialNode::Arrange(const OutputDevice &rDev, const SmFormat &rForm { PrepareAttributes(); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect::operator = (SmRect(aTmpDev, &rFormat, GetText(), @@ -3003,7 +3003,7 @@ void SmPlaceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { PrepareAttributes(); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); SmRect::operator = (SmRect(aTmpDev, &rFormat, GetText(), GetFont().GetBorderWidth())); @@ -3027,7 +3027,7 @@ void SmErrorNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { PrepareAttributes(); - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); const XubString &rText = GetText(); @@ -3065,7 +3065,7 @@ void SmBlankNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) void SmBlankNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { - SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True); aTmpDev.SetFont(GetFont()); // Abstand von der Fonthoehe abhaengig machen |