summaryrefslogtreecommitdiffstats
path: root/wizards
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-01-29 07:41:15 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-01-29 07:41:15 +0000
commitb98bea8c91292aa72d7df0468318e3325b3319af (patch)
tree6194e4e2ab2b18f51eed87a91066e38ae1b8d0ab /wizards
parentINTEGRATION: CWS dba24e_SRC680 (1.17.62); FILE MERGED (diff)
downloadcore-b98bea8c91292aa72d7df0468318e3325b3319af.tar.gz
core-b98bea8c91292aa72d7df0468318e3325b3319af.zip
INTEGRATION: CWS dba24e_SRC680 (1.10.62); FILE MERGED
2007/12/19 12:28:44 oj 1.10.62.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/db/QueryMetaData.java49
1 files changed, 22 insertions, 27 deletions
diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java
index db732b3c2a7c..5066cf47e7e7 100644
--- a/wizards/com/sun/star/wizards/db/QueryMetaData.java
+++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java
@@ -4,9 +4,9 @@
*
* $RCSfile: QueryMetaData.java,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: rt $ $Date: 2006-12-01 16:30:02 $
+ * last change: $Author: vg $ $Date: 2008-01-29 08:41:15 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -36,7 +36,6 @@ package com.sun.star.wizards.db;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
import java.util.*;
import com.sun.star.lang.Locale;
@@ -46,7 +45,7 @@ public class QueryMetaData extends CommandMetaData {
FieldColumn CurFieldColumn;
public String Command;
- Vector CommandNames;
+ Vector CommandNamesV;
public PropertyValue[][] FilterConditions = new PropertyValue[][] {};
public PropertyValue[][] GroupByFilterConditions = new PropertyValue[][] {};
public String[] UniqueAggregateFieldNames = new String[]{};
@@ -115,7 +114,6 @@ public class QueryMetaData extends CommandMetaData {
public void reorderFieldColumns(String[] _sDisplayFieldNames){
- Vector numericfieldsvector = new java.util.Vector();
FieldColumn[] LocFieldColumns = new FieldColumn[FieldColumns.length];
for (int i = 0; i < _sDisplayFieldNames.length; i++){
FieldColumn LocFieldColumn = this.getFieldColumnByDisplayName(_sDisplayFieldNames[i]);
@@ -140,43 +138,40 @@ public class QueryMetaData extends CommandMetaData {
public void removeFieldColumn(String _sFieldName, String _sCommandName){
- FieldColumn oFieldColumn = getFieldColumn(_sFieldName, _sCommandName);
- int a = 0;
- if (oFieldColumn != null){
- FieldColumn[] LocFieldColumns = new FieldColumn[FieldColumns.length -1];
- for (int i = 0; i < FieldColumns.length;i++){
- if (!FieldColumns[i].FieldName.equals(_sFieldName))
- if (!FieldColumns[i].CommandName.equals(_sCommandName)){
- LocFieldColumns[a] = FieldColumns[i];
- a++;
+ FieldColumn oFieldColumn = getFieldColumn(_sFieldName, _sCommandName);
+ int a = 0;
+ if (oFieldColumn != null){
+ FieldColumn[] LocFieldColumns = new FieldColumn[FieldColumns.length -1];
+ for (int i = 0; i < FieldColumns.length;i++){
+ if (!FieldColumns[i].FieldName.equals(_sFieldName))
+ if (!FieldColumns[i].CommandName.equals(_sCommandName)){
+ LocFieldColumns[a] = FieldColumns[i];
+ a++;
+ }
}
+ FieldColumns = LocFieldColumns;
}
- FieldColumns = LocFieldColumns;
}
- }
public String[] getIncludedCommandNames() {
FieldColumn CurQueryField;
- CommandNames = new Vector(1);
+ CommandNamesV = new Vector(1);
String CurCommandName;
- int SearchIndex;
for (int i = 0; i < FieldColumns.length; i++) {
CurQueryField = FieldColumns[i];
CurCommandName = CurQueryField.getCommandName();
- if (!CommandNames.contains(CurCommandName))
- CommandNames.addElement(CurCommandName);
+ if (!CommandNamesV.contains(CurCommandName))
+ CommandNamesV.addElement(CurCommandName);
}
- String[] sIncludedCommandNames = new String[CommandNames.size()];
- CommandNames.toArray(sIncludedCommandNames);
+ String[] sIncludedCommandNames = new String[CommandNamesV.size()];
+ CommandNamesV.toArray(sIncludedCommandNames);
return sIncludedCommandNames;
}
public static String[] getIncludedCommandNames(String[] _FieldNames) {
- FieldColumn CurQueryField;
Vector CommandNames = new Vector(1);
- int SearchIndex;
for (int i = 0; i < _FieldNames.length; i++) {
String CurCommandName = "";
String[] MetaList = JavaTools.ArrayoutofString(_FieldNames[i], ".");
@@ -200,11 +195,11 @@ public class QueryMetaData extends CommandMetaData {
public void initializeFieldTitleSet(boolean _bAppendMode) {
try {
- this.getIncludedCommandNames();
+ this.getIncludedCommandNames(); // fills the var CommandNamesV indirectly :-(
if (FieldTitleSet == null)
FieldTitleSet = new HashMap();
- for (int i = 0; i < CommandNames.size(); i++) {
- CommandObject oTable = getTableByName((String) CommandNames.elementAt(i));
+ for (int i = 0; i < CommandNamesV.size(); i++) {
+ CommandObject oTable = getTableByName((String) CommandNamesV.elementAt(i));
String sTableName = oTable.Name;
String[] LocFieldNames = oTable.xColumns.getElementNames();
for (int a = 0; a < LocFieldNames.length; a++) {