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: ...@@ -328,7 +328,7 @@ public:
*/ */
class SmRectangleNode : public SmGraphicNode class SmRectangleNode : public SmGraphicNode
{ {
Size aToSize; Size maToSize;
public: public:
explicit SmRectangleNode(const SmToken &rNodeToken) explicit SmRectangleNode(const SmToken &rNodeToken)
...@@ -351,15 +351,15 @@ public: ...@@ -351,15 +351,15 @@ public:
*/ */
class SmPolyLineNode : public SmGraphicNode class SmPolyLineNode : public SmGraphicNode
{ {
tools::Polygon aPoly; tools::Polygon maPoly;
Size aToSize; Size maToSize;
long nWidth; long mnWidth;
public: public:
explicit SmPolyLineNode(const SmToken &rNodeToken); explicit SmPolyLineNode(const SmToken &rNodeToken);
long GetWidth() const { return nWidth; } long GetWidth() const { return mnWidth; }
tools::Polygon &GetPolygon() { return aPoly; } tools::Polygon &GetPolygon() { return maPoly; }
virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override; virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override; virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override;
......
...@@ -1918,23 +1918,24 @@ void SmFontNode::SetSizeParameter(const Fraction& rValue, FontSizeType eType) ...@@ -1918,23 +1918,24 @@ void SmFontNode::SetSizeParameter(const Fraction& rValue, FontSizeType eType)
SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken) 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) void SmPolyLineNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nNewWidth)
{ {
aToSize.Width() = nNewWidth; maToSize.Width() = nNewWidth;
} }
void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nNewHeight) void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nNewHeight)
{ {
GetFont().FreezeBorderWidth(); GetFont().FreezeBorderWidth();
aToSize.Height() = nNewHeight; maToSize.Height() = nNewHeight;
} }
...@@ -1949,13 +1950,13 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) ...@@ -1949,13 +1950,13 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
long nBorderwidth = GetFont().GetBorderWidth(); long nBorderwidth = GetFont().GetBorderWidth();
// create polygon using both endpoints // create polygon using both endpoints
OSL_ENSURE(aPoly.GetSize() == 2, "Sm : wrong number of points"); assert(maPoly.GetSize() == 2);
Point aPointA, aPointB; Point aPointA, aPointB;
if (GetToken().eType == TWIDESLASH) if (GetToken().eType == TWIDESLASH)
{ {
aPointA.X() = nBorderwidth; aPointA.X() = nBorderwidth;
aPointA.Y() = aToSize.Height() - nBorderwidth; aPointA.Y() = maToSize.Height() - nBorderwidth;
aPointB.X() = aToSize.Width() - nBorderwidth; aPointB.X() = maToSize.Width() - nBorderwidth;
aPointB.Y() = nBorderwidth; aPointB.Y() = nBorderwidth;
} }
else else
...@@ -1963,17 +1964,17 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) ...@@ -1963,17 +1964,17 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token"); OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token");
aPointA.X() = aPointA.X() =
aPointA.Y() = nBorderwidth; aPointA.Y() = nBorderwidth;
aPointB.X() = aToSize.Width() - nBorderwidth; aPointB.X() = maToSize.Width() - nBorderwidth;
aPointB.Y() = aToSize.Height() - nBorderwidth; aPointB.Y() = maToSize.Height() - nBorderwidth;
} }
aPoly.SetPoint(aPointA, 0); maPoly.SetPoint(aPointA, 0);
aPoly.SetPoint(aPointB, 1); maPoly.SetPoint(aPointB, 1);
long nThick = GetFont().GetFontSize().Height() long nThick = GetFont().GetFontSize().Height()
* rFormat.GetDistance(DIS_STROKEWIDTH) / 100L; * 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) ...@@ -1998,22 +1999,22 @@ void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight)
void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth) void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth)
{ {
aToSize.Width() = nWidth; maToSize.Width() = nWidth;
} }
void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight) void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight)
{ {
GetFont().FreezeBorderWidth(); GetFont().FreezeBorderWidth();
aToSize.Height() = nHeight; maToSize.Height() = nHeight;
} }
void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/) void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/)
{ {
long nFontHeight = GetFont().GetFontSize().Height(); long nFontHeight = GetFont().GetFontSize().Height();
long nWidth = aToSize.Width(), long nWidth = maToSize.Width(),
nHeight = aToSize.Height(); nHeight = maToSize.Height();
if (nHeight == 0) if (nHeight == 0)
nHeight = nFontHeight / 30; nHeight = nFontHeight / 30;
if (nWidth == 0) 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