summaryrefslogtreecommitdiff
path: root/scripting/examples
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-10-22 12:53:14 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-10-22 12:53:14 +0000
commit97cc3a0533b9a95b7f609a5306e871013b27c634 (patch)
tree7d20b4ed4e8d542089e6b9aea717195e602235d8 /scripting/examples
parent71afdbeadc2b039e5d0e44beb4f58c9ef7f5895e (diff)
INTEGRATION: CWS scriptingf6 (1.2.30); FILE MERGED
2004/07/23 09:55:22 dfoster 1.2.30.1: #i30606# Add descriptions to code in examples.
Diffstat (limited to 'scripting/examples')
-rw-r--r--scripting/examples/javascript/HelloWorld/helloworld.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripting/examples/javascript/HelloWorld/helloworld.js b/scripting/examples/javascript/HelloWorld/helloworld.js
index 5fb8de33e2..aa170def23 100644
--- a/scripting/examples/javascript/HelloWorld/helloworld.js
+++ b/scripting/examples/javascript/HelloWorld/helloworld.js
@@ -4,8 +4,13 @@ importClass(Packages.com.sun.star.text.XTextDocument);
importClass(Packages.com.sun.star.text.XText);
importClass(Packages.com.sun.star.text.XTextRange);
+//get the document from the scripting context
oDoc = XSCRIPTCONTEXT.getDocument();
+//get the XTextDocument interface
xTextDoc = UnoRuntime.queryInterface(XTextDocument,oDoc);
+//get the XText interface
xText = xTextDoc.getText();
+//get an (empty) XTextRange interface at the end of the text
xTextRange = xText.getEnd();
+//set the text in the XTextRange
xTextRange.setString( "Hello World (in JavaScript)" );