include/editeng/overflowingtxt.hxx | 3 +- svx/source/svdraw/svdotext.cxx | 9 +++++--- svx/source/svdraw/svdotextdecomposition.cxx | 4 ++- svx/source/svdraw/svdotxed.cxx | 29 +--------------------------- 4 files changed, 13 insertions(+), 32 deletions(-)
New commits: commit 8504099dfac88007268f77f649f4db8f0db381d9 Author: matteocam <matteo.campane...@gmail.com> Date: Fri Jun 12 09:41:14 2015 -0400 Save overflowing text _before_ cutting content Change-Id: I166ed763f9c7dc4db3bd447da3ba969522d4739a diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index abc01dd..748e980 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1656,6 +1656,8 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // If overflow occurs we have to cut the text at the right point if ( rOutliner.IsPageOverflow() ) { + // Save the overflowing text before changing the outliner's state + const_cast<SdrTextObj*>(this)->mpOverflowingText = rOutliner.GetOverflowingText(); impLeaveOnlyNonOverflowingText(&rOutliner); // XXX: Order transfer of stuff in next link here @@ -1666,7 +1668,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( rOutliner.SetUpdateMode(true); /* Actual transfer of text */ - const_cast<SdrTextObj*>(this)->mpOverflowingText = rOutliner.GetOverflowingText(); + if (GetNextLinkInChain()) impMoveChainedTextToNextLink(&rChainingOutl, GetNextLinkInChain()); commit 280553d9b10a23dc33c0edf84ce78153483ec84e Author: matteocam <matteo.campane...@gmail.com> Date: Fri Jun 12 09:22:37 2015 -0400 EndTextEdit now does nothing wrt chaining; primitives should do it Change-Id: I50ea0adb6804111c2d7a0eab8082f92ab82825b8 diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 4811606..3fcd600 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -277,33 +277,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) // to make the gray field background vanish again rOutl.UpdateFields(); - // FIXME(matteocam) - // TODO: move this to one level higher - if ( IsToBeChained() && GetNextLinkInChain() != this) // XXX: defensive check - { - // FIXME: matteocam - // for now doing the same as below - probably we don't need - // any more chain checks here but one single default behavior - sal_Int32 nParaAnz = rOutl.GetParagraphCount(); - // XXX: FRESHLY COMMENTED (5/6/15) // FIXME:matteocam - //pNewText = rOutl.CreateParaObject( 0, nParaAnz ); - - pNewText = impGetNonOverflowingParaObject(&rOutl); - - // set non overflow part of text to current box - - // XXX XXX XXX XXX: decomment next line and fix const conversion problem - //pNewText = rOutl.GetNonOverflowingText()->mpHeadParas; // empty text obj. if 1st para is overflowing - // set overflowing text for SdrChainedTextPrimitive2D - mpOverflowingText = rOutl.GetOverflowingText(); - // TODO: factor the lines of code above in a single function - } - else // standard case - { - sal_Int32 nParaAnz = rOutl.GetParagraphCount(); - pNewText = rOutl.CreateParaObject( 0, nParaAnz ); - } - + sal_Int32 nParaAnz = rOutl.GetParagraphCount(); + pNewText = rOutl.CreateParaObject( 0, nParaAnz ); // need to end edit mode early since SetOutlinerParaObject already // uses GetCurrentBoundRect() which needs to take the text into account commit 23df39b2b8fd907e485afb4063d6474985236d2c Author: matteocam <matteo.campane...@gmail.com> Date: Fri Jun 12 09:19:47 2015 -0400 Added debugging check in NonOverflowingText Change-Id: I83f52e2549850ac695be12c72534c8c0c3f426ea diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 98aa612..1546835 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -55,7 +55,8 @@ class NonOverflowingText { : mpHeadParas(pHeadParas), mPreOverflowingTxt(preOverflowingTxt) { - DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?!" ); + if (pHeadParas == NULL) // Redundant line for debugging + DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?!" ); } }; commit 75eb4d03846bbe9419c5a1254804cf6ae506f08c Author: matteocam <matteo.campane...@gmail.com> Date: Fri Jun 12 09:07:23 2015 -0400 Added a check on next link Change-Id: Idb50bb11f4a6fef4602853083a1b80a92b9555bc diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 4dbc2ea..cef2fff 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2041,13 +2041,16 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const SdrTextObj *pNextTextObj = NULL; if ( pPage && pPage->GetObjCount() > 1) { - sal_uInt32 nextIndex = (GetOrdNum()+1); - // FIXME + if (!GetName().startsWith("Chainable")) { fprintf(stderr, "[CHAINABLE?] %p is _not_ chainable\n", this); return NULL; } - pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex ) ); + + sal_uInt32 nextIndex = (GetOrdNum()+1); + + if (nextIndex < pPage->GetObjCount()) + pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex ) ); return pNextTextObj; } else { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits