Apache OpenOffice (AOO) Bugzilla – Issue 29943
Iteration through paragraphs inside a selection returns all subsequent paragraphs too
Last modified: 2013-02-24 21:08:01 UTC
One algorithm very commonly used in developing OOo components is iterating through paragraphs and portions of the selected text. In fact, it is the only way to get all occurences of text with e.g. some specific formatting, since searching for formatted text in OOo Writer is broken (see issue 10569). That's why I used this algorithm in almost all my projects, but beginning from 1.1.1 it is no longer possible, because iterating through paragraphs of the selection now gives an absolutely wrong results, i. e. not only selected (fully or partially) paragraphs are returned, but also all subsequent ones. However the worst thing is that this issue IMHO indicates that something is wrong in the way how api-related parts of the OOo code are currently developed. Really, on the on hand, it is clear that the developers actively work on some problems related with portions and text ranges in OOo Writer. That's why each new version has new bugs which never existed in previous releases (see for example issue 29942). On the other hand, all issues related with this topic are treated as not very important and retargeted to OOo Later (#24292, #24049, #23552 for example). But this makes developing new macros and Writer plug-ins simply impossible, since I don't know which bugs will occur in the next version and what part of my code written for previous releases will become useless for this reason. At least please don't target this issue to OOo Later: since it is a result of the very recent code changes, it should be fixed immediately.
Created attachment 15719 [details] A Basic macro showing how the iterating through paragraphs in a selection works in 1.1.1 and above.
SW->TL: the attached macro creates a CursorByRange, where the used range is the current selection ... now a ParagraphEnumeration is created. In OOo1.1.0 this enumeration contained only the selected paragraphs, but with OOo1.1.1 and still in the current milestone it returns all paragraphs starting with the selected one.
.
Fixed in CWS tleamisc. Files changed: - unoobj2.cxx new revision: 1.42.52.3 TL->QA: When checking this one please check it also within tables and with the new tables-in-tables. Thanks!
*** Issue 27733 has been marked as a duplicate of this issue. ***
OK in CWS tleamisc.
fixed in cws_tleamisc
works as expected in cws_tleamisc => verified
ok in src680_m52 => closed