Tag: cws_src680_qiq
User: fs      
Date: 06/05/23 06:22:49

Modified:
 /dba/connectivity/source/commontools/
  dbtools2.cxx

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

File Changes:

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

File [changed]: dbtools2.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools2.cxx?r1=1.15.38.1&r2=1.15.38.2
Delta lines:  +11 -35
---------------------
--- dbtools2.cxx        10 May 2006 10:50:41 -0000      1.15.38.1
+++ dbtools2.cxx        23 May 2006 13:22:46 -0000      1.15.38.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtools2.cxx,v $
  *
- *  $Revision: 1.15.38.1 $
+ *  $Revision: 1.15.38.2 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/10 10:50:41 $
+ *  last change: $Author: fs $ $Date: 2006/05/23 13:22:46 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -229,7 +229,7 @@
        
descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME))   
>>= sSchema;
        descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) 
                >>= sTable;
 
-       
::dbtools::composeTableName(xMetaData,sCatalog,sSchema,sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+       sComposedName = ::dbtools::composeTableName( xMetaData, sCatalog, 
sSchema, sTable, sal_True, ::dbtools::eInTableDefinitions );
        if ( !sComposedName.getLength() )
                ::dbtools::throwFunctionSequenceException(_xConnection);
 
@@ -346,7 +346,7 @@
                                                                                
                                sSchema, 
                                                                                
                                sTable,
                                                                                
                                ::dbtools::eInDataManipulation);
-                                       
::dbtools::composeTableName(xMetaData,sCatalog, sSchema, 
sTable,sComposedName,sal_True,::dbtools::eInTableDefinitions);
+                                       sComposedName = 
::dbtools::composeTableName( xMetaData, sCatalog, sSchema, sTable, sal_True, 
::dbtools::eInTableDefinitions );
                                        
 
                                        if ( !sComposedName.getLength() )
@@ -448,7 +448,13 @@
                                                ::rtl::OUString sComposedName;
                                                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);
-                                               
::dbtools::composeTableName(xMetaData,getString(_aCatalog),_aSchema,_aTable,sComposedName,sal_True,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect);
+                                               sComposedName = 
::dbtools::composeTableName(
+                            xMetaData,
+                            bUseCatalogInSelect ? getString( _aCatalog ) : 
::rtl::OUString(),
+                            bUseSchemaInSelect ? _aSchema : ::rtl::OUString(),
+                            _aTable,
+                            sal_True,
+                            ::dbtools::eInDataManipulation );
 
                                                ColumnInformationMap 
aInfo(_bCase);
                                                
collectColumnInformation(_xConnection,sComposedName,sQuotedName,aInfo);
@@ -565,36 +571,6 @@
        }
 
        return xProp;
-}
-// 
-----------------------------------------------------------------------------
-::rtl::OUString composeTableName(const Reference<XDatabaseMetaData>& 
_xMetaData,
-                                                                const 
Reference<XPropertySet>& _xTable,
-                                                                sal_Bool 
_bQuote,
-                                                                EComposeRule 
_eComposeRule
-                                                                , sal_Bool 
_bUseCatalogInSelect
-                                                               , sal_Bool 
_bUseSchemaInSelect)
-{      
-       ::rtl::OUString aComposedName;
-       ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-       Reference< XPropertySetInfo > xInfo = _xTable->getPropertySetInfo();
-       if (    xInfo.is() 
-               &&      
xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) 
-               &&      
xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) 
-               &&      
xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) )
-       {
-               
-               ::rtl::OUString aCatalog;
-               ::rtl::OUString aSchema;
-               ::rtl::OUString aTable;
-               
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME))     
>>= aCatalog;
-               
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME))      
>>= aSchema;
-               
_xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))            
>>= aTable;
-               
-               
dbtools::composeTableName(_xMetaData,aCatalog,aSchema,aTable,aComposedName,_bQuote,_eComposeRule,_bUseCatalogInSelect,_bUseSchemaInSelect);
-       }
-    else
-        OSL_ENSURE( false, "::dbtools::composeTableName: this is no table 
object!" );
-       return aComposedName;
 }
 // 
-----------------------------------------------------------------------------
 sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const 
::rtl::OUString& _sProperty,sal_Bool _bDefault)




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

Reply via email to