Issue 65247 - Writer creates a bookmark SwXTextPosition*** when removing a paragraph before a TextTable
Summary: Writer creates a bookmark SwXTextPosition*** when removing a paragraph before...
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-10 10:24 UTC by clutz
Modified: 2013-02-24 21:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Bugdoc with macro that runs with SO (8.83 KB, application/octet-stream)
2006-05-22 15:12 UTC, thomas.lange
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description clutz 2006-05-10 10:24:40 UTC
Assume the following text-content:

"This is the first paragraph<bookmark name="test"><par_break>
<TextTable>
This is the second paragraph</bookmark><par_break>"

where <bookmark name="test">...</bookmarks> is a bookmark named "test" that has
been inserted into the text using Insert->Bookmark (and markes the included
content), <par_break> is a new-paragraph-charakter (shown with view->nonprinting
Charakters) and <TextTable> is a simple TextTable inserted with Table->insert.

The following basic-code deletes the first paragraph in which the bookmark
"test" starts:

Sub removeFirstPar
	mytext = ThisComponent.Text
	bookmark = ThisComponent.getBookmarks().getByName("test")
	range = bookmark.getAnchor()
	parEnum = range.createEnumeration()
	if(parEnum.hasMoreElements()) then
	  par = parEnum.nextElement()
	  mytext.removeTextContent(par)	
	endif
End Sub

After running the code, the first paragraph gets removed (OK), but there is a
new Bookmark "SwXTextPosition***" (*** is a generated number) created, which I
didn't expect (BUG!).

The mistake (only) occurs in the case of the combination of a TextParagraph
followed by a TextTable surrounded by a Bookmarks that marks both elements. So
the missbehaviour doesn't occur when running the macro on the following
text-content-example:

"This is the first paragraph<bookmark name="test"><par_break>
This is the second paragraph<par_break>
And this is the third paragraph</bookmark><par_break>"

What I really want to do is to delete an empty paragraph before a TextTable,
where the positions of the Paragraph and the Table are provided by a bookmark.
Comment 1 stephan.wunderlich 2006-05-11 09:56:43 UTC
sw->tl: when the texttable is between the two paragraphs the mentioned
additional bookmark appears. When there is no table in between it seems to work.
But when I press "CTRL-Z" to redo the change in that case I also get the
additional bookmark.
Comment 2 thomas.lange 2006-05-19 10:33:45 UTC
.
Comment 3 thomas.lange 2006-05-22 15:12:21 UTC
Created attachment 36657 [details]
Bugdoc with macro that runs with SO
Comment 4 thomas.lange 2006-05-22 15:12:54 UTC
TL->AMA: Please take over. Thanks!
Comment 5 andreas.martens 2007-12-07 14:47:25 UTC
Fixed in CWS sw8u10bf03
docbm.cxx
docedt.cxx
Comment 6 andreas.martens 2007-12-14 12:14:47 UTC
Ready for QA
Comment 7 michael.ruess 2008-01-04 14:24:42 UTC
Verified fix in CWs sw8u10bf03.
Comment 8 michael.ruess 2008-07-07 16:33:09 UTC
Checked in DEV300m22.