sw/source/core/layout/laycache.cxx |  118 ++++++++++++++++++-------------------
 sw/source/core/layout/layhelp.hxx  |   36 +++++------
 sw/source/core/layout/layouter.cxx |   92 ++++++++++++++--------------
 3 files changed, 123 insertions(+), 123 deletions(-)

New commits:
commit c3f78d6b29579911606700f136796c150c4547c2
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Nov 16 09:05:14 2020 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Nov 16 10:19:33 2020 +0100

    sw: prefix members of SwEndnoter, SwLayCacheImpl, SwLayCacheIoImpl and ...
    
    ... SwLooping
    
    See tdf#94879 for motivation.
    
    Change-Id: I4cf118cd7e68069ef3a73077b5340f7b93d87319
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105911
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/layout/laycache.cxx 
b/sw/source/core/layout/laycache.cxx
index f28191d0600f..ce33076182aa 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -80,9 +80,9 @@ void SwLayoutCache::Read( SvStream &rStream )
 
 void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, sal_Int32 
nOffset )
 {
-    aType.push_back( nType );
+    m_aType.push_back( nType );
     mIndices.push_back( nIndex );
-    aOffset.push_back( nOffset );
+    m_aOffset.push_back( nOffset );
 }
 
 bool SwLayCacheImpl::Read( SvStream& rStream )
@@ -95,7 +95,7 @@ bool SwLayCacheImpl::Read( SvStream& rStream )
     // sizes of fly frames which have been written using the "old" layout 
cache.
     // This flag should indicate that we do not want to trust the width and
     // height of fly frames
-    bUseFlyCache = aIo.GetMinorVersion() >= 1;
+    m_bUseFlyCache = aIo.GetMinorVersion() >= 1;
 
     aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES );
     aIo.OpenFlagRec();
@@ -1047,46 +1047,46 @@ void SwLayHelper::CheckFlyCache_( SwPageFrame* pPage )
 }
 
 SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, bool bWrtMd ) :
-    pStream( &rStrm ),
-    nFlagRecEnd ( 0 ),
-    nMajorVersion(SW_LAYCACHE_IO_VERSION_MAJOR),
-    nMinorVersion(SW_LAYCACHE_IO_VERSION_MINOR),
-    bWriteMode( bWrtMd ),
-    bError( false  )
+    m_pStream( &rStrm ),
+    m_nFlagRecEnd ( 0 ),
+    m_nMajorVersion(SW_LAYCACHE_IO_VERSION_MAJOR),
+    m_nMinorVersion(SW_LAYCACHE_IO_VERSION_MINOR),
+    m_bWriteMode( bWrtMd ),
+    m_bError( false  )
 {
-    if( bWriteMode )
-        pStream->WriteUInt16( nMajorVersion )
-                .WriteUInt16( nMinorVersion );
+    if( m_bWriteMode )
+        m_pStream->WriteUInt16( m_nMajorVersion )
+                .WriteUInt16( m_nMinorVersion );
 
     else
-        pStream->ReadUInt16( nMajorVersion )
-                .ReadUInt16( nMinorVersion );
+        m_pStream->ReadUInt16( m_nMajorVersion )
+                .ReadUInt16( m_nMinorVersion );
 }
 
 void SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
 {
-    sal_uInt32 nPos = pStream->Tell();
-    if( bWriteMode )
+    sal_uInt32 nPos = m_pStream->Tell();
+    if( m_bWriteMode )
     {
-        aRecords.emplace_back(cType, nPos );
-        pStream->WriteUInt32( 0 );
+        m_aRecords.emplace_back(cType, nPos );
+        m_pStream->WriteUInt32( 0 );
     }
     else
     {
         sal_uInt32 nVal(0);
-        pStream->ReadUInt32( nVal );
+        m_pStream->ReadUInt32( nVal );
         sal_uInt8 cRecTyp = static_cast<sal_uInt8>(nVal);
-        if (!nVal || cRecTyp != cType || !pStream->good())
+        if (!nVal || cRecTyp != cType || !m_pStream->good())
         {
             OSL_ENSURE( nVal, "OpenRec: Record-Header is 0" );
             OSL_ENSURE( cRecTyp == cType, "OpenRec: Wrong Record Type" );
-            aRecords.emplace_back(0, pStream->Tell() );
-            bError = true;
+            m_aRecords.emplace_back(0, m_pStream->Tell() );
+            m_bError = true;
         }
         else
         {
             sal_uInt32 nSize = nVal >> 8;
-            aRecords.emplace_back(cRecTyp, nPos+nSize );
+            m_aRecords.emplace_back(cRecTyp, nPos+nSize );
         }
     }
 }
@@ -1095,48 +1095,48 @@ void SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
 void SwLayCacheIoImpl::CloseRec()
 {
     bool bRes = true;
-    OSL_ENSURE( !aRecords.empty(), "CloseRec: no levels" );
-    if( !aRecords.empty() )
+    OSL_ENSURE( !m_aRecords.empty(), "CloseRec: no levels" );
+    if( !m_aRecords.empty() )
     {
-        sal_uInt32 nPos = pStream->Tell();
-        if( bWriteMode )
+        sal_uInt32 nPos = m_pStream->Tell();
+        if( m_bWriteMode )
         {
-            sal_uInt32 nBgn = aRecords.back().size;
-            pStream->Seek( nBgn );
+            sal_uInt32 nBgn = m_aRecords.back().size;
+            m_pStream->Seek( nBgn );
             sal_uInt32 nSize = nPos - nBgn;
-            sal_uInt32 nVal = ( nSize << 8 ) | aRecords.back().type;
-            pStream->WriteUInt32( nVal );
-            pStream->Seek( nPos );
-            if( pStream->GetError() != ERRCODE_NONE )
+            sal_uInt32 nVal = ( nSize << 8 ) | m_aRecords.back().type;
+            m_pStream->WriteUInt32( nVal );
+            m_pStream->Seek( nPos );
+            if( m_pStream->GetError() != ERRCODE_NONE )
                  bRes = false;
         }
         else
         {
-            sal_uInt32 n = aRecords.back().size;
+            sal_uInt32 n = m_aRecords.back().size;
             OSL_ENSURE( n >= nPos, "CloseRec: too much data read" );
             if( n != nPos )
             {
-                pStream->Seek( n );
+                m_pStream->Seek( n );
                 if( n < nPos )
                      bRes = false;
             }
-            if( pStream->GetErrorCode() != ERRCODE_NONE )
+            if( m_pStream->GetErrorCode() != ERRCODE_NONE )
                 bRes = false;
         }
-        aRecords.pop_back();
+        m_aRecords.pop_back();
     }
 
     if( !bRes )
-        bError = true;
+        m_bError = true;
 }
 
 sal_uInt32 SwLayCacheIoImpl::BytesLeft()
 {
     sal_uInt32 n = 0;
-    if( !bError && !aRecords.empty() )
+    if( !m_bError && !m_aRecords.empty() )
     {
-        sal_uInt32 nEndPos = aRecords.back().size;
-        sal_uInt32 nPos = pStream->Tell();
+        sal_uInt32 nEndPos = m_aRecords.back().size;
+        sal_uInt32 nPos = m_pStream->Tell();
         if( nEndPos > nPos )
             n = nEndPos - nPos;
     }
@@ -1146,15 +1146,15 @@ sal_uInt32 SwLayCacheIoImpl::BytesLeft()
 sal_uInt8 SwLayCacheIoImpl::Peek()
 {
     sal_uInt8 c(0);
-    if( !bError )
+    if( !m_bError )
     {
-        sal_uInt32 nPos = pStream->Tell();
-        pStream->ReadUChar( c );
-        pStream->Seek( nPos );
-        if( pStream->GetErrorCode() != ERRCODE_NONE )
+        sal_uInt32 nPos = m_pStream->Tell();
+        m_pStream->ReadUChar( c );
+        m_pStream->Seek( nPos );
+        if( m_pStream->GetErrorCode() != ERRCODE_NONE )
         {
             c = 0;
-            bError = true;
+            m_bError = true;
         }
     }
     return c;
@@ -1164,40 +1164,40 @@ void SwLayCacheIoImpl::SkipRec()
 {
     sal_uInt8 c = Peek();
     OpenRec( c );
-    pStream->Seek( aRecords.back().size );
+    m_pStream->Seek( m_aRecords.back().size );
     CloseRec();
 }
 
 sal_uInt8 SwLayCacheIoImpl::OpenFlagRec()
 {
-    OSL_ENSURE( !bWriteMode, "OpenFlagRec illegal in write  mode" );
+    OSL_ENSURE( !m_bWriteMode, "OpenFlagRec illegal in write  mode" );
     sal_uInt8 cFlags(0);
-    pStream->ReadUChar( cFlags );
-    nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F );
+    m_pStream->ReadUChar( cFlags );
+    m_nFlagRecEnd = m_pStream->Tell() + ( cFlags & 0x0F );
     return (cFlags >> 4);
 }
 
 void SwLayCacheIoImpl::OpenFlagRec( sal_uInt8 nFlags, sal_uInt8 nLen )
 {
-    OSL_ENSURE( bWriteMode, "OpenFlagRec illegal in read  mode" );
+    OSL_ENSURE( m_bWriteMode, "OpenFlagRec illegal in read  mode" );
     OSL_ENSURE( (nFlags & 0xF0) == 0, "illegal flags set" );
     OSL_ENSURE( nLen < 16, "wrong flag record length" );
     sal_uInt8 cFlags = (nFlags << 4) + nLen;
-    pStream->WriteUChar( cFlags );
-    nFlagRecEnd = pStream->Tell() + nLen;
+    m_pStream->WriteUChar( cFlags );
+    m_nFlagRecEnd = m_pStream->Tell() + nLen;
 }
 
 void SwLayCacheIoImpl::CloseFlagRec()
 {
-    if( bWriteMode )
+    if( m_bWriteMode )
     {
-        OSL_ENSURE( pStream->Tell() == nFlagRecEnd, "Wrong amount of data 
written" );
+        OSL_ENSURE( m_pStream->Tell() == m_nFlagRecEnd, "Wrong amount of data 
written" );
     }
     else
     {
-        OSL_ENSURE( pStream->Tell() <= nFlagRecEnd, "Too many data read" );
-        if( pStream->Tell() != nFlagRecEnd )
-            pStream->Seek( nFlagRecEnd );
+        OSL_ENSURE( m_pStream->Tell() <= m_nFlagRecEnd, "Too many data read" );
+        if( m_pStream->Tell() != m_nFlagRecEnd )
+            m_pStream->Seek( m_nFlagRecEnd );
     }
 }
 
diff --git a/sw/source/core/layout/layhelp.hxx 
b/sw/source/core/layout/layhelp.hxx
index 8408b311742d..fef26842d9cc 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -56,27 +56,27 @@ class SwLayCacheImpl
 {
     std::vector<sal_uLong> mIndices;
     /// either a textframe character offset, or a row index inside a table
-    std::deque<sal_Int32> aOffset;
-    std::vector<sal_uInt16> aType;
+    std::deque<sal_Int32> m_aOffset;
+    std::vector<sal_uInt16> m_aType;
     SwPageFlyCache m_FlyCache;
-    bool bUseFlyCache;
+    bool m_bUseFlyCache;
     void Insert( sal_uInt16 nType, sal_uLong nIndex, sal_Int32 nOffset );
 
 public:
-    SwLayCacheImpl() : bUseFlyCache(false) {}
+    SwLayCacheImpl() : m_bUseFlyCache(false) {}
 
     size_t size() const { return mIndices.size(); }
 
     bool Read( SvStream& rStream );
 
     sal_uLong GetBreakIndex( size_t nIdx ) const { return mIndices[ nIdx ]; }
-    sal_Int32 GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
-    sal_uInt16 GetBreakType( size_t nIdx ) const { return aType[ nIdx ]; }
+    sal_Int32 GetBreakOfst( size_t nIdx ) const { return m_aOffset[ nIdx ]; }
+    sal_uInt16 GetBreakType( size_t nIdx ) const { return m_aType[ nIdx ]; }
 
     size_t GetFlyCount() const { return m_FlyCache.size(); }
     SwFlyCache& GetFlyCache( size_t nIdx ) { return m_FlyCache[ nIdx ]; }
 
-    bool IsUseFlyCache() const { return bUseFlyCache; }
+    bool IsUseFlyCache() const { return m_bUseFlyCache; }
 };
 
 // Helps to create the sectionframes during the InsertCnt_-function
@@ -150,23 +150,23 @@ private:
         sal_uLong size;
         RecTypeSize(sal_uInt8 typ, sal_uLong siz) : type(typ), size(siz) {}
     };
-    std::vector<RecTypeSize> aRecords;
+    std::vector<RecTypeSize> m_aRecords;
 
-    SvStream        *pStream;
+    SvStream        *m_pStream;
 
-    sal_uLong           nFlagRecEnd;
+    sal_uLong           m_nFlagRecEnd;
 
-    sal_uInt16          nMajorVersion;
-    sal_uInt16          nMinorVersion;
+    sal_uInt16          m_nMajorVersion;
+    sal_uInt16          m_nMinorVersion;
 
-    bool            bWriteMode : 1;
-    bool            bError : 1;
+    bool            m_bWriteMode : 1;
+    bool            m_bError : 1;
 
 public:
     SwLayCacheIoImpl( SvStream& rStrm, bool bWrtMd );
 
     /// Get input or output stream
-    SvStream& GetStream() const { return *pStream; }
+    SvStream& GetStream() const { return *m_pStream; }
 
     /// Open a record of type "nType"
     void OpenRec( sal_uInt8 nType );
@@ -196,10 +196,10 @@ public:
     /// Close a flag record. Any bytes left are skipped.
     void CloseFlagRec();
 
-    bool HasError() const { return bError; }
+    bool HasError() const { return m_bError; }
 
-    sal_uInt16 GetMajorVersion() const { return nMajorVersion; }
-    sal_uInt16 GetMinorVersion() const { return nMinorVersion; }
+    sal_uInt16 GetMajorVersion() const { return m_nMajorVersion; }
+    sal_uInt16 GetMinorVersion() const { return m_nMinorVersion; }
 };
 
 // Stored information about text frames:
diff --git a/sw/source/core/layout/layouter.cxx 
b/sw/source/core/layout/layouter.cxx
index 0ae6585702eb..b3e8f83ca2a6 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -33,45 +33,45 @@
 
 class SwLooping
 {
-    sal_uInt16 nMinPage;
-    sal_uInt16 nMaxPage;
-    sal_uInt16 nCount;
+    sal_uInt16 mnMinPage;
+    sal_uInt16 mnMaxPage;
+    sal_uInt16 mnCount;
     sal_uInt16 mnLoopControlStage;
 public:
     explicit SwLooping( SwPageFrame const * pPage );
     void Control( SwPageFrame* pPage );
     void Drastic( SwFrame* pFrame );
-    bool IsLoopingLouieLight() const { return nCount > LOOP_DETECT - 30; };
+    bool IsLoopingLouieLight() const { return mnCount > LOOP_DETECT - 30; };
 };
 
 class SwEndnoter
 {
-    SwLayouter*                        pMaster;
-    SwSectionFrame*                    pSect;
-    std::unique_ptr<SwFootnoteFrames>  pEndArr;
+    SwLayouter*                        m_pMaster;
+    SwSectionFrame*                    m_pSect;
+    std::unique_ptr<SwFootnoteFrames>  m_pEndArr;
 public:
     explicit SwEndnoter( SwLayouter* pLay )
-        : pMaster( pLay ), pSect( nullptr ) {}
+        : m_pMaster( pLay ), m_pSect( nullptr ) {}
     void CollectEndnotes( SwSectionFrame* pSct );
     void CollectEndnote( SwFootnoteFrame* pFootnote );
-    const SwSectionFrame* GetSect() const { return pSect; }
+    const SwSectionFrame* GetSect() const { return m_pSect; }
     void InsertEndnotes();
-    bool HasEndnotes() const { return pEndArr && !pEndArr->empty(); }
+    bool HasEndnotes() const { return m_pEndArr && !m_pEndArr->empty(); }
 };
 
 void SwEndnoter::CollectEndnotes( SwSectionFrame* pSct )
 {
     OSL_ENSURE( pSct, "CollectEndnotes: Which section?" );
-    if( !pSect )
-        pSect = pSct;
-    else if( pSct != pSect )
+    if( !m_pSect )
+        m_pSect = pSct;
+    else if( pSct != m_pSect )
         return;
-    pSect->CollectEndnotes( pMaster );
+    m_pSect->CollectEndnotes( m_pMaster );
 }
 
 void SwEndnoter::CollectEndnote( SwFootnoteFrame* pFootnote )
 {
-    if( pEndArr && pEndArr->end() != std::find( pEndArr->begin(), 
pEndArr->end(), pFootnote ) )
+    if( m_pEndArr && m_pEndArr->end() != std::find( m_pEndArr->begin(), 
m_pEndArr->end(), pFootnote ) )
         return;
 
     if( pFootnote->GetUpper() )
@@ -103,9 +103,9 @@ void SwEndnoter::CollectEndnote( SwFootnoteFrame* pFootnote 
)
             return;
         pFootnote->Cut();
     }
-    else if( pEndArr )
+    else if( m_pEndArr )
     {
-        for (SwFootnoteFrame* pEndFootnote : *pEndArr)
+        for (SwFootnoteFrame* pEndFootnote : *m_pEndArr)
         {
             if( pEndFootnote->GetAttr() == pFootnote->GetAttr() )
             {
@@ -114,36 +114,36 @@ void SwEndnoter::CollectEndnote( SwFootnoteFrame* 
pFootnote )
             }
         }
     }
-    if( !pEndArr )
-        pEndArr.reset( new SwFootnoteFrames );  // deleted from the SwLayouter
-    pEndArr->push_back( pFootnote );
+    if( !m_pEndArr )
+        m_pEndArr.reset( new SwFootnoteFrames );  // deleted from the 
SwLayouter
+    m_pEndArr->push_back( pFootnote );
 }
 
 void SwEndnoter::InsertEndnotes()
 {
-    if( !pSect )
+    if( !m_pSect )
         return;
-    if( !pEndArr || pEndArr->empty() )
+    if( !m_pEndArr || m_pEndArr->empty() )
     {
-        pSect = nullptr;
+        m_pSect = nullptr;
         return;
     }
-    OSL_ENSURE( pSect->Lower() && pSect->Lower()->IsFootnoteBossFrame(),
+    OSL_ENSURE( m_pSect->Lower() && m_pSect->Lower()->IsFootnoteBossFrame(),
             "InsertEndnotes: Where's my column?" );
-    SwFrame* pRef = pSect->FindLastContent( SwFindMode::MyLast );
+    SwFrame* pRef = m_pSect->FindLastContent( SwFindMode::MyLast );
     SwFootnoteBossFrame *pBoss = pRef ? pRef->FindFootnoteBossFrame()
-                               : 
static_cast<SwFootnoteBossFrame*>(pSect->Lower());
-    pBoss->MoveFootnotes_( *pEndArr );
-    pEndArr.reset();
-    pSect = nullptr;
+                               : 
static_cast<SwFootnoteBossFrame*>(m_pSect->Lower());
+    pBoss->MoveFootnotes_( *m_pEndArr );
+    m_pEndArr.reset();
+    m_pSect = nullptr;
 }
 
 SwLooping::SwLooping( SwPageFrame const * pPage )
 {
     OSL_ENSURE( pPage, "Where's my page?" );
-    nMinPage = pPage->GetPhyPageNum();
-    nMaxPage = nMinPage;
-    nCount = 0;
+    mnMinPage = pPage->GetPhyPageNum();
+    mnMaxPage = mnMinPage;
+    mnCount = 0;
     mnLoopControlStage = 0;
 }
 
@@ -161,23 +161,23 @@ void SwLooping::Control( SwPageFrame* pPage )
     if( !pPage )
         return;
     const sal_uInt16 nNew = pPage->GetPhyPageNum();
-    if( nNew > nMaxPage )
-        nMaxPage = nNew;
-    if( nNew < nMinPage )
+    if (nNew > mnMaxPage)
+        mnMaxPage = nNew;
+    if (nNew < mnMinPage)
     {
-        nMinPage = nNew;
-        nMaxPage = nNew;
-        nCount = 0;
+        mnMinPage = nNew;
+        mnMaxPage = nNew;
+        mnCount = 0;
         mnLoopControlStage = 0;
     }
-    else if( nNew > nMinPage + 2 )
+    else if (nNew > mnMinPage + 2)
     {
-        nMinPage = nNew - 2;
-        nMaxPage = nNew;
-        nCount = 0;
+        mnMinPage = nNew - 2;
+        mnMaxPage = nNew;
+        mnCount = 0;
         mnLoopControlStage = 0;
     }
-    else if( ++nCount > LOOP_DETECT )
+    else if (++mnCount > LOOP_DETECT)
     {
 #if OSL_DEBUG_LEVEL > 1
         static bool bNoLouie = false;
@@ -191,13 +191,13 @@ void SwLooping::Control( SwPageFrame* pPage )
 #endif
 
         Drastic( pPage->Lower() );
-        if( nNew > nMinPage && pPage->GetPrev() )
+        if (nNew > mnMinPage && pPage->GetPrev())
             Drastic( static_cast<SwPageFrame*>(pPage->GetPrev())->Lower() );
-        if( nNew < nMaxPage && pPage->GetNext() )
+        if (nNew < mnMaxPage && pPage->GetNext())
             Drastic( static_cast<SwPageFrame*>(pPage->GetNext())->Lower() );
 
         ++mnLoopControlStage;
-        nCount = 0;
+        mnCount = 0;
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to