<div dir="ltr"><div>I have an issue with my current chaining code.</div>The current chaining mechanism seems to be working:<div>once out of edit mode, when a page overflow occurs, the first paragraph that causes it and all the next ones are moved in the next link in the chain .</div>

<div>The problem arises when the first paragraph is the one that overflows already.</div><div>Instead of disappearing from the first text box and appearing into the the second one, it rather simply disappears from the first.</div>

<div><br></div><div>I have an hypothesis about what goes wrong.</div><div>The following code describes what happens when we get out of edit mode:</div><div><br></div><div>// the following is pseudo code</div><div>SdrTextObj::EndTextEdit(...) {</div>

<div>[...]</div><div>  // ignores overflowing text</div><div>  newText = Non_Overflowing_Paragraphs() // !! It is NULL if all text overflows</div><div>  // saves overflowing text for later use from other SdrTextObj-s in the chain</div>

<div>  this->overflowingText = Overflowing_Paragraphs()</div><div><br></div><div>  // set truncated text in current SdrTextObj</div><div>  this->SetCurrentText(newText) // this method is SetOutlinerParaObject in the original code</div>

<div><br></div><div>[...]</div><div>}</div><div><br></div><div>The code above truncates the text in the first box.</div><div>The text in the second paragraph is restored by creating an appropriate SdrChainedTextPrimitive object and its create2DDecomposition method.</div>

<div>It seems that such a method is never called when all text is overflowing, i.e. when newText above is NULL.</div><div>The two are plausibly one consequence of the other.</div><div><br></div><div>An ideal solution would be to replace that NULL pointer with a dummy OutlinerParaObject or something like that.<br>

Any hint on how to do this?</div><div><br></div><div>In case anyone wanted to have a look:</div><div><a href="http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/svdraw/svdotxed.cxx?h=feature/gsoc14-draw-chained-text-boxes#n252">http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/svdraw/svdotxed.cxx?h=feature/gsoc14-draw-chained-text-boxes#n252</a><br>

</div><div><br></div><div><a href="http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx?h=feature/gsoc14-draw-chained-text-boxes#n488">http://cgit.freedesktop.org/libreoffice/core/tree/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx?h=feature/gsoc14-draw-chained-text-boxes#n488</a><br>

</div><div><br></div><div>Cheers,</div><div>Matteo</div></div>