[Libreoffice-commits] core.git: sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 23 17:54:32 UTC 2020


 sw/source/core/inc/frame.hxx       |   10 ++---
 sw/source/core/layout/newfrm.cxx   |    4 +-
 sw/source/core/layout/paintfrm.cxx |   60 +++++++++++++++---------------
 sw/source/core/layout/virtoutp.cxx |   74 ++++++++++++++++++-------------------
 sw/source/core/layout/virtoutp.hxx |   28 +++++++-------
 sw/source/core/layout/wsfrm.cxx    |    2 -
 6 files changed, 90 insertions(+), 88 deletions(-)

New commits:
commit 406e1d123500b1c40a32055c3876ab06e88370e8
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Nov 23 09:02:03 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Nov 23 18:53:47 2020 +0100

    sw: prefix members of SwFrame, SwFrameAreaDefinition, SwLayVout and SwLineRect
    
    See tdf#94879 for motivation.
    
    Change-Id: I93627e54ba9330e8e1ff2136ab00ecd743c0dd79
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106397
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 90930daeabee..d2dc6a15eaaa 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -148,7 +148,7 @@ private:
 
     // #i65250#
     // frame ID is now in general available - used for layout loop control
-    static sal_uInt32 mnLastFrameId;
+    static sal_uInt32 snLastFrameId;
     const  sal_uInt32 mnFrameId;
 
 protected:
@@ -315,7 +315,7 @@ class SW_DLLPUBLIC SwFrame : public SwFrameAreaDefinition, public SwClient, publ
     friend void MakeNxt( SwFrame *pFrame, SwFrame *pNxt );
 
     // cache for (border) attributes
-    static SwCache *mpCache;
+    static SwCache *spCache;
 
     SwRootFrame   *mpRoot;
     SwLayoutFrame *mpUpper;
@@ -502,9 +502,9 @@ public:
 
     SwFrameType GetType() const { return mnFrameType; }
 
-    static SwCache &GetCache()                { return *mpCache; }
-    static SwCache *GetCachePtr()             { return mpCache;  }
-    static void     SetCache( SwCache *pNew ) { mpCache = pNew;  }
+    static SwCache &GetCache()                { return *spCache; }
+    static SwCache *GetCachePtr()             { return spCache;  }
+    static void     SetCache( SwCache *pNew ) { spCache = pNew;  }
 
     // change PrtArea size and FrameSize
     SwTwips Shrink( SwTwips, bool bTst = false, bool bInfo = false );
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 0431299cdd72..36d80df0e3c9 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -46,7 +46,7 @@ SwLayVout     *SwRootFrame::s_pVout = nullptr;
 bool           SwRootFrame::s_isInPaint = false;
 bool           SwRootFrame::s_isNoVirDev = false;
 
-SwCache *SwFrame::mpCache = nullptr;
+SwCache *SwFrame::spCache = nullptr;
 
 static tools::Long FirstMinusSecond( tools::Long nFirst, tools::Long nSecond )
     { return nFirst - nSecond; }
@@ -288,7 +288,7 @@ SwRectFn fnRectVertL2R = &aVerticalLeftToRight;
 SwRectFn fnRectVertL2RB2T = &aVerticalLeftToRightBottomToTop;
 
 // #i65250#
-sal_uInt32 SwFrameAreaDefinition::mnLastFrameId=0;
+sal_uInt32 SwFrameAreaDefinition::snLastFrameId=0;
 
 
 void FrameInit()
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 12536c52a054..43c655e5c856 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -147,30 +147,32 @@ namespace {
 // Classes collecting the border lines and help lines
 class SwLineRect : public SwRect
 {
-    Color             aColor;
-    SvxBorderLineStyle nStyle;
-    const SwTabFrame *pTab;
-    SubColFlags       nSubColor;  //colorize subsidiary lines
-    bool              bPainted;   //already painted?
-    sal_uInt8         nLock;      //To distinguish the line and the hell layer.
+    Color m_aColor;
+    SvxBorderLineStyle m_nStyle;
+    const SwTabFrame* m_pTabFrame;
+    SubColFlags m_nSubColor; //colorize subsidiary lines
+    bool m_bPainted; //already painted?
+    sal_uInt8 m_nLock; //To distinguish the line and the hell layer.
 public:
     SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderLineStyle nStyle,
                 const SwTabFrame *pT , const SubColFlags nSCol );
 
-    const Color&         GetColor() const { return aColor;}
-    SvxBorderLineStyle   GetStyle() const { return nStyle; }
-    const SwTabFrame      *GetTab()   const { return pTab;  }
-    void  SetPainted()                    { bPainted = true; }
-    void  Lock( bool bLock )              { if ( bLock )
-                                                ++nLock;
-                                            else if ( nLock )
-                                                --nLock;
-                                          }
-    bool        IsPainted()               const { return bPainted; }
-    bool        IsLocked()                const { return nLock != 0;  }
-    SubColFlags GetSubColor()             const { return nSubColor;}
-
-    bool MakeUnion( const SwRect &rRect, SwPaintProperties const &properties );
+    const Color& GetColor() const { return m_aColor; }
+    SvxBorderLineStyle GetStyle() const { return m_nStyle; }
+    const SwTabFrame* GetTab() const { return m_pTabFrame; }
+    void SetPainted() { m_bPainted = true; }
+    void Lock(bool bLock)
+    {
+        if (bLock)
+            ++m_nLock;
+        else if (m_nLock)
+            --m_nLock;
+    }
+    bool IsPainted() const { return m_bPainted; }
+    bool IsLocked() const { return m_nLock != 0; }
+    SubColFlags GetSubColor() const { return m_nSubColor; }
+
+    bool MakeUnion(const SwRect& rRect, SwPaintProperties const& properties);
 };
 
 }
@@ -512,17 +514,17 @@ void BorderLines::AddBorderLines(const drawinglayer::primitive2d::Primitive2DCon
     }
 }
 
-SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderLineStyle nStyl,
-                        const SwTabFrame *pT, const SubColFlags nSCol ) :
-    SwRect( rRect ),
-    nStyle( nStyl ),
-    pTab( pT ),
-    nSubColor( nSCol ),
-    bPainted( false ),
-    nLock( 0 )
+SwLineRect::SwLineRect(const SwRect& rRect, const Color* pCol, const SvxBorderLineStyle nStyl,
+                       const SwTabFrame* pT, const SubColFlags nSCol)
+    : SwRect(rRect)
+    , m_nStyle(nStyl)
+    , m_pTabFrame(pT)
+    , m_nSubColor(nSCol)
+    , m_bPainted(false)
+    , m_nLock(0)
 {
     if ( pCol != nullptr )
-        aColor = *pCol;
+        m_aColor = *pCol;
 }
 
 bool SwLineRect::MakeUnion( const SwRect &rRect, SwPaintProperties const & properties)
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index ace9cb283347..ad0fa58eb0a5 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -84,26 +84,26 @@ bool SwLayVout::DoesFit( const Size &rNew )
         return false;
     if( rNew.IsEmpty() )
         return false;
-    if( rNew.Width() <= aSize.Width() )
+    if( rNew.Width() <= m_aSize.Width() )
         return true;
-    if( !pVirDev )
+    if( !m_pVirDev )
     {
-        pVirDev = VclPtr<VirtualDevice>::Create();
-        pVirDev->SetLineColor();
-        if( pOut )
+        m_pVirDev = VclPtr<VirtualDevice>::Create();
+        m_pVirDev->SetLineColor();
+        if( m_pOut )
         {
-            if( pVirDev->GetFillColor() != pOut->GetFillColor() )
-                pVirDev->SetFillColor( pOut->GetFillColor() );
+            if( m_pVirDev->GetFillColor() != m_pOut->GetFillColor() )
+                m_pVirDev->SetFillColor( m_pOut->GetFillColor() );
         }
     }
 
-    if( rNew.Width() > aSize.Width() )
+    if( rNew.Width() > m_aSize.Width() )
     {
-        aSize.setWidth( rNew.Width() );
-        if( !pVirDev->SetOutputSizePixel( aSize ) )
+        m_aSize.setWidth( rNew.Width() );
+        if( !m_pVirDev->SetOutputSizePixel( m_aSize ) )
         {
-            pVirDev.disposeAndClear();
-            aSize.setWidth( 0 );
+            m_pVirDev.disposeAndClear();
+            m_aSize.setWidth( 0 );
             return false;
         }
     }
@@ -122,67 +122,67 @@ void SwLayVout::Enter(  SwViewShell *pShell, SwRect &rRect, bool bOn )
 #ifdef DBG_UTIL
     if( pShell->GetViewOptions()->IsTest3() )
     {
-        ++nCount;
+        ++m_nCount;
         return;
     }
 #endif
 
-    bOn = bOn && !nCount && rRect.HasArea() && pShell->GetWin();
-    ++nCount;
+    bOn = bOn && !m_nCount && rRect.HasArea() && pShell->GetWin();
+    ++m_nCount;
     if( !bOn )
         return;
 
-    pSh = pShell;
-    pOut = nullptr;
-    OutputDevice *pO = pSh->GetOut();
+    m_pShell = pShell;
+    m_pOut = nullptr;
+    OutputDevice *pO = m_pShell->GetOut();
 // We don't cheat on printers or virtual output devices...
     if( OUTDEV_WINDOW != pO->GetOutDevType() )
         return;
 
-    pOut = pO;
-    Size aPixSz( pOut->PixelToLogic( Size( 1,1 )) );
+    m_pOut = pO;
+    Size aPixSz( m_pOut->PixelToLogic( Size( 1,1 )) );
     SwRect aTmp( rRect );
     aTmp.AddWidth(aPixSz.Width()/2 + 1 );
     aTmp.AddHeight(aPixSz.Height()/2 + 1 );
     tools::Rectangle aTmpRect( pO->LogicToPixel( aTmp.SVRect() ) );
 
-    OSL_ENSURE( !pSh->GetWin()->IsReallyVisible() ||
-            aTmpRect.GetWidth() <= pSh->GetWin()->GetOutputSizePixel().Width() + 2,
+    OSL_ENSURE( !m_pShell->GetWin()->IsReallyVisible() ||
+            aTmpRect.GetWidth() <= m_pShell->GetWin()->GetOutputSizePixel().Width() + 2,
             "Paintwidth bigger than visarea?" );
     // Does the rectangle fit in our buffer?
     if( !DoesFit( aTmpRect.GetSize() ) )
     {
-        pOut = nullptr;
+        m_pOut = nullptr;
         return;
     }
 
-    aRect = SwRect( pO->PixelToLogic( aTmpRect ) );
+    m_aRect = SwRect( pO->PixelToLogic( aTmpRect ) );
 
-    SetOutDev( pSh, pVirDev );
+    SetOutDev( m_pShell, m_pVirDev );
 
-    if( pVirDev->GetFillColor() != pOut->GetFillColor() )
-        pVirDev->SetFillColor( pOut->GetFillColor() );
+    if( m_pVirDev->GetFillColor() != m_pOut->GetFillColor() )
+        m_pVirDev->SetFillColor( m_pOut->GetFillColor() );
 
-    MapMode aMapMode( pOut->GetMapMode() );
+    MapMode aMapMode( m_pOut->GetMapMode() );
     // use method to set mapping
     //aMapMode.SetOrigin( Point(0,0) - aRect.Pos() );
-    ::SetMappingForVirtDev( aRect.Pos(), pOut, pVirDev );
+    ::SetMappingForVirtDev( m_aRect.Pos(), m_pOut, m_pVirDev );
 
-    if( aMapMode != pVirDev->GetMapMode() )
-        pVirDev->SetMapMode( aMapMode );
+    if( aMapMode != m_pVirDev->GetMapMode() )
+        m_pVirDev->SetMapMode( aMapMode );
 
     // set value of parameter <rRect>
-    rRect = aRect;
+    rRect = m_aRect;
 
 }
 
 void SwLayVout::Flush_()
 {
-    OSL_ENSURE( pVirDev, "SwLayVout::DrawOut: nothing left Toulouse" );
-    pOut->DrawOutDev( aRect.Pos(), aRect.SSize(),
-                      aRect.Pos(), aRect.SSize(), *pVirDev );
-    SetOutDev( pSh, pOut );
-    pOut = nullptr;
+    OSL_ENSURE( m_pVirDev, "SwLayVout::DrawOut: nothing left Toulouse" );
+    m_pOut->DrawOutDev( m_aRect.Pos(), m_aRect.SSize(),
+                      m_aRect.Pos(), m_aRect.SSize(), *m_pVirDev );
+    SetOutDev( m_pShell, m_pOut );
+    m_pOut = nullptr;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx
index c120f8cc6423..df24ec196656 100644
--- a/sw/source/core/layout/virtoutp.hxx
+++ b/sw/source/core/layout/virtoutp.hxx
@@ -30,30 +30,30 @@ class SwLayVout
 {
     friend void FrameFinit();    //deletes Vout
 private:
-    SwViewShell*      pSh;
-    VclPtr<OutputDevice>  pOut;
-    VclPtr<VirtualDevice> pVirDev;
-    SwRect          aRect;
-    SwRect          aOrgRect;
-    Size            aSize;
-    sal_uInt16          nCount;
+    SwViewShell*      m_pShell;
+    VclPtr<OutputDevice>  m_pOut;
+    VclPtr<VirtualDevice> m_pVirDev;
+    SwRect          m_aRect;
+    SwRect          m_aOrgRect;
+    Size            m_aSize;
+    sal_uInt16          m_nCount;
 
     bool DoesFit( const Size &rOut );
 
 public:
-    SwLayVout() : pSh(nullptr), pOut(nullptr), pVirDev(nullptr), aSize(0, VIRTUALHEIGHT), nCount(0) {}
-    ~SwLayVout() { pVirDev.disposeAndClear(); }
+    SwLayVout() : m_pShell(nullptr), m_pOut(nullptr), m_pVirDev(nullptr), m_aSize(0, VIRTUALHEIGHT), m_nCount(0) {}
+    ~SwLayVout() { m_pVirDev.disposeAndClear(); }
 
     /// OD 27.09.2002 #103636# - change 2nd parameter <rRect> - no longer <const>
     void Enter( SwViewShell *pShell, SwRect &rRect, bool bOn );
-    void Leave() { --nCount; Flush(); }
+    void Leave() { --m_nCount; Flush(); }
 
-    void SetOrgRect( SwRect const &rRect ) { aOrgRect = rRect; }
-    const SwRect& GetOrgRect() const { return aOrgRect; }
+    void SetOrgRect( SwRect const &rRect ) { m_aOrgRect = rRect; }
+    const SwRect& GetOrgRect() const { return m_aOrgRect; }
 
-    bool IsFlushable() const { return bool(pOut); }
+    bool IsFlushable() const { return bool(m_pOut); }
     void Flush_();
-    void Flush() { if( pOut ) Flush_(); }
+    void Flush() { if( m_pOut ) Flush_(); }
 };
 
 #endif
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 438eaaef79fd..e7efffdec412 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -71,7 +71,7 @@ SwFrameAreaDefinition::SwFrameAreaDefinition()
     mbFrameAreaPositionValid(false),
     mbFrameAreaSizeValid(false),
     mbFramePrintAreaValid(false),
-    mnFrameId(SwFrameAreaDefinition::mnLastFrameId++)
+    mnFrameId(SwFrameAreaDefinition::snLastFrameId++)
 {
 }
 


More information about the Libreoffice-commits mailing list