[Libreoffice-commits] core.git: sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 15 06:35:35 UTC 2021
sw/source/filter/ww8/rtfattributeoutput.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 43f11dfb6674bb1e8a52ffba0682d692da8d45b2
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Jul 14 20:44:24 2021 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jul 15 08:35:00 2021 +0200
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 at collabora.com>
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;
More information about the Libreoffice-commits
mailing list