[Libreoffice-commits] core.git: starmath/inc starmath/source
Takeshi Abe
tabe at fixedpoint.jp
Mon Nov 23 00:11:27 PST 2015
starmath/inc/visitors.hxx | 17 +++++++++--------
starmath/source/visitors.cxx | 16 ++++++++--------
2 files changed, 17 insertions(+), 16 deletions(-)
New commits:
commit 3168dbbbe356164369f6b7edfeeb6ad217c56d55
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Sat Nov 21 16:49:07 2015 +0900
starmath: Prefix members of SmCaretPos2LineVisitor
Change-Id: I277a66d32af51af7e28fd424dedd7980619e9d6e
Reviewed-on: https://gerrit.libreoffice.org/20104
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 9fb2873..b1eeddc 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -134,23 +134,24 @@ class SmCaretPos2LineVisitor : public SmDefaultingVisitor
{
public:
/** Given position and device this constructor will compute a line for the caret */
- SmCaretPos2LineVisitor( OutputDevice *pDevice, SmCaretPos position ) {
- pDev = pDevice;
- pos = position;
+ SmCaretPos2LineVisitor( OutputDevice *pDevice, SmCaretPos position )
+ : mpDev( pDevice )
+ , maPos( position )
+ {
SAL_WARN_IF( !position.IsValid(), "starmath", "Cannot draw invalid position!" );
- pos.pSelectedNode->Accept( this );
+ maPos.pSelectedNode->Accept( this );
}
virtual ~SmCaretPos2LineVisitor() {}
void Visit( SmTextNode* pNode ) override;
using SmDefaultingVisitor::Visit;
SmCaretLine GetResult( ){
- return line;
+ return maLine;
}
private:
- SmCaretLine line;
- VclPtr<OutputDevice> pDev;
- SmCaretPos pos;
+ SmCaretLine maLine;
+ VclPtr<OutputDevice> mpDev;
+ SmCaretPos maPos;
protected:
/** Default method for computing lines for pNodes */
void DefaultVisit( SmNode* pNode ) override;
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 24c5446..640c1e2 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -250,31 +250,31 @@ void SmCaretDrawingVisitor::DefaultVisit( SmNode* pNode )
void SmCaretPos2LineVisitor::Visit( SmTextNode* pNode )
{
//Save device state
- pDev->Push( PushFlags::FONT | PushFlags::TEXTCOLOR );
+ mpDev->Push( PushFlags::FONT | PushFlags::TEXTCOLOR );
- long i = pos.Index;
+ long i = maPos.Index;
- pDev->SetFont( pNode->GetFont( ) );
+ mpDev->SetFont( pNode->GetFont( ) );
//Find coordinates
- long left = pNode->GetLeft( ) + pDev->GetTextWidth( pNode->GetText( ), 0, i );
+ long left = pNode->GetLeft( ) + mpDev->GetTextWidth( pNode->GetText( ), 0, i );
long top = pNode->GetTop( );
long height = pNode->GetHeight( );
- line = SmCaretLine( left, top, height );
+ maLine = SmCaretLine( left, top, height );
//Restore device state
- pDev->Pop( );
+ mpDev->Pop( );
}
void SmCaretPos2LineVisitor::DefaultVisit( SmNode* pNode )
{
//Vertical line ( code from SmCaretDrawingVisitor )
Point p1 = pNode->GetTopLeft( );
- if( pos.Index == 1 )
+ if( maPos.Index == 1 )
p1.Move( pNode->GetWidth( ), 0 );
- line = SmCaretLine( p1.X( ), p1.Y( ), pNode->GetHeight( ) );
+ maLine = SmCaretLine( p1.X( ), p1.Y( ), pNode->GetHeight( ) );
}
More information about the Libreoffice-commits
mailing list