summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-10 12:48:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 08:24:29 +0100
commit3588a48a82d37f940595570758bc1d1179d18b84 (patch)
treedaa314ae437771157a53f8a5d5043a685f399ac3 /filter
parenta8f31d5120c2ae9109d316db73b5adf9cb26c892 (diff)
TypedWhichId
use a strong-typedef template to give which IDs a type, which we can carry around to do a (a) little bit more convenience when Get()'ing them and (b) a little bit of enforcement of which PoolItem subclass each ID uses Fix a bug in casting EE_PARA_BULLETSTATE to the wrong subclass in AccessibleEditableTextPara::_correctValues Change-Id: I015ce8b3b0f6d21308af182afa3caf122c877a5b Reviewed-on: https://gerrit.libreoffice.org/44587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx6
-rw-r--r--filter/source/msfilter/svdfppt.cxx20
2 files changed, 13 insertions, 13 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 25be4f0f04f6..63f152418418 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1532,7 +1532,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
break;
}
}
- rSet.Put( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
+ rSet.Put( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR.Which() ) );
rSet.Put( SdrTextVertAdjustItem( eTVA ) );
rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
@@ -3661,7 +3661,7 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj )
SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
if ( !aSelection.nStartPos )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, false ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE.Which(), false ) );
aSelection.nStartPos = 0;
rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
nParaIndex++;
@@ -4469,7 +4469,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if ( bIsRTL )
{
SfxItemSet aSet2( rOutliner.GetParaAttribs( i ) );
- aSet2.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
+ aSet2.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR.Which() ) );
rOutliner.SetParaAttribs( i, aSet2 );
bCreateNewParaObject = true;
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 0ba7d259d7a5..78ee76593663 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1090,7 +1090,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
bAutoGrowHeight = bFitShapeToText;
}
}
- pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
+ pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR.Which() ) );
//Autofit text only if there is no auto grow height and width
//See fdo#41245
@@ -2329,11 +2329,11 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
sal_uInt32 nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
pPara->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
if ( !nIsBullet2 )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, false ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE.Which(), false ) );
if ( !aSelection.nStartPos ) // in PPT empty paragraphs never gets a bullet
{
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, false ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE.Which(), false ) );
}
aSelection.nStartPos = 0;
rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
@@ -4396,7 +4396,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
aRule.SetLevel( 0, aNumberFormat );
}
}
- mpNumBulletItem[ i ] = new SvxNumBulletItem( aRule, EE_PARA_NUMBULLET );
+ mpNumBulletItem[ i ] = new SvxNumBulletItem( aRule, EE_PARA_NUMBULLET.Which() );
}
}
@@ -6231,7 +6231,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
GetAttrib(PPT_ParaAttr_BulletOfs, _nBulletOfs, nDestinationInstance);
if ( !nIsBullet2 )
{
- SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
+ SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE.Which() );
sal_uInt16 nAbsLSpace = (sal_uInt16)( ( _nTextOfs * 2540 ) / 576 );
sal_uInt16 nFirstLineOffset = nAbsLSpace - (sal_uInt16)( ( _nBulletOfs * 2540 ) / 576 );
aLRSpaceItem.SetLeft( nAbsLSpace );
@@ -6240,7 +6240,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
}
else
{
- SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
+ SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE.Which() );
aLRSpaceItem.SetLeft( 0 );
aLRSpaceItem.SetTextFirstLineOfstValue( 0 );
rSet.Put( aLRSpaceItem );
@@ -6255,12 +6255,12 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
}
if ( GetAttrib( PPT_ParaAttr_AsianLB_1, nVal, nDestinationInstance ) )
- rSet.Put(SvxForbiddenRuleItem(nVal != 0, EE_PARA_FORBIDDENRULES));
+ rSet.Put(SvxForbiddenRuleItem(nVal != 0, EE_PARA_FORBIDDENRULES.Which()));
if ( GetAttrib( PPT_ParaAttr_AsianLB_3, nVal, nDestinationInstance ) )
- rSet.Put(SvxHangingPunctuationItem(nVal != 0, EE_PARA_HANGINGPUNCTUATION));
+ rSet.Put(SvxHangingPunctuationItem(nVal != 0, EE_PARA_HANGINGPUNCTUATION.Which()));
if ( GetAttrib( PPT_ParaAttr_BiDi, nVal, nDestinationInstance ) )
- rSet.Put( SvxFrameDirectionItem( nVal == 1 ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
+ rSet.Put( SvxFrameDirectionItem( nVal == 1 ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR.Which() ) );
// LineSpacing
PPTPortionObj* pPortion = First();
@@ -7406,7 +7406,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel
//set textHorizontalAdjust and TextWritingMode attr
const sal_Int32 eHA(static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue());
- const SvxFrameDirection eDirection = static_cast<const SvxFrameDirectionItem&>(pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue();
+ const SvxFrameDirection eDirection = pObj->GetMergedItem(EE_PARA_WRITINGDIR).GetValue();
xPropSet->setPropertyValue( "TextHorizontalAdjust" , Any( eHA ) );
if ( eDirection == SvxFrameDirection::Vertical_RL_TB )
{//vertical writing