[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 27 08:19:36 UTC 2020
sw/inc/htmltbl.hxx | 34 +++++++++++------------
sw/source/core/doc/htmltbl.cxx | 49 ++++++++++++++++++----------------
sw/source/core/doc/swstylemanager.cxx | 22 +++++++++------
sw/source/core/inc/txtfly.hxx | 2 -
sw/source/core/text/txtfly.cxx | 14 ++++-----
5 files changed, 64 insertions(+), 57 deletions(-)
New commits:
commit 66c8463e69bffc0460d778e2686f78a17575d663
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Jul 27 08:54:03 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Jul 27 10:18:52 2020 +0200
sw: prefix members of SwContourCache, SwHTMLTableLayoutCell, ...
... SwHTMLTableLayoutConstraints and SwStyleManager
See tdf#94879 for motivation.
Change-Id: I950012885edd77a0aa44a5aee1ef1ceb358bdf03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99466
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index 8ed20b83fb36..ffff0af7112c 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -82,14 +82,14 @@ public:
class SwHTMLTableLayoutCell
{
- std::shared_ptr<SwHTMLTableLayoutCnts> xContents; ///< Content of cell.
+ std::shared_ptr<SwHTMLTableLayoutCnts> m_xContents; ///< Content of cell.
- sal_uInt16 nRowSpan; ///< ROWSPAN of cell.
- sal_uInt16 nColSpan; ///< COLSPAN of cell.
- sal_uInt16 nWidthOption; ///< Given width of cell in Twip or %.
+ sal_uInt16 m_nRowSpan; ///< ROWSPAN of cell.
+ sal_uInt16 m_nColSpan; ///< COLSPAN of cell.
+ sal_uInt16 m_nWidthOption; ///< Given width of cell in Twip or %.
- bool bPercentWidthOption : 1; ///< nWidth is %-value.
- bool bNoWrapOption : 1; ///< NOWRAP-option.
+ bool m_bPercentWidthOption : 1; ///< nWidth is %-value.
+ bool m_bNoWrapOption : 1; ///< NOWRAP-option.
public:
@@ -99,20 +99,20 @@ public:
bool bNWrapOpt );
/// Set or get content of a cell.
- void SetContents(std::shared_ptr<SwHTMLTableLayoutCnts> const& rCnts) { xContents = rCnts; }
- const std::shared_ptr<SwHTMLTableLayoutCnts>& GetContents() const { return xContents; }
+ void SetContents(std::shared_ptr<SwHTMLTableLayoutCnts> const& rCnts) { m_xContents = rCnts; }
+ const std::shared_ptr<SwHTMLTableLayoutCnts>& GetContents() const { return m_xContents; }
inline void SetProtected();
/// Set or get ROWSPAN/COLSPAN of cell.
- void SetRowSpan( sal_uInt16 nRSpan ) { nRowSpan = nRSpan; }
- sal_uInt16 GetRowSpan() const { return nRowSpan; }
- sal_uInt16 GetColSpan() const { return nColSpan; }
+ void SetRowSpan( sal_uInt16 nRSpan ) { m_nRowSpan = nRSpan; }
+ sal_uInt16 GetRowSpan() const { return m_nRowSpan; }
+ sal_uInt16 GetColSpan() const { return m_nColSpan; }
- sal_uInt16 GetWidthOption() const { return nWidthOption; }
- bool IsPercentWidthOption() const { return bPercentWidthOption; }
+ sal_uInt16 GetWidthOption() const { return m_nWidthOption; }
+ bool IsPercentWidthOption() const { return m_bPercentWidthOption; }
- bool HasNoWrapOption() const { return bNoWrapOption; }
+ bool HasNoWrapOption() const { return m_bNoWrapOption; }
};
class SwHTMLTableLayoutColumn
@@ -340,9 +340,9 @@ public:
inline void SwHTMLTableLayoutCell::SetProtected()
{
- nRowSpan = 1;
- nColSpan = 1;
- xContents.reset();
+ m_nRowSpan = 1;
+ m_nColSpan = 1;
+ m_xContents.reset();
}
inline void SwHTMLTableLayoutColumn::MergeMinMaxNoAlign( sal_uLong nCMin,
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index f791e7d3435a..e3e642f667ea 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -52,26 +52,26 @@ namespace {
class SwHTMLTableLayoutConstraints
{
- sal_uInt16 nRow; // start row
- sal_uInt16 nCol; // start column
- sal_uInt16 nColSpan; // the column's COLSPAN
+ sal_uInt16 m_nRow; // start row
+ sal_uInt16 m_nCol; // start column
+ sal_uInt16 m_nColSpan; // the column's COLSPAN
- std::unique_ptr<SwHTMLTableLayoutConstraints> pNext; // the next constraint
+ std::unique_ptr<SwHTMLTableLayoutConstraints> m_pNext; // the next constraint
- sal_uLong nMinNoAlign, nMaxNoAlign; // provisional result of AL-Pass 1
+ sal_uLong m_nMinNoAlign, m_nMaxNoAlign; // provisional result of AL-Pass 1
public:
SwHTMLTableLayoutConstraints( sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRow,
sal_uInt16 nCol, sal_uInt16 nColSp );
- sal_uLong GetMinNoAlign() const { return nMinNoAlign; }
- sal_uLong GetMaxNoAlign() const { return nMaxNoAlign; }
+ sal_uLong GetMinNoAlign() const { return m_nMinNoAlign; }
+ sal_uLong GetMaxNoAlign() const { return m_nMaxNoAlign; }
SwHTMLTableLayoutConstraints *InsertNext( SwHTMLTableLayoutConstraints *pNxt );
- SwHTMLTableLayoutConstraints* GetNext() const { return pNext.get(); }
+ SwHTMLTableLayoutConstraints* GetNext() const { return m_pNext.get(); }
- sal_uInt16 GetColSpan() const { return nColSpan; }
- sal_uInt16 GetColumn() const { return nCol; }
+ sal_uInt16 GetColSpan() const { return m_nColSpan; }
+ sal_uInt16 GetColumn() const { return m_nCol; }
};
}
@@ -93,10 +93,10 @@ SwHTMLTableLayoutCell::SwHTMLTableLayoutCell(std::shared_ptr<SwHTMLTableLayoutCn
sal_uInt16 nRSpan, sal_uInt16 nCSpan,
sal_uInt16 nWidth, bool bPercentWidth,
bool bNWrapOpt ) :
- xContents(rCnts),
- nRowSpan( nRSpan ), nColSpan( nCSpan ),
- nWidthOption( nWidth ), bPercentWidthOption( bPercentWidth ),
- bNoWrapOption( bNWrapOpt )
+ m_xContents(rCnts),
+ m_nRowSpan( nRSpan ), m_nColSpan( nCSpan ),
+ m_nWidthOption( nWidth ), m_bPercentWidthOption( bPercentWidth ),
+ m_bNoWrapOption( bNWrapOpt )
{}
SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
@@ -109,10 +109,14 @@ SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
bLeftBorder( bLBorder )
{}
-SwHTMLTableLayoutConstraints::SwHTMLTableLayoutConstraints(
- sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRw, sal_uInt16 nColumn, sal_uInt16 nColSp ):
- nRow( nRw ), nCol( nColumn ), nColSpan( nColSp ),
- nMinNoAlign( nMin ), nMaxNoAlign( nMax )
+SwHTMLTableLayoutConstraints::SwHTMLTableLayoutConstraints(sal_uLong nMin, sal_uLong nMax,
+ sal_uInt16 nRw, sal_uInt16 nColumn,
+ sal_uInt16 nColSp)
+ : m_nRow(nRw)
+ , m_nCol(nColumn)
+ , m_nColSpan(nColSp)
+ , m_nMinNoAlign(nMin)
+ , m_nMaxNoAlign(nMax)
{}
SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
@@ -122,8 +126,7 @@ SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
SwHTMLTableLayoutConstraints *pConstr = this;
while( pConstr )
{
- if( pConstr->nRow > pNxt->nRow ||
- pConstr->GetColumn() > pNxt->GetColumn() )
+ if (pConstr->m_nRow > pNxt->m_nRow || pConstr->GetColumn() > pNxt->GetColumn())
break;
pPrev = pConstr;
pConstr = pConstr->GetNext();
@@ -131,13 +134,13 @@ SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
if( pPrev )
{
- pNxt->pNext = std::move(pPrev->pNext);
- pPrev->pNext.reset( pNxt );
+ pNxt->m_pNext = std::move(pPrev->m_pNext);
+ pPrev->m_pNext.reset(pNxt);
pConstr = this;
}
else
{
- pNxt->pNext.reset( this );
+ pNxt->m_pNext.reset(this);
pConstr = pNxt;
}
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index cfca5ee5b27a..92297f35c2c7 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -57,16 +57,16 @@ namespace {
class SwStyleManager : public IStyleAccess
{
- StylePool aAutoCharPool;
- StylePool aAutoParaPool;
+ StylePool m_aAutoCharPool;
+ StylePool m_aAutoParaPool;
std::unique_ptr<SwStyleCache> mpCharCache;
std::unique_ptr<SwStyleCache> mpParaCache;
public:
// accept empty item set for ignorable paragraph items.
- explicit SwStyleManager( SfxItemSet const * pIgnorableParagraphItems )
- : aAutoCharPool(),
- aAutoParaPool( pIgnorableParagraphItems )
+ explicit SwStyleManager(SfxItemSet const* pIgnorableParagraphItems)
+ : m_aAutoCharPool()
+ , m_aAutoParaPool(pIgnorableParagraphItems)
{}
virtual std::shared_ptr<SfxItemSet> getAutomaticStyle( const SfxItemSet& rSet,
IStyleAccess::SwAutoStyleFamily eFamily,
@@ -97,14 +97,16 @@ std::shared_ptr<SfxItemSet> SwStyleManager::getAutomaticStyle( const SfxItemSet&
IStyleAccess::SwAutoStyleFamily eFamily,
const OUString* pParentName )
{
- StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
+ StylePool& rAutoPool
+ = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? m_aAutoCharPool : m_aAutoParaPool;
return rAutoPool.insertItemSet( rSet, pParentName );
}
std::shared_ptr<SfxItemSet> SwStyleManager::cacheAutomaticStyle( const SfxItemSet& rSet,
IStyleAccess::SwAutoStyleFamily eFamily )
{
- StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
+ StylePool& rAutoPool
+ = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? m_aAutoCharPool : m_aAutoParaPool;
std::shared_ptr<SfxItemSet> pStyle = rAutoPool.insertItemSet( rSet );
if (eFamily == IStyleAccess::AUTO_STYLE_CHAR)
{
@@ -124,7 +126,8 @@ std::shared_ptr<SfxItemSet> SwStyleManager::cacheAutomaticStyle( const SfxItemSe
std::shared_ptr<SfxItemSet> SwStyleManager::getByName( const OUString& rName,
IStyleAccess::SwAutoStyleFamily eFamily )
{
- StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
+ StylePool& rAutoPool
+ = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? m_aAutoCharPool : m_aAutoParaPool;
std::unique_ptr<SwStyleCache> &rpCache = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? mpCharCache : mpParaCache;
if( !rpCache )
rpCache.reset(new SwStyleCache());
@@ -143,7 +146,8 @@ std::shared_ptr<SfxItemSet> SwStyleManager::getByName( const OUString& rName,
void SwStyleManager::getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rStyles,
IStyleAccess::SwAutoStyleFamily eFamily )
{
- StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
+ StylePool& rAutoPool
+ = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? m_aAutoCharPool : m_aAutoParaPool;
// setup <StylePool> iterator, which skips unused styles and ignorable items
std::unique_ptr<IStylePoolIteratorAccess> pIter = rAutoPool.createIterator( true, true );
std::shared_ptr<SfxItemSet> pStyle = pIter->getNext();
diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx
index 0f3c9e8c7bb0..611e64e7c573 100644
--- a/sw/source/core/inc/txtfly.hxx
+++ b/sw/source/core/inc/txtfly.hxx
@@ -58,7 +58,7 @@ class SwContourCache
std::unique_ptr<TextRanger> mxTextRanger;
};
std::vector<CacheItem> mvItems;
- long nPntCnt;
+ long mnPointCount;
SwRect ContourRect( const SwFormat* pFormat, const SdrObject* pObj,
const SwTextFrame* pFrame, const SwRect &rLine, const long nXPos,
const bool bRight );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index cbaee31900ad..a020d2435705 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -116,7 +116,7 @@ namespace
}
SwContourCache::SwContourCache() :
- nPntCnt( 0 )
+ mnPointCount( 0 )
{
}
@@ -126,7 +126,7 @@ SwContourCache::~SwContourCache()
void SwContourCache::ClrObject( sal_uInt16 nPos )
{
- nPntCnt -= mvItems[ nPos ].mxTextRanger->GetPointCount();
+ mnPointCount -= mvItems[ nPos ].mxTextRanger->GetPointCount();
mvItems.erase(mvItems.begin() + nPos);
}
@@ -146,7 +146,7 @@ void ClrContourCache()
if( pContourCache )
{
pContourCache->mvItems.clear();
- pContourCache->nPntCnt = 0;
+ pContourCache->mnPointCount = 0;
}
}
@@ -211,7 +211,7 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
{
if( GetCount() == POLY_CNT )
{
- nPntCnt -= mvItems.back().mxTextRanger->GetPointCount();
+ mnPointCount -= mvItems.back().mxTextRanger->GetPointCount();
mvItems.pop_back();
}
::basegfx::B2DPolyPolygon aPolyPolygon;
@@ -252,10 +252,10 @@ SwRect SwContourCache::ContourRect( const SwFormat* pFormat,
pPolyPolygon.reset();
- nPntCnt += mvItems[0].mxTextRanger->GetPointCount();
- while( nPntCnt > POLY_MAX && mvItems.size() > POLY_MIN )
+ mnPointCount += mvItems[0].mxTextRanger->GetPointCount();
+ while( mnPointCount > POLY_MAX && mvItems.size() > POLY_MIN )
{
- nPntCnt -= mvItems.back().mxTextRanger->GetPointCount();
+ mnPointCount -= mvItems.back().mxTextRanger->GetPointCount();
mvItems.pop_back();
}
}
More information about the Libreoffice-commits
mailing list