summaryrefslogtreecommitdiff
path: root/chart2
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 /chart2
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 'chart2')
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.cxx2
-rw-r--r--chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx8
-rw-r--r--chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx2
8 files changed, 11 insertions, 11 deletions
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 73d8598a6dd2..abfffe1b6355 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -306,7 +306,7 @@ bool DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const
}
if( m_pLB_TextDirection->GetSelectedEntryCount() > 0 )
- rOutAttrs->Put( SvxFrameDirectionItem( m_pLB_TextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
+ rOutAttrs->Put( SvxFrameDirectionItem( m_pLB_TextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR.Which() ) );
if( m_pDC_Dial->IsVisible() )
{
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 3df8869364be..7fdeb8ffea7d 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -149,7 +149,7 @@ bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
rOutAttrs->Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, m_pCbShowDescription->IsChecked() ) );
if( m_pLbTextDirection->GetSelectedEntryCount() > 0 )
- rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
+ rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR.Which() ) );
return true;
}
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 554235d17343..8c0e7310081d 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -63,7 +63,7 @@ bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
m_aLegendPositionResources.writeToItemSet(*rOutAttrs);
if( m_pLbTextDirection->GetSelectedEntryCount() > 0 )
- rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR ) );
+ rOutAttrs->Put( SvxFrameDirectionItem( m_pLbTextDirection->GetSelectEntryValue(), EE_PARA_WRITINGDIR.Which() ) );
return true;
}
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index ae304b22d24e..05537d931c8a 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -96,7 +96,7 @@ bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
SvxFrameDirection aDirection( m_pLbTextDirection->GetSelectEntryValue() );
- rOutAttrs->Put( SvxFrameDirectionItem( aDirection, EE_PARA_WRITINGDIR ) );
+ rOutAttrs->Put( SvxFrameDirectionItem( aDirection, EE_PARA_WRITINGDIR.Which() ) );
return true;
}
diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
index 062b4b173b3e..7810f28e4b3c 100644
--- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
@@ -56,9 +56,9 @@ ItemPropertyMapType & lcl_GetCharacterPropertyPropertyMap()
{EE_CHAR_OUTLINE, {"CharContoured", 0}},
{EE_CHAR_EMPHASISMARK, {"CharEmphasis", 0}},
- {EE_PARA_WRITINGDIR, {"WritingMode", 0}},
+ {EE_PARA_WRITINGDIR.Which(), {"WritingMode", 0}},
- {EE_PARA_ASIANCJKSPACING, {"ParaIsCharacterDistance", 0}}};
+ {EE_PARA_ASIANCJKSPACING.Which(), {"ParaIsCharacterDistance", 0}}};
return aCharacterPropertyMap;
}
@@ -296,8 +296,8 @@ void CharacterPropertyItemConverter::FillSpecialItem(
}
break;
- case EE_PARA_FORBIDDENRULES:
- case EE_PARA_HANGINGPUNCTUATION:
+ case EE_PARA_FORBIDDENRULES.Which():
+ case EE_PARA_HANGINGPUNCTUATION.Which():
rOutItemSet.DisableItem( nWhichId );
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index b8c85f61c046..3c3d4fd2a1a1 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -82,7 +82,7 @@ const sal_uInt16 nDataLabelWhichPairs[] =
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */
SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES,
- EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR,
+ EE_PARA_WRITINGDIR.Which(),EE_PARA_WRITINGDIR.Which(),
0
};
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 49f1670e9f37..7dc5a3d8e99a 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1538,7 +1538,7 @@ void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDraw
if( nWritingMode != -1 && nWritingMode != text::WritingMode2::PAGE )
{
if( pDrawModelWrapper.get() )
- pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SvxFrameDirectionItem(static_cast<SvxFrameDirection>(nWritingMode), EE_PARA_WRITINGDIR) );
+ pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SvxFrameDirectionItem(static_cast<SvxFrameDirection>(nWritingMode), EE_PARA_WRITINGDIR.Which()) );
}
}
catch( const uno::Exception& ex )
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index ab87a0769172..100517b08de1 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -63,7 +63,7 @@ DrawModelWrapper::DrawModelWrapper()
SfxItemPool* pMasterPool = &GetItemPool();
pMasterPool->SetDefaultMetric(MapUnit::Map100thMM);
- pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) );
+ pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE.Which(), true) );
pMasterPool->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5));
SfxItemPool* pPool = pMasterPool;