Kaydet (Commit) 0d2e083f authored tarafından Takeshi Abe's avatar Takeshi Abe

starmath: Prefix members of SmPolyLineNode etc.

Change-Id: I6fa81689e14e605cd7449526e44245d4fdebb298
Reviewed-on: https://gerrit.libreoffice.org/31536Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTakeshi Abe <tabe@fixedpoint.jp>
üst 1b206f37
......@@ -328,7 +328,7 @@ public:
*/
class SmRectangleNode : public SmGraphicNode
{
Size aToSize;
Size maToSize;
public:
explicit SmRectangleNode(const SmToken &rNodeToken)
......@@ -351,15 +351,15 @@ public:
*/
class SmPolyLineNode : public SmGraphicNode
{
tools::Polygon aPoly;
Size aToSize;
long nWidth;
tools::Polygon maPoly;
Size maToSize;
long mnWidth;
public:
explicit SmPolyLineNode(const SmToken &rNodeToken);
long GetWidth() const { return nWidth; }
tools::Polygon &GetPolygon() { return aPoly; }
long GetWidth() const { return mnWidth; }
tools::Polygon &GetPolygon() { return maPoly; }
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
......
......@@ -1918,23 +1918,24 @@ void SmFontNode::SetSizeParameter(const Fraction& rValue, FontSizeType eType)
SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken)
: SmGraphicNode(NPOLYLINE, rNodeToken)
: SmGraphicNode(NPOLYLINE, rNodeToken)
, maPoly(2)
, maToSize()
, mnWidth(0)
{
aPoly.SetSize(2);
nWidth = 0;
}
void SmPolyLineNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nNewWidth)
{
aToSize.Width() = nNewWidth;
maToSize.Width() = nNewWidth;
}
void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nNewHeight)
{
GetFont().FreezeBorderWidth();
aToSize.Height() = nNewHeight;
maToSize.Height() = nNewHeight;
}
......@@ -1949,13 +1950,13 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
long nBorderwidth = GetFont().GetBorderWidth();
// create polygon using both endpoints
OSL_ENSURE(aPoly.GetSize() == 2, "Sm : wrong number of points");
assert(maPoly.GetSize() == 2);
Point aPointA, aPointB;
if (GetToken().eType == TWIDESLASH)
{
aPointA.X() = nBorderwidth;
aPointA.Y() = aToSize.Height() - nBorderwidth;
aPointB.X() = aToSize.Width() - nBorderwidth;
aPointA.Y() = maToSize.Height() - nBorderwidth;
aPointB.X() = maToSize.Width() - nBorderwidth;
aPointB.Y() = nBorderwidth;
}
else
......@@ -1963,17 +1964,17 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token");
aPointA.X() =
aPointA.Y() = nBorderwidth;
aPointB.X() = aToSize.Width() - nBorderwidth;
aPointB.Y() = aToSize.Height() - nBorderwidth;
aPointB.X() = maToSize.Width() - nBorderwidth;
aPointB.Y() = maToSize.Height() - nBorderwidth;
}
aPoly.SetPoint(aPointA, 0);
aPoly.SetPoint(aPointB, 1);
maPoly.SetPoint(aPointA, 0);
maPoly.SetPoint(aPointB, 1);
long nThick = GetFont().GetFontSize().Height()
* rFormat.GetDistance(DIS_STROKEWIDTH) / 100L;
nWidth = nThick + 2 * nBorderwidth;
mnWidth = nThick + 2 * nBorderwidth;
SmRect::operator = (SmRect(aToSize.Width(), aToSize.Height()));
SmRect::operator = (SmRect(maToSize.Width(), maToSize.Height()));
}
......@@ -1998,22 +1999,22 @@ void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth)
{
aToSize.Width() = nWidth;
maToSize.Width() = nWidth;
}
void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight)
{
GetFont().FreezeBorderWidth();
aToSize.Height() = nHeight;
maToSize.Height() = nHeight;
}
void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/)
{
long nFontHeight = GetFont().GetFontSize().Height();
long nWidth = aToSize.Width(),
nHeight = aToSize.Height();
long nWidth = maToSize.Width(),
nHeight = maToSize.Height();
if (nHeight == 0)
nHeight = nFontHeight / 30;
if (nWidth == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment