Apache OpenOffice (AOO) Bugzilla – Issue 68511
TextCursor includes paragraph numbering with length "0" for numbering
Last modified: 2013-02-24 21:08:31 UTC
It seems that there's something wrong with text cursors at the begin of a numbered paragraph. Follow a few tests: 1) select the first word of a numbered paragraph and run this code: sub test1 oSel = thisComponent.getCurrentSelection() print oSel(0).getString() ' print numbers and word end sub 2) with the view_cursor after the 1st character of the 1st word in a numbered paragraph, run this code: sub test2 oSel = thisComponent.getCurrentSelection() txtCur = oSel(0).getText().createTextCursorByRange(oSel(0)) txtCur.goLeft(1,True) print txtCur.getString() ' print numbers AND char end sub 3) with the view_cursor before the numbering: sub test3 oSel = thisComponent.getCurrentSelection() txtCur = oSel(0).getText().createTextCursorByRange(oSel(0)) txtCur.goRight(1,True) print txtCur.getString() ' print numbering AND 1st char of 1st word end sub
jsc -> tl: writer API issue
.
@noelson: Please contribute a sample document containing the macros! Please explain what behaviour you expected (and why aou did) and what unexpected observations you saw. Please contribute a more meaningful Summary!
Created attachment 42469 [details] doc for testing purpose
I checked with "2.0.2 German version WIN XP: [680m5(Build9011)]" and can confirm all effects listed in document "issue_68511.odt". I can't decide whether that is a bug (indeed it might be unexpected that the numbering will be included) or a feature: _If you want to move the cursor position, it should not matter how long the numbering is (100 or 99 with 3 or 2 digits).
You wrote : ".. I can't decide whether that is a bug .." For me, it's definitively a bug : I can't get properly the text content of a paragraph without the numbering sticked to the first word. With the Java API, all kind of access to a numbered paragraph I tried provide with this trouble : with a text range or a text cursor, enumeration paragraph by paragraph, sub-enumeration of the paragraph content, ... See discussion here : http://www.oooforum.org/forum/viewtopic.phtml?t=54466 The workaround I found is to add a space (or something else) before the paragraph text, get the text after this added space (properly provided without the numbering), and then remove the added space to restore the original text.
as per desc6 I am confirming described behavior.
No more issues accepted for OOo 2.4 unless there are serious problems.