diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-03-07 16:14:16 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-07 17:04:08 +0100 |
commit | 2f91d6c40356038145861bb0459cf0d32c0e7ffe (patch) | |
tree | 29a37980baee67d05b4e84f15b7b145f3bd6976a /sw | |
parent | 71b55cf57460aec3fec948676251448934ba31d1 (diff) |
sw: add prefix to SwTextGridItem members
Change-Id: Ie086d56f01bc06de14c6fb1713a43aec8e6335f9
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/tgrditem.hxx | 77 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 129 |
2 files changed, 105 insertions, 101 deletions
diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx index c137fcda1bcc..dd25833392e7 100644 --- a/sw/inc/tgrditem.hxx +++ b/sw/inc/tgrditem.hxx @@ -31,18 +31,21 @@ enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS }; class SW_DLLPUBLIC SwTextGridItem : public SfxPoolItem { - Color aColor; - sal_uInt16 nLines; - sal_uInt16 nBaseHeight, nRubyHeight; - SwTextGrid eGridType; - sal_Bool bRubyTextBelow; - sal_Bool bPrintGrid; - sal_Bool bDisplayGrid; +private: + Color m_aColor; + sal_uInt16 m_nLines; + sal_uInt16 m_nBaseHeight; + sal_uInt16 m_nRubyHeight; + SwTextGrid m_eGridType; + sal_Bool m_bRubyTextBelow; + sal_Bool m_bPrintGrid; + sal_Bool m_bDisplayGrid; //for textgrid enhancement - sal_uInt16 nBaseWidth; - sal_Bool bSnapToChars; - sal_Bool bSquaredMode; + sal_uInt16 m_nBaseWidth; + sal_Bool m_bSnapToChars; + sal_Bool m_bSquaredMode; + public: SwTextGridItem(); virtual ~SwTextGridItem(); @@ -60,44 +63,44 @@ public: SwTextGridItem& operator=( const SwTextGridItem& ); - const Color& GetColor() const { return aColor; } - void SetColor( const Color& rCol ) { aColor = rCol; } + const Color& GetColor() const { return m_aColor; } + void SetColor( const Color& rCol ) { m_aColor = rCol; } - sal_uInt16 GetLines() const { return nLines; } - void SetLines( sal_uInt16 nNew ) { nLines = nNew; } + sal_uInt16 GetLines() const { return m_nLines; } + void SetLines( sal_uInt16 nNew ) { m_nLines = nNew; } - sal_uInt16 GetBaseHeight() const { return nBaseHeight; } - void SetBaseHeight( sal_uInt16 nNew ) { nBaseHeight = nNew; } + sal_uInt16 GetBaseHeight() const { return m_nBaseHeight; } + void SetBaseHeight( sal_uInt16 nNew ) { m_nBaseHeight = nNew; } - sal_uInt16 GetRubyHeight() const { return nRubyHeight; } - void SetRubyHeight( sal_uInt16 nNew ) { nRubyHeight = nNew; } + sal_uInt16 GetRubyHeight() const { return m_nRubyHeight; } + void SetRubyHeight( sal_uInt16 nNew ) { m_nRubyHeight = nNew; } - SwTextGrid GetGridType() const { return eGridType; } - void SetGridType( SwTextGrid eNew ) { eGridType = eNew; } + SwTextGrid GetGridType() const { return m_eGridType; } + void SetGridType( SwTextGrid eNew ) { m_eGridType = eNew; } - sal_Bool IsRubyTextBelow() const { return bRubyTextBelow; } - sal_Bool GetRubyTextBelow() const { return bRubyTextBelow; } - void SetRubyTextBelow( sal_Bool bNew ) { bRubyTextBelow = bNew; } + sal_Bool IsRubyTextBelow() const { return m_bRubyTextBelow; } + sal_Bool GetRubyTextBelow() const { return m_bRubyTextBelow; } + void SetRubyTextBelow( sal_Bool bNew ) { m_bRubyTextBelow = bNew; } - sal_Bool IsPrintGrid() const { return bPrintGrid; } - sal_Bool GetPrintGrid() const { return bPrintGrid; } - void SetPrintGrid( sal_Bool bNew ) { bPrintGrid = bNew; } + sal_Bool IsPrintGrid() const { return m_bPrintGrid; } + sal_Bool GetPrintGrid() const { return m_bPrintGrid; } + void SetPrintGrid( sal_Bool bNew ) { m_bPrintGrid = bNew; } - sal_Bool IsDisplayGrid() const { return bDisplayGrid; } - sal_Bool GetDisplayGrid() const { return bDisplayGrid; } - void SetDisplayGrid( sal_Bool bNew ) { bDisplayGrid = bNew; } + sal_Bool IsDisplayGrid() const { return m_bDisplayGrid; } + sal_Bool GetDisplayGrid() const { return m_bDisplayGrid; } + void SetDisplayGrid( sal_Bool bNew ) { m_bDisplayGrid = bNew; } //for textgrid enhancement - sal_uInt16 GetBaseWidth() const { return nBaseWidth;} - void SetBaseWidth( sal_uInt16 nNew ) { nBaseWidth = nNew; } + sal_uInt16 GetBaseWidth() const { return m_nBaseWidth;} + void SetBaseWidth( sal_uInt16 nNew ) { m_nBaseWidth = nNew; } - sal_Bool IsSnapToChars() const { return bSnapToChars; } - sal_Bool GetSnapToChars() const { return bSnapToChars; } - void SetSnapToChars( sal_Bool bNew ) { bSnapToChars = bNew; } + sal_Bool IsSnapToChars() const { return m_bSnapToChars; } + sal_Bool GetSnapToChars() const { return m_bSnapToChars; } + void SetSnapToChars( sal_Bool bNew ) { m_bSnapToChars = bNew; } - sal_Bool IsSquaredMode() const { return bSquaredMode; } - sal_Bool GetSquaredMode() const { return bSquaredMode; } - void SetSquaredMode( sal_Bool bNew ) { bSquaredMode = bNew; } + sal_Bool IsSquaredMode() const { return m_bSquaredMode; } + sal_Bool GetSquaredMode() const { return m_bSquaredMode; } + void SetSquaredMode( sal_Bool bNew ) { m_bSquaredMode = bNew; } void SwitchPaperMode(sal_Bool bNew ); void Init(); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index f80cf38e8a96..f251813bebf8 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2105,10 +2105,10 @@ bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) // class SwTextGridItem SwTextGridItem::SwTextGridItem() - : SfxPoolItem( RES_TEXTGRID ), aColor( COL_LIGHTGRAY ), nLines( 20 ), - nBaseHeight( 400 ), nRubyHeight( 200 ), eGridType( GRID_NONE ), - bRubyTextBelow( 0 ), bPrintGrid( 1 ), bDisplayGrid( 1 ), - nBaseWidth(400), bSnapToChars( 1 ), bSquaredMode(1) + : SfxPoolItem( RES_TEXTGRID ), m_aColor( COL_LIGHTGRAY ), m_nLines( 20 ) + , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( GRID_NONE ) + , m_bRubyTextBelow( 0 ), m_bPrintGrid( 1 ), m_bDisplayGrid( 1 ) + , m_nBaseWidth(400), m_bSnapToChars( 1 ), m_bSquaredMode(1) { } @@ -2119,17 +2119,18 @@ SwTextGridItem::~SwTextGridItem() bool SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const { OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return eGridType == ((SwTextGridItem&)rAttr).GetGridType() && - nLines == ((SwTextGridItem&)rAttr).GetLines() && - nBaseHeight == ((SwTextGridItem&)rAttr).GetBaseHeight() && - nRubyHeight == ((SwTextGridItem&)rAttr).GetRubyHeight() && - bRubyTextBelow == ((SwTextGridItem&)rAttr).GetRubyTextBelow() && - bDisplayGrid == ((SwTextGridItem&)rAttr).GetDisplayGrid() && - bPrintGrid == ((SwTextGridItem&)rAttr).GetPrintGrid() && - aColor == ((SwTextGridItem&)rAttr).GetColor() && - nBaseWidth == ((SwTextGridItem&)rAttr).GetBaseWidth() && - bSnapToChars == ((SwTextGridItem&)rAttr).GetSnapToChars() && - bSquaredMode == ((SwTextGridItem&)rAttr).GetSquaredMode(); + SwTextGridItem const& rOther(static_cast<SwTextGridItem const&>(rAttr)); + return m_eGridType == rOther.GetGridType() + && m_nLines == rOther.GetLines() + && m_nBaseHeight == rOther.GetBaseHeight() + && m_nRubyHeight == rOther.GetRubyHeight() + && m_bRubyTextBelow == rOther.GetRubyTextBelow() + && m_bDisplayGrid == rOther.GetDisplayGrid() + && m_bPrintGrid == rOther.GetPrintGrid() + && m_aColor == rOther.GetColor() + && m_nBaseWidth == rOther.GetBaseWidth() + && m_bSnapToChars == rOther.GetSnapToChars() + && m_bSquaredMode == rOther.GetSquaredMode(); } SfxPoolItem* SwTextGridItem::Clone( SfxItemPool* ) const @@ -2139,17 +2140,17 @@ SfxPoolItem* SwTextGridItem::Clone( SfxItemPool* ) const SwTextGridItem& SwTextGridItem::operator=( const SwTextGridItem& rCpy ) { - aColor = rCpy.GetColor(); - nLines = rCpy.GetLines(); - nBaseHeight = rCpy.GetBaseHeight(); - nRubyHeight = rCpy.GetRubyHeight(); - eGridType = rCpy.GetGridType(); - bRubyTextBelow = rCpy.GetRubyTextBelow(); - bPrintGrid = rCpy.GetPrintGrid(); - bDisplayGrid = rCpy.GetDisplayGrid(); - nBaseWidth = rCpy.GetBaseWidth(); - bSnapToChars = rCpy.GetSnapToChars(); - bSquaredMode = rCpy.GetSquaredMode(); + m_aColor = rCpy.GetColor(); + m_nLines = rCpy.GetLines(); + m_nBaseHeight = rCpy.GetBaseHeight(); + m_nRubyHeight = rCpy.GetRubyHeight(); + m_eGridType = rCpy.GetGridType(); + m_bRubyTextBelow = rCpy.GetRubyTextBelow(); + m_bPrintGrid = rCpy.GetPrintGrid(); + m_bDisplayGrid = rCpy.GetDisplayGrid(); + m_nBaseWidth = rCpy.GetBaseWidth(); + m_bSnapToChars = rCpy.GetSnapToChars(); + m_bSquaredMode = rCpy.GetSquaredMode(); return *this; } @@ -2167,28 +2168,28 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const rVal <<= GetLines(); break; case MID_GRID_RUBY_BELOW: - rVal.setValue( &bRubyTextBelow, ::getBooleanCppuType() ); + rVal.setValue( &m_bRubyTextBelow, ::getBooleanCppuType() ); break; case MID_GRID_PRINT: - rVal.setValue( &bPrintGrid, ::getBooleanCppuType() ); + rVal.setValue( &m_bPrintGrid, ::getBooleanCppuType() ); break; case MID_GRID_DISPLAY: - rVal.setValue( &bDisplayGrid, ::getBooleanCppuType() ); + rVal.setValue( &m_bDisplayGrid, ::getBooleanCppuType() ); break; case MID_GRID_BASEHEIGHT: OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0, "This value needs TWIPS-MM100 conversion" ); - rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseHeight); + rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(m_nBaseHeight); break; case MID_GRID_BASEWIDTH: OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0, "This value needs TWIPS-MM100 conversion" ); - rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseWidth); + rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(m_nBaseWidth); break; case MID_GRID_RUBYHEIGHT: OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0, "This value needs TWIPS-MM100 conversion" ); - rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nRubyHeight); + rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(m_nRubyHeight); break; case MID_GRID_TYPE: switch( GetGridType() ) @@ -2209,11 +2210,11 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const } break; case MID_GRID_SNAPTOCHARS: - rVal.setValue( &bSnapToChars, ::getBooleanCppuType() ); + rVal.setValue( &m_bSnapToChars, ::getBooleanCppuType() ); break; case MID_GRID_STANDARD_MODE: { - sal_Bool bStandardMode = !bSquaredMode; + sal_Bool bStandardMode = !m_bSquaredMode; rVal.setValue( &bStandardMode, ::getBooleanCppuType() ); } break; @@ -2333,62 +2334,62 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) void SwTextGridItem::SwitchPaperMode(sal_Bool bNew) { - if( bNew == bSquaredMode ) + if (bNew == m_bSquaredMode) { //same paper mode, not switch return; } // use default value when grid is disable - if( eGridType == GRID_NONE ) + if (m_eGridType == GRID_NONE) { - bSquaredMode = bNew; + m_bSquaredMode = bNew; Init(); return; } - if( bSquaredMode ) + if (m_bSquaredMode) { //switch from "squared mode" to "standard mode" - nBaseWidth = nBaseHeight; - nBaseHeight = nBaseHeight + nRubyHeight; - nRubyHeight = 0; + m_nBaseWidth = m_nBaseHeight; + m_nBaseHeight = m_nBaseHeight + m_nRubyHeight; + m_nRubyHeight = 0; } else { //switch from "standard mode" to "squared mode" - nRubyHeight = nBaseHeight/3; - nBaseHeight = nBaseHeight - nRubyHeight; - nBaseWidth = nBaseHeight; + m_nRubyHeight = m_nBaseHeight/3; + m_nBaseHeight = m_nBaseHeight - m_nRubyHeight; + m_nBaseWidth = m_nBaseHeight; } - bSquaredMode = !bSquaredMode; + m_bSquaredMode = !m_bSquaredMode; } void SwTextGridItem::Init() { - if( bSquaredMode ) + if (m_bSquaredMode) { - nLines = 20; - nBaseHeight = 400; - nRubyHeight = 200; - eGridType = GRID_NONE; - bRubyTextBelow = 0; - bPrintGrid = 1; - bDisplayGrid = 1; - bSnapToChars = 1; - nBaseWidth = 400; + m_nLines = 20; + m_nBaseHeight = 400; + m_nRubyHeight = 200; + m_eGridType = GRID_NONE; + m_bRubyTextBelow = 0; + m_bPrintGrid = 1; + m_bDisplayGrid = 1; + m_bSnapToChars = 1; + m_nBaseWidth = 400; } else { - nLines = 44; - nBaseHeight = 312; - nRubyHeight = 0; - eGridType = GRID_NONE; - bRubyTextBelow = 0; - bPrintGrid = 1; - bDisplayGrid = 1; - nBaseWidth = 210; - bSnapToChars = 1; + m_nLines = 44; + m_nBaseHeight = 312; + m_nRubyHeight = 0; + m_eGridType = GRID_NONE; + m_bRubyTextBelow = 0; + m_bPrintGrid = 1; + m_bDisplayGrid = 1; + m_nBaseWidth = 210; + m_bSnapToChars = 1; } } |