[GSoC] Chaining overflowing text between boxes does not work when all text overflows

Matteo Campanelli matteo.campanelli at gmail.com
Fri Aug 8 09:18:13 PDT 2014


I have an issue with my current chaining code.
The current chaining mechanism seems to be working:
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 .
The problem arises when the first paragraph is the one that overflows
already.
Instead of disappearing from the first text box and appearing into the the
second one, it rather simply disappears from the first.

I have an hypothesis about what goes wrong.
The following code describes what happens when we get out of edit mode:

// the following is pseudo code
SdrTextObj::EndTextEdit(...) {
[...]
  // ignores overflowing text
  newText = Non_Overflowing_Paragraphs() // !! It is NULL if all text
overflows
  // saves overflowing text for later use from other SdrTextObj-s in the
chain
  this->overflowingText = Overflowing_Paragraphs()

  // set truncated text in current SdrTextObj
  this->SetCurrentText(newText) // this method is SetOutlinerParaObject in
the original code

[...]
}

The code above truncates the text in the first box.
The text in the second paragraph is restored by creating an appropriate
SdrChainedTextPrimitive object and its create2DDecomposition method.
It seems that such a method is never called when all text is overflowing,
i.e. when newText above is NULL.
The two are plausibly one consequence of the other.

An ideal solution would be to replace that NULL pointer with a dummy
OutlinerParaObject or something like that.
Any hint on how to do this?

In case anyone wanted to have a look:
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/sdr/primitive2d/sdrtextprimitive2d.cxx?h=feature/gsoc14-draw-chained-text-boxes#n488

Cheers,
Matteo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140808/ad1ed6e2/attachment.html>


More information about the LibreOffice mailing list