sw/source/core/doc/docsort.cxx | 56 ++++++++++++++++++------------------ sw/source/core/doc/visiturl.cxx | 12 +++---- sw/source/core/docnode/node2lay.cxx | 8 ++--- sw/source/core/inc/docsort.hxx | 24 +++++++-------- sw/source/core/inc/laycache.hxx | 18 +++++------ sw/source/core/inc/node2lay.hxx | 2 - sw/source/core/inc/visiturl.hxx | 2 - sw/source/core/layout/laycache.cxx | 30 +++++++++---------- 8 files changed, 76 insertions(+), 76 deletions(-)
New commits: commit 37d5cccceb9f02d60de326f5b1fc5098dc004739 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Jun 15 09:05:50 2020 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jun 15 09:48:46 2020 +0200 sw: prefix members of FlatFndBox, SwLayoutCache, SwNode2Layout and ... ... SwURLStateChanged See tdf#94879 for motivation. Change-Id: Id20c322dc79f385cfa067a999c76938ee5896dcd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96311 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 3a5f982f72e8..18b128769939 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -735,21 +735,21 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar, /// Generate two-dimensional array of FndBoxes FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const FndBox_& rBoxRef) : - pDoc(pDocPtr), - nRow(0), - nCol(0) + m_pDoc(pDocPtr), + m_nRow(0), + m_nCol(0) { // If the array is symmetric - bSym = CheckLineSymmetry(rBoxRef); - if( bSym ) + m_bSym = CheckLineSymmetry(rBoxRef); + if( m_bSym ) { // Determine column/row count - nCols = GetColCount(rBoxRef); - nRows = GetRowCount(rBoxRef); + m_nCols = GetColCount(rBoxRef); + m_nRows = GetRowCount(rBoxRef); // Create linear array - size_t nCount = static_cast<size_t>(nRows) * nCols; - pArr = std::make_unique<FndBox_ const *[]>(nCount); - memset(pArr.get(), 0, sizeof(const FndBox_*) * nCount); + size_t nCount = static_cast<size_t>(m_nRows) * m_nCols; + m_pArr = std::make_unique<FndBox_ const *[]>(nCount); + memset(m_pArr.get(), 0, sizeof(const FndBox_*) * nCount); FillFlat( rBoxRef ); } @@ -860,12 +860,12 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) const FndLines_t& rLines = rBox.GetLines(); // Iterate over Lines - sal_uInt16 nOldRow = nRow; + sal_uInt16 nOldRow = m_nRow; for (const auto & pLine : rLines) { // The Boxes of a Line const FndBoxes_t& rBoxes = pLine->GetBoxes(); - sal_uInt16 nOldCol = nCol; + sal_uInt16 nOldCol = m_nCol; for( FndBoxes_t::size_type j = 0; j < rBoxes.size(); ++j ) { // Check the Box if it's an atomic one @@ -874,8 +874,8 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) if( pBox->GetLines().empty() ) { // save it - sal_uInt16 nOff = nRow * nCols + nCol; - pArr[nOff] = pBox; + sal_uInt16 nOff = m_nRow * m_nCols + m_nCol; + m_pArr[nOff] = pBox; // Save the Formula/Format/Value values const SwFrameFormat* pFormat = pBox->GetBox()->GetFrameFormat(); @@ -884,17 +884,17 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_VALUE ) ) { auto pSet = std::make_unique<SfxItemSet>( - pDoc->GetAttrPool(), + m_pDoc->GetAttrPool(), svl::Items< RES_VERT_ORIENT, RES_VERT_ORIENT, RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{}); pSet->Put( pFormat->GetAttrSet() ); - if( ppItemSets.empty() ) + if( m_ppItemSets.empty() ) { - size_t nCount = static_cast<size_t>(nRows) * nCols; - ppItemSets.resize(nCount); + size_t nCount = static_cast<size_t>(m_nRows) * m_nCols; + m_ppItemSets.resize(nCount); } - ppItemSets[nOff] = std::move(pSet); + m_ppItemSets[nOff] = std::move(pSet); } bModRow = true; @@ -904,31 +904,31 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) // Iterate recursively over the Lines of a Box FillFlat( *pBox, ( j+1 == rBoxes.size() ) ); } - nCol++; + m_nCol++; } if(bModRow) - nRow++; - nCol = nOldCol; + m_nRow++; + m_nCol = nOldCol; } if(!bLastBox) - nRow = nOldRow; + m_nRow = nOldRow; } /// Access a specific Cell const FndBox_* FlatFndBox::GetBox(sal_uInt16 n_Col, sal_uInt16 n_Row) const { - sal_uInt16 nOff = n_Row * nCols + n_Col; - const FndBox_* pTmp = pArr[nOff]; + sal_uInt16 nOff = n_Row * m_nCols + n_Col; + const FndBox_* pTmp = m_pArr[nOff]; - OSL_ENSURE(n_Col < nCols && n_Row < nRows && pTmp, "invalid array access"); + OSL_ENSURE(n_Col < m_nCols && n_Row < m_nRows && pTmp, "invalid array access"); return pTmp; } const SfxItemSet* FlatFndBox::GetItemSet(sal_uInt16 n_Col, sal_uInt16 n_Row) const { - OSL_ENSURE( ppItemSets.empty() || ( n_Col < nCols && n_Row < nRows), "invalid array access"); + OSL_ENSURE( m_ppItemSets.empty() || ( n_Col < m_nCols && n_Row < m_nRows), "invalid array access"); - return !ppItemSets.empty() ? ppItemSets[unsigned(n_Row * nCols) + n_Col].get() : nullptr; + return !m_ppItemSets.empty() ? m_ppItemSets[unsigned(n_Row * m_nCols) + n_Col].get() : nullptr; } sal_uInt16 SwMovedBoxes::GetPos(const SwTableBox* pTableBox) const diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 1e284f1d8509..62758c60e83d 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -30,7 +30,7 @@ #include <docsh.hxx> SwURLStateChanged::SwURLStateChanged( SwDoc* pD ) - : pDoc( pD ) + : m_pDoc( pD ) { StartListening( *INetURLHistory::GetOrCreate() ); } @@ -42,21 +42,21 @@ SwURLStateChanged::~SwURLStateChanged() void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) { - if( dynamic_cast<const INetURLHistoryHint*>(&rHint) && pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) + if( dynamic_cast<const INetURLHistoryHint*>(&rHint) && m_pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) { // This URL has been changed: const INetURLObject* pIURL = static_cast<const INetURLHistoryHint&>(rHint).GetObject(); OUString sURL( pIURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ) ), sBkmk; - SwEditShell* pESh = pDoc->GetEditShell(); + SwEditShell* pESh = m_pDoc->GetEditShell(); - if( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() && + if( m_pDoc->GetDocShell() && m_pDoc->GetDocShell()->GetMedium() && // If this is our Doc, we can also have local jumps! - pDoc->GetDocShell()->GetMedium()->GetName() == sURL ) + m_pDoc->GetDocShell()->GetMedium()->GetName() == sURL ) sBkmk = "#" + pIURL->GetMark(); bool bAction = false, bUnLockView = false; - for (const SfxPoolItem* pItem : pDoc->GetAttrPool().GetItemSurrogates(RES_TXTATR_INETFMT)) + for (const SfxPoolItem* pItem : m_pDoc->GetAttrPool().GetItemSurrogates(RES_TXTATR_INETFMT)) { const SwFormatINetFormat* pFormatItem = dynamic_cast<const SwFormatINetFormat*>(pItem); if( pFormatItem != nullptr && diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index a62f55ec64e6..7eb1a0ce15f3 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -425,7 +425,7 @@ SwFrame* SwNode2LayImpl::GetFrame( const Point* pDocPos ) const } SwNode2Layout::SwNode2Layout( const SwNode& rNd, sal_uLong nIdx ) - : pImpl( new SwNode2LayImpl( rNd, nIdx, false ) ) + : m_pImpl( new SwNode2LayImpl( rNd, nIdx, false ) ) { } @@ -443,12 +443,12 @@ void SwNode2LayoutSaveUpperFrames::RestoreUpperFrames( SwFrame* SwNode2Layout::NextFrame() { - return pImpl->NextFrame(); + return m_pImpl->NextFrame(); } SwLayoutFrame* SwNode2Layout::UpperFrame( SwFrame* &rpFrame, const SwNode &rNode ) { - return pImpl->UpperFrame( rpFrame, rNode ); + return m_pImpl->UpperFrame( rpFrame, rNode ); } SwNode2Layout::~SwNode2Layout() @@ -461,7 +461,7 @@ SwNode2LayoutSaveUpperFrames::~SwNode2LayoutSaveUpperFrames() SwFrame* SwNode2Layout::GetFrame( const Point* pDocPos ) const { - return pImpl->GetFrame( pDocPos ); + return m_pImpl->GetFrame( pDocPos ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx index a660ba4cbae0..fdc73f908027 100644 --- a/sw/source/core/inc/docsort.hxx +++ b/sw/source/core/inc/docsort.hxx @@ -125,9 +125,9 @@ public: FlatFndBox(SwDoc* pDocPtr, const FndBox_& rBox); ~FlatFndBox(); - bool IsSymmetric() const { return bSym; } - sal_uInt16 GetRows() const { return nRows; } - sal_uInt16 GetCols() const { return nCols; } + bool IsSymmetric() const { return m_bSym; } + sal_uInt16 GetRows() const { return m_nRows; } + sal_uInt16 GetCols() const { return m_nCols; } const FndBox_* GetBox(sal_uInt16 nCol, sal_uInt16 nRow) const; @@ -141,19 +141,19 @@ private: sal_uInt16 GetRowCount(const FndBox_& rBox); void FillFlat(const FndBox_&, bool bLastBox=false); - SwDoc* pDoc; - std::unique_ptr<FndBox_ const *[]> pArr; - std::vector<std::unique_ptr<SfxItemSet>> ppItemSets; + SwDoc* m_pDoc; + std::unique_ptr<FndBox_ const *[]> m_pArr; + std::vector<std::unique_ptr<SfxItemSet>> m_ppItemSets; - sal_uInt16 nRows; - sal_uInt16 nCols; - sal_uInt16 nRow; - sal_uInt16 nCol; + sal_uInt16 m_nRows; + sal_uInt16 m_nCols; + sal_uInt16 m_nRow; + sal_uInt16 m_nCol; - bool bSym; + bool m_bSym; }; -inline bool FlatFndBox::HasItemSets() const { return !ppItemSets.empty(); } +inline bool FlatFndBox::HasItemSets() const { return !m_ppItemSets.empty(); } #endif diff --git a/sw/source/core/inc/laycache.hxx b/sw/source/core/inc/laycache.hxx index 6f3a5a00d427..27f36a96faf7 100644 --- a/sw/source/core/inc/laycache.hxx +++ b/sw/source/core/inc/laycache.hxx @@ -40,8 +40,8 @@ class SvStream; */ class SwLayoutCache { - std::unique_ptr<SwLayCacheImpl> pImpl; - sal_uInt16 nLockCount; + std::unique_ptr<SwLayCacheImpl> m_pImpl; + sal_uInt16 m_nLockCount; public: SwLayoutCache(); @@ -51,14 +51,14 @@ public: static void Write( SvStream &rStream, const SwDoc& rDoc ); void ClearImpl(); - bool IsLocked() const { return nLockCount > 0; } - sal_uInt16& GetLockCount() { return nLockCount; } + bool IsLocked() const { return m_nLockCount > 0; } + sal_uInt16& GetLockCount() { return m_nLockCount; } SwLayCacheImpl *LockImpl() - { if( nLockCount & 0x8000 ) return nullptr; - if ( pImpl ) - ++nLockCount; - return pImpl.get(); } - void UnlockImpl() { --nLockCount; } + { if( m_nLockCount & 0x8000 ) return nullptr; + if ( m_pImpl ) + ++m_nLockCount; + return m_pImpl.get(); } + void UnlockImpl() { --m_nLockCount; } #ifdef DBG_UTIL bool CompareLayout( const SwDoc& rDoc ) const; diff --git a/sw/source/core/inc/node2lay.hxx b/sw/source/core/inc/node2lay.hxx index 9faadd574d4f..c61e2e9e80a7 100644 --- a/sw/source/core/inc/node2lay.hxx +++ b/sw/source/core/inc/node2lay.hxx @@ -53,7 +53,7 @@ class Point; class SwNode2Layout { - std::unique_ptr<SwNode2LayImpl> pImpl; + std::unique_ptr<SwNode2LayImpl> m_pImpl; public: /// Use this ctor for inserting before/after rNd /// @param nIdx is the index of the to-be-inserted Node diff --git a/sw/source/core/inc/visiturl.hxx b/sw/source/core/inc/visiturl.hxx index 54f051247a60..c16486d690f8 100644 --- a/sw/source/core/inc/visiturl.hxx +++ b/sw/source/core/inc/visiturl.hxx @@ -26,7 +26,7 @@ class SwDoc; class SwURLStateChanged : public SfxListener { - SwDoc* pDoc; + SwDoc* m_pDoc; public: SwURLStateChanged( SwDoc* pD ); virtual ~SwURLStateChanged() override; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index d7c9cc72fc69..f821a8d355d1 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star; -SwLayoutCache::SwLayoutCache() : nLockCount( 0 ) {} +SwLayoutCache::SwLayoutCache() : m_nLockCount( 0 ) {} /* * Reading and writing of the layout cache. @@ -68,12 +68,12 @@ SwLayoutCache::SwLayoutCache() : nLockCount( 0 ) {} void SwLayoutCache::Read( SvStream &rStream ) { - if( !pImpl ) + if( !m_pImpl ) { - pImpl.reset( new SwLayCacheImpl ); - if( !pImpl->Read( rStream ) ) + m_pImpl.reset( new SwLayCacheImpl ); + if( !m_pImpl->Read( rStream ) ) { - pImpl.reset(); + m_pImpl.reset(); } } } @@ -325,7 +325,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) #ifdef DBG_UTIL bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const { - if( !pImpl ) + if( !m_pImpl ) return true; const SwRootFrame *pRootFrame = rDoc.getIDocumentLayoutAccess().GetCurrentLayout(); if( pRootFrame ) @@ -338,7 +338,7 @@ bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const pPage = static_cast<const SwPageFrame*>(pPage->GetNext()); while( pPage ) { - if( nIndex >= pImpl->size() ) + if( nIndex >= m_pImpl->size() ) return false; const SwLayoutFrame* pLay = pPage->FindBodyCont(); @@ -357,12 +357,12 @@ bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const { bool bFollow = static_cast<const SwTextFrame*>(pTmp)->IsFollow(); nNdIdx -= nStartOfContent; - if( pImpl->GetBreakIndex( nIndex ) != nNdIdx || + if( m_pImpl->GetBreakIndex( nIndex ) != nNdIdx || SW_LAYCACHE_IO_REC_PARA != - pImpl->GetBreakType( nIndex ) || + m_pImpl->GetBreakType( nIndex ) || (bFollow ? sal_Int32(static_cast<const SwTextFrame*>(pTmp)->GetOffset()) - : COMPLETE_STRING) != pImpl->GetBreakOfst(nIndex)) + : COMPLETE_STRING) != m_pImpl->GetBreakOfst(nIndex)) { return false; } @@ -396,10 +396,10 @@ bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const if( nNdIdx > nStartOfContent ) { nNdIdx -= nStartOfContent; - if( pImpl->GetBreakIndex( nIndex ) != nNdIdx || + if( m_pImpl->GetBreakIndex( nIndex ) != nNdIdx || SW_LAYCACHE_IO_REC_TABLE != - pImpl->GetBreakType( nIndex ) || - nOfst != pImpl->GetBreakOfst( nIndex ) ) + m_pImpl->GetBreakType( nIndex ) || + nOfst != m_pImpl->GetBreakOfst( nIndex ) ) { return false; } @@ -442,13 +442,13 @@ void SwLayoutCache::ClearImpl() { if( !IsLocked() ) { - pImpl.reset(); + m_pImpl.reset(); } } SwLayoutCache::~SwLayoutCache() { - OSL_ENSURE( !nLockCount, "Deleting a locked SwLayoutCache!?" ); + OSL_ENSURE( !m_nLockCount, "Deleting a locked SwLayoutCache!?" ); } /// helper class to create not nested section frames for nested sections. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits