Tag: cws_src680_dba27
User: oj      
Date: 05/03/10 06:39:46

Modified:
 /dba/dbaccess/source/ui/querydesign/
  QueryDesignView.cxx

Log:
 #i44704# check if table is already known from join

File Changes:

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: QueryDesignView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx?r1=1.71&r2=1.71.20.1
Delta lines:  +16 -4
--------------------
--- QueryDesignView.cxx 17 Feb 2005 11:08:56 -0000      1.71
+++ QueryDesignView.cxx 10 Mar 2005 14:39:42 -0000      1.71.20.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: QueryDesignView.cxx,v $
  *
- *  $Revision: 1.71 $
+ *  $Revision: 1.71.20.1 $
  *
- *  last change: $Author: vg $ $Date: 2005/02/17 11:08:56 $
+ *  last change: $Author: oj $ $Date: 2005/03/10 14:39:42 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1181,6 +1181,7 @@
 
                ::rtl::OUString aTableListStr;
                // wird gebraucht um sicher zustelllen das eine Tabelle nicht 
doppelt vorkommt
+               map< ::rtl::OUString,sal_Bool,::comphelper::UStringMixLess> 
aTableNames;
 
                // generate outer join clause in from
                if(!pConnList->empty())
@@ -1200,6 +1201,18 @@
 
                                        if(aJoin.getLength())
                                        {
+                                               // insert tables into table 
list to avoid double entries
+                                               OQueryTableWindow* 
pEntryTabFrom = static_cast<OQueryTableWindow*>(pEntryConn->GetSourceWin());
+                                               OQueryTableWindow* pEntryTabTo 
= static_cast<OQueryTableWindow*>(pEntryConn->GetDestWin());
+
+                                               ::rtl::OUString 
sTabName(BuildTable(_xConnection,pEntryTabFrom));
+                                               if(aTableNames.find(sTabName) 
== aTableNames.end())
+                                                       aTableNames[sTabName] = 
sal_True;
+                                               sTabName = 
BuildTable(_xConnection,pEntryTabTo);
+                                               if(aTableNames.find(sTabName) 
== aTableNames.end())
+                                                       aTableNames[sTabName] = 
sal_True;
+
+                                               // create join                  
                
                                                sal_Bool bUseEscape = 
::dbtools::isDataSourcePropertyEnabled(_xConnection,PROPERTY_OUTERJOINESCAPE,sal_True);
                                                ::rtl::OUString aStr;
                                                if ( bUseEscape )
@@ -1214,7 +1227,6 @@
                        }
 
                        // and now all inner joins
-                       map< 
::rtl::OUString,sal_Bool,::comphelper::UStringMixLess> aTableNames;
                        aIter = pConnList->begin();
                        for(;aIter != pConnList->end();++aIter)
                        {




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to