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

Modified:
 /dba/connectivity/source/commontools/
  TColumnsHelper.cxx, TIndexes.cxx, TKeys.cxx, TTableHelper.cxx

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

File Changes:

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: TColumnsHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TColumnsHelper.cxx?r1=1.6&r2=1.6.104.1
Delta lines:  +6 -6
-------------------
--- TColumnsHelper.cxx  8 Sep 2005 05:10:11 -0000       1.6
+++ TColumnsHelper.cxx  23 May 2006 13:24:20 -0000      1.6.104.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TColumnsHelper.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.6.104.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 05:10:11 $
+ *  last change: $Author: fs $ $Date: 2006/05/23 13:24:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -133,7 +133,7 @@
                Reference<XDatabaseMetaData> xMetaData = 
xConnection->getMetaData();
                sal_Bool bUseCatalogInSelect = 
isDataSourcePropertyEnabled(xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCatalogInSelect")),sal_True);
                sal_Bool bUseSchemaInSelect = 
isDataSourcePropertyEnabled(xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSchemaInSelect")),sal_True);
-               ::rtl::OUString sComposedName = 
::dbtools::composeTableName(xMetaData,m_pTable,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+               ::rtl::OUString sComposedName = 
::dbtools::composeTableName(xMetaData,m_pTable,::dbtools::eInDataManipulation,!bUseCatalogInSelect,!bUseSchemaInSelect,true);
                
collectColumnInformation(xConnection,sComposedName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"))
 ,m_pImpl->m_aColumnInfo);
                aFind = m_pImpl->m_aColumnInfo.find(_rName);
        }
@@ -192,7 +192,7 @@
                ::rtl::OUString aSql    = 
::rtl::OUString::createFromAscii("ALTER TABLE ");
                ::rtl::OUString aQuote  = xMetaData->getIdentifierQuoteString(  
);
 
-               aSql += 
::dbtools::composeTableName(xMetaData,m_pTable,sal_True,::dbtools::eInTableDefinitions);
+               aSql += ::dbtools::composeTableName( xMetaData, m_pTable, 
::dbtools::eInTableDefinitions, false, false, true );
                aSql += ::rtl::OUString::createFromAscii(" ADD ");
                aSql += 
::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection());
                
@@ -215,7 +215,7 @@
                Reference<XDatabaseMetaData> xMetaData = 
m_pTable->getConnection()->getMetaData();
                ::rtl::OUString aQuote  = xMetaData->getIdentifierQuoteString(  
);
 
-               aSql += 
::dbtools::composeTableName(xMetaData,m_pTable,sal_True,::dbtools::eInTableDefinitions);
+               aSql += ::dbtools::composeTableName( xMetaData, m_pTable, 
::dbtools::eInTableDefinitions, false, false, true );
                aSql += ::rtl::OUString::createFromAscii(" DROP ");
                aSql += ::dbtools::quoteName( aQuote,_sElementName);
 

File [changed]: TIndexes.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TIndexes.cxx?r1=1.7&r2=1.7.104.1
Delta lines:  +6 -6
-------------------
--- TIndexes.cxx        8 Sep 2005 05:11:32 -0000       1.7
+++ TIndexes.cxx        23 May 2006 13:24:21 -0000      1.7.104.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TIndexes.cxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.7.104.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 05:11:32 $
+ *  last change: $Author: fs $ $Date: 2006/05/23 13:24:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -175,7 +175,7 @@
                
dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
                ::rtl::OUString aComposedName;
                
-               
dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,aComposedName,sal_True,::dbtools::eInIndexDefinitions);
+               aComposedName = 
dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
                if ( aName.getLength() )
                {
                        aSql.append(::dbtools::quoteName( aQuote,aName ));
@@ -245,9 +245,9 @@
 
                ::rtl::OUString aSql    = 
::rtl::OUString::createFromAscii("DROP INDEX ");
 
-               ::rtl::OUString aComposedName = 
dbtools::composeTableName(m_pTable->getMetaData(),m_pTable,sal_True,::dbtools::eInIndexDefinitions);
+               ::rtl::OUString aComposedName = dbtools::composeTableName( 
m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, 
false, true );
                ::rtl::OUString sIndexName,sTemp;
-               
dbtools::composeTableName(m_pTable->getMetaData(),sTemp,aSchema,aName,sIndexName,sal_True,::dbtools::eInIndexDefinitions,sal_True,sal_True);
+               sIndexName = dbtools::composeTableName( 
m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, 
::dbtools::eInIndexDefinitions );
 
                aSql += sIndexName
                                + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" 
ON "))

File [changed]: TKeys.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TKeys.cxx?r1=1.7&r2=1.7.104.1
Delta lines:  +7 -6
-------------------
--- TKeys.cxx   8 Sep 2005 05:12:25 -0000       1.7
+++ TKeys.cxx   23 May 2006 13:24:21 -0000      1.7.104.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TKeys.cxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.7.104.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 05:12:25 $
+ *  last change: $Author: fs $ $Date: 2006/05/23 13:24:21 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -122,7 +122,7 @@
                                if ( xRow->getString(12) == _rName )
                                {
                                        ::rtl::OUString aComposedName;
-                                       
::dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aName,aComposedName,sal_False,::dbtools::eInDataManipulation);
+                                       aComposedName = 
::dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aName,sal_False,::dbtools::eInDataManipulation);
                                        OTableKeyHelper* pRet = new 
OTableKeyHelper(m_pTable,_rName,aComposedName,KeyType::FOREIGN,nUpdateRule,nDeleteRule);
                                        xRet = pRet;
                                        break;
@@ -191,7 +191,8 @@
                ::rtl::OUString aQuote  = 
m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString(  );
                ::rtl::OUString aDot    = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
 
-               aSql += 
composeTableName(m_pTable->getConnection()->getMetaData(),m_pTable,sal_True,::dbtools::eInTableDefinitions)
 + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD "));
+        aSql += composeTableName( m_pTable->getConnection()->getMetaData(), 
m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
+        aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD "));
 
                if ( nKeyType == KeyType::PRIMARY )
                {
@@ -286,7 +287,7 @@
        {
                ::rtl::OUString aSql    = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
 
-               aSql += 
composeTableName(m_pTable->getConnection()->getMetaData(),m_pTable,sal_True,::dbtools::eInTableDefinitions);
+               aSql += composeTableName( 
m_pTable->getConnection()->getMetaData(), 
m_pTable,::dbtools::eInTableDefinitions, false, false, true );
 
                Reference<XPropertySet> xKey(getObject(_nPos),UNO_QUERY);
 

File [changed]: TTableHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TTableHelper.cxx?r1=1.3&r2=1.3.104.1
Delta lines:  +6 -6
-------------------
--- TTableHelper.cxx    8 Sep 2005 05:13:29 -0000       1.3
+++ TTableHelper.cxx    23 May 2006 13:24:22 -0000      1.3.104.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TTableHelper.cxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.3.104.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 05:13:29 $
+ *  last change: $Author: fs $ $Date: 2006/05/23 13:24:22 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -287,10 +287,10 @@
                
::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
 
                ::rtl::OUString sComposedName;
-               
::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sComposedName,sal_True,::dbtools::eInDataManipulation);
+               sComposedName = 
::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
                sSql += sComposedName
                         + ::rtl::OUString::createFromAscii(" TO ");
-               
::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInDataManipulation);
+               sComposedName = 
::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
                sSql += sComposedName;
 
                Reference< XStatement > xStmt = m_xConnection->createStatement( 
 );
@@ -331,7 +331,7 @@
 ::rtl::OUString SAL_CALL OTableHelper::getName() throw(RuntimeException)
 {
        ::rtl::OUString sComposedName;
-       
::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sComposedName,sal_False,::dbtools::eInDataManipulation);
+       sComposedName = 
::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_False,::dbtools::eInDataManipulation);
        return sComposedName;
 }
 // 
-----------------------------------------------------------------------------




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

Reply via email to