summaryrefslogtreecommitdiff
path: root/scripting/examples
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2006-03-22 09:45:11 +0000
committerOliver Bolte <obo@openoffice.org>2006-03-22 09:45:11 +0000
commit8879a49af8dcf2abcc5b15d25008e76b06c4cb7e (patch)
treeee7e2e76e22b9a8833486e39ed39624447d41988 /scripting/examples
parentf6c464dbc0ed79239ef1982876e91ed194969b83 (diff)
INTEGRATION: CWS pyunofixes2 (1.2.34); FILE MERGED
2005/11/01 13:19:11 jbu 1.2.34.1: #i44632# text is now append to end of document as the other HelloWorld examples do (contributed by bmarcelly)
Diffstat (limited to 'scripting/examples')
-rw-r--r--scripting/examples/python/HelloWorld.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripting/examples/python/HelloWorld.py b/scripting/examples/python/HelloWorld.py
index cc634c265b..7f5b45c8cd 100644
--- a/scripting/examples/python/HelloWorld.py
+++ b/scripting/examples/python/HelloWorld.py
@@ -6,9 +6,8 @@ def HelloWorldPython( ):
model = XSCRIPTCONTEXT.getDocument()
#get the XText interface
text = model.Text
-#create an XTextCursor
- cursor = text.createTextCursor()
-#and insert the string
- text.insertString( cursor, "Hello World (in Python)", 0 )
+#create an XTextRange at the end of the document
+ tRange = text.End
+#and set the string
+ tRange.String = "Hello World (in Python)"
return None
-