summaryrefslogtreecommitdiffstats
path: root/wizards
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-01-29 07:42:07 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-01-29 07:42:07 +0000
commit31e0ac86e6e181f6781fa207a5f21cf110c26cf2 (patch)
treed39a8be60a3bf5a2cdf2db55a2e1dfaf83dfcb99 /wizards
parentINTEGRATION: CWS dba24e_SRC680 (1.14.38); FILE MERGED (diff)
downloadcore-31e0ac86e6e181f6781fa207a5f21cf110c26cf2.tar.gz
core-31e0ac86e6e181f6781fa207a5f21cf110c26cf2.zip
INTEGRATION: CWS dba24e_SRC680 (1.4.120); FILE MERGED
2007/12/19 12:28:44 oj 1.4.120.1: #i84339# handle refcount by releasing the objects as early as possible, gc is not alsways the best way to trust :-)
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/query/CallQueryWizard.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/wizards/com/sun/star/wizards/query/CallQueryWizard.java b/wizards/com/sun/star/wizards/query/CallQueryWizard.java
index edf540011cc8..ab40b8e7a157 100644
--- a/wizards/com/sun/star/wizards/query/CallQueryWizard.java
+++ b/wizards/com/sun/star/wizards/query/CallQueryWizard.java
@@ -4,9 +4,9 @@
*
* $RCSfile: CallQueryWizard.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: vg $ $Date: 2006-04-07 12:48:29 $
+ * last change: $Author: vg $ $Date: 2008-01-29 08:42:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -34,7 +34,9 @@
************************************************************************/
package com.sun.star.wizards.query;
+import com.sun.star.beans.PropertyAttribute;
import com.sun.star.beans.PropertyValue;
+import com.sun.star.lang.XComponent;
import com.sun.star.uno.Type;
import com.sun.star.wizards.common.Properties;
@@ -81,27 +83,43 @@ public class CallQueryWizard {
/** This class implements the component. At least the interfaces XServiceInfo,
* XTypeProvider, and XInitialization should be provided by the service.
*/
- public static class QueryWizardImplementation implements com.sun.star.lang.XInitialization, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XTypeProvider, com.sun.star.task.XJobExecutor {
+ public static class QueryWizardImplementation extends com.sun.star.lib.uno.helper.PropertySet implements com.sun.star.lang.XInitialization, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XTypeProvider, com.sun.star.task.XJobExecutor {
PropertyValue[] databaseproperties;
+ public XComponent Document = null;
+ public XComponent DocumentDefinition = null;
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xmultiservicefactoryInitialization A special service factory
* could be introduced while initializing.
*/
public QueryWizardImplementation(com.sun.star.lang.XMultiServiceFactory xmultiservicefactoryInitialization) {
+ super();
xmultiservicefactory = xmultiservicefactoryInitialization;
+ registerProperty("Document", (short)(PropertyAttribute.READONLY|PropertyAttribute.MAYBEVOID));
+ registerProperty("DocumentDefinition", (short)(PropertyAttribute.READONLY|PropertyAttribute.MAYBEVOID));
}
public void trigger(String sEvent) {
try {
- com.sun.star.frame.XComponentLoader xcomponentloader = (com.sun.star.frame.XComponentLoader) com.sun.star.uno.UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class, xmultiservicefactory.createInstance("com.sun.star.frame.Desktop"));
if (sEvent.compareTo("start") == 0) {
QueryWizard CurQueryWizard = new QueryWizard(xmultiservicefactory);
- CurQueryWizard.startQueryWizard(xmultiservicefactory, databaseproperties);
+ XComponent[] obj = CurQueryWizard.startQueryWizard(xmultiservicefactory, databaseproperties);
+ if ( obj != null ){
+ DocumentDefinition = obj[1];
+ Document = obj[0];
+ }
+ CurQueryWizard = null;
+ }
+ else if (sEvent.compareTo("end") == 0) {
+ DocumentDefinition = null;
+ Document = null;
+ databaseproperties = null;
}
} catch (Exception exception) {
System.err.println(exception);
}
+ System.gc();
}
/** The service name, that must be used to get an instance of this service.