Tag: cws_src680_qiq
User: fs      
Date: 06/05/23 23:40:25

Modified:
 /dba/dbaccess/source/core/api/
  CacheSet.cxx, FilteredContainer.cxx, KeySet.cxx, RowSet.cxx,
  SingleSelectQueryComposer.cxx, table.cxx, tablecontainer.cxx,
  viewcontainer.cxx

Log:
 some refactoring of compose/quoteTableName and friends, in preparation of 
#i51143#

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: CacheSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CacheSet.cxx?r1=1.40&r2=1.40.118.1
Delta lines:  +4 -5
-------------------
--- CacheSet.cxx        23 Sep 2005 12:01:45 -0000      1.40
+++ CacheSet.cxx        24 May 2006 06:40:18 -0000      1.40.118.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: CacheSet.cxx,v $
  *
- *  $Revision: 1.40 $
+ *  $Revision: 1.40.118.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:01:45 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:18 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -183,11 +183,10 @@
        if(!m_aComposedTableName.getLength() && _xTable.is() )
        {
                Reference<XDatabaseMetaData> 
xMeta(m_xConnection->getMetaData());
-               composeTableName(xMeta
+               m_aComposedTableName = composeTableName(xMeta
                                                
,comphelper::getString(_xTable->getPropertyValue(PROPERTY_CATALOGNAME))
                                                
,comphelper::getString(_xTable->getPropertyValue(PROPERTY_SCHEMANAME))
                                                
,comphelper::getString(_xTable->getPropertyValue(PROPERTY_NAME))
-                                               ,m_aComposedTableName
                                                ,sal_True
                                                
,::dbtools::eInDataManipulation);
        }

File [changed]: FilteredContainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/FilteredContainer.cxx?r1=1.6&r2=1.6.122.1
Delta lines:  +6 -6
-------------------
--- FilteredContainer.cxx       8 Sep 2005 09:57:48 -0000       1.6
+++ FilteredContainer.cxx       24 May 2006 06:40:19 -0000      1.6.122.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: FilteredContainer.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.6.122.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 09:57:48 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:19 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -42,7 +42,7 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #endif
 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
-#include <connectivity/dbtools.hxx>
+#include "connectivity/dbtools.hxx"
 #endif
 #ifndef _WLDCRD_HXX
 #include <tools/wldcrd.hxx>
@@ -252,7 +252,7 @@
                                                // we're not interested in the 
"wasNull", as the getStrings would return an empty string in
                                                // that case, which is 
sufficient here
 
-                                               composeTableName(m_xMetaData, 
sCatalog, sSchema, sName, sComposedName, 
sal_False,::dbtools::eInDataManipulation);
+                                               sComposedName = 
composeTableName( m_xMetaData, sCatalog, sSchema, sName, sal_False, 
::dbtools::eInDataManipulation );
                                                bFilterMatch =  bNoTableFilters
                                                                        ||      
((nTableFilterLen != 0) && (NULL != bsearch(&sComposedName, 
aTableFilter.getConstArray(), nTableFilterLen, sizeof(::rtl::OUString), 
NameCompare)));
                                                // the table is allowed to 
"pass" if we had no filters at all or any of the non-wildcard filters matches
@@ -341,7 +341,7 @@
     ::rtl::OUString OFilteredContainer::getNameForObject(const ObjectType& 
_xObject)
     {
         OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!");
-           return 
::dbtools::composeTableName(m_xMetaData,_xObject,sal_False,::dbtools::eInDataManipulation);
+           return ::dbtools::composeTableName( m_xMetaData, _xObject, 
::dbtools::eInDataManipulation, false, false, false );
     }
 // 
..............................................................................
 } // namespace

File [changed]: KeySet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.cxx?r1=1.60&r2=1.60.2.1
Delta lines:  +8 -10
--------------------
--- KeySet.cxx  4 May 2006 08:35:48 -0000       1.60
+++ KeySet.cxx  24 May 2006 06:40:19 -0000      1.60.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: KeySet.cxx,v $
  *
- *  $Revision: 1.60 $
+ *  $Revision: 1.60.2.1 $
  *
- *  last change: $Author: rt $ $Date: 2006/05/04 08:35:48 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:19 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -233,7 +233,7 @@
        ::rtl::OUString sComposedName;
        sCatalog = sSchema = sTable = ::rtl::OUString();
        
::dbtools::qualifiedNameComponents(xMetaData,m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-       
::dbtools::composeTableName(xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInDataManipulation);
+       sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, 
sSchema, sTable, sal_True, ::dbtools::eInDataManipulation );
        // create the where clause
        OColumnNamePos::const_iterator aIter;
        for(aIter = (*m_pKeyColumnNames).begin();aIter != 
(*m_pKeyColumnNames).end();)
@@ -1212,12 +1212,10 @@
 {
        ::rtl::OUString aComposedName;
        Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData();
-       sal_Bool bUseCatalogInSelect = 
::dbtools::isDataSourcePropertyEnabled(m_xConnection,PROPERTY_USECATALOGINSELECT,sal_True);
-       sal_Bool bUseSchemaInSelect = 
::dbtools::isDataSourcePropertyEnabled(m_xConnection,PROPERTY_USESCHEMAINSELECT,sal_True);
 
        if( xMetaData.is() && xMetaData->supportsTableCorrelationNames() )
        {
-               
::dbtools::composeTableName(xMetaData,_sCatalog,_sSchema,_sTable,aComposedName,sal_False,::dbtools::eInDataManipulation);
+               aComposedName = ::dbtools::composeTableName( xMetaData, 
_sCatalog, _sSchema, _sTable, sal_False, ::dbtools::eInDataManipulation );
                // first we have to check if the composed tablename is in the 
select clause or if an alias is used
                Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY);
                Reference<XNameAccess> xSelectTables = xTabSup->getTables();
@@ -1228,14 +1226,14 @@
                        { // the composed name isn't used in the select clause 
so we have to find out which name is used instead
                                ::rtl::OUString sCatalog,sSchema,sTable;
                                
::dbtools::qualifiedNameComponents(xMetaData,m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
-                               
::dbtools::composeTableName(xMetaData,sCatalog,sSchema,sTable,aComposedName,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+                               aComposedName = 
::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable 
);
                        }
                        else
-                               
::dbtools::composeTableName(xMetaData,_sCatalog,_sSchema,_sTable,aComposedName,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+                               aComposedName = 
::dbtools::composeTableNameForSelect( m_xConnection, _sCatalog, _sSchema, 
_sTable );
                }
        }
        else
-               
::dbtools::composeTableName(xMetaData,_sCatalog,_sSchema,_sTable,aComposedName,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+               aComposedName = ::dbtools::composeTableNameForSelect( 
m_xConnection, _sCatalog, _sSchema, _sTable );
 
        return aComposedName;
 }

File [changed]: RowSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.143.10.1&r2=1.143.10.2
Delta lines:  +7 -8
-------------------
--- RowSet.cxx  10 May 2006 10:54:59 -0000      1.143.10.1
+++ RowSet.cxx  24 May 2006 06:40:20 -0000      1.143.10.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSet.cxx,v $
  *
- *  $Revision: 1.143.10.1 $
+ *  $Revision: 1.143.10.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/10 10:54:59 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1699,7 +1699,7 @@
                // create the composed table name
                ::rtl::OUString aComposedTableName;
                if(m_aUpdateTableName.getLength())
-                       
composeTableName(m_xActiveConnection->getMetaData(),m_aUpdateCatalogName,m_aUpdateSchemaName,m_aUpdateTableName,aComposedTableName,sal_False,::dbtools::eInDataManipulation);
+                       aComposedTableName = composeTableName( 
m_xActiveConnection->getMetaData(), m_aUpdateCatalogName, m_aUpdateSchemaName, 
m_aUpdateTableName, sal_False, ::dbtools::eInDataManipulation );
 
                m_pCache = new 
ORowSetCache(xRs,m_xAnalyzer,m_xServiceManager,m_aParameterRow,aComposedTableName,m_bModified,m_bNew);
                if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY 
)
@@ -2144,11 +2144,10 @@
                                        if ( xSup.is() )
                                                m_xColumns = xSup->getColumns();
 
-                                       sal_Bool bUseCatalogInSelect = 
::dbtools::isDataSourcePropertyEnabled(m_xActiveConnection,PROPERTY_USECATALOGINSELECT,sal_True);
-                                       sal_Bool bUseSchemaInSelect = 
::dbtools::isDataSourcePropertyEnabled(m_xActiveConnection,PROPERTY_USESCHEMAINSELECT,sal_True);
-
                                        aQuery = 
rtl::OUString::createFromAscii("SELECT * FROM ");
-                                       aQuery += 
::dbtools::quoteTableName(m_xActiveConnection->getMetaData(), 
m_aCommand,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+                                   ::rtl::OUString sCatalog, sSchema, sTable;
+                                   ::dbtools::qualifiedNameComponents( 
m_xActiveConnection->getMetaData(), m_aCommand, sCatalog, sSchema, sTable, 
::dbtools::eInDataManipulation );
+                                       aQuery += 
::dbtools::composeTableNameForSelect( m_xActiveConnection, sCatalog, sSchema, 
sTable );
                                }
                                else
                                {
@@ -2179,7 +2178,7 @@
                                                        
xQuery->getPropertyValue(PROPERTY_UPDATE_SCHEMANAME)    >>= aSchema;
                                                        
xQuery->getPropertyValue(PROPERTY_UPDATE_TABLENAME)             >>= aTable;
                                                        if(aTable.getLength())
-                                                               
composeTableName(m_xActiveConnection->getMetaData(),aCatalog,aSchema,aTable,m_aUpdateTableName,sal_False,::dbtools::eInDataManipulation);
+                                                               
m_aUpdateTableName = composeTableName( m_xActiveConnection->getMetaData(), 
aCatalog, aSchema, aTable, sal_False, ::dbtools::eInDataManipulation );
 
                                                        
Reference<XColumnsSupplier> xSup(xQuery,UNO_QUERY);
                                                        if(xSup.is())

File [changed]: SingleSelectQueryComposer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx?r1=1.13.18.4&r2=1.13.18.5
Delta lines:  +7 -7
-------------------
--- SingleSelectQueryComposer.cxx       17 May 2006 04:30:23 -0000      
1.13.18.4
+++ SingleSelectQueryComposer.cxx       24 May 2006 06:40:20 -0000      
1.13.18.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SingleSelectQueryComposer.cxx,v $
  *
- *  $Revision: 1.13.18.4 $
+ *  $Revision: 1.13.18.5 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/17 04:30:23 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -454,7 +454,7 @@
                                {
                                        ::rtl::OUString aCatlog,aSchema,aTable;
                                        
::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::eInDataManipulation);
-                                       
::dbtools::composeTableName(m_xMetaData,aCatlog,aSchema,aTable,sTableName,sal_True,::dbtools::eInDataManipulation);
+                                       sTableName = 
::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, sal_True, 
::dbtools::eInDataManipulation );
                                }
                                else
                                        sTableName = 
::dbtools::quoteName(aQuote,sTableName);
@@ -526,7 +526,7 @@
                {
                        ::rtl::OUString aCatlog,aSchema,aTable;
                        
::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::eInDataManipulation);
-                       
::dbtools::composeTableName(m_xMetaData,aCatlog,aSchema,aTable,sTableName,sal_True,::dbtools::eInDataManipulation);
+                       sTableName = ::dbtools::composeTableName( m_xMetaData, 
aCatlog, aSchema, aTable, sal_True, ::dbtools::eInDataManipulation );
                }
                else
                        sTableName = ::dbtools::quoteName(aQuote,sTableName);
@@ -1190,7 +1190,7 @@
                }
                else
                {
-                       
::dbtools::composeTableName(m_xMetaData,aCatalog,aSchema,aTable,aComposedName,sal_False,::dbtools::eInDataManipulation);
+                       aComposedName = ::dbtools::composeTableName( 
m_xMetaData, aCatalog, aSchema, aTable, sal_False, 
::dbtools::eInDataManipulation );
 
                        // first check if this is the table we want to or has 
it a tablealias
 
@@ -1222,7 +1222,7 @@
                }
                if(pBegin != pEnd)
                {
-                       
::dbtools::composeTableName(m_xMetaData,aCatalog,aSchema,aTable,sReturn,sal_True,::dbtools::eInDataManipulation);
+                       sReturn = ::dbtools::composeTableName( m_xMetaData, 
aCatalog, aSchema, aTable, sal_True, ::dbtools::eInDataManipulation );
                        sReturn += 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
                }
        }
@@ -1456,7 +1456,7 @@
                {
                        ::rtl::OUString aCatlog,aSchema,aTable;
                        
::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::eInDataManipulation);
-                       
::dbtools::composeTableName(m_xMetaData,aCatlog,aSchema,aTable,sTableName,sal_True,::dbtools::eInDataManipulation);
+                       sTableName = ::dbtools::composeTableName( m_xMetaData, 
aCatlog, aSchema, aTable, sal_True, ::dbtools::eInDataManipulation );
                }
                else
                        sTableName = ::dbtools::quoteName(aQuote,sTableName);

File [changed]: table.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/table.cxx?r1=1.54&r2=1.54.124.1
Delta lines:  +4 -4
-------------------
--- table.cxx   8 Sep 2005 10:12:13 -0000       1.54
+++ table.cxx   24 May 2006 06:40:21 -0000      1.54.124.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: table.cxx,v $
  *
- *  $Revision: 1.54 $
+ *  $Revision: 1.54.124.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 10:12:13 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -382,7 +382,7 @@
                        aQuote = xMeta->getIdentifierQuoteString(  );
                ::rtl::OUString sComposedName;
 
-               
::dbtools::composeTableName(xMeta,m_CatalogName,m_SchemaName,m_Name,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+               sComposedName = ::dbtools::composeTableName( xMeta, 
m_CatalogName, m_SchemaName, m_Name, sal_True, ::dbtools::eInTableDefinitions );
                if(!sComposedName.getLength())
                        ::dbtools::throwFunctionSequenceException(*this);
 

File [changed]: tablecontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/tablecontainer.cxx?r1=1.60&r2=1.60.124.1
Delta lines:  +4 -4
-------------------
--- tablecontainer.cxx  8 Sep 2005 10:12:33 -0000       1.60
+++ tablecontainer.cxx  24 May 2006 06:40:21 -0000      1.60.124.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: tablecontainer.cxx,v $
  *
- *  $Revision: 1.60 $
+ *  $Revision: 1.60.124.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 10:12:33 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -479,7 +479,7 @@
                                        
xTable->getPropertyValue(PROPERTY_SCHEMANAME)   >>= sSchema;
                                xTable->getPropertyValue(PROPERTY_NAME)         
        >>= sTable;
 
-                               
::dbtools::composeTableName(m_xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+                               sComposedName = ::dbtools::composeTableName( 
m_xMetaData, sCatalog, sSchema, sTable, sal_True, 
::dbtools::eInTableDefinitions );
 
                                ::rtl::OUString sType;
                                xTable->getPropertyValue(PROPERTY_TYPE)         
        >>= sType;

File [changed]: viewcontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/viewcontainer.cxx?r1=1.22&r2=1.22.118.1
Delta lines:  +5 -5
-------------------
--- viewcontainer.cxx   23 Sep 2005 12:03:41 -0000      1.22
+++ viewcontainer.cxx   24 May 2006 06:40:22 -0000      1.22.118.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: viewcontainer.cxx,v $
  *
- *  $Revision: 1.22 $
+ *  $Revision: 1.22.118.1 $
  *
- *  last change: $Author: hr $ $Date: 2005/09/23 12:03:41 $
+ *  last change: $Author: fs $ $Date: 2006/05/24 06:40:22 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -201,7 +201,7 @@
        else
        {
                ::rtl::OUString aSql    = 
::rtl::OUString::createFromAscii("CREATE VIEW ");
-               ::rtl::OUString sComposedName = 
::dbtools::composeTableName(m_xMetaData,descriptor,sal_True,::dbtools::eInTableDefinitions);
+               ::rtl::OUString sComposedName = ::dbtools::composeTableName( 
m_xMetaData, descriptor, ::dbtools::eInTableDefinitions, false, false, true );
                if(!sComposedName.getLength())
                        
::dbtools::throwFunctionSequenceException(static_cast<XTypeProvider*>(static_cast<OFilteredContainer*>(this)));
 
@@ -240,7 +240,7 @@
                        xTable->getPropertyValue(PROPERTY_SCHEMANAME)   >>= 
sSchema;
                        xTable->getPropertyValue(PROPERTY_NAME)                 
>>= sTable;
 
-                       
::dbtools::composeTableName(m_xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+                       sComposedName = ::dbtools::composeTableName( 
m_xMetaData, sCatalog, sSchema, sTable, sal_True, 
::dbtools::eInTableDefinitions );
                }
 
                if(!sComposedName.getLength())




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

Reply via email to