diff options
Diffstat (limited to 'sw/source/core/text/porfld.cxx')
-rw-r--r-- | sw/source/core/text/porfld.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index c366401c9153..6110edc415fe 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -175,10 +175,18 @@ SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pP pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() ); pInf->SetIdx(TextFrameIndex(0)); } - else if (nIdx < TextFrameIndex(pOldText->getLength())) + else { - sal_Int32 const nFieldLen(pPor->GetFieldLen()); - aText = (*pOldText).replaceAt(sal_Int32(nIdx), nFieldLen, aText); + TextFrameIndex nEnd(pOldText->getLength()); + if (nIdx < nEnd) + { + sal_Int32 const nFieldLen(pPor->GetFieldLen()); + aText = (*pOldText).replaceAt(sal_Int32(nIdx), nFieldLen, aText); + } + else if (nIdx == nEnd) + aText = *pOldText + aText; + else + SAL_WARN("sw.core", "SwFieldSlot bad SwFieldPortion index."); } pInf->SetText( aText ); } @@ -1066,6 +1074,9 @@ void SwTextFrame::StopAnimation( const OutputDevice* pOut ) */ SwCombinedPortion::SwCombinedPortion( const OUString &rText ) : SwFieldPortion( rText ) + , m_aWidth{ static_cast<sal_uInt16>(0), + static_cast<sal_uInt16>(0), + static_cast<sal_uInt16>(0) } , m_nUpPos(0) , m_nLowPos(0) , m_nProportion(55) |