Hi,

I have got a simple collapsed TextCursor and I would like to delete the next
charakter in a programmatic way without using the dispatch-framework(!). The
function should behave exakt like pressing the "DEL"-Key in a
writer-document. To do that, I tried the following basic code:

REM the cursor is already present
cursor.goRight(1, false)
cursor.goLeft(1, true)
cursor.setString("")

now assume the following text content:

"here is some text<CURSOR_POS><PAR_BREAK>
and this is the next text"

where <CURSOR_POS> is the position of my collapsed TextCursor and
<PAR_BREAK> is a new-paragraph-charakter (shown with view->nonprinting
Charakters).
Now running the above code produces a joined version of both paragraphs
"here is some textand this is the next text", and this is what I want!

But there is one special case in which the above code behaves different from
pressing the DEL-key:

assume the following content:

"here is some text<CURSOR_POS><PAR_BREAK>
<TEXT_TABLE>
<PAR_BREAK>"

where <TEXT_TABLE> is a text-Table inserted directly after the first
paragraph. Pressing the del-key at the <CURSOR_POS> would ignore the
deletion as a texparagraph and a texttable cannot be joined. Wheras running
the above code, deletes the table and thats what I don't want to get.

Any Ideas how to avoid the removal of the texttable (without using the
dispatch-framework!) are welcome

best regards,
Christoph

Reply via email to