Tag: cws_src680_dba24c
User: fs      
Date: 2007-09-18 12:53:56+0000
Modified:
   dba/dbaccess/source/core/api/RowSetCache.cxx
   dba/dbaccess/source/core/api/RowSetCache.hxx
   dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx

Log:
 during #i81095#: moved from XMultiServiceFactory to 
::comphelper::ComponentContext

File Changes:

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

File [changed]: RowSetCache.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.cxx?r1=1.94&r2=1.94.56.1
Delta lines:  +6 -6
-------------------
--- RowSetCache.cxx     2007-05-10 10:11:18+0000        1.94
+++ RowSetCache.cxx     2007-09-18 12:53:53+0000        1.94.56.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSetCache.cxx,v $
  *
- *  $Revision: 1.94 $
+ *  $Revision: 1.94.56.1 $
  *
- *  last change: $Author: kz $ $Date: 2007/05/10 10:11:18 $
+ *  last change: $Author: fs $ $Date: 2007/09/18 12:53:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -139,13 +139,13 @@
 // -------------------------------------------------------------------------
 ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
                                                   const Reference< 
XSingleSelectQueryAnalyzer >& _xAnalyzer,
-                                                  const Reference< 
XMultiServiceFactory >& _xServiceFactory,
+                           const ::comphelper::ComponentContext& _rContext,
                                                   const ::rtl::OUString& 
_rUpdateTableName,
                                                   sal_Bool&    _bModified,
                                                   sal_Bool&    _bNew)
        :m_xSet(_xRs)
        ,m_xMetaData(Reference< XResultSetMetaDataSupplier 
>(_xRs,UNO_QUERY)->getMetaData())
-       ,m_xServiceFactory(_xServiceFactory)
+       ,m_aContext( _rContext )
        ,m_pCacheSet(NULL)
        ,m_pMatrix(NULL)
        ,m_pInsertMatrix(NULL)
@@ -1460,7 +1460,7 @@
        sal_Bool bOk = sal_False;
        ::rtl::OUString sSql = _xAnalyzer->getQuery();
        ::rtl::OUString sErrorMsg;
-       ::connectivity::OSQLParser aSqlParser(m_xServiceFactory);
+       ::connectivity::OSQLParser aSqlParser( 
m_aContext.getLegacyServiceFactory() );
        ::std::auto_ptr< ::connectivity::OSQLParseNode> pSqlParseNode( 
aSqlParser.parseTree(sErrorMsg,sSql));
        if ( pSqlParseNode.get() && SQL_ISRULE(pSqlParseNode, select_statement) 
)
        {

File [changed]: RowSetCache.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.hxx?r1=1.32&r2=1.32.58.1
Delta lines:  +8 -5
-------------------
--- RowSetCache.hxx     2007-05-10 10:11:31+0000        1.32
+++ RowSetCache.hxx     2007-09-18 12:53:53+0000        1.32.58.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RowSetCache.hxx,v $
  *
- *  $Revision: 1.32 $
+ *  $Revision: 1.32.58.1 $
  *
- *  last change: $Author: kz $ $Date: 2007/05/10 10:11:31 $
+ *  last change: $Author: fs $ $Date: 2007/09/18 12:53:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -92,6 +92,9 @@
 #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
 #include <comphelper/propertycontainer.hxx>
 #endif
+#ifndef COMPHELPER_COMPONENTCONTEXT_HXX
+#include <comphelper/componentcontext.hxx>
+#endif
 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
 #include <cppuhelper/implbase5.hxx>
 #endif
@@ -127,7 +130,7 @@
                //the set can be static, bookmarkable or keyset
                ::com::sun::star::uno::WeakReference< 
::com::sun::star::sdbc::XResultSet>               m_xSet;
                ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XResultSetMetaData >  m_xMetaData; // must be before 
m_aInsertRow
-               ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory;
+        ::comphelper::ComponentContext                                         
         m_aContext;
 
                ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> 
                                m_xCacheSet;
 
@@ -191,7 +194,7 @@
        public:
                ORowSetCache(const ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XResultSet >&,
                                         const 
::com::sun::star::uno::Reference< 
::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xAnalyzer,
-                                        const 
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory 
>& _xServiceFactory,
+                                        const ::comphelper::ComponentContext& 
_rContext,
                                         const ::rtl::OUString& 
_rUpdateTableName,
                                         sal_Bool&      _bModified,
                                         sal_Bool&      _bNew);

File [changed]: SingleSelectQueryComposer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx?r1=1.23.76.1&r2=1.23.76.2
Delta lines:  +14 -14
---------------------
--- SingleSelectQueryComposer.cxx       2007-09-12 09:09:37+0000        
1.23.76.1
+++ SingleSelectQueryComposer.cxx       2007-09-18 12:53:53+0000        
1.23.76.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SingleSelectQueryComposer.cxx,v $
  *
- *  $Revision: 1.23.76.1 $
+ *  $Revision: 1.23.76.2 $
  *
- *  last change: $Author: fs $ $Date: 2007/09/12 09:09:37 $
+ *  last change: $Author: fs $ $Date: 2007/09/18 12:53:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -246,23 +246,23 @@
 // -------------------------------------------------------------------------
 OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< 
XNameAccess>& _rxTables,
                                                           const Reference< 
XConnection>& _xConnection,
-                                                          const Reference< 
XMultiServiceFactory >& _xServiceFactory)
+                               const ::comphelper::ComponentContext& _rContext 
)
     :OSubComponent(m_aMutex,_xConnection)
     ,OPropertyContainer(m_aBHelper)
-    ,m_aSqlParser(_xServiceFactory)
+    ,m_aSqlParser( _rContext.getLegacyServiceFactory() )
     ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser, NULL )
     ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser, NULL )
     ,m_aElementaryParts( (size_t)SQLPartCount )
     ,m_xConnection(_xConnection)
     ,m_xMetaData(_xConnection->getMetaData())
     ,m_xConnectionTables( _rxTables )
-    ,m_xServiceFactory(_xServiceFactory)
+    ,m_aContext( _rContext )
     ,m_pTables(NULL)
     ,m_nBoolCompareMode(BOOL_COMPARISON_DEFAULT)
 {
        DBG_CTOR(OSingleSelectQueryComposer,NULL);
 
-    if ( !m_xServiceFactory.is() || !m_xConnection.is() || 
!m_xConnectionTables.is() )
+    if ( !m_aContext.is() || !m_xConnection.is() || !m_xConnectionTables.is() )
         throw IllegalArgumentException();
 
     
registerProperty(PROPERTY_ORIGINAL,PROPERTY_ID_ORIGINAL,PropertyAttribute::BOUND|PropertyAttribute::READONLY,&m_sOrignal,::getCppuType(&m_sOrignal));
@@ -270,8 +270,9 @@
        m_aCurrentColumns.resize(4);
 
        m_aLocale = SvtSysLocale().GetLocaleData().getLocale();
-       m_xNumberFormatsSupplier = 
dbtools::getNumberFormats(m_xConnection,sal_True,m_xServiceFactory);
-       Reference< XLocaleData> xLocaleData = 
Reference<XLocaleData>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.LocaleData"))),UNO_QUERY);
+       m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, 
sal_True, m_aContext.getLegacyServiceFactory() );
+    Reference< XLocaleData > xLocaleData;
+    m_aContext.createComponent( "com.sun.star.i18n.LocaleData", xLocaleData );
        LocaleDataItem aData = xLocaleData->getLocaleItem(m_aLocale);
        m_sDecimalSep = aData.decimalSeparator;
        OSL_ENSURE(m_sDecimalSep.getLength() == 
1,"OSingleSelectQueryComposer::OSingleSelectQueryComposer decimal separator is 
not 1 length");
@@ -327,7 +328,6 @@
 
        m_xConnectionTables     = NULL;
        m_xConnection           = NULL;
-       m_xServiceFactory       = NULL;
 
        clearCurrentCollections();
 }
@@ -1537,8 +1537,8 @@
 
        if ( aValue.hasValue() )
        {
-               if(!m_xTypeConverter.is())
-                       m_xTypeConverter = Reference< XTypeConverter 
>(m_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))),UNO_QUERY);
+               if(  !m_xTypeConverter.is() )
+            m_aContext.createComponent( "com.sun.star.script.Converter", 
m_xTypeConverter );
                OSL_ENSURE(m_xTypeConverter.is(),"NO typeconverter!");
 
                switch(nType)
@@ -1695,9 +1695,9 @@
                        if ( pCondition )
                        {
                                ::std::vector< ::std::vector < PropertyValue > 
> aFilters;
-                               Reference< 
::com::sun::star::util::XNumberFormatter >  xFormatter(m_xServiceFactory
-                                                               
->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))),
 UNO_QUERY);
-                               
xFormatter->attachNumberFormatsSupplier(m_xNumberFormatsSupplier);
+                Reference< XNumberFormatter > xFormatter;
+                m_aContext.createComponent( 
"com.sun.star.util.NumberFormatter", xFormatter );
+                               xFormatter->attachNumberFormatsSupplier( 
m_xNumberFormatsSupplier );
 
                                if (setORCriteria(pCondition, 
m_aAdditiveIterator, aFilters, xFormatter))
                                {




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

Reply via email to