diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-16 09:59:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-17 08:45:15 +0200 |
commit | a49eeecd2372c620caa66428acaf27ebc7d70e92 (patch) | |
tree | ce9b6ec88766662272f517710a62a831b02592a8 /editeng | |
parent | de47ae4f7e409d2e341829a044d8f721377e2663 (diff) |
convert SvxInterLineSpaceRule to scoped enum
and rename it to be more explicit
Change-Id: I3f8bd7928495dba1e94b785cdda06d9819ee66bf
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdbg.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/paraitem.cxx | 26 |
5 files changed, 25 insertions, 25 deletions
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 2e984e7da7c6..df4a6464c96a 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -130,7 +130,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) aDebStr.append("Min: "); aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpace())); } - else if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + else if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) { aDebStr.append("Prop: "); aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLineSpacingItem&>(rItem).GetPropLineSpace())); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 0429d7560f0d..b54ce8faec71 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -73,7 +73,7 @@ using namespace ::com::sun::star; static sal_uInt16 lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) { sal_uInt16 nExtra = 0; - if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + if ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) { nExtra = rLSItem.GetInterLineSpace(); } @@ -3543,7 +3543,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) { const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); - sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; // only from the top ... @@ -3586,7 +3586,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) aRange.Max() += rL.GetHeight(); } - if( ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) && rLSItem.GetPropLineSpace() && + if( ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) && rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() < 100 ) ) { const EditLine& rL = pPortion->GetLines()[nFirstInvalid]; @@ -3613,7 +3613,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart aPaM.SetNode( pPortion->GetNode() ); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); - sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; long nY = pPortion->GetFirstLineOffset(); @@ -4029,7 +4029,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) { const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); - sal_Int32 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; + sal_Int32 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; if ( nSBL ) { @@ -4127,7 +4127,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, long nY = pPortion->GetFirstLineOffset(); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); - sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; sal_Int32 nCurIndex = 0; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index bf52ede29ad4..337e2a67a448 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1351,7 +1351,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + ( nFixHeight - nTxtHeight ) ) ); pLine->SetHeight( nFixHeight, nTxtHeight ); } - else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + else if ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) { if ( nPara || pLine->GetStartPortion() ) // Not the very first line { @@ -1678,7 +1678,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn pTmpLine->SetMaxAscent( (sal_uInt16)(pTmpLine->GetMaxAscent() + ( nFixHeight - nTxtHeight ) ) ); pTmpLine->SetHeight( nFixHeight, nTxtHeight ); } - else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + else if ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) { sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion ); if ( nPara || pTmpLine->GetStartPortion() ) // Not the very first line @@ -2937,7 +2937,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt Point aParaStart( aStartPos ); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); - sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; bool bPaintBullet (false); @@ -3959,7 +3959,7 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const nTotalOccupiedHeight += pPortion->GetFirstLineOffset(); const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL)); - sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE)); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 1facdd5e232b..17eed1c5ca6a 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -754,7 +754,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SL ); sal_Int32 nVal = static_cast<const SvxLineSpacingItem&>(rItem).GetLineHeight(); char cMult = '0'; - if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop ) { // From where do I get the value now? // The SwRTF parser is based on a 240 Font! diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index e27e3a281553..83b6f4d91bb2 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -85,7 +85,7 @@ SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId nInterLineSpace = 0; nLineHeight = nHeight; eLineSpace = SVX_LINE_SPACE_AUTO; - eInterLineSpace = SVX_INTER_LINE_SPACE_OFF; + eInterLineSpaceRule = SvxInterLineSpaceRule::Off; } @@ -101,12 +101,12 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const && (eLineSpace == SVX_LINE_SPACE_AUTO || nLineHeight == rLineSpace.nLineHeight) // Same Linespacing Rule? - && ( eInterLineSpace == rLineSpace.eInterLineSpace ) + && ( eInterLineSpaceRule == rLineSpace.eInterLineSpaceRule ) // Either set proportional or additive. - && (( eInterLineSpace == SVX_INTER_LINE_SPACE_OFF) - || (eInterLineSpace == SVX_INTER_LINE_SPACE_PROP + && (( eInterLineSpaceRule == SvxInterLineSpaceRule::Off) + || (eInterLineSpaceRule == SvxInterLineSpaceRule::Prop && nPropLineSpace == rLineSpace.nPropLineSpace) - || (eInterLineSpace == SVX_INTER_LINE_SPACE_FIX + || (eInterLineSpaceRule == SvxInterLineSpaceRule::Fix && (nInterLineSpace == rLineSpace.nInterLineSpace))); } @@ -124,12 +124,12 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const switch( eLineSpace ) { case SVX_LINE_SPACE_AUTO: - if(eInterLineSpace == SVX_INTER_LINE_SPACE_FIX) + if(eInterLineSpaceRule == SvxInterLineSpaceRule::Fix) { aLSp.Mode = style::LineSpacingMode::LEADING; aLSp.Height = ( bConvert ? (short)convertTwipToMm100(nInterLineSpace) : nInterLineSpace); } - else if(eInterLineSpace == SVX_INTER_LINE_SPACE_OFF) + else if(eInterLineSpaceRule == SvxInterLineSpaceRule::Off) { aLSp.Mode = style::LineSpacingMode::PROP; aLSp.Height = 100; @@ -186,7 +186,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { case style::LineSpacingMode::LEADING: { - eInterLineSpace = SVX_INTER_LINE_SPACE_FIX; + eInterLineSpaceRule = SvxInterLineSpaceRule::Fix; eLineSpace = SVX_LINE_SPACE_AUTO; nInterLineSpace = aLSp.Height; if(bConvert) @@ -199,15 +199,15 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) eLineSpace = SVX_LINE_SPACE_AUTO; nPropLineSpace = (sal_Int16)aLSp.Height; if(100 == aLSp.Height) - eInterLineSpace = SVX_INTER_LINE_SPACE_OFF; + eInterLineSpaceRule = SvxInterLineSpaceRule::Off; else - eInterLineSpace = SVX_INTER_LINE_SPACE_PROP; + eInterLineSpaceRule = SvxInterLineSpaceRule::Prop; } break; case style::LineSpacingMode::FIX: case style::LineSpacingMode::MINIMUM: { - eInterLineSpace = SVX_INTER_LINE_SPACE_OFF; + eInterLineSpaceRule = SvxInterLineSpaceRule::Off; eLineSpace = aLSp.Mode == style::LineSpacingMode::FIX ? SVX_LINE_SPACE_FIX : SVX_LINE_SPACE_MIN; nLineHeight = aLSp.Height; if(bConvert) @@ -261,7 +261,7 @@ SfxPoolItem* SvxLineSpacingItem::Create(SvStream& rStrm, sal_uInt16) const pAttr->SetInterLineSpace( nInterSpace ); pAttr->SetPropLineSpace( nPropSpace ); pAttr->GetLineSpaceRule() = (SvxLineSpace)nRule; - pAttr->GetInterLineSpaceRule() = (SvxInterLineSpace)nInterRule; + pAttr->SetInterLineSpaceRule( (SvxInterLineSpaceRule)nInterRule ); return pAttr; } @@ -272,7 +272,7 @@ SvStream& SvxLineSpacingItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion* .WriteInt16( GetInterLineSpace() ) .WriteUInt16( GetLineHeight() ) .WriteSChar( GetLineSpaceRule() ) - .WriteSChar( GetInterLineSpaceRule() ); + .WriteSChar( (char) GetInterLineSpaceRule() ); return rStrm; } |