1*b31e36b3SAndrew Rist// *************************************************************
2*b31e36b3SAndrew Rist//
3*b31e36b3SAndrew Rist//  Licensed to the Apache Software Foundation (ASF) under one
4*b31e36b3SAndrew Rist//  or more contributor license agreements.  See the NOTICE file
5*b31e36b3SAndrew Rist//  distributed with this work for additional information
6*b31e36b3SAndrew Rist//  regarding copyright ownership.  The ASF licenses this file
7*b31e36b3SAndrew Rist//  to you under the Apache License, Version 2.0 (the
8*b31e36b3SAndrew Rist//  "License"); you may not use this file except in compliance
9*b31e36b3SAndrew Rist//  with the License.  You may obtain a copy of the License at
10*b31e36b3SAndrew Rist//
11*b31e36b3SAndrew Rist//    http://www.apache.org/licenses/LICENSE-2.0
12*b31e36b3SAndrew Rist//
13*b31e36b3SAndrew Rist//  Unless required by applicable law or agreed to in writing,
14*b31e36b3SAndrew Rist//  software distributed under the License is distributed on an
15*b31e36b3SAndrew Rist//  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b31e36b3SAndrew Rist//  KIND, either express or implied.  See the License for the
17*b31e36b3SAndrew Rist//  specific language governing permissions and limitations
18*b31e36b3SAndrew Rist//  under the License.
19*b31e36b3SAndrew Rist//
20*b31e36b3SAndrew Rist// *************************************************************
21cdf0e10cSrcweir// If using XComponentContext need to uncomment import directive below:
22cdf0e10cSrcweir// import com.sun.star.uno.XComponentContext;
23cdf0e10cSrcweir
24cdf0e10cSrcweir// If using XDesktop need to uncomment import directive below:
25cdf0e10cSrcweir// import com.sun.star.frame.XDesktop;
26cdf0e10cSrcweir
27cdf0e10cSrcweir// If using XComponent need to uncomment import directive below:
28cdf0e10cSrcweir// import com.sun.star.frame.XModel;
29cdf0e10cSrcweir
30cdf0e10cSrcweirimport drafts.com.sun.star.script.framework.runtime.XScriptContext;
31cdf0e10cSrcweir
32cdf0e10cSrcweir/* Use the XScriptContext variable "context" to access the document for
33cdf0e10cSrcweir   which this script was invoked. This variable will be initialised
34cdf0e10cSrcweir   automatically by the Scripting Framework when the script is invoked.
35cdf0e10cSrcweir
36cdf0e10cSrcweir   Methods available are:
37cdf0e10cSrcweir
38cdf0e10cSrcweir        context.getDocument() returns XModel
39cdf0e10cSrcweir        context.getDesktop() returns XDesktop
40cdf0e10cSrcweir        context.getComponentContext() returns XComponentContext
41cdf0e10cSrcweir*/
42cdf0e10cSrcweir
43cdf0e10cSrcweir// Uncomment to get the current document model
44cdf0e10cSrcweir// xmodel = context.getDocument();
45