svx/source/svdraw/svdotextdecomposition.cxx | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
New commits: commit d50fd94d02ab9dc97619e788c8607ebfa3482c45 Author: matteocam <matteo.campane...@gmail.com> Date: Thu Jun 18 16:13:37 2015 -0400 Implements overwriting behavior in SdrTextObj for underflow. Bugged. Change-Id: I20e8d7e7343621f652603ce76d0d7ae92a6e6483 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 009bb4a..7fb4dc6 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -796,8 +796,33 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin if (mpOverflowingText == NULL) return NULL; - // XXX: Not sure if necessary - //pOutliner->Clear(); + // XXX: Put following code in a separate method (possibly in another class) + if ( GetTextChain()->GetOverwriteOnOverflow(pNextTextObj) ) + { + // We only make three blocks of paragraphs and ignore the rest + + // reset behavior + GetTextChain()->SetOverwriteOnOverflow(pNextTextObj, false); + + if (mpOverflowingText->HasOtherParas()) { + // Make first paragraph + impSetOutlinerToEmptyTxt(pOutliner); + Paragraph *pFstPara = pOutliner->GetParagraph(0); + pOutliner->SetText(mpOverflowingText->GetHeadingLines(), pFstPara); + + // Add middle paragraphs + if (mpOverflowingText->mpMidParas) + pOutliner->AddText(*mpOverflowingText->mpMidParas); + + pOutliner->Insert(mpOverflowingText->GetEndingLines()); + } else { + impSetOutlinerToEmptyTxt(pOutliner); + Paragraph *pFstPara = pOutliner->GetParagraph(0); + pOutliner->SetText(mpOverflowingText->GetEndingLines(), pFstPara); + } + + return pOutliner->CreateParaObject(); + } OutlinerParaObject *pCurTxt = pNextTextObj->GetOutlinerParaObject(); pOutliner->SetText(*pCurTxt); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits