summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx4
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx24
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx9
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx8
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx4
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.cxx20
-rw-r--r--sw/source/filter/ww8/ww8par.hxx4
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx13
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx49
11 files changed, 78 insertions, 65 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 7d4d4df1fb3d..501f632ff3f2 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -944,7 +944,7 @@ void DocxExport::WriteSettings()
}
// Display Background Shape
- if (boost::optional<SvxBrushItem> oBrush = getBackground())
+ if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
// Turn on the 'displayBackgroundShape'
pFS->singleElementNS(XML_w, XML_displayBackgroundShape);
@@ -1456,7 +1456,7 @@ void DocxExport::WriteMainText()
m_aLinkedTextboxesHelper.clear();
// Write background page color
- if (boost::optional<SvxBrushItem> oBrush = getBackground())
+ if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
Color backgroundColor = oBrush->GetColor();
OString aBackgroundColorStr = msfilter::util::ConvertColor(backgroundColor);
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index b2b06a77443b..2dbd38230402 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -419,7 +419,7 @@ void RtfExport::WriteMainText()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
- if (boost::optional<SvxBrushItem> oBrush = getBackground())
+ if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_VIEWBKSP).WriteChar('1');
Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BACKGROUND);
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index f713a9c2de88..feacf1de6f9b 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1608,11 +1608,11 @@ void SwBasicEscherEx::WriteGrfBullet(const Graphic& rGrf)
aPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
const Color aTmpColor( COL_WHITE );
- SvxBrushItem aBrush( aTmpColor, RES_BACKGROUND );
- const SvxBrushItem *pRet = rWrt.GetCurrentPageBgBrush();
+ std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(aTmpColor, RES_BACKGROUND));
+ const SvxBrushItem* pRet = rWrt.GetCurrentPageBgBrush();
if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT)))
- aBrush = *pRet;
- WriteBrushAttr(aBrush, aPropOpt);
+ aBrush.reset(static_cast<SvxBrushItem*>(pRet->Clone()));
+ WriteBrushAttr(*aBrush, aPropOpt);
aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0 );
aPropOpt.Commit( GetStream() );
@@ -2080,13 +2080,21 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat,
if (bIsInHeader)
{
- SvxBrushItem aBrush(rFormat.makeBackgroundBrushItem());
- WriteBrushAttr(aBrush, rPropOpt);
+ std::shared_ptr<SvxBrushItem> aBrush(rFormat.makeBackgroundBrushItem());
+
+ if(aBrush)
+ {
+ WriteBrushAttr(*aBrush, rPropOpt);
+ }
}
else
{
- SvxBrushItem aBrush(rWrt.TrueFrameBgBrush(rFormat));
- WriteBrushAttr(aBrush, rPropOpt);
+ std::shared_ptr<SvxBrushItem> aBrush(rWrt.TrueFrameBgBrush(rFormat));
+
+ if(aBrush)
+ {
+ WriteBrushAttr(*aBrush, rPropOpt);
+ }
}
const SdrObject* pObj = rFormat.FindRealSdrObject();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index e89563655fd7..d08796457530 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1623,7 +1623,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const
return pRet;
}
-SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const
+std::shared_ptr<SvxBrushItem> WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const
{
const SwFrameFormat *pFlyFormat = &rFlyFormat;
const SvxBrushItem* pRet = nullptr;
@@ -1657,9 +1657,12 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const
pRet = GetCurrentPageBgBrush();
const Color aTmpColor( COL_WHITE );
- SvxBrushItem aRet( aTmpColor, RES_BACKGROUND );
+ std::shared_ptr<SvxBrushItem> aRet(std::make_shared<SvxBrushItem>(aTmpColor, RES_BACKGROUND));
+
if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT)))
- aRet = *pRet;
+ {
+ aRet.reset(static_cast<SvxBrushItem*>(pRet->Clone()));
+ }
return aRet;
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 07ba40b373fd..1ccca8f8eb78 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1522,17 +1522,17 @@ void WW8Export::AppendBookmarkEndWithCorrection( const OUString& rName )
m_pBkmks->Append( nEndCP - 1, rName );
}
-boost::optional<SvxBrushItem> MSWordExportBase::getBackground()
+std::shared_ptr<SvxBrushItem> MSWordExportBase::getBackground()
{
- boost::optional<SvxBrushItem> oRet;
+ std::shared_ptr<SvxBrushItem> oRet;
const SwFrameFormat &rFormat = m_pDoc->GetPageDesc(0).GetMaster();
- SvxBrushItem aBrush(RES_BACKGROUND);
+ std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
SfxItemState eState = rFormat.GetBackgroundState(aBrush);
if (SfxItemState::SET == eState)
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
- if (aBrush.GetColor() != COL_AUTO)
+ if (aBrush->GetColor() != COL_AUTO)
oRet = aBrush;
}
return oRet;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c40b36a81bf8..1be70995ca50 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -878,7 +878,7 @@ protected:
void SetCurPam(sal_uLong nStt, sal_uLong nEnd);
/// Get background color of the document, if there is one.
- boost::optional<SvxBrushItem> getBackground();
+ std::shared_ptr<SvxBrushItem> getBackground();
/// Populates m_vecBulletPic with all the bullet graphics used by numberings.
int CollectGrfsOfBullets();
/// Write the numbering picture bullets.
@@ -1033,7 +1033,7 @@ public:
void WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes* pO = nullptr );
void WritePostItBegin( ww::bytes* pO = nullptr );
const SvxBrushItem* GetCurrentPageBgBrush() const;
- SvxBrushItem TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const;
+ std::shared_ptr<SvxBrushItem> TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const;
void AppendFlyInFlys(const ww8::Frame& rFrameFormat, const Point& rNdTopLeft);
void WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 886ea9dbc904..710e3bf6e86e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -310,7 +310,8 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, b
if (pXFillStyleItem && pXFillStyleItem->GetValue() == drawing::FillStyle_SOLID && !rSet.HasItem(RES_BACKGROUND))
{
// Construct an SvxBrushItem, as expected by the exporters.
- AttrOutput().OutputItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
+ std::shared_ptr<SvxBrushItem> aBrush(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
+ AttrOutput().OutputItem(*aBrush);
}
}
m_pISet = nullptr; // for double attributes
@@ -853,7 +854,8 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b
case drawing::FillStyle_SOLID:
{
// Construct an SvxBrushItem, as expected by the exporters.
- aSet.Put(getSvxBrushItemFromSourceSet(rFrameFormat.GetAttrSet(), RES_BACKGROUND));
+ std::shared_ptr<SvxBrushItem> aBrush(getSvxBrushItemFromSourceSet(rFrameFormat.GetAttrSet(), RES_BACKGROUND));
+ aSet.Put(*aBrush);
break;
}
default:
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 060fcd09c6cb..bef9cc9cd8a3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1487,7 +1487,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
if (const SfxItemSet *pSet = pNd->GetpSwAttrSet())
eState = pSet->GetItemState(RES_LR_SPACE, false);
if (eState != SfxItemState::SET && rReader.m_nCurrentColl < rReader.m_vColl.size())
- pItem = &(rReader.m_vColl[rReader.m_nCurrentColl].maWordLR);
+ pItem = rReader.m_vColl[rReader.m_nCurrentColl].maWordLR.get();
}
/*
@@ -1660,7 +1660,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
WW8_TBD const * pTyp = reinterpret_cast<WW8_TBD const *>(pData + 2*nDel + 2*nIns + 2); // Type Array
- SvxTabStopItem aAttr(0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP);
+ std::shared_ptr<SvxTabStopItem> aAttr(std::make_shared<SvxTabStopItem>(0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP));
const SwFormat * pSty = nullptr;
sal_uInt16 nTabBase;
@@ -1686,7 +1686,9 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
bFound = pSty->GetAttrSet().GetItemState(RES_PARATR_TABSTOP, false,
&pTabs) == SfxItemState::SET;
if( bFound )
- aAttr = *static_cast<const SvxTabStopItem*>(pTabs);
+ {
+ aAttr.reset(static_cast<SvxTabStopItem*>(pTabs->Clone()));
+ }
else
{
sal_uInt16 nOldTabBase = nTabBase;
@@ -1719,9 +1721,9 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
SvxTabStop aTabStop;
for (short i=0; i < nDel; ++i)
{
- sal_uInt16 nPos = aAttr.GetPos(SVBT16ToUInt16(pDel + i*2));
+ sal_uInt16 nPos = aAttr->GetPos(SVBT16ToUInt16(pDel + i*2));
if( nPos != SVX_TAB_NOTFOUND )
- aAttr.Remove( nPos );
+ aAttr->Remove( nPos );
}
for (short i=0; i < nIns; ++i)
@@ -1763,14 +1765,14 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
break;
}
- sal_uInt16 nPos2 = aAttr.GetPos( nPos );
+ sal_uInt16 nPos2 = aAttr->GetPos( nPos );
if (nPos2 != SVX_TAB_NOTFOUND)
- aAttr.Remove(nPos2); // Or else Insert() refuses
- aAttr.Insert(aTabStop);
+ aAttr->Remove(nPos2); // Or else Insert() refuses
+ aAttr->Insert(aTabStop);
}
if (nIns || nDel)
- NewAttr(aAttr);
+ NewAttr(*aAttr);
else
{
// Here we have a tab definition which inserts no extra tabs, or deletes
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 33b0a9349141..f7be682a8d1c 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -239,7 +239,7 @@ public:
sal_uInt16 m_n81Flags; // for bold, italic, ...
sal_uInt16 m_n81BiDiFlags; // for bold, italic, ...
- SvxLRSpaceItem maWordLR;
+ std::shared_ptr<SvxLRSpaceItem> maWordLR;
bool m_bValid; // empty of valid
bool m_bImported; // for recursive imports
bool m_bColl; // true-> pFormat is SwTextFormatColl
@@ -271,7 +271,7 @@ public:
mnWW8OutlineLevel( MAXLEVEL ),
m_n81Flags( 0 ),
m_n81BiDiFlags(0),
- maWordLR( RES_LR_SPACE ),
+ maWordLR(std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE)),
m_bValid(false),
m_bImported(false),
m_bColl(false),
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 829011373542..f28a076da3b1 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1757,8 +1757,7 @@ void SwWW8ImplReader::RegisterNumFormatOnStyle(sal_uInt16 nStyle)
if (rStyleInf.m_bValid && rStyleInf.m_pFormat)
{
//Save old pre-list modified indent, which are the word indent values
- rStyleInf.maWordLR =
- ItemGet<SvxLRSpaceItem>(*rStyleInf.m_pFormat, RES_LR_SPACE);
+ rStyleInf.maWordLR.reset(static_cast<SvxLRSpaceItem*>(ItemGet<SvxLRSpaceItem>(*rStyleInf.m_pFormat, RES_LR_SPACE).Clone()));
// Phase 2: refresh StyleDef after reading all Lists
SwNumRule* pNmRule = nullptr;
@@ -1991,19 +1990,19 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
pTextNode->SetAttr( aEmptyRule );
// create an empty SvxLRSpaceItem
- SvxLRSpaceItem aLR( RES_LR_SPACE );
+ std::shared_ptr<SvxLRSpaceItem> aLR(std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE));
// replace it with the one of the current node if it exist
const SfxPoolItem* pLR = GetFormatAttr(RES_LR_SPACE);
if( pLR )
- aLR = *static_cast<const SvxLRSpaceItem*>(pLR);
+ aLR.reset(static_cast<SvxLRSpaceItem*>(pLR->Clone()));
// reset/blank the left indent (and only the left)
- aLR.SetTextLeft(0);
- aLR.SetTextFirstLineOfst(0);
+ aLR->SetTextLeft(0);
+ aLR->SetTextFirstLineOfst(0);
// apply the modified SvxLRSpaceItem to the current paragraph
- pTextNode->SetAttr( aLR );
+ pTextNode->SetAttr( *aLR );
}
m_nLFOPosition = USHRT_MAX;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index f95859e553a5..bcb276246418 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4139,10 +4139,10 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
short nPara = SVBT16ToUInt16( pData );
- SvxLRSpaceItem aLR( RES_LR_SPACE );
+ std::shared_ptr<SvxLRSpaceItem> aLR(std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE));
const SfxPoolItem* pLR = GetFormatAttr(RES_LR_SPACE);
if( pLR )
- aLR = *static_cast<const SvxLRSpaceItem*>(pLR);
+ aLR.reset(static_cast<SvxLRSpaceItem*>(pLR->Clone()));
// Fix the regression issue: #i99822#: Discussion?
// Since the list level formatting doesn't apply into paragraph style
@@ -4159,10 +4159,10 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
const SwNumFormat* pFormat = pNumRule->GetNumFormat( nLvl );
if ( pFormat && pFormat->GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
- aLR.SetTextLeft( pFormat->GetIndentAt() );
- aLR.SetTextFirstLineOfst( static_cast<short>(pFormat->GetFirstLineIndent()) );
+ aLR->SetTextLeft( pFormat->GetIndentAt() );
+ aLR->SetTextFirstLineOfst( static_cast<short>(pFormat->GetFirstLineIndent()) );
// make paragraph have hard-set indent attributes
- pTextNode->SetAttr( aLR );
+ pTextNode->SetAttr( *aLR );
}
}
}
@@ -4202,7 +4202,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
case NS_sprm::v6::sprmPDxaLeft:
case NS_sprm::sprmPDxaLeft80:
case NS_sprm::sprmPDxaLeft:
- aLR.SetTextLeft( nPara );
+ aLR->SetTextLeft( nPara );
if (m_pCurrentColl && m_nCurrentColl < m_vColl.size())
{
m_vColl[m_nCurrentColl].m_bListReleventIndentSet = true;
@@ -4236,7 +4236,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
}
}
- aLR.SetTextFirstLineOfst(nPara);
+ aLR->SetTextFirstLineOfst(nPara);
if (!m_pCurrentColl)
{
@@ -4246,7 +4246,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
{
if (!lcl_HasExplicitLeft(m_xPlcxMan.get(), m_bVer67))
{
- aLR.SetTextLeft(pNumFormat->GetIndentAt());
+ aLR->SetTextLeft(pNumFormat->GetIndentAt());
// If have not explicit left, set number format list tab position is doc default tab
const SvxTabStopItem *pDefaultStopItem = m_rDoc.GetAttrPool().GetPoolDefaultItem(RES_PARATR_TABSTOP);
@@ -4266,13 +4266,13 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe
case NS_sprm::v6::sprmPDxaRight:
case NS_sprm::sprmPDxaRight80:
case NS_sprm::sprmPDxaRight:
- aLR.SetRight( nPara );
+ aLR->SetRight( nPara );
break;
default:
return;
}
- NewAttr( aLR, bFirstLinOfstSet, bLeftIndentSet ); // #i103711#, #i105414#
+ NewAttr( *aLR, bFirstLinOfstSet, bLeftIndentSet ); // #i103711#, #i105414#
}
// Sprm 20
@@ -4982,29 +4982,29 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8*, short nLen)
// otherwise it's not possible to turn of the style attribute hard.
const SvxBoxItem* pBox
= static_cast<const SvxBoxItem*>(GetFormatAttr( RES_BOX ));
- SvxBoxItem aBox(RES_BOX);
+ std::shared_ptr<SvxBoxItem> aBox(std::make_shared<SvxBoxItem>(RES_BOX));
if (pBox)
- aBox = *pBox;
+ aBox.reset(static_cast<SvxBoxItem*>(pBox->Clone()));
short aSizeArray[5]={0};
- SetBorder(aBox, aBrcs, &aSizeArray[0], nBorder);
+ SetBorder(*aBox, aBrcs, &aSizeArray[0], nBorder);
tools::Rectangle aInnerDist;
GetBorderDistance( aBrcs, aInnerDist );
if (nBorder & (1 << WW8_LEFT))
- aBox.SetDistance( static_cast<sal_uInt16>(aInnerDist.Left()), SvxBoxItemLine::LEFT );
+ aBox->SetDistance( static_cast<sal_uInt16>(aInnerDist.Left()), SvxBoxItemLine::LEFT );
if (nBorder & (1 << WW8_TOP))
- aBox.SetDistance( static_cast<sal_uInt16>(aInnerDist.Top()), SvxBoxItemLine::TOP );
+ aBox->SetDistance( static_cast<sal_uInt16>(aInnerDist.Top()), SvxBoxItemLine::TOP );
if (nBorder & (1 << WW8_RIGHT))
- aBox.SetDistance( static_cast<sal_uInt16>(aInnerDist.Right()), SvxBoxItemLine::RIGHT );
+ aBox->SetDistance( static_cast<sal_uInt16>(aInnerDist.Right()), SvxBoxItemLine::RIGHT );
if (nBorder & (1 << WW8_BOT))
- aBox.SetDistance( static_cast<sal_uInt16>(aInnerDist.Bottom()), SvxBoxItemLine::BOTTOM );
+ aBox->SetDistance( static_cast<sal_uInt16>(aInnerDist.Bottom()), SvxBoxItemLine::BOTTOM );
- NewAttr( aBox );
+ NewAttr( *aBox );
SvxShadowItem aS(RES_SHADOW);
if( SetShadow( aS, &aSizeArray[0], aBrcs[WW8_RIGHT] ) )
@@ -5031,8 +5031,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
= static_cast<const SvxBoxItem*>(GetFormatAttr( RES_CHRATR_BOX ));
if( pBox )
{
- SvxBoxItem aBoxItem(RES_CHRATR_BOX);
- aBoxItem = *pBox;
+ std::shared_ptr<SvxBoxItem> aBoxItem(static_cast<SvxBoxItem*>(pBox->Clone()));
WW8_BRCVer9 aBrc;
int nBrcVer = (nId == NS_sprm::sprmCBrc) ? 9 : (m_bVer67 ? 6 : 8);
@@ -5041,11 +5040,11 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
// Border style is none -> no border, no shadow
if( editeng::ConvertBorderStyleFromWord(aBrc.brcType()) != SvxBorderLineStyle::NONE )
{
- Set1Border(aBoxItem, aBrc, SvxBoxItemLine::TOP, 0, nullptr, true);
- Set1Border(aBoxItem, aBrc, SvxBoxItemLine::BOTTOM, 0, nullptr, true);
- Set1Border(aBoxItem, aBrc, SvxBoxItemLine::LEFT, 0, nullptr, true);
- Set1Border(aBoxItem, aBrc, SvxBoxItemLine::RIGHT, 0, nullptr, true);
- NewAttr( aBoxItem );
+ Set1Border(*aBoxItem, aBrc, SvxBoxItemLine::TOP, 0, nullptr, true);
+ Set1Border(*aBoxItem, aBrc, SvxBoxItemLine::BOTTOM, 0, nullptr, true);
+ Set1Border(*aBoxItem, aBrc, SvxBoxItemLine::LEFT, 0, nullptr, true);
+ Set1Border(*aBoxItem, aBrc, SvxBoxItemLine::RIGHT, 0, nullptr, true);
+ NewAttr( *aBoxItem );
short aSizeArray[WW8_RIGHT+1]={0}; aSizeArray[WW8_RIGHT] = 1;
SvxShadowItem aShadowItem(RES_CHRATR_SHADOW);