Issue 114520

Summary: API: field at the beginning of a paragraph is "merged" with following word (if any)
Product: Writer Reporter: olivier_chenot <olivier.chenot>
Component: programmingAssignee: AOO issues mailing list <issues>
Status: REOPENED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: elish, issues
Version: OOO320m12Keywords: needmoreinfo
Target Milestone: ---   
Hardware: Unknown   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Bug sample
none
field at start of paragraph is merged with following word none

Description olivier_chenot 2010-09-15 11:05:29 UTC
gotoEndOfWord does not see mailing field if not set at beginning of line.
Comment 1 olivier_chenot 2010-09-15 11:06:11 UTC
Created attachment 71704 [details]
Bug sample
Comment 2 olivier_chenot 2010-09-15 11:12:04 UTC
sample code is as follows :

oText = oDocument.getText
oCursor = oText.createTextCursorByRange(oText.getStart)
' document elements loop
do
   ' current word selection 
   oResult = oCursor.gotoEndOfWord(True)
	   
   ' word value 
   MsgBox "Word value [" + n + "] : " + oCursor.String

   ' next step
   n = n + 1
   Proceed = oCursor.gotoNextWord (false)
	   
Loop While Proceed					

If you have a look in attached document, see macro in Macro:module1:main macro,
 file containing mailing fields is GotoEndofWord Sample.odt
Comment 3 eric.savary 2010-09-15 11:16:14 UTC
Reassigned to JSK
Comment 4 hans_werner67 2011-03-28 11:59:10 UTC
Assign to new default-assignee
Comment 5 eric.savary 2011-04-11 07:21:54 UTC
Reassigned to TBO.
Comment 6 Edwin Sharp 2014-03-13 08:24:41 UTC
"BASIC runtime error.
Object variable not set."
@ oDocument = oDesktop.LoadComponentFromURL("D:\01 Sauvegarde\Work\Pvbn\Issue Sample\GotoEndofWord Sample.odt","_blank",0,NoArgs())
?
AOO410m14(Build:9760)  -  Rev. 1573601
2014-03-03 17:47:48 (Mo, 03 Mrz 2014)
Win 7
Comment 7 Edwin Sharp 2014-03-26 08:43:16 UTC
No info from author.
Comment 8 mroe 2014-03-26 10:35:54 UTC
Created attachment 82985 [details]
field at start of paragraph is merged with following word
Comment 9 mroe 2014-03-26 10:36:40 UTC
Interesting in API programming I have looked for the meaning of this bug.
I created a new example doc by using user fields so it is to see that the described behaviour is not limited to mail merge fields.

There is a simple macro inside the doc like the original macro, which iterates over the words of the text in the document and display it between ">|" and "|<".

The results for the included fields are:
If a field is located at the beginning of a paragraph it will be "merged" with the following word. Otherwise fields are not treated as words.

In view of this result the original description was directed wrong because there was a lonely field in one paragraph. So the reporter meant it was right treated as word.

That's why I change the topic.
Comment 10 Marcus 2017-05-20 10:45:33 UTC
Reset the assignee to the default "issues@openoffice.apache.org".