dba33f: #i53377# make property IsReadOnly bound

This commit is contained in:
Ocke Janssen [oj]
2010-02-08 14:09:08 +01:00
parent d16fa93c41
commit 1baf7abd1c
3 changed files with 34 additions and 15 deletions

View File

@@ -73,7 +73,7 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaDa
DECL_PROP1_BOOL( ISCURRENCY, READONLY ); DECL_PROP1_BOOL( ISCURRENCY, READONLY );
DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY ); DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY );
DECL_PROP1( ISNULLABLE, sal_Int32, READONLY ); DECL_PROP1( ISNULLABLE, sal_Int32, READONLY );
DECL_PROP1_BOOL( ISREADONLY, READONLY ); DECL_PROP1_BOOL( ISREADONLY, BOUND );
DECL_PROP1_BOOL( ISROWVERSION, READONLY ); DECL_PROP1_BOOL( ISROWVERSION, READONLY );
DECL_PROP1_BOOL( ISSEARCHABLE, READONLY ); DECL_PROP1_BOOL( ISSEARCHABLE, READONLY );
DECL_PROP1_BOOL( ISSIGNED, READONLY ); DECL_PROP1_BOOL( ISSIGNED, READONLY );

View File

@@ -107,7 +107,7 @@ ORowSetDataColumn::~ORowSetDataColumn()
DECL_PROP1_BOOL( ISCURRENCY, READONLY ); DECL_PROP1_BOOL( ISCURRENCY, READONLY );
DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY ); DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY );
DECL_PROP1( ISNULLABLE, sal_Int32, READONLY ); DECL_PROP1( ISNULLABLE, sal_Int32, READONLY );
DECL_PROP1_BOOL( ISREADONLY, READONLY ); DECL_PROP1_BOOL( ISREADONLY, BOUND );
DECL_PROP1_BOOL( ISROWVERSION, READONLY ); DECL_PROP1_BOOL( ISROWVERSION, READONLY );
DECL_PROP1_BOOL( ISSEARCHABLE, READONLY ); DECL_PROP1_BOOL( ISSEARCHABLE, READONLY );
DECL_PROP1_BOOL( ISSIGNED, READONLY ); DECL_PROP1_BOOL( ISSIGNED, READONLY );
@@ -160,13 +160,21 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void SAL_CALL ORowSetDataColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )throw (Exception) void SAL_CALL ORowSetDataColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )throw (Exception)
{ {
if ( PROPERTY_ID_VALUE == nHandle ) switch( nHandle )
{ {
updateObject(rValue); case PROPERTY_ID_VALUE:
} updateObject(rValue);
else break;
{ case PROPERTY_ID_ISREADONLY:
ODataColumn::setFastPropertyValue_NoBroadcast( nHandle,rValue ); {
sal_Bool bVal = sal_False;
rValue >>= bVal;
m_isReadOnly.reset(bVal);
}
break;
default:
ODataColumn::setFastPropertyValue_NoBroadcast( nHandle,rValue );
break;
} }
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@@ -176,14 +184,26 @@ sal_Bool SAL_CALL ORowSetDataColumn::convertFastPropertyValue( Any & rConvertedV
const Any& rValue ) throw (IllegalArgumentException) const Any& rValue ) throw (IllegalArgumentException)
{ {
sal_Bool bModified = sal_False; sal_Bool bModified = sal_False;
if ( PROPERTY_ID_VALUE == nHandle ) switch( nHandle )
{ {
rConvertedValue = rValue; case PROPERTY_ID_VALUE:
getFastPropertyValue(rOldValue, PROPERTY_ID_VALUE); {
bModified = rConvertedValue != rOldValue; rConvertedValue = rValue;
getFastPropertyValue(rOldValue, PROPERTY_ID_VALUE);
bModified = rConvertedValue != rOldValue;
}
break;
case PROPERTY_ID_ISREADONLY:
{
rConvertedValue = rValue;
getFastPropertyValue(rOldValue, PROPERTY_ID_ISREADONLY);
bModified = rConvertedValue != rOldValue;
}
break;
default:
bModified = ODataColumn::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue);
break;
} }
else
bModified = ODataColumn::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue);
return bModified; return bModified;
} }

View File

@@ -83,7 +83,6 @@ namespace dbaccess
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue )throw (::com::sun::star::uno::Exception); virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue )throw (::com::sun::star::uno::Exception);
virtual void fireValueChange(const ::connectivity::ORowSetValue& _rOldValue); virtual void fireValueChange(const ::connectivity::ORowSetValue& _rOldValue);
protected: protected:
using ODataColumn::getFastPropertyValue; using ODataColumn::getFastPropertyValue;
}; };