summaryrefslogtreecommitdiff
path: root/scripting/examples
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-10-22 12:52:59 +0000
committerRüdiger Timm <rt@openoffice.org>2004-10-22 12:52:59 +0000
commit4319114420c69d7789eaea329b354c86bf8ff642 (patch)
treecd0f6d8a2fa1eae083da7db07308522722f89805 /scripting/examples
parentd725f5e3e31647c9eb3b496e4a1240df7d899d63 (diff)
INTEGRATION: CWS scriptingf6 (1.2.40); FILE MERGED
2004/07/23 09:55:21 dfoster 1.2.40.1: #i30606# Add descriptions to code in examples.
Diffstat (limited to 'scripting/examples')
-rw-r--r--scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js b/scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js
index bf72759a20ef..a66d08a185c6 100644
--- a/scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js
+++ b/scripting/examples/javascript/ExportSheetsToHTML/exportsheetstohtml.js
@@ -16,13 +16,22 @@ importClass(Packages.com.sun.star.uno.Type);
importClass(java.lang.System);
+//get the document object from the scripting context
oDoc = XSCRIPTCONTEXT.getDocument();
+//get the XSpreadsheetDocument interface from the document
xSDoc = UnoRuntime.queryInterface(XSpreadsheetDocument, oDoc);
+//get the XModel interface from the document
xModel = UnoRuntime.queryInterface(XModel,oDoc);
+//get the XIndexAccess interface used to access each sheet
xSheetsIndexAccess = UnoRuntime.queryInterface(XIndexAccess, xSDoc.getSheets());
+//get the XStorable interface used to save the document
xStorable = UnoRuntime.queryInterface(XStorable,xSDoc);
+//get the XModifiable interface used to indicate if the document has been
+//changed
xModifiable = UnoRuntime.queryInterface(XModifiable,xSDoc);
+//set up an array of PropertyValue objects used to save each sheet in the
+//document
storeProps = new Array;//PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
@@ -47,8 +56,11 @@ for(var i=0;i<xSheetsIndexAccess.getCount();i++)
function setAllButOneHidden(xSheetsIndexAccess,vis) {
//System.err.println("count="+xSheetsIndexAccess.getCount());
+ //get an XPropertySet interface for the vis-th sheet
xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(vis));
+ //set the vis-th sheet to be visible
xPropSet.setPropertyValue("IsVisible", true);
+ // set all other sheets to be invisible
for(var i=0;i<xSheetsIndexAccess.getCount();i++)
{
xPropSet = AnyConverter.toObject( new Type(XPropertySet), xSheetsIndexAccess.getByIndex(i));