Tag: cws_src680_dba24d User: oj Date: 2007-11-21 12:37:20+0000 Modified: dba/dbaccess/source/core/api/statement.cxx dba/dbaccess/source/core/dataaccess/ModelImpl.cxx dba/dbaccess/source/core/inc/statement.hxx
Log: #i68854# impl TypeSettingInfo for Oracle File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: statement.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/statement.cxx?r1=1.16.106.1&r2=1.16.106.2 Delta lines: +85 -67 --------------------- --- statement.cxx 2007-11-08 14:10:57+0000 1.16.106.1 +++ statement.cxx 2007-11-21 12:37:17+0000 1.16.106.2 @@ -89,7 +89,8 @@ const Reference< XInterface > & _xStatement) :OSubComponent(m_aMutex, _xConn) ,OPropertySetHelper(OComponentHelper::rBHelper) - ,m_bUseBookmarks(sal_False) + ,m_bUseBookmarks( sal_False ) + ,m_bEscapeProcessing( sal_True ) { DBG_CTOR(OStatementBase, NULL); @@ -252,39 +253,61 @@ switch (nHandle) { case PROPERTY_ID_USEBOOKMARKS: - if ( m_xAggregateAsSet.is() ) - { - bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bUseBookmarks); - if (bModified && m_xAggregateAsSet->getPropertySetInfo()->hasPropertyByName(PROPERTY_USEBOOKMARKS)) - m_xAggregateAsSet->setPropertyValue(PROPERTY_USEBOOKMARKS, rConvertedValue); - } + bModified = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, m_bUseBookmarks ); + break; + + case PROPERTY_ID_ESCAPE_PROCESSING: + bModified = ::comphelper::tryPropertyValue( rConvertedValue, rOldValue, rValue, m_bEscapeProcessing ); break; + default: + if ( m_xAggregateAsSet.is() ) { // get the property name - ::rtl::OUString aPropName; - sal_Int16 nAttributes; - getInfoHelper().fillPropertyMembersByHandle(&aPropName, &nAttributes, nHandle); - OSL_ENSURE(aPropName.getLength(), "property not found?"); + ::rtl::OUString sPropName; + getInfoHelper().fillPropertyMembersByHandle( &sPropName, NULL, nHandle ); // now set the value - if ( m_xAggregateAsSet.is() ) - m_xAggregateAsSet->setPropertyValue(aPropName, rValue); + Any aCurrentValue = m_xAggregateAsSet->getPropertyValue( sPropName ); + if ( aCurrentValue != rValue ) + { + rOldValue = aCurrentValue; + rConvertedValue = rValue; + bModified = sal_True; } } + break; + } return bModified; } //------------------------------------------------------------------------------ void OStatementBase::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { - switch (nHandle) + switch ( nHandle ) { - // the other properties are set in convertFast... case PROPERTY_ID_USEBOOKMARKS: { - m_bUseBookmarks = ::comphelper::getBOOL(rValue); - } break; + m_bUseBookmarks = ::comphelper::getBOOL( rValue ); + if ( m_xAggregateAsSet.is() && m_xAggregateAsSet->getPropertySetInfo()->hasPropertyByName( PROPERTY_USEBOOKMARKS ) ) + m_xAggregateAsSet->setPropertyValue( PROPERTY_USEBOOKMARKS, rValue ); + } + break; + + case PROPERTY_ID_ESCAPE_PROCESSING: + m_bEscapeProcessing = ::comphelper::getBOOL( rValue ); + if ( m_xAggregateAsSet.is() ) + m_xAggregateAsSet->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, rValue ); + break; + + default: + if ( m_xAggregateAsSet.is() ) + { + ::rtl::OUString sPropName; + getInfoHelper().fillPropertyMembersByHandle( &sPropName, NULL, nHandle ); + m_xAggregateAsSet->setPropertyValue( sPropName, rValue ); + } + break; } } @@ -294,20 +317,23 @@ switch (nHandle) { case PROPERTY_ID_USEBOOKMARKS: - rValue.setValue(&m_bUseBookmarks, getBooleanCppuType()); + rValue <<= m_bUseBookmarks; break; + + case PROPERTY_ID_ESCAPE_PROCESSING: + // don't rely on our aggregate - if it implements this wrong, and always returns + // TRUE here, then we would loop in impl_doEscapeProcessing_nothrow + rValue <<= m_bEscapeProcessing; + break; + default: - { - // get the property name - ::rtl::OUString aPropName; - sal_Int16 nAttributes; - const_cast<OStatementBase*>(this)->getInfoHelper(). - fillPropertyMembersByHandle(&aPropName, &nAttributes, nHandle); - OSL_ENSURE(aPropName.getLength(), "property not found?"); - // now read the value if ( m_xAggregateAsSet.is() ) - rValue = m_xAggregateAsSet->getPropertyValue(aPropName); + { + ::rtl::OUString sPropName; + const_cast< OStatementBase* >( this )->getInfoHelper().fillPropertyMembersByHandle( &sPropName, NULL, nHandle ); + rValue = m_xAggregateAsSet->getPropertyValue( sPropName ); } + break; } } @@ -550,13 +576,10 @@ // ----------------------------------------------------------------------------- ::rtl::OUString OStatement::impl_doEscapeProcessing_nothrow( const ::rtl::OUString& _rSQL ) const { + if ( !m_bEscapeProcessing ) + return _rSQL; try { - bool bEscapeProcessing = false; - OSL_VERIFY( m_xAggregateAsSet->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); - if ( !bEscapeProcessing ) - return _rSQL; - if ( !impl_ensureComposer_nothrow() ) return _rSQL; @@ -569,11 +592,6 @@ return _rSQL; ::rtl::OUString sLowLevelSQL = m_xComposer->getQueryWithSubstitution(); - if ( sLowLevelSQL == m_xComposer->getQuery() ) - // if the low level SQL is the same as the high level SQL, then simply - // return the original SQL statement, without tampering with it at all. - return _rSQL; - return sLowLevelSQL; } catch( const Exception& ) Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ModelImpl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.cxx?r1=1.19.54.1&r2=1.19.54.2 Delta lines: +8 -3 ------------------- --- ModelImpl.cxx 2007-11-06 09:20:13+0000 1.19.54.1 +++ ModelImpl.cxx 2007-11-21 12:37:17+0000 1.19.54.2 @@ -4,9 +4,9 @@ * * $RCSfile: ModelImpl.cxx,v $ * - * $Revision: 1.19.54.1 $ + * $Revision: 1.19.54.2 $ * - * last change: $Author: oj $ $Date: 2007/11/06 09:20:13 $ + * last change: $Author: oj $ $Date: 2007/11/21 12:37:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -87,6 +87,8 @@ #ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ #include <com/sun/star/sdbc/XDriverAccess.hpp> #endif +#include <com/sun/star/beans/Optional.hpp> +#include <com/sun/star/beans/Pair.hpp> #ifndef _COM_SUN_STAR_EMBED_XTRANSACTIONBROADCASTER_HPP_ #include <com/sun/star/embed/XTransactionBroadcaster.hpp> #endif @@ -457,13 +459,14 @@ try { // the set of property value types in the bag is limited: - Sequence< Type > aAllowedTypes(5); + Sequence< Type > aAllowedTypes(6); Type* pAllowedType = aAllowedTypes.getArray(); *pAllowedType++ = ::getCppuType( static_cast< sal_Bool* >( NULL ) ); *pAllowedType++ = ::getCppuType( static_cast< double* >( NULL ) ); *pAllowedType++ = ::getCppuType( static_cast< ::rtl::OUString* >( NULL ) ); *pAllowedType++ = ::getCppuType( static_cast< sal_Int32* >( NULL ) ); *pAllowedType++ = ::getCppuType( static_cast< sal_Int16* >( NULL ) ); + *pAllowedType++ = ::getCppuType( static_cast< Sequence< Any >* >( NULL ) ); Sequence< Any > aInitArgs( 2 ); aInitArgs[0] <<= NamedValue( @@ -996,6 +999,8 @@ AsciiPropertyValue( "PreferDosLikeLineEnds", makeAny( (sal_Bool)sal_False ) ), AsciiPropertyValue( "FormsCheckRequiredFields", makeAny( (sal_Bool)sal_True ) ), AsciiPropertyValue( "IgnoreCurrency", makeAny( (sal_Bool)sal_False ) ), + AsciiPropertyValue( "TypeInfoSettings", makeAny( Sequence< Any >()) ), + AsciiPropertyValue( NULL, Any() ) }; return aKnownSettings; Directory: /dba/dbaccess/source/core/inc/ ========================================= File [changed]: statement.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/statement.hxx?r1=1.9&r2=1.9.106.1 Delta lines: +4 -3 ------------------- --- statement.hxx 2007-01-17 14:52:54+0000 1.9 +++ statement.hxx 2007-11-21 12:37:17+0000 1.9.106.1 @@ -102,6 +102,7 @@ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAggregateAsSet; ::com::sun::star::uno::Reference< ::com::sun::star::util::XCancellable > m_xAggregateAsCancellable; sal_Bool m_bUseBookmarks; + sal_Bool m_bEscapeProcessing; virtual ~OStatementBase(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
