diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-07-14 20:44:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-07-15 08:35:00 +0200 |
commit | 43f11dfb6674bb1e8a52ffba0682d692da8d45b2 (patch) | |
tree | c9fc77b26a002cbd6c66854e54f37661dbeb5af8 /sw/source | |
parent | 2a31c5dd37012de5a52dbbc08937401fc38434fb (diff) |
sw: use SfxPoolItem::StaticWhichCast() in RtfAttributeOutput
See commit 0025e80ba6d882f6f885499efaf37ab0e2ed699d (sw: use
SfxPoolItem::StaticWhichCast() in SwTextBoxHelper, 2021-07-07) for
motivation.
Change-Id: Ifb3e2466dd25ad554b81cdac63742230072e64a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118952
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5759c4f60c89..16892f24833b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -747,7 +747,7 @@ void RtfAttributeOutput::TableDefaultBorders( if (!pCellFormat->GetAttrSet().HasItem(RES_BOX, &pItem)) return; - auto& rBox = static_cast<const SvxBoxItem&>(*pItem); + auto& rBox = pItem->StaticWhichCast(RES_BOX); static const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT }; static const char* aBorderNames[] @@ -801,7 +801,7 @@ void RtfAttributeOutput::TableBackgrounds( const SfxPoolItem* pItem; if (pCellFormat->GetAttrSet().HasItem(RES_BACKGROUND, &pItem)) { - auto& rBack = static_cast<const SvxBrushItem&>(*pItem); + auto& rBack = pItem->StaticWhichCast(RES_BACKGROUND); if (rBack.GetColor() != COL_AUTO) aColor = rBack.GetColor(); } @@ -905,7 +905,7 @@ void RtfAttributeOutput::TableVerticalCell( if (!pCellFormat->GetAttrSet().HasItem(RES_VERT_ORIENT, &pItem)) return; - switch (static_cast<const SwFormatVertOrient*>(pItem)->GetVertOrient()) + switch (pItem->StaticWhichCast(RES_VERT_ORIENT).GetVertOrient()) { case text::VertOrientation::CENTER: m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); @@ -2559,6 +2559,8 @@ void RtfAttributeOutput::CharUnderline(const SvxUnderlineItem& rUnderline) const char* pStr = nullptr; const SfxPoolItem* pItem = m_rExport.HasItem(RES_CHRATR_WORDLINEMODE); bool bWord = false; + // No StaticWhichCast(RES_CHRATR_WORDLINEMODE), this may be for a postit, where the which ids + // don't match. if (pItem) bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue(); switch (rUnderline.GetLineStyle()) @@ -3586,7 +3588,7 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox) { SvxShadowLocation eShadowLocation = SvxShadowLocation::NONE; if (const SfxPoolItem* pItem = GetExport().HasItem(RES_SHADOW)) - eShadowLocation = static_cast<const SvxShadowItem*>(pItem)->GetLocation(); + eShadowLocation = pItem->StaticWhichCast(RES_SHADOW).GetLocation(); const SvxBoxItemLine* pBrd = aBorders; const char** pBrdNms = aBorderNames; |