From c7c52f60657baa65e104530247ed05a90479e99e Mon Sep 17 00:00:00 2001 From: Deepanshu Sharma <129deepanshusharma@gmail.com> Date: Fri, 27 Sep 2024 02:17:29 +0530 Subject: [PATCH] tdf#114441 change width,height to tools::Long in starmath Change-Id: I69e0968643c5c30fbe7f67dfb392d176ab796fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174000 Reviewed-by: Hossein Tested-by: Jenkins --- starmath/inc/node.hxx | 24 ++++++++++++------------ starmath/inc/rect.hxx | 2 +- starmath/source/node.cxx | 22 +++++++++++----------- starmath/source/visitors.cxx | 2 +- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index f59c23ea426f..778c11c2a968 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -369,8 +369,8 @@ public: void SetScaleMode(SmScaleMode eMode) { meScaleMode = eMode; } //visual stuff TODO comment - virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth); - virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight); + virtual void AdaptToX(OutputDevice &rDev, tools::Long nWidth); + virtual void AdaptToY(OutputDevice &rDev, tools::Long nHeight); /** * Gets the node type. @@ -671,8 +671,8 @@ public: {} //visual stuff TODO comment - virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override; - virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override; + virtual void AdaptToX(OutputDevice &rDev, tools::Long nWidth) override; + virtual void AdaptToY(OutputDevice &rDev, tools::Long nHeight) override; /** * Prepares the SmRect to render. @@ -718,8 +718,8 @@ public: tools::Polygon &GetPolygon() { return maPoly; } //visual stuff TODO comment - virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override; - virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override; + virtual void AdaptToX(OutputDevice &rDev, tools::Long nWidth) override; + virtual void AdaptToY(OutputDevice &rDev, tools::Long nHeight) override; /** * Prepares the SmRect to render. @@ -962,8 +962,8 @@ public: explicit SmMathSymbolNode(const SmToken &rNodeToken); //visual stuff TODO comment - virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override; - virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override; + virtual void AdaptToX(OutputDevice &rDev, tools::Long nWidth) override; + virtual void AdaptToY(OutputDevice &rDev, tools::Long nHeight) override; /** * Prepare preliminary settings about font and text @@ -1016,7 +1016,7 @@ public: */ class SmRootSymbolNode final : public SmMathSymbolNode { - sal_uLong mnBodyWidth; // width of body (argument) of root sign + tools::Long mnBodyWidth; // width of body (argument) of root sign public: explicit SmRootSymbolNode(const SmToken &rNodeToken) @@ -1028,11 +1028,11 @@ public: * Allows to know how long is the root and paint it. * @return body width */ - sal_uLong GetBodyWidth() const {return mnBodyWidth;}; + tools::Long GetBodyWidth() const {return mnBodyWidth;}; //visual stuff TODO comment - virtual void AdaptToX(OutputDevice &rDev, sal_uLong nHeight) override; - virtual void AdaptToY(OutputDevice &rDev, sal_uLong nHeight) override; + virtual void AdaptToX(OutputDevice &rDev, tools::Long nHeight) override; + virtual void AdaptToY(OutputDevice &rDev, tools::Long nHeight) override; /** * Accept a visitor. diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx index 0b28581a00f9..5960e1b48f65 100644 --- a/starmath/inc/rect.hxx +++ b/starmath/inc/rect.hxx @@ -114,7 +114,7 @@ public: void SetItalicSpaces(tools::Long nLeftSpace, tools::Long nRightSpace); - void SetWidth(sal_uLong nWidth) { aSize.setWidth(nWidth); } + void SetWidth(tools::Long nWidth) { aSize.setWidth(nWidth); } void SetLeft(tools::Long nLeft); void SetRight(tools::Long nRight); diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 022596b4e2d2..983fa174c7d9 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -240,12 +240,12 @@ void SmNode::Move(const Point& rVector) ForEachNonNull(this, [&rVector](SmNode *pNode){pNode->Move(rVector);}); } -void SmNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong /*nWidth*/) +void SmNode::AdaptToX(OutputDevice &/*rDev*/, tools::Long /*nWidth*/) { } -void SmNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong /*nHeight*/) +void SmNode::AdaptToY(OutputDevice &/*rDev*/, tools::Long /*nHeight*/) { } @@ -1715,13 +1715,13 @@ SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken) } -void SmPolyLineNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nNewWidth) +void SmPolyLineNode::AdaptToX(OutputDevice &/*rDev*/, tools::Long nNewWidth) { maToSize.setWidth( nNewWidth ); } -void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nNewHeight) +void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, tools::Long nNewHeight) { GetFont().FreezeBorderWidth(); maToSize.setHeight( nNewHeight ); @@ -1769,13 +1769,13 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) /**************************************************************************/ -void SmRootSymbolNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth) +void SmRootSymbolNode::AdaptToX(OutputDevice &/*rDev*/, tools::Long nWidth) { mnBodyWidth = nWidth; } -void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) +void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, tools::Long nHeight) { // some additional length so that the horizontal // bar will be positioned above the argument @@ -1786,13 +1786,13 @@ void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) /**************************************************************************/ -void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth) +void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, tools::Long nWidth) { maToSize.setWidth( nWidth ); } -void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight) +void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, tools::Long nHeight) { GetFont().FreezeBorderWidth(); maToSize.setHeight( nHeight ); @@ -1813,7 +1813,7 @@ void SmRectangleNode::Arrange(OutputDevice &rDev, const SmFormat &/*rFormat*/) aTmpDev.SetFont(GetFont()); // add some borderspace - sal_uLong nTmpBorderWidth = GetFont().GetBorderWidth(); + tools::Long nTmpBorderWidth = GetFont().GetBorderWidth(); nHeight += 2 * nTmpBorderWidth; //! use this method in order to have 'SmRect::HasAlignInfo() == true' @@ -2068,7 +2068,7 @@ SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken) SetText(GetToken().cMathChar); } -void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth) +void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, tools::Long nWidth) { // Since there is no function to do this, we try to approximate it: Size aFntSize (GetFont().GetFontSize()); @@ -2091,7 +2091,7 @@ void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth) GetFont().SetSize(aFntSize); } -void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) +void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, tools::Long nHeight) { GetFont().FreezeBorderWidth(); Size aFntSize (GetFont().GetFontSize()); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 3e11201ebef2..5d126fcff481 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -479,7 +479,7 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode ) mrDev.SetLineColor( ); aTmpDev.SetFont( pNode->GetFont( ) ); - sal_uLong nTmpBorderWidth = pNode->GetFont( ).GetBorderWidth( ); + tools::Long nTmpBorderWidth = pNode->GetFont( ).GetBorderWidth( ); // get rectangle and remove borderspace tools::Rectangle aTmp ( pNode->AsRectangle( ) + maPosition - pNode->GetTopLeft( ) );