[Libreoffice-commits] core.git: sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 1 08:38:51 UTC 2021
sw/source/core/text/frmform.cxx | 12 ++++-----
sw/source/core/text/porexp.cxx | 2 -
sw/source/core/text/porexp.hxx | 4 +--
sw/source/core/text/porfld.cxx | 52 +++++++++++++++++++--------------------
sw/source/core/text/porfld.hxx | 4 +--
sw/source/core/text/pormulti.cxx | 22 ++++++++--------
sw/source/core/text/pormulti.hxx | 10 +++----
7 files changed, 53 insertions(+), 53 deletions(-)
New commits:
commit f4df151d0133aa5897ecedc50083a9103d566191
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 1 09:02:56 2021 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Feb 1 09:38:10 2021 +0100
sw: prefix members of FormatLevel, SwNumberPortion, SwPostItsPortion and ...
... SwRubyPortion
See tdf#94879 for motivation.
Change-Id: I24bb59ea921cdea2888d5a1009db5030e4ee897a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110239
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index aee8bcae2985..0304661e8438 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -55,17 +55,17 @@ namespace {
class FormatLevel
{
- static sal_uInt16 nLevel;
+ static sal_uInt16 s_nLevel;
public:
- FormatLevel() { ++nLevel; }
- ~FormatLevel() { --nLevel; }
- static sal_uInt16 GetLevel() { return nLevel; }
- static bool LastLevel() { return 10 < nLevel; }
+ FormatLevel() { ++s_nLevel; }
+ ~FormatLevel() { --s_nLevel; }
+ static sal_uInt16 GetLevel() { return s_nLevel; }
+ static bool LastLevel() { return 10 < s_nLevel; }
};
}
-sal_uInt16 FormatLevel::nLevel = 0;
+sal_uInt16 FormatLevel::s_nLevel = 0;
void ValidateText( SwFrame *pFrame ) // Friend of frame
{
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 7a72b94e669d..29f470c1490c 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -211,7 +211,7 @@ void SwBlankPortion::HandlePortion( SwPortionHandler& rPH ) const
}
SwPostItsPortion::SwPostItsPortion( bool bScrpt )
- : bScript( bScrpt )
+ : m_bScript( bScrpt )
{
mnLineLength = TextFrameIndex(1);
SetWhichPor( PortionType::PostIts );
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index c3cebe233715..9c7be5be5aaf 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -58,14 +58,14 @@ public:
class SwPostItsPortion : public SwExpandPortion
{
- bool bScript;
+ bool m_bScript;
public:
explicit SwPostItsPortion( bool bScrpt );
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
virtual bool Format( SwTextFormatInfo &rInf ) override;
virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
- bool IsScript() const { return bScript; }
+ bool IsScript() const { return m_bScript; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 0f3c31141342..6348ea44fbf9 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -502,8 +502,8 @@ SwNumberPortion::SwNumberPortion( const OUString &rExpand,
const sal_uInt16 nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive )
: SwFieldPortion( rExpand, std::move(pFont) ),
- nFixWidth(0),
- nMinDist( nMinDst ),
+ m_nFixWidth(0),
+ m_nMinDist( nMinDst ),
mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive )
{
SetWhichPor( PortionType::Number );
@@ -524,7 +524,7 @@ SwFieldPortion *SwNumberPortion::Clone( const OUString &rExpand ) const
pNewFnt.reset(new SwFont( *m_pFont ));
return new SwNumberPortion( rExpand, std::move(pNewFnt), IsLeft(), IsCenter(),
- nMinDist, mbLabelAlignmentPosAndSpaceModeActive );
+ m_nMinDist, mbLabelAlignmentPosAndSpaceModeActive );
}
/**
@@ -539,7 +539,7 @@ bool SwNumberPortion::Format( SwTextFormatInfo &rInf )
const bool bFull = SwFieldPortion::Format( rInf );
SetLen(TextFrameIndex(0));
// a numbering portion can be contained in a rotated portion!!!
- nFixWidth = rInf.IsMulti() ? Height() : Width();
+ m_nFixWidth = rInf.IsMulti() ? Height() : Width();
rInf.SetNumDone( !rInf.GetRest() );
if( rInf.IsNumDone() )
{
@@ -574,8 +574,8 @@ bool SwNumberPortion::Format( SwTextFormatInfo &rInf )
else
nDiff = 0;
- if( nDiff < nFixWidth + nMinDist )
- nDiff = nFixWidth + nMinDist;
+ if( nDiff < m_nFixWidth + m_nMinDist )
+ nDiff = m_nFixWidth + m_nMinDist;
// Numbering evades the Fly, no nDiff in the second round
// Tricky special case: FlyFrame is in an Area we're just about to
@@ -648,7 +648,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
pTmp = pTmp->GetNextPortion();
else
{
- nOffset = pTmp->Width() - static_cast<const SwNumberPortion*>(pTmp)->nFixWidth;
+ nOffset = pTmp->Width() - static_cast<const SwNumberPortion*>(pTmp)->m_nFixWidth;
break;
}
}
@@ -679,15 +679,15 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
SwFontSave aSave( rInf, m_pFont.get() );
- if( nFixWidth == Width() && ! HasFollow() )
+ if( m_nFixWidth == Width() && ! HasFollow() )
SwExpandPortion::Paint( rInf );
else
{
// logical const: reset width
SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
- bPaintSpace = bPaintSpace && nFixWidth < nOldWidth;
- sal_uInt16 nSpaceOffs = nFixWidth;
- pThis->Width( nFixWidth );
+ bPaintSpace = bPaintSpace && m_nFixWidth < nOldWidth;
+ sal_uInt16 nSpaceOffs = m_nFixWidth;
+ pThis->Width( m_nFixWidth );
if( ( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() ) )
@@ -695,7 +695,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
else
{
SwTextPaintInfo aInf( rInf );
- if( nOffset < nMinDist )
+ if( nOffset < m_nMinDist )
nOffset = 0;
else
{
@@ -704,11 +704,11 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
/* #110778# a / 2 * 2 == a is not a tautology */
sal_uInt16 nTmpOffset = nOffset;
nOffset /= 2;
- if( nOffset < nMinDist )
- nOffset = nTmpOffset - nMinDist;
+ if( nOffset < m_nMinDist )
+ nOffset = nTmpOffset - m_nMinDist;
}
else
- nOffset = nOffset - nMinDist;
+ nOffset = nOffset - m_nMinDist;
}
aInf.X( aInf.X() + nOffset );
SwExpandPortion::Paint( aInf );
@@ -786,7 +786,7 @@ SwGrfNumPortion::SwGrfNumPortion(
m_eOrient = text::VertOrientation::TOP;
}
Width( static_cast<sal_uInt16>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
- nFixWidth = Width();
+ m_nFixWidth = Width();
m_nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
Height( sal_uInt16(m_nGrfHeight) );
m_bNoPaint = false;
@@ -824,7 +824,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
nFollowedByWidth = Width();
SetLen(TextFrameIndex(0));
}
- Width( nFixWidth + nFollowedByWidth );
+ Width( m_nFixWidth + nFollowedByWidth );
const bool bFull = rInf.Width() < rInf.X() + Width();
const bool bFly = rInf.GetFly() ||
( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
@@ -854,8 +854,8 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
nDiff = 0;
else if ( nDiff > rInf.X() )
nDiff -= rInf.X();
- if( nDiff < nFixWidth + nMinDist )
- nDiff = nFixWidth + nMinDist;
+ if( nDiff < m_nFixWidth + m_nMinDist )
+ nDiff = m_nFixWidth + m_nMinDist;
// Numbering evades Fly, no nDiff in the second round
// Tricky special case: FlyFrame is in the Area we were just
@@ -891,28 +891,28 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
return;
}
Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE );
- tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(nFixWidth - 2 * GRFNUM_SECURE) );
+ tools::Long nTmpWidth = std::max( tools::Long(0), static_cast<tools::Long>(m_nFixWidth - 2 * GRFNUM_SECURE) );
Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
( IsLeft() && ! rInf.GetTextFrame()->IsRightToLeft() ) ||
( ! IsLeft() && ! IsCenter() && rInf.GetTextFrame()->IsRightToLeft() );
- if( nFixWidth < Width() && !bTmpLeft )
+ if( m_nFixWidth < Width() && !bTmpLeft )
{
- sal_uInt16 nOffset = Width() - nFixWidth;
- if( nOffset < nMinDist )
+ sal_uInt16 nOffset = Width() - m_nFixWidth;
+ if( nOffset < m_nMinDist )
nOffset = 0;
else
{
if( IsCenter() )
{
nOffset /= 2;
- if( nOffset < nMinDist )
- nOffset = Width() - nFixWidth - nMinDist;
+ if( nOffset < m_nMinDist )
+ nOffset = Width() - m_nFixWidth - m_nMinDist;
}
else
- nOffset = nOffset - nMinDist;
+ nOffset = nOffset - m_nMinDist;
}
aPos.AdjustX(nOffset );
}
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 42575a09e7b3..519e56f8f58c 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -128,8 +128,8 @@ public:
class SwNumberPortion : public SwFieldPortion
{
protected:
- sal_uInt16 nFixWidth; // See Glues
- sal_uInt16 nMinDist; // Minimal distance to the text
+ sal_uInt16 m_nFixWidth; // See Glues
+ sal_uInt16 m_nMinDist; // Minimal distance to the text
bool mbLabelAlignmentPosAndSpaceModeActive;
public:
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 410707d8d4bf..4f75a5765356 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -538,8 +538,8 @@ SwDoubleLinePortion::~SwDoubleLinePortion()
// beside the main text, e.g. phonetic characters.
SwRubyPortion::SwRubyPortion(const SwRubyPortion& rRuby, TextFrameIndex const nEnd)
: SwMultiPortion( nEnd )
- , nRubyOffset( rRuby.GetRubyOffset() )
- , nAdjustment( rRuby.GetAdjustment() )
+ , m_nRubyOffset( rRuby.GetRubyOffset() )
+ , m_nAdjustment( rRuby.GetAdjustment() )
{
SetDirection( rRuby.GetDirection() );
SetRubyPosition( rRuby.GetRubyPosition() );
@@ -558,8 +558,8 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
OSL_ENSURE( SwMultiCreatorId::Ruby == rCreate.nId, "Ruby expected" );
OSL_ENSURE( RES_TXTATR_CJK_RUBY == rCreate.pAttr->Which(), "Wrong attribute" );
const SwFormatRuby& rRuby = rCreate.pAttr->GetRuby();
- nAdjustment = rRuby.GetAdjustment();
- nRubyOffset = nOffs;
+ m_nAdjustment = rRuby.GetAdjustment();
+ m_nRubyOffset = nOffs;
const SwTextFrame *pFrame = rInf.GetTextFrame();
RubyPosition ePos = static_cast<RubyPosition>( rRuby.GetPosition() );
@@ -608,10 +608,10 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
if ( rCreate.nLevel % 2 )
{
// switch right and left ruby adjustment in rtl environment
- if ( css::text::RubyAdjust_LEFT == nAdjustment )
- nAdjustment = css::text::RubyAdjust_RIGHT;
- else if ( css::text::RubyAdjust_RIGHT == nAdjustment )
- nAdjustment = css::text::RubyAdjust_LEFT;
+ if ( css::text::RubyAdjust_LEFT == m_nAdjustment )
+ m_nAdjustment = css::text::RubyAdjust_RIGHT;
+ else if ( css::text::RubyAdjust_RIGHT == m_nAdjustment )
+ m_nAdjustment = css::text::RubyAdjust_LEFT;
SetDirection( DIR_RIGHT2LEFT );
}
@@ -652,7 +652,7 @@ void SwRubyPortion::Adjust_( SwTextFormatInfo &rInf )
sal_uInt16 nLeft = 0; // the space in front of the first letter
sal_uInt16 nRight = 0; // the space at the end of the last letter
TextFrameIndex nSub(0);
- switch ( nAdjustment )
+ switch ( m_nAdjustment )
{
case css::text::RubyAdjust_CENTER: nRight = static_cast<sal_uInt16>(nLineDiff / 2);
[[fallthrough]];
@@ -737,9 +737,9 @@ void SwRubyPortion::CalcRubyOffset()
if( pField )
{
if( pField->HasFollow() )
- nRubyOffset = pField->GetNextOffset();
+ m_nRubyOffset = pField->GetNextOffset();
else
- nRubyOffset = TextFrameIndex(COMPLETE_STRING);
+ m_nRubyOffset = TextFrameIndex(COMPLETE_STRING);
}
}
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index d714df2a7657..2731b1a29576 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -187,8 +187,8 @@ public:
class SwRubyPortion : public SwMultiPortion
{
- TextFrameIndex nRubyOffset;
- css::text::RubyAdjust nAdjustment;
+ TextFrameIndex m_nRubyOffset;
+ css::text::RubyAdjust m_nAdjustment;
void Adjust_( SwTextFormatInfo &rInf);
public:
SwRubyPortion(const SwRubyPortion& rRuby, TextFrameIndex nEnd);
@@ -200,9 +200,9 @@ public:
void CalcRubyOffset();
void Adjust( SwTextFormatInfo &rInf )
- { if(nAdjustment != css::text::RubyAdjust_LEFT && GetRoot().GetNext()) Adjust_(rInf); }
- css::text::RubyAdjust GetAdjustment() const { return nAdjustment; }
- TextFrameIndex GetRubyOffset() const { return nRubyOffset; }
+ { if(m_nAdjustment != css::text::RubyAdjust_LEFT && GetRoot().GetNext()) Adjust_(rInf); }
+ css::text::RubyAdjust GetAdjustment() const { return m_nAdjustment; }
+ TextFrameIndex GetRubyOffset() const { return m_nRubyOffset; }
};
class SwRotatedPortion : public SwMultiPortion
More information about the Libreoffice-commits
mailing list