diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-16 11:56:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-17 08:45:15 +0200 |
commit | 42ab2cfbd92bc30a62a2c126d4ad6d5726846d8b (patch) | |
tree | 07cfc005093e203c93c633da24eb5bdcf00314b6 /editeng | |
parent | convert SvxInterLineSpaceRule to scoped enum (diff) | |
download | core-42ab2cfbd92bc30a62a2c126d4ad6d5726846d8b.tar.gz core-42ab2cfbd92bc30a62a2c126d4ad6d5726846d8b.zip |
convert SvxLineSpace to scoped enum
and rename to be more explicit
Change-Id: Id06e6b68ef30e1d0d0daf19c37a390060e8bcb01
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdbg.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 8 | ||||
-rw-r--r-- | editeng/source/items/paraitem.cxx | 28 | ||||
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 14 |
5 files changed, 27 insertions, 27 deletions
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index df4a6464c96a..1572f046cec5 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -125,7 +125,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) break; case EE_PARA_SBL: aDebStr.append("SBL="); - if ( static_cast<const SvxLineSpacingItem&>(rItem).GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) + if ( static_cast<const SvxLineSpacingItem&>(rItem).GetLineSpaceRule() == SvxLineSpaceRule::Min ) { aDebStr.append("Min: "); aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpace())); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index f4e12e833524..458dc14bf610 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -893,7 +893,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit DBG_ASSERT( dynamic_cast<const SvxLineSpacingItem *>(&rPoolItem) != nullptr, "ConvertItem: Invalid Item!" ); SvxLineSpacingItem& rItem = static_cast<SvxLineSpacingItem&>(rPoolItem); // SetLineHeight changes also eLineSpace! - if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) + if ( rItem.GetLineSpaceRule() == SvxLineSpaceRule::Min ) rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); } break; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 337e2a67a448..ff612cb13d01 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1332,7 +1332,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if ( !bSameLineAgain && !aStatus.IsOutliner() ) { - if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) + if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Min ) { sal_uInt16 nMinHeight = GetYValue( rLSItem.GetLineHeight() ); sal_uInt16 nTxtHeight = pLine->GetHeight(); @@ -1344,7 +1344,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pLine->SetHeight( nMinHeight, nTxtHeight ); } } - else if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX ) + else if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Fix ) { sal_uInt16 nFixHeight = GetYValue( rLSItem.GetLineHeight() ); sal_uInt16 nTxtHeight = pLine->GetHeight(); @@ -1658,7 +1658,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn if ( !aStatus.IsOutliner() ) { - if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) + if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Min ) { sal_uInt16 nMinHeight = rLSItem.GetLineHeight(); sal_uInt16 nTxtHeight = pTmpLine->GetHeight(); @@ -1670,7 +1670,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn pTmpLine->SetHeight( nMinHeight, nTxtHeight ); } } - else if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX ) + else if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Fix ) { sal_uInt16 nFixHeight = rLSItem.GetLineHeight(); sal_uInt16 nTxtHeight = pTmpLine->GetHeight(); diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 83b6f4d91bb2..ab7f1c197f25 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -84,7 +84,7 @@ SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId nPropLineSpace = 100; nInterLineSpace = 0; nLineHeight = nHeight; - eLineSpace = SVX_LINE_SPACE_AUTO; + eLineSpaceRule = SvxLineSpaceRule::Auto; eInterLineSpaceRule = SvxInterLineSpaceRule::Off; } @@ -96,9 +96,9 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const const SvxLineSpacingItem& rLineSpace = static_cast<const SvxLineSpacingItem&>(rAttr); return // Same Linespacing Rule? - (eLineSpace == rLineSpace.eLineSpace) + (eLineSpaceRule == rLineSpace.eLineSpaceRule) // For maximum and minimum Linespacing be the size must coincide. - && (eLineSpace == SVX_LINE_SPACE_AUTO || + && (eLineSpaceRule == SvxLineSpaceRule::Auto || nLineHeight == rLineSpace.nLineHeight) // Same Linespacing Rule? && ( eInterLineSpaceRule == rLineSpace.eInterLineSpaceRule ) @@ -121,9 +121,9 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const nMemberId &= ~CONVERT_TWIPS; style::LineSpacing aLSp; - switch( eLineSpace ) + switch( eLineSpaceRule ) { - case SVX_LINE_SPACE_AUTO: + case SvxLineSpaceRule::Auto: if(eInterLineSpaceRule == SvxInterLineSpaceRule::Fix) { aLSp.Mode = style::LineSpacingMode::LEADING; @@ -140,13 +140,13 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const aLSp.Height = nPropLineSpace; } break; - case SVX_LINE_SPACE_FIX : - case SVX_LINE_SPACE_MIN : - aLSp.Mode = eLineSpace == SVX_LINE_SPACE_FIX ? style::LineSpacingMode::FIX : style::LineSpacingMode::MINIMUM; + case SvxLineSpaceRule::Fix : + case SvxLineSpaceRule::Min : + aLSp.Mode = eLineSpaceRule == SvxLineSpaceRule::Fix ? style::LineSpacingMode::FIX : style::LineSpacingMode::MINIMUM; aLSp.Height = ( bConvert ? (short)convertTwipToMm100(nLineHeight) : nLineHeight ); break; default: - ;//prevent warning about SVX_LINE_SPACE_END + ;//prevent warning about SvxLineSpaceRule::End } switch ( nMemberId ) @@ -187,7 +187,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case style::LineSpacingMode::LEADING: { eInterLineSpaceRule = SvxInterLineSpaceRule::Fix; - eLineSpace = SVX_LINE_SPACE_AUTO; + eLineSpaceRule = SvxLineSpaceRule::Auto; nInterLineSpace = aLSp.Height; if(bConvert) nInterLineSpace = (short)convertMm100ToTwip(nInterLineSpace); @@ -196,7 +196,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) break; case style::LineSpacingMode::PROP: { - eLineSpace = SVX_LINE_SPACE_AUTO; + eLineSpaceRule = SvxLineSpaceRule::Auto; nPropLineSpace = (sal_Int16)aLSp.Height; if(100 == aLSp.Height) eInterLineSpaceRule = SvxInterLineSpaceRule::Off; @@ -208,7 +208,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case style::LineSpacingMode::MINIMUM: { eInterLineSpaceRule = SvxInterLineSpaceRule::Off; - eLineSpace = aLSp.Mode == style::LineSpacingMode::FIX ? SVX_LINE_SPACE_FIX : SVX_LINE_SPACE_MIN; + eLineSpaceRule = aLSp.Mode == style::LineSpacingMode::FIX ? SvxLineSpaceRule::Fix : SvxLineSpaceRule::Min; nLineHeight = aLSp.Height; if(bConvert) nLineHeight = (sal_uInt16)convertMm100ToTwip(nLineHeight); @@ -260,7 +260,7 @@ SfxPoolItem* SvxLineSpacingItem::Create(SvStream& rStrm, sal_uInt16) const SvxLineSpacingItem* pAttr = new SvxLineSpacingItem( nHeight, Which() ); pAttr->SetInterLineSpace( nInterSpace ); pAttr->SetPropLineSpace( nPropSpace ); - pAttr->GetLineSpaceRule() = (SvxLineSpace)nRule; + pAttr->SetLineSpaceRule( (SvxLineSpaceRule)nRule ); pAttr->SetInterLineSpaceRule( (SvxInterLineSpaceRule)nInterRule ); return pAttr; } @@ -271,7 +271,7 @@ SvStream& SvxLineSpacingItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion* rStrm.WriteSChar( GetPropLineSpace() ) .WriteInt16( GetInterLineSpace() ) .WriteUInt16( GetLineHeight() ) - .WriteSChar( GetLineSpaceRule() ) + .WriteSChar( (char) GetLineSpaceRule() ) .WriteSChar( (char) GetInterLineSpaceRule() ); return rStrm; } diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index a7e428d2bdce..ff4afc633ac0 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -449,7 +449,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) nTokenValue = 200; // is one BYTE !!! aLSpace.SetPropLineSpace( (const sal_uInt8)nTokenValue ); - aLSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; + aLSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto ); pSet->Put( aLSpace ); } @@ -467,28 +467,28 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if (1000 == nTokenValue ) nTokenValue = 240; - SvxLineSpace eLnSpc; + SvxLineSpaceRule eLnSpc; if (nTokenValue < 0) { - eLnSpc = SVX_LINE_SPACE_FIX; + eLnSpc = SvxLineSpaceRule::Fix; nTokenValue = -nTokenValue; } else if (nTokenValue == 0) { //if \sl0 is used, the line spacing is automatically //determined - eLnSpc = SVX_LINE_SPACE_AUTO; + eLnSpc = SvxLineSpaceRule::Auto; } else - eLnSpc = SVX_LINE_SPACE_MIN; + eLnSpc = SvxLineSpaceRule::Min; if (IsCalcValue()) CalcValue(); - if (eLnSpc != SVX_LINE_SPACE_AUTO) + if (eLnSpc != SvxLineSpaceRule::Auto) aLSpace.SetLineHeight( (const sal_uInt16)nTokenValue ); - aLSpace.GetLineSpaceRule() = eLnSpc; + aLSpace.SetLineSpaceRule(eLnSpc); pSet->Put(aLSpace); } break; |