diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-08 09:07:27 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-08 09:58:00 +0100 |
commit | 5dd669ff658c37171dedd5cfb012065741b3f242 (patch) | |
tree | cfe095dc799e3f056fa21842371d28c766a64b94 /sw/source | |
parent | 6b00d0576a310796590631d14c54d7d5ea6814ac (diff) |
sw: prefix members of SwArrowPortion, SwTextLine, SwTextPainter and ...
... WidowsAndOrphans
See tdf#94879 for motivation.
Change-Id: I1999c83e5afe100b95481ac470f4d854b5f113f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110547
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/text/itrpaint.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/itrpaint.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/porrst.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/porrst.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/txtcache.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/txtcache.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/widorp.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/text/widorp.hxx | 8 |
8 files changed, 42 insertions, 42 deletions
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 61fd156e191c..75493bad82be 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -66,7 +66,7 @@ void SwTextPainter::CtorInitTextPainter( SwTextFrame *pNewFrame, SwTextPaintInfo m_pInf = pNewInf; SwFont *pMyFnt = GetFnt(); GetInfo().SetFont( pMyFnt ); - bPaintDrop = false; + m_bPaintDrop = false; } SwLinePortion *SwTextPainter::CalcPaintOfst( const SwRect &rPaint ) @@ -169,12 +169,12 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, // DropCaps! // 7538: of course for the printer, too - if( !bPaintDrop ) + if( !m_bPaintDrop ) { // 8084: Optimization, less painting // AMA: By 8084 7538 has been revived // bDrawInWindow removed, so that DropCaps also can be printed - bPaintDrop = pPor == m_pCurr->GetFirstPortion() + m_bPaintDrop = pPor == m_pCurr->GetFirstPortion() && GetDropLines() >= GetLineNr(); } diff --git a/sw/source/core/text/itrpaint.hxx b/sw/source/core/text/itrpaint.hxx index 155f67efef64..c016cff4e735 100644 --- a/sw/source/core/text/itrpaint.hxx +++ b/sw/source/core/text/itrpaint.hxx @@ -26,7 +26,7 @@ class SwMultiPortion; class SwTextPainter : public SwTextCursor { - bool bPaintDrop; + bool m_bPaintDrop; SwLinePortion *CalcPaintOfst( const SwRect &rPaint ); void CheckSpecialUnderline( const SwLinePortion* pPor, @@ -35,7 +35,7 @@ protected: void CtorInitTextPainter( SwTextFrame *pFrame, SwTextPaintInfo *pInf ); explicit SwTextPainter(SwTextNode const * pTextNode) : SwTextCursor(pTextNode) - , bPaintDrop(false) + , m_bPaintDrop(false) { } @@ -52,8 +52,8 @@ public: // surrounding SwBidiPortion void PaintMultiPortion( const SwRect &rPaint, SwMultiPortion& rMulti, const SwMultiPortion* pEnvPor = nullptr ); - void SetPaintDrop( const bool bNew ) { bPaintDrop = bNew; } - bool IsPaintDrop() const { return bPaintDrop; } + void SetPaintDrop( const bool bNew ) { m_bPaintDrop = bNew; } + bool IsPaintDrop() const { return m_bPaintDrop; } SwTextPaintInfo &GetInfo() { return static_cast<SwTextPaintInfo&>(SwTextIter::GetInfo()); } const SwTextPaintInfo &GetInfo() const diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index fe94c2e9aa0b..ed0779a26961 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -232,7 +232,7 @@ void SwKernPortion::FormatEOL( SwTextFormatInfo &rInf ) } SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) : - bLeft( true ) + m_bLeft( true ) { Height( rPortion.Height() ); SetAscent( rPortion.GetAscent() ); @@ -241,19 +241,19 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) : } SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf ) - : bLeft( false ) + : m_bLeft( false ) { Height( static_cast<sal_uInt16>(rInf.GetTextFrame()->getFramePrintArea().Height()) ); - aPos.setX( rInf.GetTextFrame()->getFrameArea().Left() + + m_aPos.setX( rInf.GetTextFrame()->getFrameArea().Left() + rInf.GetTextFrame()->getFramePrintArea().Right() ); - aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() + + m_aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() + rInf.GetTextFrame()->getFramePrintArea().Bottom() ); SetWhichPor( PortionType::Arrow ); } void SwArrowPortion::Paint( const SwTextPaintInfo &rInf ) const { - const_cast<SwArrowPortion*>(this)->aPos = rInf.GetPos(); + const_cast<SwArrowPortion*>(this)->m_aPos = rInf.GetPos(); } SwLinePortion *SwArrowPortion::Compress() { return this; } diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx index af678bb54fc2..5a6ee8484968 100644 --- a/sw/source/core/text/porrst.hxx +++ b/sw/source/core/text/porrst.hxx @@ -100,15 +100,15 @@ public: class SwArrowPortion : public SwLinePortion { - Point aPos; - bool bLeft; + Point m_aPos; + bool m_bLeft; public: explicit SwArrowPortion( const SwLinePortion &rPortion ); explicit SwArrowPortion( const SwTextPaintInfo &rInf ); virtual void Paint( const SwTextPaintInfo &rInf ) const override; virtual SwLinePortion *Compress() override; - bool IsLeft() const { return bLeft; } - const Point& GetPos() const { return aPos; } + bool IsLeft() const { return m_bLeft; } + const Point& GetPos() const { return m_aPos; } }; // The characters which are forbidden at the start of a line like the dot and diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx index 2c8866c7f09a..dbc22914cacd 100644 --- a/sw/source/core/text/txtcache.cxx +++ b/sw/source/core/text/txtcache.cxx @@ -26,7 +26,7 @@ SwTextLine::SwTextLine( SwTextFrame const *pFrame, std::unique_ptr<SwParaPortion> pNew ) : SwCacheObj( static_cast<void const *>(pFrame) ), - pLine( std::move(pNew) ) + m_pLine( std::move(pNew) ) { } diff --git a/sw/source/core/text/txtcache.hxx b/sw/source/core/text/txtcache.hxx index 158f997ff10c..e71be076fabb 100644 --- a/sw/source/core/text/txtcache.hxx +++ b/sw/source/core/text/txtcache.hxx @@ -27,7 +27,7 @@ class SwTextFrame; class SwTextLine : public SwCacheObj { - std::unique_ptr<SwParaPortion> pLine; + std::unique_ptr<SwParaPortion> m_pLine; virtual void UpdateCachePos() override; @@ -35,14 +35,14 @@ public: SwTextLine(SwTextFrame const* pFrame, std::unique_ptr<SwParaPortion> pNew = nullptr); virtual ~SwTextLine() override; - SwParaPortion* GetPara() { return pLine.get(); } - const SwParaPortion* GetPara() const { return pLine.get(); } + SwParaPortion* GetPara() { return m_pLine.get(); } + const SwParaPortion* GetPara() const { return m_pLine.get(); } void SetPara(SwParaPortion* pNew, bool bDelete) { if (!bDelete) - (void)pLine.release(); - pLine.reset(pNew); + (void)m_pLine.release(); + m_pLine.reset(pNew); } }; diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index cdbbc2cc4e81..141fd9437a84 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -231,7 +231,7 @@ void SwTextFrameBreak::SetRstHeight( const SwTextMargin &rLine ) WidowsAndOrphans::WidowsAndOrphans( SwTextFrame *pNewFrame, const SwTwips nRst, bool bChkKeep ) - : SwTextFrameBreak( pNewFrame, nRst ), nWidLines( 0 ), nOrphLines( 0 ) + : SwTextFrameBreak( pNewFrame, nRst ), m_nWidLines( 0 ), m_nOrphLines( 0 ) { SwSwapIfSwapped swap(m_pFrame); @@ -249,20 +249,20 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrame *pNewFrame, const SwTwips nRst, // nevertheless the paragraph can request lines from the Master // because of the Orphan rule. if( m_pFrame->IsFollow() ) - nWidLines = m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetWidows().GetValue(); + m_nWidLines = m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetWidows().GetValue(); } else { const SwAttrSet& rSet = m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet(); const SvxOrphansItem &rOrph = rSet.GetOrphans(); if ( rOrph.GetValue() > 1 ) - nOrphLines = rOrph.GetValue(); + m_nOrphLines = rOrph.GetValue(); if ( m_pFrame->IsFollow() ) - nWidLines = rSet.GetWidows().GetValue(); + m_nWidLines = rSet.GetWidows().GetValue(); } - if ( !(m_bKeep || nWidLines || nOrphLines) ) + if ( !(m_bKeep || m_nWidLines || m_nOrphLines) ) return; bool bResetFlags = false; @@ -298,8 +298,8 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrame *pNewFrame, const SwTwips nRst, if ( bResetFlags ) { m_bKeep = false; - nOrphLines = 0; - nWidLines = 0; + m_nOrphLines = 0; + m_nWidLines = 0; } } @@ -318,9 +318,9 @@ bool WidowsAndOrphans::FindBreak( SwTextFrame *pFrame, SwTextMargin &rLine, SwSwapIfSwapped swap(m_pFrame); bool bRet = true; - sal_uInt16 nOldOrphans = nOrphLines; + sal_uInt16 nOldOrphans = m_nOrphLines; if( bHasToFit ) - nOrphLines = 0; + m_nOrphLines = 0; rLine.Bottom(); if( !IsBreakNowWidAndOrp( rLine ) ) @@ -348,7 +348,7 @@ bool WidowsAndOrphans::FindBreak( SwTextFrame *pFrame, SwTextMargin &rLine, rLine.TruncLines( true ); bRet = bBack; } - nOrphLines = nOldOrphans; + m_nOrphLines = nOldOrphans; return bRet; } @@ -364,7 +364,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) OSL_ENSURE( ! pFrame->IsVertical() || ! pFrame->IsSwapped(), "WidowsAndOrphans::FindWidows with swapped frame" ); - if( !nWidLines || !pFrame->IsFollow() ) + if( !m_nWidLines || !pFrame->IsFollow() ) return false; rLine.Bottom(); @@ -398,14 +398,14 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) const SwTwips nChg = aRectFnSet.YDiff( nTmpY, nDocPrtTop + nOldHeight ); // below the Widows-threshold... - if( rLine.GetLineNr() >= nWidLines ) + if( rLine.GetLineNr() >= m_nWidLines ) { // Follow to Master I // If the Follow *grows*, there is the chance for the Master to // receive lines, that it was forced to hand over to the Follow lately: // Prepare(Need); check that below nChg! // (0W, 2O, 2M, 2F) + 1F = 3M, 2F - if( rLine.GetLineNr() > nWidLines && pFrame->IsJustWidow() ) + if( rLine.GetLineNr() > m_nWidLines && pFrame->IsJustWidow() ) { // If the Master is locked, it has probably just donated a line // to us, we don't return that just because we turned it into @@ -512,7 +512,7 @@ bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool return false; // Check the Widows-rule - if( !nWidLines && !m_pFrame->IsFollow() ) + if( !m_nWidLines && !m_pFrame->IsFollow() ) { // Usually we only have to check for Widows if we are a Follow. // On WouldFit the rule has to be checked for the Master too, @@ -520,7 +520,7 @@ bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool // In Ctor of WidowsAndOrphans the nWidLines are only calced for // Follows from the AttrSet - so we catch up now: const SwAttrSet& rSet = m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet(); - nWidLines = rSet.GetWidows().GetValue(); + m_nWidLines = rSet.GetWidows().GetValue(); } // After Orphans/Initials, do enough lines remain for Widows? @@ -530,7 +530,7 @@ bool WidowsAndOrphans::WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool // Widow lines would have wrong width. // 2. Test formatting is only done up to the given space. // we do not have any lines for widows at all. - if( bTst || nLineCnt - nMinLines >= nWidLines ) + if( bTst || nLineCnt - nMinLines >= m_nWidLines ) { if( rMaxHeight >= nLineSum ) { diff --git a/sw/source/core/text/widorp.hxx b/sw/source/core/text/widorp.hxx index 9c0e37fc2720..dd55dba216bb 100644 --- a/sw/source/core/text/widorp.hxx +++ b/sw/source/core/text/widorp.hxx @@ -52,15 +52,15 @@ public: class WidowsAndOrphans : public SwTextFrameBreak { private: - sal_uInt16 nWidLines, nOrphLines; + sal_uInt16 m_nWidLines, m_nOrphLines; public: WidowsAndOrphans( SwTextFrame *pFrame, const SwTwips nRst = 0, bool bCheckKeep = true ); bool FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ); sal_uInt16 GetOrphansLines() const - { return nOrphLines; } - void ClrOrphLines(){ nOrphLines = 0; } + { return m_nOrphLines; } + void ClrOrphLines(){ m_nOrphLines = 0; } bool FindBreak( SwTextFrame *pFrame, SwTextMargin &rLine, bool bHasToFit ); bool WouldFit( SwTextMargin &rLine, SwTwips &rMaxHeight, bool bTest ); @@ -72,7 +72,7 @@ public: if ( isOnFirstLine && rLine.GetCurr()->IsDummy()) { return IsBreakNow( rLine ); } - if ( rLine.GetLineNr() > nOrphLines ) { + if ( rLine.GetLineNr() > m_nOrphLines ) { return IsBreakNow( rLine ); } return false; |