diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-08 14:49:12 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-08 14:49:12 +0000 |
commit | 8a26a17a944b852333ec79c27cb77dfdff55855d (patch) | |
tree | 4c872567a2ff83af90c2c87913e28b5a6eb2b366 /wizards | |
parent | 722d66eda9200c6db2b12c7b8324811084540535 (diff) |
INTEGRATION: CWS toolkit01 (1.3.56); FILE MERGED
2005/02/28 12:28:40 bc 1.3.56.1: #i37478# repainting problems in Webwizard and ReportWizard addressed
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/web/TOCPreview.java | 59 |
1 files changed, 13 insertions, 46 deletions
diff --git a/wizards/com/sun/star/wizards/web/TOCPreview.java b/wizards/com/sun/star/wizards/web/TOCPreview.java index d703b01ac52b..38ebfe6ff72e 100644 --- a/wizards/com/sun/star/wizards/web/TOCPreview.java +++ b/wizards/com/sun/star/wizards/web/TOCPreview.java @@ -2,9 +2,9 @@ * * $RCSfile: TOCPreview.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2004-09-08 14:15:55 $ + * last change: $Author: vg $ $Date: 2005-03-08 15:49:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,13 +66,17 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.frame.FrameSearchFlag; import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.XFrame; +import com.sun.star.frame.XTerminateListener; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.URL; import com.sun.star.util.XURLTransformer; import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.common.Properties; import com.sun.star.wizards.common.UCB; +import com.sun.star.wizards.document.OfficeDocument; import com.sun.star.wizards.ui.event.Task; import com.sun.star.wizards.web.data.CGLayout; import com.sun.star.wizards.web.data.CGSettings; @@ -101,6 +105,7 @@ public class TOCPreview { private XDispatch xDispatch; private PropertyValue[] loadArgs; private UCB ucb; + private XFrame xFrame; /** * @param xmsf_ @@ -109,17 +114,17 @@ public class TOCPreview { * @param tempDir_ destination * @throws Exception */ - public TOCPreview(XMultiServiceFactory xmsf_, CGSettings settings, WebWizardDialogResources res, String tempDir_) + public TOCPreview(XMultiServiceFactory xmsf_, CGSettings settings, WebWizardDialogResources res, String tempDir_, XFrame _xFrame) throws Exception { + xFrame = _xFrame; xmsf = xmsf_; resources = res; fileAccess = new FileAccess(xmsf); tempDir = tempDir_; - loadArgs = loadArgs( - FileAccess.connectURLs(tempDir,"/index.html") ); - - prepare(); + loadArgs = loadArgs( FileAccess.connectURLs(tempDir,"/index.html") ); + openHyperlink = Desktop.getDispatchURL(xmsf, ".uno:OpenHyperlink"); + xDispatch = Desktop.getDispatcher(xmsf, xFrame, "_top", openHyperlink); ucb = new UCB(xmsf); Process.copyStaticImages(ucb ,settings,tempDir); @@ -139,52 +144,14 @@ public class TOCPreview { Task task = new Task("","",10000); Process.generate(xmsf, layout, doc, fileAccess, tempDir, task); Process.copyLayoutFiles(ucb,fileAccess,settings,layout,tempDir); - xDispatch.dispatch(openHyperlink, loadArgs); - } - - /** - * copies "static" files to the temporary directory. - * The "static" files are images (and other files ?) - * which do not change when the layout/style are changed, - * and can therefore be copies once per session. - * @throws Exception - */ - private void prepare() throws Exception { - Object frame = Desktop.getDesktop(xmsf).getCurrentFrame(); - - XDispatchProvider dispatchProvider = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class,frame); - - XURLTransformer xParser = null; - xParser=(XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - xmsf.createInstance("com.sun.star.util.URLTransformer")); - openHyperlink = dispURL(xParser); - - xDispatch = dispatchProvider.queryDispatch(openHyperlink, - "_top", FrameSearchFlag.ALL); - + xDispatch.dispatch(openHyperlink, loadArgs); //Dispatch.dispatch(openHyperlink, loadArgs); } - /** - * dispatch URL - * @param xTrans - * @return - */ - private URL dispURL(XURLTransformer xTrans) { - URL[] aParseURL = new URL[1]; - aParseURL[0] = new URL(); - aParseURL[0].Complete = ".uno:OpenHyperlink"; - xTrans.parseStrict(aParseURL); - return aParseURL[0]; - } private PropertyValue[] loadArgs(String url) { - //System.out.println(url); PropertyValue pv = new PropertyValue(); pv.Name = "URL"; pv.Value = url; return new PropertyValue[] {pv}; } - } |