summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-11-30 19:09:23 +0900
committerDavid Tardon <dtardon@redhat.com>2015-12-10 08:28:26 +0000
commitbe738d33d1b9574b4afdc438af2950cea0fb301b (patch)
tree98f4ec972f63e829e670af73be3f451c0a9b6521 /starmath
parentc67c7c2007b7c9194304d341c6abe22a0096790c (diff)
starmath: Prefix members of SmDrawingVisitor
Change-Id: Ia7efb3db2d1e76aad8873cf5822107b4666249de Reviewed-on: https://gerrit.libreoffice.org/20281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/visitors.hxx11
-rw-r--r--starmath/source/visitors.cxx38
2 files changed, 25 insertions, 24 deletions
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 8ae394ee3faf..f51b961d3629 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -170,8 +170,9 @@ public:
* @remarks This constructor will do the drawing, no need to anything more.
*/
SmDrawingVisitor( OutputDevice &rDevice, Point position, SmNode* pTree )
- : rDev( rDevice ) {
- this->Position = position;
+ : mrDev( rDevice )
+ , maPosition( position )
+ {
pTree->Accept( this );
}
virtual ~SmDrawingVisitor() {}
@@ -215,13 +216,13 @@ private:
/** Draw an SmSpecialNode or a subclass of this */
void DrawSpecialNode( SmSpecialNode* pNode );
/** OutputDevice to draw on */
- OutputDevice& rDev;
- /** Position to draw on the rDev
+ OutputDevice& mrDev;
+ /** Position to draw on the mrDev
* @remarks This variable is used to pass parameters in DrawChildren( ), this means
that after a call to DrawChildren( ) the contents of this method is undefined
so if needed cache it locally on the stack.
*/
- Point Position;
+ Point maPosition;
};
// SmSetSelectionVisitor
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 7fcd98f7cd78..2d45b239d820 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -413,9 +413,9 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode )
// draw root-sign itself
DrawSpecialNode( pNode );
- SmTmpDevice aTmpDev( rDev, true );
+ SmTmpDevice aTmpDev( mrDev, true );
aTmpDev.SetFillColor( pNode->GetFont( ).GetColor( ) );
- rDev.SetLineColor( );
+ mrDev.SetLineColor( );
aTmpDev.SetFont( pNode->GetFont( ) );
// since the width is always unscaled it corresponds ot the _original_
@@ -425,17 +425,17 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode )
long nBarHeight = pNode->GetWidth( ) * 7L / 100L;
long nBarWidth = pNode->GetBodyWidth( ) + pNode->GetBorderWidth( );
Point aBarOffset( pNode->GetWidth( ), +pNode->GetBorderWidth( ) );
- Point aBarPos( Position + aBarOffset );
+ Point aBarPos( maPosition + aBarOffset );
Rectangle aBar( aBarPos, Size( nBarWidth, nBarHeight ) );
//! avoid GROWING AND SHRINKING of drawn rectangle when constantly
//! increasing zoomfactor.
// This is done by shifting its output-position to a point that
// corresponds exactly to a pixel on the output device.
- Point aDrawPos( rDev.PixelToLogic( rDev.LogicToPixel( aBar.TopLeft( ) ) ) );
+ Point aDrawPos( mrDev.PixelToLogic( mrDev.LogicToPixel( aBar.TopLeft( ) ) ) );
aBar.SetPos( aDrawPos );
- rDev.DrawRect( aBar );
+ mrDev.DrawRect( aBar );
}
void SmDrawingVisitor::Visit( SmDynIntegralSymbolNode* pNode )
@@ -466,13 +466,13 @@ void SmDrawingVisitor::Visit( SmPolyLineNode* pNode )
Point aOffset ( Point( ) - pNode->GetPolygon( ).GetBoundRect( ).TopLeft( )
+ Point( nBorderwidth, nBorderwidth ) ),
- aPos ( Position + aOffset );
+ aPos ( maPosition + aOffset );
pNode->GetPolygon( ).Move( aPos.X( ), aPos.Y( ) ); //Works because Polygon wraps a pointer
- SmTmpDevice aTmpDev ( rDev, false );
+ SmTmpDevice aTmpDev ( mrDev, false );
aTmpDev.SetLineColor( pNode->GetFont( ).GetColor( ) );
- rDev.DrawPolyLine( pNode->GetPolygon( ), aInfo );
+ mrDev.DrawPolyLine( pNode->GetPolygon( ), aInfo );
}
void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
@@ -480,15 +480,15 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
if ( pNode->IsPhantom( ) )
return;
- SmTmpDevice aTmpDev ( rDev, false );
+ SmTmpDevice aTmpDev ( mrDev, false );
aTmpDev.SetFillColor( pNode->GetFont( ).GetColor( ) );
- rDev.SetLineColor( );
+ mrDev.SetLineColor( );
aTmpDev.SetFont( pNode->GetFont( ) );
sal_uLong nTmpBorderWidth = pNode->GetFont( ).GetBorderWidth( );
// get rectangle and remove borderspace
- Rectangle aTmp ( pNode->AsRectangle( ) + Position - pNode->GetTopLeft( ) );
+ Rectangle aTmp ( pNode->AsRectangle( ) + maPosition - pNode->GetTopLeft( ) );
aTmp.Left( ) += nTmpBorderWidth;
aTmp.Right( ) -= nTmpBorderWidth;
aTmp.Top( ) += nTmpBorderWidth;
@@ -501,10 +501,10 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
//! increasing zoomfactor.
// This is done by shifting its output-position to a point that
// corresponds exactly to a pixel on the output device.
- Point aPos ( rDev.PixelToLogic( rDev.LogicToPixel( aTmp.TopLeft( ) ) ) );
+ Point aPos ( mrDev.PixelToLogic( mrDev.LogicToPixel( aTmp.TopLeft( ) ) ) );
aTmp.SetPos( aPos );
- rDev.DrawRect( aTmp );
+ mrDev.DrawRect( aTmp );
}
void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode )
@@ -512,15 +512,15 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode )
if ( pNode->IsPhantom() || pNode->GetText().isEmpty() || pNode->GetText()[0] == '\0' )
return;
- SmTmpDevice aTmpDev ( rDev, false );
+ SmTmpDevice aTmpDev ( mrDev, false );
aTmpDev.SetFont( pNode->GetFont( ) );
- Point aPos ( Position );
+ Point aPos ( maPosition );
aPos.Y( ) += pNode->GetBaselineOffset( );
// auf Pixelkoordinaten runden
- aPos = rDev.PixelToLogic( rDev.LogicToPixel( aPos ) );
+ aPos = mrDev.PixelToLogic( mrDev.LogicToPixel( aPos ) );
- rDev.DrawStretchText( aPos, pNode->GetWidth( ), pNode->GetText( ) );
+ mrDev.DrawStretchText( aPos, pNode->GetWidth( ), pNode->GetText( ) );
}
void SmDrawingVisitor::DrawSpecialNode( SmSpecialNode* pNode )
@@ -537,13 +537,13 @@ void SmDrawingVisitor::DrawChildren( SmNode* pNode )
if ( pNode->IsPhantom( ) )
return;
- Point rPosition = Position;
+ Point rPosition = maPosition;
SmNodeIterator it( pNode );
while( it.Next( ) )
{
Point aOffset ( it->GetTopLeft( ) - pNode->GetTopLeft( ) );
- Position = rPosition + aOffset;
+ maPosition = rPosition + aOffset;
it->Accept( this );
}
}