[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 27 18:25:20 UTC 2018


 sc/source/ui/inc/notemark.hxx  |   40 ++++++------
 sc/source/ui/view/notemark.cxx |  131 ++++++++++++++++++++---------------------
 2 files changed, 86 insertions(+), 85 deletions(-)

New commits:
commit b916d29c44df60e41f3b5a1ea6a5fe602050b942
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Apr 30 20:05:48 2018 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Aug 27 20:25:00 2018 +0200

    sc: prefix members of ScNoteMarker
    
    Change-Id: Ia4d7646d0534cfd74d5fd54700af80484443f106
    Reviewed-on: https://gerrit.libreoffice.org/53681
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/59619
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index 8b87809d0fd1..27a6d9da2a84 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -31,24 +31,24 @@ class SdrModel;
 class ScNoteMarker
 {
 private:
-    VclPtr<vcl::Window>     pWindow;
-    VclPtr<vcl::Window>     pRightWin;
-    VclPtr<vcl::Window>     pBottomWin;
-    VclPtr<vcl::Window>     pDiagWin;
-    ScDocument* pDoc;
-    ScAddress   aDocPos;
-    OUString    aUserText;
-    tools::Rectangle   aVisRect;
-    Timer       aTimer;
-    MapMode     aMapMode;
-    bool        bLeft;
-    bool        bByKeyboard;
+    VclPtr<vcl::Window>     m_pWindow;
+    VclPtr<vcl::Window>     m_pRightWin;
+    VclPtr<vcl::Window>     m_pBottomWin;
+    VclPtr<vcl::Window>     m_pDiagWin;
+    ScDocument* m_pDoc;
+    ScAddress   m_aDocPos;
+    OUString    m_aUserText;
+    tools::Rectangle   m_aVisRect;
+    Timer       m_aTimer;
+    MapMode     m_aMapMode;
+    bool        m_bLeft;
+    bool        m_bByKeyboard;
 
-    tools::Rectangle       aRect;
-    SdrModel*       pModel;
-    ScCaptionPtr    mxObject;
-    bool            bVisible;
-    Point           aGridOff;
+    tools::Rectangle       m_aRect;
+    SdrModel*       m_pModel;
+    ScCaptionPtr    m_xObject;
+    bool            m_bVisible;
+    Point           m_aGridOff;
     DECL_LINK( TimeHdl, Timer*, void );
 
 public:
@@ -60,9 +60,9 @@ public:
     void        Draw();
     void        InvalidateWin();
 
-    const ScAddress& GetDocPos() const       { return aDocPos; }
-    bool        IsByKeyboard() const    { return bByKeyboard; }
-    void        SetGridOff( const Point& rOff ) { aGridOff = rOff; }
+    const ScAddress& GetDocPos() const       { return m_aDocPos; }
+    bool        IsByKeyboard() const    { return m_bByKeyboard; }
+    void        SetGridOff( const Point& rOff ) { m_aGridOff = rOff; }
 };
 
 #endif
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index f486a70d0168..fe49c314ba23 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -37,77 +37,78 @@
 ScNoteMarker::ScNoteMarker( vcl::Window* pWin, vcl::Window* pRight, vcl::Window* pBottom, vcl::Window* pDiagonal,
                             ScDocument* pD, const ScAddress& aPos, const OUString& rUser,
                             const MapMode& rMap, bool bLeftEdge, bool bForce, bool bKeyboard ) :
-    pWindow( pWin ),
-    pRightWin( pRight ),
-    pBottomWin( pBottom ),
-    pDiagWin( pDiagonal ),
-    pDoc( pD ),
-    aDocPos( aPos ),
-    aUserText( rUser ),
-    aMapMode( rMap ),
-    bLeft( bLeftEdge ),
-    bByKeyboard( bKeyboard ),
-    pModel( nullptr ),
-    bVisible( false )
+    m_pWindow( pWin ),
+    m_pRightWin( pRight ),
+    m_pBottomWin( pBottom ),
+    m_pDiagWin( pDiagonal ),
+    m_pDoc( pD ),
+    m_aDocPos( aPos ),
+    m_aUserText( rUser ),
+    m_aMapMode( rMap ),
+    m_bLeft( bLeftEdge ),
+    m_bByKeyboard( bKeyboard ),
+    m_pModel( nullptr ),
+    m_bVisible( false )
 {
-    Size aSizePixel = pWindow->GetOutputSizePixel();
-    if( pRightWin )
-        aSizePixel.Width() += pRightWin->GetOutputSizePixel().Width();
-    if( pBottomWin )
-        aSizePixel.Height() += pBottomWin->GetOutputSizePixel().Height();
+    Size aSizePixel = m_pWindow->GetOutputSizePixel();
+    if( m_pRightWin )
+        aSizePixel.AdjustWidth(m_pRightWin->GetOutputSizePixel().Width() );
+    if( m_pBottomWin )
+        aSizePixel.AdjustHeight(m_pBottomWin->GetOutputSizePixel().Height() );
     tools::Rectangle aVisPixel( Point( 0, 0 ), aSizePixel );
-    aVisRect = pWindow->PixelToLogic( aVisPixel, aMapMode );
+    m_aVisRect = m_pWindow->PixelToLogic( aVisPixel, m_aMapMode );
 
-    aTimer.SetInvokeHandler( LINK( this, ScNoteMarker, TimeHdl ) );
-    aTimer.SetTimeout( bForce ? SC_NOTEMARK_SHORT : SC_NOTEMARK_TIME );
-    aTimer.Start();
+    m_aTimer.SetInvokeHandler( LINK( this, ScNoteMarker, TimeHdl ) );
+    m_aTimer.SetTimeout( bForce ? SC_NOTEMARK_SHORT : SC_NOTEMARK_TIME );
+    m_aTimer.Start();
 }
 
 ScNoteMarker::~ScNoteMarker()
 {
-    if (pModel)
-        mxObject.release();     // deleting pModel also deletes the SdrCaptionObj
+    if (m_pModel)
+        m_xObject.release();     // deleting pModel also deletes the SdrCaptionObj
 
     InvalidateWin();
 
-    delete pModel;
+    delete m_pModel;
 }
 
 IMPL_LINK_NOARG(ScNoteMarker, TimeHdl, Timer *, void)
 {
-    if (!bVisible)
+    if (!m_bVisible)
     {
         SvtPathOptions aPathOpt;
         OUString aPath = aPathOpt.GetPalettePath();
-        pModel = new SdrModel(aPath, nullptr, nullptr, false);
-        pModel->SetScaleUnit(MapUnit::Map100thMM);
-        SfxItemPool& rPool = pModel->GetItemPool();
+        m_pModel = new SdrModel(aPath, nullptr, nullptr, false);
+        m_pModel->SetScaleUnit(MapUnit::Map100thMM);
+        SfxItemPool& rPool = m_pModel->GetItemPool();
         rPool.SetDefaultMetric(MapUnit::Map100thMM);
         rPool.FreezeIdRanges();
 
-        OutputDevice* pPrinter = pDoc->GetRefDevice();
+        OutputDevice* pPrinter = m_pDoc->GetRefDevice();
         if (pPrinter)
         {
             // On the outliner of the draw model also the printer is set as RefDevice,
             // and it should look uniform.
-            Outliner& rOutliner = pModel->GetDrawOutliner();
+            Outliner& rOutliner = m_pModel->GetDrawOutliner();
             rOutliner.SetRefDevice(pPrinter);
         }
 
-        if( SdrPage* pPage = pModel->AllocPage( false ) )
+        if( SdrPage* pPage = m_pModel->AllocPage( false ) )
+
         {
-            mxObject = ScNoteUtil::CreateTempCaption( *pDoc, aDocPos, *pPage, aUserText, aVisRect, bLeft );
-            if( mxObject )
+            m_xObject = ScNoteUtil::CreateTempCaption( *m_pDoc, m_aDocPos, *pPage, m_aUserText, m_aVisRect, m_bLeft );
+            if( m_xObject )
             {
-                mxObject->SetGridOffset( aGridOff );
-                aRect = mxObject->GetCurrentBoundRect();
+                m_xObject->SetGridOffset( m_aGridOff );
+                m_aRect = m_xObject->GetCurrentBoundRect();
             }
 
             // Insert page so that the model recognise it and also deleted
-            pModel->InsertPage( pPage );
+            m_pModel->InsertPage( pPage );
 
         }
-        bVisible = true;
+        m_bVisible = true;
     }
 
     Draw();
@@ -143,46 +144,46 @@ static MapMode lcl_MoveMapMode( const MapMode& rMap, const Size& rMove )
 
 void ScNoteMarker::Draw()
 {
-    if ( mxObject && bVisible )
+    if ( m_xObject && m_bVisible )
     {
-        lcl_DrawWin( mxObject.get(), pWindow, aMapMode );
+        lcl_DrawWin( m_xObject.get(), m_pWindow, m_aMapMode );
 
-        if ( pRightWin || pBottomWin )
+        if ( m_pRightWin || m_pBottomWin )
         {
-            Size aWinSize = pWindow->PixelToLogic( pWindow->GetOutputSizePixel(), aMapMode );
-            if ( pRightWin )
-                lcl_DrawWin( mxObject.get(), pRightWin,
-                                lcl_MoveMapMode( aMapMode, Size( aWinSize.Width(), 0 ) ) );
-            if ( pBottomWin )
-                lcl_DrawWin( mxObject.get(), pBottomWin,
-                                lcl_MoveMapMode( aMapMode, Size( 0, aWinSize.Height() ) ) );
-            if ( pDiagWin )
-                lcl_DrawWin( mxObject.get(), pDiagWin, lcl_MoveMapMode( aMapMode, aWinSize ) );
+            Size aWinSize = m_pWindow->PixelToLogic( m_pWindow->GetOutputSizePixel(), m_aMapMode );
+            if ( m_pRightWin )
+                lcl_DrawWin( m_xObject.get(), m_pRightWin,
+                                lcl_MoveMapMode( m_aMapMode, Size( aWinSize.Width(), 0 ) ) );
+            if ( m_pBottomWin )
+                lcl_DrawWin( m_xObject.get(), m_pBottomWin,
+                                lcl_MoveMapMode( m_aMapMode, Size( 0, aWinSize.Height() ) ) );
+            if ( m_pDiagWin )
+                lcl_DrawWin( m_xObject.get(), m_pDiagWin, lcl_MoveMapMode( m_aMapMode, aWinSize ) );
         }
     }
 }
 
 void ScNoteMarker::InvalidateWin()
 {
-    if (bVisible)
+    if (m_bVisible)
     {
-        pWindow->Invalidate( OutputDevice::LogicToLogic(aRect, aMapMode, pWindow->GetMapMode()) );
+        m_pWindow->Invalidate( OutputDevice::LogicToLogic(m_aRect, m_aMapMode, m_pWindow->GetMapMode()) );
 
-        if ( pRightWin || pBottomWin )
+        if ( m_pRightWin || m_pBottomWin )
         {
-            Size aWinSize = pWindow->PixelToLogic( pWindow->GetOutputSizePixel(), aMapMode );
-            if ( pRightWin )
-                pRightWin->Invalidate( OutputDevice::LogicToLogic(aRect,
-                                        lcl_MoveMapMode( aMapMode, Size( aWinSize.Width(), 0 ) ),
-                                        pRightWin->GetMapMode()) );
-            if ( pBottomWin )
-                pBottomWin->Invalidate( OutputDevice::LogicToLogic(aRect,
-                                        lcl_MoveMapMode( aMapMode, Size( 0, aWinSize.Height() ) ),
-                                        pBottomWin->GetMapMode()) );
-            if ( pDiagWin )
-                pDiagWin->Invalidate( OutputDevice::LogicToLogic(aRect,
-                                        lcl_MoveMapMode( aMapMode, aWinSize ),
-                                        pDiagWin->GetMapMode()) );
+            Size aWinSize = m_pWindow->PixelToLogic( m_pWindow->GetOutputSizePixel(), m_aMapMode );
+            if ( m_pRightWin )
+                m_pRightWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+                                        lcl_MoveMapMode( m_aMapMode, Size( aWinSize.Width(), 0 ) ),
+                                        m_pRightWin->GetMapMode()) );
+            if ( m_pBottomWin )
+                m_pBottomWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+                                        lcl_MoveMapMode( m_aMapMode, Size( 0, aWinSize.Height() ) ),
+                                        m_pBottomWin->GetMapMode()) );
+            if ( m_pDiagWin )
+                m_pDiagWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+                                        lcl_MoveMapMode( m_aMapMode, aWinSize ),
+                                        m_pDiagWin->GetMapMode()) );
         }
     }
 }


More information about the Libreoffice-commits mailing list