summaryrefslogtreecommitdiffstats
path: root/forms/source/component/Grid.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2002-10-04 07:14:15 +0000
committerFrank Schönheit <fs@openoffice.org>2002-10-04 07:14:15 +0000
commit9a681f26605dc1cf9e8a322cebd5cc8cf07c1567 (patch)
tree2bca98a8ed38b98eed130334bcf785ba5d040b71 /forms/source/component/Grid.cxx
parent#103388# removed a debuggin relic from the previous revision (diff)
downloadcore-9a681f26605dc1cf9e8a322cebd5cc8cf07c1567.tar.gz
core-9a681f26605dc1cf9e8a322cebd5cc8cf07c1567.zip
#103388# introduced ElementDescription to cache some information (interfaces) about to-be-inserted objects
Diffstat (limited to 'forms/source/component/Grid.cxx')
-rw-r--r--forms/source/component/Grid.cxx40
1 files changed, 25 insertions, 15 deletions
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index 63dd597fabbb..0a1c1f988f5d 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Grid.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: fs $ $Date: 2001-11-08 11:24:52 $
+ * last change: $Author: fs $ $Date: 2002-10-04 08:11:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -984,8 +984,8 @@ void SAL_CALL OGridControlModel::reloaded(const EventObject& rEvent) throw(Runti
OGridColumn* OGridControlModel::getColumnImplementation(const InterfaceRef& _rxIFace) const
{
OGridColumn* pImplementation = NULL;
- Reference<XUnoTunnel> xUnoTunnel(_rxIFace, UNO_QUERY);
- if (xUnoTunnel.is())
+ Reference< XUnoTunnel > xUnoTunnel( _rxIFace, UNO_QUERY );
+ if ( xUnoTunnel.is() )
pImplementation = reinterpret_cast<OGridColumn*>(xUnoTunnel->getSomething(OGridColumn::getUnoTunnelImplementationId()));
return pImplementation;
@@ -1032,33 +1032,43 @@ void OGridControlModel::implRemoved(const InterfaceRef& _rxObject)
}
//------------------------------------------------------------------------------
-void OGridControlModel::implInserted(const InterfaceRef& _rxObject)
+void OGridControlModel::implInserted( const ElementDescription* _pElement )
{
- OInterfaceContainer::implInserted(_rxObject);
+ OInterfaceContainer::implInserted( _pElement );
- Reference< XSQLErrorBroadcaster > xBroadcaster( _rxObject, UNO_QUERY );
+ Reference< XSQLErrorBroadcaster > xBroadcaster( _pElement->xInterface, UNO_QUERY );
if ( xBroadcaster.is() )
xBroadcaster->addSQLErrorListener( this );
- gotColumn(_rxObject);
+ gotColumn( _pElement->xInterface );
+}
+
+//------------------------------------------------------------------------------
+void OGridControlModel::implReplaced( const InterfaceRef& _rxReplacedObject, const ElementDescription* _pElement )
+{
+ OInterfaceContainer::implReplaced( _rxReplacedObject, _pElement );
+ lostColumn( _rxReplacedObject );
+ gotColumn( _pElement->xInterface );
}
//------------------------------------------------------------------------------
-void OGridControlModel::implReplaced(const InterfaceRef& _rxReplacedObject, const InterfaceRef& _rxNewObject)
+ElementDescription* OGridControlModel::createElementMetaData( )
{
- OInterfaceContainer::implReplaced(_rxReplacedObject, _rxNewObject);
- lostColumn(_rxReplacedObject);
- gotColumn(_rxNewObject);
+ return new ColumnDescription;
}
//------------------------------------------------------------------------------
-InterfaceRef OGridControlModel::approveNewElement( const InterfaceRef& _rxObject )
+void OGridControlModel::approveNewElement( const Reference< XPropertySet >& _rxObject, ElementDescription* _pElement )
{
OGridColumn* pCol = getColumnImplementation( _rxObject );
if ( !pCol )
throw IllegalArgumentException();
- return OInterfaceContainer::approveNewElement( _rxObject );
+ OInterfaceContainer::approveNewElement( _rxObject, _pElement );
+
+ // if we're here, the object passed all tests
+ if ( _pElement )
+ static_cast< ColumnDescription* >( _pElement )->pColumn = pCol;
}
// XPersistObject
@@ -1222,7 +1232,7 @@ void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream) t
}
if ( xCol.is() )
- implInsert( i, xCol, sal_False, sal_False, sal_False );
+ implInsert( i, xCol, sal_False, NULL, sal_False );
}
}