diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-11-27 08:05:31 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-11-27 08:05:31 +0000 |
commit | 2c54015705b8aa101f8e08f622faa2392529afcf (patch) | |
tree | d89494e5e8180933800ddbe310f5db5a5efa9e06 /wizards/com/sun/star/wizards/document/OfficeDocument.java | |
parent | ef8079b2d45311e6f45940f9c0c0543c842b6cd3 (diff) |
INTEGRATION: CWS qwizardsbf1 (1.3.2); FILE MERGED
2004/11/02 17:31:14 tv 1.3.2.5: removed merge problems between dbwizard1 and qwizardsbf1
2004/11/02 14:52:08 tv 1.3.2.4: RESYNC: (1.3-1.4); FILE MERGED
2004/10/25 13:23:15 tv 1.3.2.3: #i35890# updated date in letter wizard and fax wizard preview
2004/10/13 12:05:59 tv 1.3.2.2: small bugfixes
2004/09/24 14:06:59 tv 1.3.2.1: change in Frame handling: disconnect preview frame from desktop, implement own terminateListener, close preview via XCloseable
Diffstat (limited to 'wizards/com/sun/star/wizards/document/OfficeDocument.java')
-rw-r--r-- | wizards/com/sun/star/wizards/document/OfficeDocument.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.java b/wizards/com/sun/star/wizards/document/OfficeDocument.java index e7c1e9cc241e..aa829b5855a5 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.java +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeDocument.java,v $ * -* $Revision: 1.4 $ +* $Revision: 1.5 $ * -* last change: $Author: pjunck $ $Date: 2004-10-27 13:32:18 $ +* last change: $Author: kz $ $Date: 2004-11-27 09:05:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -60,7 +60,6 @@ package com.sun.star.wizards.document; -import com.sun.star.lang.IndexOutOfBoundsException; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.container.XNameAccess; @@ -84,8 +83,11 @@ import com.sun.star.lang.XServiceInfo; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XDesktop; import com.sun.star.frame.XFrame; +import com.sun.star.frame.XFrames; +import com.sun.star.frame.XFramesSupplier; import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; +import com.sun.star.frame.XTerminateListener; import com.sun.star.util.XCloseable; import com.sun.star.util.XModifiable; @@ -170,9 +172,16 @@ public class OfficeDocument { return oDocument; } - public static XFrame createNewFrame(XMultiServiceFactory xMSF) { + public static XFrame createNewFrame(XMultiServiceFactory xMSF, XTerminateListener listener) { XFrame xF = (XFrame) UnoRuntime.queryInterface(XFrame.class, Desktop.getDesktop(xMSF)); XFrame xFrame = xF.findFrame("_blank", 0); + if (listener != null) { + XFramesSupplier xFS = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, xF); + XFrames xFF = xFS.getFrames(); + xFF.remove(xFrame); + XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xF); + xDesktop.addTerminateListener(listener); + } return xFrame; } @@ -216,6 +225,7 @@ public class OfficeDocument { xStoreable.storeAsURL(StorePath, oStoreProperties); return true; } catch (Exception exception) { + exception.printStackTrace(System.out); //TODO make sure that the peer of the dialog is used when available showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgSavingImpossible); |