Tag: cws_src680_kaddrbook
User: ebischoff
Date: 05/10/12 09:42:22

Modified:
 /dba/connectivity/source/drivers/kab/
  KPreparedStatement.cxx, KPreparedStatement.hxx

Log:
 Fixed a bug

File Changes:

Directory: /dba/connectivity/source/drivers/kab/
================================================

File [changed]: KPreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KPreparedStatement.cxx?r1=1.1.2.6&r2=1.1.2.7
Delta lines:  +28 -9
--------------------
--- KPreparedStatement.cxx      12 Sep 2005 12:10:05 -0000      1.1.2.6
+++ KPreparedStatement.cxx      12 Oct 2005 16:42:20 -0000      1.1.2.7
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: KPreparedStatement.cxx,v $
  *
- *  $Revision: 1.1.2.6 $
+ *  $Revision: 1.1.2.7 $
  *
- *  last change: $Author: ebischoff $ $Date: 2005/09/12 12:10:05 $
+ *  last change: $Author: ebischoff $ $Date: 2005/10/12 16:42:20 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -79,6 +79,28 @@
 
 IMPLEMENT_SERVICE_INFO(KabPreparedStatement, 
"com.sun.star.sdbc.drivers.KabPreparedStatement", 
"com.sun.star.sdbc.PreparedStatement");
 // -------------------------------------------------------------------------
+void KabPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
+{
+       // no parameters allowed in this implementation
+       throw SQLException();
+}
+// -------------------------------------------------------------------------
+void KabPreparedStatement::setKabFields() const throw(SQLException)
+{
+       ::vos::ORef<connectivity::OSQLColumns> xColumns;        // selected 
columns
+       KabResultSetMetaData *pMeta;                            // meta 
information - holds the list of KAddressBook fields
+
+       xColumns = m_aSQLIterator.getSelectColumns();
+       if (!xColumns.isValid())
+       {
+               ::dbtools::throwGenericSQLException(
+                       ::rtl::OUString::createFromAscii("Invalid selection of 
columns"),
+                       NULL);
+       }
+       pMeta = (KabResultSetMetaData *) m_xMetaData.get();
+       pMeta->setKabFields(xColumns);
+}
+// -------------------------------------------------------------------------
 KabPreparedStatement::KabPreparedStatement(
        KabConnection* _pConnection,
        const ::rtl::OUString& sql)
@@ -98,7 +120,10 @@
        checkDisposed(KabCommonStatement_BASE::rBHelper.bDisposed);
                
        if (!m_xMetaData.is())
+       {
                m_xMetaData = new KabResultSetMetaData(getOwnConnection());
+               setKabFields();
+       }
        return m_xMetaData;
 }
 // -------------------------------------------------------------------------
@@ -353,10 +378,4 @@
                default:
                        
KabCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
        }
-}
-// 
-----------------------------------------------------------------------------
-void KabPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
-{
-       // no parameters allowed in this implementation
-       throw SQLException();
 }

File [changed]: KPreparedStatement.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/kab/KPreparedStatement.hxx?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +8 -10
--------------------
--- KPreparedStatement.hxx      12 Sep 2005 12:10:06 -0000      1.1.2.5
+++ KPreparedStatement.hxx      12 Oct 2005 16:42:20 -0000      1.1.2.6
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: KPreparedStatement.hxx,v $
  *
- *  $Revision: 1.1.2.5 $
+ *  $Revision: 1.1.2.6 $
  *
- *  last change: $Author: ebischoff $ $Date: 2005/09/12 12:10:06 $
+ *  last change: $Author: ebischoff $ $Date: 2005/10/12 16:42:20 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -97,21 +97,19 @@
                                sal_Int32                                       
nDataType;
 
                                Parameter(const ::com::sun::star::uno::Any&     
rValue,
-                                                 sal_Int32                     
                                rDataType) : aValue(rValue),nDataType(rDataType)
-                               {
-                               }
-
+                                                 sal_Int32                     
                                rDataType)
+                                       : aValue(rValue), nDataType(rDataType)
+                               { }
                        };
 
                        ::std::vector< Parameter>               m_aParameters;
-                       
//====================================================================
-                       // Data attributes
-                       
//====================================================================
                        ::rtl::OUString                                 
m_sSqlStatement;
-                       ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XResultSetMetaData >  m_xMetaData;
+                       ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XResultSetMetaData >
+                                                                               
        m_xMetaData;
                        sal_Bool                                                
m_bPrepared;
 
                        void checkParameterIndex(sal_Int32 _parameterIndex);
+                       void setKabFields() const 
throw(::com::sun::star::sdbc::SQLException);
 
                protected:
                        virtual void SAL_CALL setFastPropertyValue_NoBroadcast(




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

Reply via email to