summaryrefslogtreecommitdiff
path: root/starmath/source/node.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/node.cxx')
-rw-r--r--starmath/source/node.cxx254
1 files changed, 127 insertions, 127 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index ecfa7d52b08c..9af5027eea5e 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -140,7 +140,7 @@ void SmTmpDevice::SetFont(const Font &rNewFont)
SmNode::SmNode(SmNodeType eNodeType, const SmToken &rNodeToken)
{
- eType = eNodeType;
+ eType = eNodeType;
eScaleMode = SCALE_NONE;
aNodeToken = rNodeToken;
nAccIndex = -1;
@@ -173,7 +173,7 @@ SmNode * SmNode::GetSubNode(USHORT /*nIndex*/)
SmNode * SmNode::GetLeftMost()
- // returns leftmost node of current subtree.
+ // returns leftmost node of current subtree.
//! (this assumes the one with index 0 is always the leftmost subnode
//! for the current node).
{
@@ -190,7 +190,7 @@ void SmNode::SetPhantom(BOOL bIsPhantomP)
bIsPhantom = bIsPhantomP;
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->SetPhantom(bIsPhantom);
@@ -203,7 +203,7 @@ void SmNode::SetColor(const Color& rColor)
GetFont().SetColor(rColor);
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->SetColor(rColor);
@@ -252,7 +252,7 @@ void SmNode::SetFont(const SmFace &rFace)
GetFont() = rFace;
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->SetFont(rFace);
@@ -268,7 +268,7 @@ void SmNode::SetFontSize(const Fraction &rSize, USHORT nType)
{
Fraction aVal (SmPtsTo100th_mm(rSize.GetNumerator()),
rSize.GetDenominator());
- long nHeight = (long)aVal;
+ long nHeight = (long)aVal;
aFntSize = GetFont().GetSize();
aFntSize.Width() = 0;
@@ -299,7 +299,7 @@ void SmNode::SetFontSize(const Fraction &rSize, USHORT nType)
}
// check the requested size against maximum value
- static int __READONLY_DATA nMaxVal = SmPtsTo100th_mm(128);
+ static int __READONLY_DATA nMaxVal = SmPtsTo100th_mm(128);
if (aFntSize.Height() > nMaxVal)
aFntSize.Height() = nMaxVal;
@@ -307,8 +307,8 @@ void SmNode::SetFontSize(const Fraction &rSize, USHORT nType)
}
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
- for (USHORT i = 0; i < nSize; i++)
+ USHORT nSize = GetNumSubNodes();
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->SetFontSize(rSize, nType);
}
@@ -319,8 +319,8 @@ void SmNode::SetSize(const Fraction &rSize)
GetFont() *= rSize;
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
- for (USHORT i = 0; i < nSize; i++)
+ USHORT nSize = GetNumSubNodes();
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->SetSize(rSize);
}
@@ -344,7 +344,7 @@ void SmNode::SetRectHorAlign(RectHorAlign eHorAlign, BOOL bApplyToSubTree )
void SmNode::PrepareAttributes()
{
- GetFont().SetWeight((Attributes() & ATTR_BOLD) ? WEIGHT_BOLD : WEIGHT_NORMAL);
+ GetFont().SetWeight((Attributes() & ATTR_BOLD) ? WEIGHT_BOLD : WEIGHT_NORMAL);
GetFont().SetItalic((Attributes() & ATTR_ITALIC) ? ITALIC_NORMAL : ITALIC_NONE);
}
@@ -352,18 +352,18 @@ void SmNode::PrepareAttributes()
void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
{
#if OSL_DEBUG_LEVEL > 1
- bIsDebug = TRUE;
+ bIsDebug = TRUE;
#else
- bIsDebug = FALSE;
+ bIsDebug = FALSE;
#endif
- bIsPhantom = FALSE;
- nFlags = 0;
+ bIsPhantom = FALSE;
+ nFlags = 0;
nAttributes = 0;
switch (rFormat.GetHorAlign())
- { case AlignLeft: eRectHorAlign = RHA_LEFT; break;
- case AlignCenter: eRectHorAlign = RHA_CENTER; break;
- case AlignRight: eRectHorAlign = RHA_RIGHT; break;
+ { case AlignLeft: eRectHorAlign = RHA_LEFT; break;
+ case AlignCenter: eRectHorAlign = RHA_CENTER; break;
+ case AlignRight: eRectHorAlign = RHA_RIGHT; break;
}
GetFont() = rFormat.GetFont(FNT_MATH);
@@ -373,7 +373,7 @@ void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
GetFont().SetItalic(ITALIC_NONE);
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->Prepare(rFormat, rDocShell);
@@ -389,7 +389,7 @@ void SmNode::ToggleDebug() const
pThis->bIsDebug = bIsDebug ? FALSE : TRUE;
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = pThis->GetSubNode(i)))
pNode->ToggleDebug();
@@ -399,14 +399,14 @@ void SmNode::ToggleDebug() const
void SmNode::Move(const Point& rPosition)
{
- if (rPosition.X() == 0 && rPosition.Y() == 0)
+ if (rPosition.X() == 0 && rPosition.Y() == 0)
return;
SmRect::Move(rPosition);
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
- for (USHORT i = 0; i < nSize; i++)
+ USHORT nSize = GetNumSubNodes();
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->Move(rPosition);
}
@@ -415,8 +415,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++)
+ USHORT nSize = GetNumSubNodes();
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->Arrange(rDev, rFormat);
}
@@ -424,10 +424,10 @@ void SmNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
void SmNode::CreateTextFromNode(String &rText)
{
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
if (nSize > 1)
rText.Append('{');
- for (USHORT i = 0; i < nSize; i++)
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->CreateTextFromNode(rText);
if (nSize > 1)
@@ -453,15 +453,15 @@ const SmNode * SmNode::FindTokenAt(USHORT nRow, USHORT nCol) const
// position 'nRow', 'nCol'.
//! (there should be exactly one such node if any)
{
- if ( IsVisible()
- && nRow == GetToken().nRow
- && nCol >= GetToken().nCol && nCol < GetToken().nCol + GetToken().aText.Len())
+ if ( IsVisible()
+ && nRow == GetToken().nRow
+ && nCol >= GetToken().nCol && nCol < GetToken().nCol + GetToken().aText.Len())
return this;
else
{
- USHORT nNumSubNodes = GetNumSubNodes();
- for (USHORT i = 0; i < nNumSubNodes; i++)
- { const SmNode *pNode = GetSubNode(i);
+ USHORT nNumSubNodes = GetNumSubNodes();
+ for (USHORT i = 0; i < nNumSubNodes; i++)
+ { const SmNode *pNode = GetSubNode(i);
if (!pNode)
continue;
@@ -478,16 +478,16 @@ const SmNode * SmNode::FindTokenAt(USHORT nRow, USHORT nCol) const
const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const
{
- long nDist = LONG_MAX;
+ long nDist = LONG_MAX;
const SmNode *pResult = 0;
if (IsVisible())
pResult = this;
else
{
- USHORT nNumSubNodes = GetNumSubNodes();
- for (USHORT i = 0; i < nNumSubNodes; i++)
- { const SmNode *pNode = GetSubNode(i);
+ USHORT nNumSubNodes = GetNumSubNodes();
+ for (USHORT i = 0; i < nNumSubNodes; i++)
+ { const SmNode *pNode = GetSubNode(i);
if (!pNode)
continue;
@@ -495,7 +495,7 @@ const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const
long nTmp;
const SmNode *pFound = pNode->FindRectClosestTo(rPoint);
if (pFound && (nTmp = pFound->OrientedDist(rPoint)) < nDist)
- { nDist = nTmp;
+ { nDist = nTmp;
pResult = pFound;
// quit immediately if 'rPoint' is inside the *should not
@@ -532,8 +532,8 @@ const SmNode * SmNode::FindNodeWithAccessibleIndex(xub_StrLen nAccIdx) const
pResult = this;
else
{
- USHORT nNumSubNodes = GetNumSubNodes();
- for (USHORT i = 0; i < nNumSubNodes; i++)
+ USHORT nNumSubNodes = GetNumSubNodes();
+ for (USHORT i = 0; i < nNumSubNodes; i++)
{
const SmNode *pNode = GetSubNode(i);
if (!pNode)
@@ -667,7 +667,7 @@ SmStructureNode::~SmStructureNode()
{
SmNode *pNode;
- for (USHORT i = 0; i < GetNumSubNodes(); i++)
+ for (USHORT i = 0; i < GetNumSubNodes(); i++)
if (NULL != (pNode = GetSubNode(i)))
delete pNode;
}
@@ -785,10 +785,10 @@ void SmGraphicNode::GetAccessibleText( String &rText ) const
void SmExpressionNode::CreateTextFromNode(String &rText)
{
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
if (nSize > 1)
rText.Append('{');
- for (USHORT i = 0; i < nSize; i++)
+ for (USHORT i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
{
pNode->CreateTextFromNode(rText);
@@ -815,7 +815,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
Point rPosition;
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
// make distance depend on font size
long nDist = +(rFormat.GetDistance(DIS_VERTICAL)
@@ -828,9 +828,9 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
long nMaxWidth = 0,
nTmp;
USHORT i;
- for (i = 0; i < nSize; i++)
+ for (i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
- { pNode->Arrange(rDev, rFormat);
+ { pNode->Arrange(rDev, rFormat);
if ((nTmp = pNode->GetItalicWidth()) > nMaxWidth)
nMaxWidth = nTmp;
}
@@ -839,8 +839,8 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
SmRect::operator = (SmRect(nMaxWidth, 0));
for (i = 0; i < nSize; i++)
{ if (NULL != (pNode = GetSubNode(i)))
- { const SmRect &rNodeRect = pNode->GetRect();
- const SmNode *pCoNode = pNode->GetLeftMost();
+ { const SmRect &rNodeRect = pNode->GetRect();
+ const SmNode *pCoNode = pNode->GetLeftMost();
RectHorAlign eHorAlign = pCoNode->GetRectHorAlign();
aPos = rNodeRect.AlignTo(*this, RP_BOTTOM,
@@ -881,9 +881,9 @@ 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 nSize = GetNumSubNodes();
USHORT i;
- for (i = 0; i < nSize; i++)
+ for (i = 0; i < nSize; i++)
if (NULL != (pNode = GetSubNode(i)))
pNode->Arrange(rDev, rFormat);
@@ -934,7 +934,7 @@ void SmExpressionNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat
{
SmLineNode::Arrange(rDev, rFormat);
- // copy alignment of leftmost subnode if any
+ // copy alignment of leftmost subnode if any
SmNode *pNode = GetLeftMost();
if (pNode)
SetRectHorAlign(pNode->GetRectHorAlign(), FALSE);
@@ -989,7 +989,7 @@ void SmRootNode::GetHeightVerOffset(const SmRect &rRect,
rVerOffset = (rRect.GetBottom() - rRect.GetAlignB()) / 2;
rHeight = rRect.GetHeight() - rVerOffset;
- OSL_ENSURE(rHeight >= 0, "Sm : Ooops...");
+ OSL_ENSURE(rHeight >= 0, "Sm : Ooops...");
OSL_ENSURE(rVerOffset >= 0, "Sm : Ooops...");
}
@@ -1023,11 +1023,11 @@ void SmRootNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
//! not to get the root symbol but the pExtra when clicking on it in the
//! GraphicWindow. (That is because of the simplicity of the algorithm
//! that finds the node corresponding to a mouseclick in the window.)
- SmNode *pExtra = GetSubNode(0),
+ SmNode *pExtra = GetSubNode(0),
*pRootSym = GetSubNode(1),
- *pBody = GetSubNode(2);
+ *pBody = GetSubNode(2);
OSL_ENSURE(pRootSym, "Sm: NULL pointer");
- OSL_ENSURE(pBody, "Sm: NULL pointer");
+ OSL_ENSURE(pBody, "Sm: NULL pointer");
pBody->Arrange(rDev, rFormat);
@@ -1050,7 +1050,7 @@ void SmRootNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
pRootSym->MoveTo(aPos);
if (pExtra)
- { pExtra->SetSize(Fraction(rFormat.GetRelSize(SIZ_INDEX), 100));
+ { pExtra->SetSize(Fraction(rFormat.GetRelSize(SIZ_INDEX), 100));
pExtra->Arrange(rDev, rFormat);
aPos = GetExtraPos(*pRootSym, *pExtra);
@@ -1142,9 +1142,9 @@ void SmBinVerNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
pDenom->Arrange(rDev, rFormat);
long nFontHeight = GetFont().GetSize().Height(),
- nExtLen = nFontHeight * rFormat.GetDistance(DIS_FRACTION) / 100L,
- nThick = nFontHeight * rFormat.GetDistance(DIS_STROKEWIDTH) / 100L,
- nWidth = Max(pNum->GetItalicWidth(), pDenom->GetItalicWidth()),
+ nExtLen = nFontHeight * rFormat.GetDistance(DIS_FRACTION) / 100L,
+ nThick = nFontHeight * rFormat.GetDistance(DIS_STROKEWIDTH) / 100L,
+ nWidth = Max(pNum->GetItalicWidth(), pDenom->GetItalicWidth()),
nNumDist = bIsTextmode ? 0 :
nFontHeight * rFormat.GetDistance(DIS_NUMERATOR) / 100L,
nDenomDist = bIsTextmode ? 0 :
@@ -1156,7 +1156,7 @@ void SmBinVerNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
pLine->Arrange(rDev, rFormat);
// get horizontal alignment for numerator
- const SmNode *pLM = pNum->GetLeftMost();
+ const SmNode *pLM = pNum->GetLeftMost();
RectHorAlign eHorAlign = pLM->GetRectHorAlign();
// move numerator to its position
@@ -1165,7 +1165,7 @@ void SmBinVerNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
pNum->MoveTo(aPos);
// get horizontal alignment for denominator
- pLM = pDenom->GetLeftMost();
+ pLM = pDenom->GetLeftMost();
eHorAlign = pLM->GetRectHorAlign();
// move denominator to its position
@@ -1251,7 +1251,7 @@ USHORT GetLineIntersectionPoint(Point &rResult,
{
// hier achten wir nicht auf Rechengenauigkeit
// (das wuerde aufwendiger und lohnt sich hier kaum)
- double fLambda = ( (rPoint1.Y() - rPoint2.Y()) * rHeading2.X()
+ double fLambda = ( (rPoint1.Y() - rPoint2.Y()) * rHeading2.X()
- (rPoint1.X() - rPoint2.X()) * rHeading2.Y())
/ fDet;
rResult = Point(rPoint1.X() + (long) (fLambda * rHeading1.X()),
@@ -1264,7 +1264,7 @@ USHORT GetLineIntersectionPoint(Point &rResult,
SmBinDiagonalNode::SmBinDiagonalNode(const SmToken &rNodeToken)
-: SmStructureNode(NBINDIAGONAL, rNodeToken)
+: SmStructureNode(NBINDIAGONAL, rNodeToken)
{
bAscending = FALSE;
SetNumSubNodes(3);
@@ -1275,18 +1275,18 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize,
const Point &rDiagPoint, double fAngleDeg) const
// gibt die Position und Groesse fuer den Diagonalstrich zurueck.
// Vor.: das SmRect des Nodes gibt die Begrenzung vor(!), muss also selbst
- // bereits bekannt sein.
+ // bereits bekannt sein.
{
const double fPi = 3.1415926535897932384626433;
double fAngleRad = fAngleDeg / 180.0 * fPi;
- long nRectLeft = GetItalicLeft(),
+ long nRectLeft = GetItalicLeft(),
nRectRight = GetItalicRight(),
nRectTop = GetTop(),
nRectBottom = GetBottom();
- Point aRightHdg (100, 0),
- aDownHdg (0, 100),
- aDiagHdg ( (long)(100.0 * cos(fAngleRad)),
+ Point aRightHdg (100, 0),
+ aDownHdg (0, 100),
+ aDiagHdg ( (long)(100.0 * cos(fAngleRad)),
(long)(-100.0 * sin(fAngleRad)) );
long nLeft, nRight, nTop, nBottom; // Raender des Rechtecks fuer die
@@ -1488,9 +1488,9 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
long nDelta, nDist;
// iterate over all possible sub-/supscripts
- SmRect aTmpRect (rBodyRect);
+ SmRect aTmpRect (rBodyRect);
for (int i = 0; i < SUBSUP_NUM_ENTRIES; i++)
- { SmSubSup eSubSup = (SmSubSup) i; // cast
+ { SmSubSup eSubSup = (SmSubSup) i; // cast
SmNode *pSubSup = GetSubSup(eSubSup);
if (!pSubSup)
@@ -1499,8 +1499,8 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// switch position of limits if we are in textmode
if (rFormat.IsTextmode() && (GetToken().nGroup & TGLIMIT))
switch (eSubSup)
- { case CSUB: eSubSup = RSUB; break;
- case CSUP: eSubSup = RSUP; break;
+ { case CSUB: eSubSup = RSUB; break;
+ case CSUP: eSubSup = RSUP; break;
default:
break;
}
@@ -1522,7 +1522,7 @@ void SmSubSupNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
//! be sure that CSUB, CSUP are handled before the other cases!
switch (eSubSup)
- { case RSUB :
+ { case RSUB :
case LSUB :
if (!bIsTextmode)
nDist = nOrigHeight
@@ -1684,14 +1684,14 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
pBody->Arrange(rDev, rFormat);
BOOL bIsScaleNormal = rFormat.IsScaleNormalBrackets(),
- bScale = pBody->GetHeight() > 0 &&
+ bScale = pBody->GetHeight() > 0 &&
(GetScaleMode() == SCALE_HEIGHT || bIsScaleNormal),
- bIsABS = GetToken().eType == TABS;
+ bIsABS = GetToken().eType == TABS;
long nFaceHeight = GetFont().GetSize().Height();
// Uebergroesse in % ermitteln
- USHORT nPerc = 0;
+ USHORT nPerc = 0;
if (!bIsABS && bScale)
{ // im Fall von Klammern mit Uebergroesse...
USHORT nIndex = GetScaleMode() == SCALE_HEIGHT ?
@@ -1746,7 +1746,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// damit auch "\(a\) - (a) - left ( a right )" vernuenftig aussieht
RectVerAlign eVerAlign = bScale ? RVA_CENTERY : RVA_BASELINE;
- Point aPos;
+ Point aPos;
aPos = pLeft->AlignTo(*pBody, RP_LEFT, RHA_CENTER, eVerAlign);
aPos.X() -= nDist;
pLeft->MoveTo(aPos);
@@ -1966,14 +1966,14 @@ void SmAlignNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
{
OSL_ENSURE(GetNumSubNodes() > 0, "Sm: missing subnode");
- SmNode *pNode = GetSubNode(0);
+ SmNode *pNode = GetSubNode(0);
RectHorAlign eHorAlign = RHA_CENTER;
switch (GetToken().eType)
{
- case TALIGNL: eHorAlign = RHA_LEFT; break;
- case TALIGNC: eHorAlign = RHA_CENTER; break;
- case TALIGNR: eHorAlign = RHA_RIGHT; break;
+ case TALIGNL: eHorAlign = RHA_LEFT; break;
+ case TALIGNC: eHorAlign = RHA_CENTER; break;
+ case TALIGNR: eHorAlign = RHA_RIGHT; break;
default:
break;
}
@@ -2003,9 +2003,9 @@ void SmAttributNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// get relative position of attribut
RectVerAlign eVerAlign;
- long nDist = 0;
+ long nDist = 0;
switch (GetToken().eType)
- { case TUNDERLINE :
+ { case TUNDERLINE :
eVerAlign = RVA_ATTRIBUT_LO;
break;
case TOVERSTRIKE :
@@ -2126,9 +2126,9 @@ void SmFontNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
int nFnt = -1;
switch (GetToken().eType)
{
- case TFIXED: nFnt = FNT_FIXED; break;
- case TSANS: nFnt = FNT_SANS; break;
- case TSERIF: nFnt = FNT_SERIF; break;
+ case TFIXED: nFnt = FNT_FIXED; break;
+ case TSANS: nFnt = FNT_SANS; break;
+ case TSERIF: nFnt = FNT_SERIF; break;
default:
break;
}
@@ -2149,7 +2149,7 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
OSL_ENSURE(pNode, "Sm: missing subnode");
switch (GetToken().eType)
- { case TSIZE :
+ { case TSIZE :
pNode->SetFontSize(aFontSize, nSizeType);
break;
case TSANS :
@@ -2157,22 +2157,22 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
case TFIXED :
pNode->SetFont(GetFont());
break;
- case TUNKNOWN : break; // no assertion on "font <?> <?>"
-
- case TPHANTOM : SetPhantom(TRUE); break;
- case TBOLD : SetAttribut(ATTR_BOLD); break;
- case TITALIC : SetAttribut(ATTR_ITALIC); break;
- case TNBOLD : ClearAttribut(ATTR_BOLD); break;
- case TNITALIC : ClearAttribut(ATTR_ITALIC); break;
-
- case TBLACK : SetColor(Color(COL_BLACK)); break;
- case TWHITE : SetColor(Color(COL_WHITE)); break;
- case TRED : SetColor(Color(COL_RED)); break;
- case TGREEN : SetColor(Color(COL_GREEN)); break;
- case TBLUE : SetColor(Color(COL_BLUE)); break;
- case TCYAN : SetColor(Color(COL_CYAN)); break;
- case TMAGENTA : SetColor(Color(COL_MAGENTA)); break;
- case TYELLOW : SetColor(Color(COL_YELLOW)); break;
+ case TUNKNOWN : break; // no assertion on "font <?> <?>"
+
+ case TPHANTOM : SetPhantom(TRUE); break;
+ case TBOLD : SetAttribut(ATTR_BOLD); break;
+ case TITALIC : SetAttribut(ATTR_ITALIC); break;
+ case TNBOLD : ClearAttribut(ATTR_BOLD); break;
+ case TNITALIC : ClearAttribut(ATTR_ITALIC); break;
+
+ case TBLACK : SetColor(Color(COL_BLACK)); break;
+ case TWHITE : SetColor(Color(COL_WHITE)); break;
+ case TRED : SetColor(Color(COL_RED)); break;
+ case TGREEN : SetColor(Color(COL_GREEN)); break;
+ case TBLUE : SetColor(Color(COL_BLUE)); break;
+ case TCYAN : SetColor(Color(COL_CYAN)); break;
+ case TMAGENTA : SetColor(Color(COL_MAGENTA)); break;
+ case TYELLOW : SetColor(Color(COL_YELLOW)); break;
default:
OSL_ENSURE(FALSE, "Sm: unknown case");
@@ -2195,7 +2195,7 @@ void SmFontNode::SetSizeParameter(const Fraction& rValue, USHORT Type)
SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken)
-: SmGraphicNode(NPOLYLINE, rNodeToken)
+: SmGraphicNode(NPOLYLINE, rNodeToken)
{
aPoly.SetSize(2);
nWidth = 0;
@@ -2248,7 +2248,7 @@ void SmPolyLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
aPoly.SetPoint(aPointA, 0);
aPoly.SetPoint(aPointB, 1);
- long nThick = GetFont().GetSize().Height()
+ long nThick = GetFont().GetSize().Height()
* rFormat.GetDistance(DIS_STROKEWIDTH) / 100L;
nWidth = nThick + 2 * nBorderwidth;
@@ -2296,7 +2296,7 @@ void SmRectangleNode::Arrange(const OutputDevice &rDev, const SmFormat &/*rForma
if (nHeight == 0)
nHeight = nFontHeight / 30;
if (nWidth == 0)
- nWidth = nFontHeight / 3;
+ nWidth = nFontHeight / 3;
SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE);
aTmpDev.SetFont(GetFont());
@@ -2358,7 +2358,7 @@ void SmTextNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
{
PrepareAttributes();
- USHORT nSizeDesc = GetFontDesc() == FNT_FUNCTION ?
+ USHORT nSizeDesc = GetFontDesc() == FNT_FUNCTION ?
SIZ_FUNCTION : SIZ_TEXT;
GetFont() *= Fraction (rFormat.GetRelSize(nSizeDesc), 100);
@@ -2480,7 +2480,7 @@ void SmMatrixNode::CreateTextFromNode(String &rText)
void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
{
- Point aPosition,
+ Point aPosition,
aOffset;
SmNode *pNode;
USHORT i, j;
@@ -2488,7 +2488,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// initialize array that is to hold the maximum widhts of all
// elements (subnodes) in that column.
long *pColWidth = new long[nNumCols];
- for (j = 0; j < nNumCols; j++)
+ for (j = 0; j < nNumCols; j++)
pColWidth[j] = 0;
// arrange subnodes and calculate the aboves arrays contents
@@ -2515,17 +2515,17 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// build array that holds the leftmost position for each column
long *pColLeft = new long[nNumCols];
long nX = 0;
- for (j = 0; j < nNumCols; j++)
- { pColLeft[j] = nX;
+ for (j = 0; j < nNumCols; j++)
+ { pColLeft[j] = nX;
nX += pColWidth[j] + nHorDist;
}
- Point aPos, aDelta;
- SmRect aLineRect;
+ Point aPos, aDelta;
+ SmRect aLineRect;
SmRect::operator = (SmRect());
- for (i = 0; i < nNumRows; i++)
- { aLineRect = SmRect();
- for (j = 0; j < nNumCols; j++)
+ for (i = 0; i < nNumRows; i++)
+ { aLineRect = SmRect();
+ for (j = 0; j < nNumCols; j++)
{ SmNode *pTmpNode = GetSubNode(i * nNumCols + j);
OSL_ENSURE(pTmpNode, "Sm: NULL pointer");
@@ -2542,7 +2542,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// caculate horizontal position of element depending on column
// and horizontal alignment
switch (eHorAlign)
- { case RHA_LEFT:
+ { case RHA_LEFT:
aPos.X() = rNodeRect.GetLeft() + pColLeft[j];
break;
case RHA_CENTER:
@@ -2564,10 +2564,10 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
aPos.Y() += nVerDist;
// move 'aLineRect' and rectangles in that line to final position
- aDelta.X() = 0; // since horizontal alignment is already done
+ aDelta.X() = 0; // since horizontal alignment is already done
aDelta.Y() = aPos.Y() - aLineRect.GetTop();
aLineRect.Move(aDelta);
- for (j = 0; j < nNumCols; j++)
+ for (j = 0; j < nNumCols; j++)
if (NULL != (pNode = GetSubNode(i * nNumCols + j)))
pNode->Move(aDelta);
@@ -2596,7 +2596,7 @@ SmNode * SmMatrixNode::GetLeftMost()
SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken)
-: SmSpecialNode(NMATH, rNodeToken, FNT_MATH)
+: SmSpecialNode(NMATH, rNodeToken, FNT_MATH)
{
xub_Unicode cChar = GetToken().cMathChar;
if ((xub_Unicode) '\0' != cChar)
@@ -2684,7 +2684,7 @@ void SmMathSymbolNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat
const XubString &rText = GetText();
if (rText.Len() == 0 || rText.GetChar(0) == xub_Unicode('\0'))
- { SmRect::operator = (SmRect());
+ { SmRect::operator = (SmRect());
return;
}
@@ -2726,7 +2726,7 @@ void SmRectangleNode::CreateTextFromNode(String &rText)
void SmAttributNode::CreateTextFromNode(String &rText)
{
SmNode *pNode;
- USHORT nSize = GetNumSubNodes();
+ USHORT nSize = GetNumSubNodes();
OSL_ENSURE(nSize == 2, "Node missing members");
rText.Append('{');
sal_Unicode nLast=0;
@@ -2804,7 +2804,7 @@ SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, US
SmSpecialNode::SmSpecialNode(const SmToken &rNodeToken) :
- SmTextNode(NSPECIAL, rNodeToken, FNT_MATH) //! default Font nicht immer richtig
+ SmTextNode(NSPECIAL, rNodeToken, FNT_MATH) //! default Font nicht immer richtig
{
bIsFromGreekSymbolSet = lcl_IsFromGreekSymbolSet( rNodeToken.aText );
}
@@ -2814,7 +2814,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
{
SmNode::Prepare(rFormat, rDocShell);
- const SmSym *pSym;
+ const SmSym *pSym;
SmModule *pp = SM_MOD();
String aName( GetToken().aText.Copy(1) );
@@ -2954,8 +2954,8 @@ void SmBlankNode::IncreaseBy(const SmToken &rToken)
{
switch(rToken.eType)
{
- case TBLANK: nNum += 4; break;
- case TSBLANK: nNum += 1; break;
+ case TBLANK: nNum += 4; break;
+ case TSBLANK: nNum += 1; break;
default:
break;
}