[Libreoffice-commits] core.git: starmath/inc starmath/source
Takeshi Abe
tabe at fixedpoint.jp
Wed Nov 25 22:47:08 PST 2015
starmath/inc/visitors.hxx | 8 +++---
starmath/source/visitors.cxx | 52 +++++++++++++++++++++----------------------
2 files changed, 30 insertions(+), 30 deletions(-)
New commits:
commit b2b4184edb388c72ef9e68e7bcd974a3d538a152
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Fri Nov 20 19:35:18 2015 +0900
starmath: Prefix members of SmCaretDrawingVisitor
Change-Id: I9d033a67f6073f3da368f8241ac48c7d391b89c9
Reviewed-on: https://gerrit.libreoffice.org/20080
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index b1eeddc..8ae394e 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -117,11 +117,11 @@ public:
void Visit( SmTextNode* pNode ) override;
using SmDefaultingVisitor::Visit;
private:
- OutputDevice &rDev;
- SmCaretPos pos;
+ OutputDevice &mrDev;
+ SmCaretPos maPos;
/** Offset to draw from */
- Point Offset;
- bool isCaretVisible;
+ Point maOffset;
+ bool mbCaretVisible;
protected:
/** Default method for drawing pNodes */
void DefaultVisit( SmNode* pNode ) override;
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 640c1e2..bdde37e 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -166,83 +166,83 @@ SmCaretDrawingVisitor::SmCaretDrawingVisitor( OutputDevice& rDevice,
SmCaretPos position,
Point offset,
bool caretVisible )
- : rDev( rDevice )
+ : mrDev( rDevice )
+ , maPos( position )
+ , maOffset( offset )
+ , mbCaretVisible( caretVisible )
{
- pos = position;
- Offset = offset;
- isCaretVisible = caretVisible;
SAL_WARN_IF( !position.IsValid(), "starmath", "Cannot draw invalid position!" );
if( !position.IsValid( ) )
return;
//Save device state
- rDev.Push( PushFlags::FONT | PushFlags::MAPMODE | PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::TEXTCOLOR );
+ mrDev.Push( PushFlags::FONT | PushFlags::MAPMODE | PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::TEXTCOLOR );
- pos.pSelectedNode->Accept( this );
+ maPos.pSelectedNode->Accept( this );
//Restore device state
- rDev.Pop( );
+ mrDev.Pop( );
}
void SmCaretDrawingVisitor::Visit( SmTextNode* pNode )
{
- long i = pos.Index;
+ long i = maPos.Index;
- rDev.SetFont( pNode->GetFont( ) );
+ mrDev.SetFont( pNode->GetFont( ) );
//Find the line
SmNode* pLine = SmCursor::FindTopMostNodeInLine( pNode );
//Find coordinates
- long left = pNode->GetLeft( ) + rDev.GetTextWidth( pNode->GetText( ), 0, i ) + Offset.X( );
- long top = pLine->GetTop( ) + Offset.Y( );
+ long left = pNode->GetLeft( ) + mrDev.GetTextWidth( pNode->GetText( ), 0, i ) + maOffset.X( );
+ long top = pLine->GetTop( ) + maOffset.Y( );
long height = pLine->GetHeight( );
- long left_line = pLine->GetLeft( ) + Offset.X( );
- long right_line = pLine->GetRight( ) + Offset.X( );
+ long left_line = pLine->GetLeft( ) + maOffset.X( );
+ long right_line = pLine->GetRight( ) + maOffset.X( );
//Set color
- rDev.SetLineColor( Color( COL_BLACK ) );
+ mrDev.SetLineColor( Color( COL_BLACK ) );
- if ( isCaretVisible ) {
+ if ( mbCaretVisible ) {
//Draw vertical line
Point p1( left, top );
Point p2( left, top + height );
- rDev.DrawLine( p1, p2 );
+ mrDev.DrawLine( p1, p2 );
}
//Underline the line
Point pLeft( left_line, top + height );
Point pRight( right_line, top + height );
- rDev.DrawLine( pLeft, pRight );
+ mrDev.DrawLine( pLeft, pRight );
}
void SmCaretDrawingVisitor::DefaultVisit( SmNode* pNode )
{
- rDev.SetLineColor( Color( COL_BLACK ) );
+ mrDev.SetLineColor( Color( COL_BLACK ) );
//Find the line
SmNode* pLine = SmCursor::FindTopMostNodeInLine( pNode );
//Find coordinates
- long left = pNode->GetLeft( ) + Offset.X( ) + ( pos.Index == 1 ? pNode->GetWidth( ) : 0 );
- long top = pLine->GetTop( ) + Offset.Y( );
+ long left = pNode->GetLeft( ) + maOffset.X( ) + ( maPos.Index == 1 ? pNode->GetWidth( ) : 0 );
+ long top = pLine->GetTop( ) + maOffset.Y( );
long height = pLine->GetHeight( );
- long left_line = pLine->GetLeft( ) + Offset.X( );
- long right_line = pLine->GetRight( ) + Offset.X( );
+ long left_line = pLine->GetLeft( ) + maOffset.X( );
+ long right_line = pLine->GetRight( ) + maOffset.X( );
//Set color
- rDev.SetLineColor( Color( COL_BLACK ) );
+ mrDev.SetLineColor( Color( COL_BLACK ) );
- if ( isCaretVisible ) {
+ if ( mbCaretVisible ) {
//Draw vertical line
Point p1( left, top );
Point p2( left, top + height );
- rDev.DrawLine( p1, p2 );
+ mrDev.DrawLine( p1, p2 );
}
//Underline the line
Point pLeft( left_line, top + height );
Point pRight( right_line, top + height );
- rDev.DrawLine( pLeft, pRight );
+ mrDev.DrawLine( pLeft, pRight );
}
// SmCaretPos2LineVisitor
More information about the Libreoffice-commits
mailing list