Kaydet (Commit) ef71127f authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS dba24e_SRC680 (1.7.94); FILE MERGED

2007/12/19 12:28:44 oj 1.7.94.1: #i84339# handle refcount by releasing the objects as early as possible, gc is not alsways the best way to trust :-)
üst 31e0ac86
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: Finalizer.java,v $ * $RCSfile: Finalizer.java,v $
* *
* $Revision: 1.7 $ * $Revision: 1.8 $
* *
* last change: $Author: obo $ $Date: 2006-07-10 16:05:08 $ * last change: $Author: vg $ $Date: 2008-01-29 08:42:23 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -38,12 +38,13 @@ import com.sun.star.wizards.common.*; ...@@ -38,12 +38,13 @@ import com.sun.star.wizards.common.*;
import com.sun.star.awt.XRadioButton; import com.sun.star.awt.XRadioButton;
import com.sun.star.wizards.db.*; import com.sun.star.wizards.db.*;
import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
import com.sun.star.sdb.CommandType; import com.sun.star.sdb.CommandType;
import com.sun.star.uno.*; import com.sun.star.uno.*;
import com.sun.star.wizards.ui.*; import com.sun.star.wizards.ui.*;
public class Finalizer { public class Finalizer {
UnoDialog2 CurUnoDialog; QueryWizard CurUnoDialog;
String resQuery; String resQuery;
Object txtSummary; Object txtSummary;
Object txtTitle; Object txtTitle;
...@@ -52,7 +53,7 @@ public class Finalizer { ...@@ -52,7 +53,7 @@ public class Finalizer {
QuerySummary CurDBMetaData; QuerySummary CurDBMetaData;
public Finalizer(UnoDialog2 _CurUnoDialog, QuerySummary _CurDBMetaData) { public Finalizer(QueryWizard _CurUnoDialog, QuerySummary _CurDBMetaData) {
short curtabindex = (short) (100 * QueryWizard.SOSUMMARYPAGE); short curtabindex = (short) (100 * QueryWizard.SOSUMMARYPAGE);
String reslblQueryTitle; String reslblQueryTitle;
String resoptDisplayQuery; String resoptDisplayQuery;
...@@ -116,25 +117,29 @@ public class Finalizer { ...@@ -116,25 +117,29 @@ public class Finalizer {
return (String) Helper.getUnoPropertyValue(UnoDialog.getModel(txtTitle), "Text"); return (String) Helper.getUnoPropertyValue(UnoDialog.getModel(txtTitle), "Text");
} }
public void finish() { public XComponent[] finish() {
XComponent[] ret = null;
try { try {
CurDBMetaData.oSQLQueryComposer = new SQLQueryComposer(CurDBMetaData); CurDBMetaData.oSQLQueryComposer = new SQLQueryComposer(CurDBMetaData);
String queryname = getTitle(); String queryname = getTitle();
boolean bsuccess = CurDBMetaData.oSQLQueryComposer.setQueryCommand(queryname, CurUnoDialog.xWindow, true, true); boolean bsuccess = CurDBMetaData.oSQLQueryComposer.setQueryCommand(queryname, CurUnoDialog.xWindow, true, true);
if (bsuccess) { if (bsuccess) {
bsuccess = CurDBMetaData.createQuery(CurDBMetaData.oSQLQueryComposer, queryname); bsuccess = CurDBMetaData.createQuery(CurDBMetaData.oSQLQueryComposer, queryname);
if ( !bsuccess ) if ( bsuccess ){
return;
short igoon = AnyConverter.toShort(Helper.getUnoPropertyValue(UnoDialog.getModel(xRadioDisplayQuery), "State")); short igoon = AnyConverter.toShort(Helper.getUnoPropertyValue(UnoDialog.getModel(xRadioDisplayQuery), "State"));
if (igoon == (short) 1) if (igoon == (short) 1)
CurDBMetaData.switchtoDataViewmode(queryname, CommandType.QUERY); ret = CurDBMetaData.switchtoDataViewmode(queryname, CommandType.QUERY,CurUnoDialog.getCurFrame());
else else
CurDBMetaData.switchtoDesignmode(queryname, CommandType.QUERY); ret = CurDBMetaData.switchtoDesignmode(queryname, CommandType.QUERY,CurUnoDialog.getCurFrame());
CurUnoDialog.xDialog.endExecute(); CurUnoDialog.xDialog.endExecute();
} }
}
CurDBMetaData.oSQLQueryComposer = null;
CurDBMetaData = null;
CurUnoDialog = null;
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
e.printStackTrace(); e.printStackTrace();
} }
return ret;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment