|
|
|
@@ -1398,7 +1398,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE
|
|
|
|
|
// this should not be (deadlock) critical, as by definition, every component should release
|
|
|
|
|
// any own mutexes before notifying
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (!pGrid)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@@ -1518,7 +1518,7 @@ void FmXGridPeer::removeUpdateListener(const Reference< XUpdateListener >& l) th
|
|
|
|
|
|
|
|
|
|
sal_Bool FmXGridPeer::commit() throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (!m_xCursor.is() || !pGrid)
|
|
|
|
|
return sal_True;
|
|
|
|
|
|
|
|
|
@@ -1541,7 +1541,7 @@ sal_Bool FmXGridPeer::commit() throw( RuntimeException, std::exception )
|
|
|
|
|
|
|
|
|
|
void FmXGridPeer::cursorMoved(const EventObject& _rEvent) throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
// we are not interested in move to insert row only in the resetted event
|
|
|
|
|
// which is fired after positioning an the insert row
|
|
|
|
|
if (pGrid && pGrid->IsOpen() && !::comphelper::getBOOL(Reference< XPropertySet > (_rEvent.Source, UNO_QUERY)->getPropertyValue(FM_PROP_ISNEW)))
|
|
|
|
@@ -1551,7 +1551,7 @@ void FmXGridPeer::cursorMoved(const EventObject& _rEvent) throw( RuntimeExceptio
|
|
|
|
|
|
|
|
|
|
void FmXGridPeer::rowChanged(const EventObject& _rEvent) throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (pGrid && pGrid->IsOpen())
|
|
|
|
|
{
|
|
|
|
|
if (m_xCursor->rowUpdated() && !pGrid->IsCurrentAppending())
|
|
|
|
@@ -1654,7 +1654,7 @@ void FmXGridPeer::setColumns(const Reference< XIndexContainer >& Columns) throw(
|
|
|
|
|
{
|
|
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast< FmGridControl* >( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
if (m_xColumns.is())
|
|
|
|
|
{
|
|
|
|
@@ -1770,7 +1770,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) throw( RuntimeExcep
|
|
|
|
|
{
|
|
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
// Handle Column beruecksichtigen
|
|
|
|
|
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove())
|
|
|
|
@@ -1825,7 +1825,7 @@ void FmXGridPeer::elementRemoved(const ContainerEvent& evt) throw( RuntimeExcept
|
|
|
|
|
{
|
|
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>(GetWindow());
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
// Handle Column beruecksichtigen
|
|
|
|
|
if (!pGrid || !m_xColumns.is() || pGrid->IsInColumnMove() || m_xColumns->getCount() == ((sal_Int32)pGrid->GetModelColCount()))
|
|
|
|
@@ -1842,7 +1842,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) t
|
|
|
|
|
{
|
|
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
bool bVoid = !Value.hasValue();
|
|
|
|
|
|
|
|
|
@@ -2255,14 +2255,14 @@ void SAL_CALL FmXGridPeer::removeGridControlListener( const Reference< XGridCont
|
|
|
|
|
|
|
|
|
|
sal_Int16 FmXGridPeer::getCurrentColumnPosition() throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
return pGrid ? pGrid->GetViewColumnPos(pGrid->GetCurColumnId()) : -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FmXGridPeer::setCurrentColumnPosition(sal_Int16 nPos) throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (pGrid)
|
|
|
|
|
pGrid->GoToColumnId(pGrid->GetColumnIdFromViewPos(nPos));
|
|
|
|
|
}
|
|
|
|
@@ -2272,7 +2272,7 @@ void FmXGridPeer::selectionChanged(const EventObject& evt) throw( RuntimeExcepti
|
|
|
|
|
{
|
|
|
|
|
SolarMutexGuard aGuard;
|
|
|
|
|
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (pGrid)
|
|
|
|
|
{
|
|
|
|
|
Reference< ::com::sun::star::view::XSelectionSupplier > xSelSupplier(evt.Source, UNO_QUERY);
|
|
|
|
@@ -2340,7 +2340,7 @@ Reference< XEnumeration > FmXGridPeer::createEnumeration() throw( RuntimeExcept
|
|
|
|
|
|
|
|
|
|
sal_Int32 FmXGridPeer::getCount() throw( RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (pGrid)
|
|
|
|
|
return pGrid->GetViewColCount();
|
|
|
|
|
else
|
|
|
|
@@ -2350,7 +2350,7 @@ sal_Int32 FmXGridPeer::getCount() throw( RuntimeException, std::exception )
|
|
|
|
|
|
|
|
|
|
Any FmXGridPeer::getByIndex(sal_Int32 _nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception )
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (_nIndex < 0 ||
|
|
|
|
|
_nIndex >= getCount() || !pGrid)
|
|
|
|
|
throw IndexOutOfBoundsException();
|
|
|
|
@@ -2429,7 +2429,7 @@ sal_Bool FmXGridPeer::supportsMode(const OUString& Mode) throw( RuntimeException
|
|
|
|
|
|
|
|
|
|
void FmXGridPeer::columnVisible(DbGridColumn* pColumn)
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId());
|
|
|
|
|
Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell());
|
|
|
|
@@ -2444,7 +2444,7 @@ void FmXGridPeer::columnVisible(DbGridColumn* pColumn)
|
|
|
|
|
|
|
|
|
|
void FmXGridPeer::columnHidden(DbGridColumn* pColumn)
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
|
|
|
|
|
sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId());
|
|
|
|
|
Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell());
|
|
|
|
@@ -2599,7 +2599,7 @@ void FmXGridPeer::statusChanged(const ::com::sun::star::frame::FeatureStateEvent
|
|
|
|
|
{
|
|
|
|
|
DBG_ASSERT(m_pDispatchers[i] == Event.Source, "FmXGridPeer::statusChanged : the event source is a little bit suspect !");
|
|
|
|
|
m_pStateCache[i] = Event.IsEnabled;
|
|
|
|
|
FmGridControl* pGrid = static_cast<FmGridControl*>( GetWindow() );
|
|
|
|
|
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
|
|
|
|
if (*pSlots != SID_FM_RECORD_UNDO)
|
|
|
|
|
pGrid->GetNavigationBar().InvalidateState(*pSlots);
|
|
|
|
|
break;
|
|
|
|
@@ -2621,8 +2621,7 @@ sal_Bool SAL_CALL FmXGridPeer::select( const Any& _rSelection ) throw (IllegalAr
|
|
|
|
|
if ( !( _rSelection >>= aBookmarks ) )
|
|
|
|
|
throw IllegalArgumentException();
|
|
|
|
|
|
|
|
|
|
FmGridControl* pVclControl = static_cast<FmGridControl*>(GetWindow());
|
|
|
|
|
return pVclControl->selectBookmarks(aBookmarks);
|
|
|
|
|
return GetAs< FmGridControl >()->selectBookmarks(aBookmarks);
|
|
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
|
// speaking strictly, we would have to adjust our model, as our ColumnSelection may have changed.
|
|
|
|
@@ -2635,7 +2634,7 @@ sal_Bool SAL_CALL FmXGridPeer::select( const Any& _rSelection ) throw (IllegalAr
|
|
|
|
|
|
|
|
|
|
Any SAL_CALL FmXGridPeer::getSelection( ) throw (RuntimeException, std::exception)
|
|
|
|
|
{
|
|
|
|
|
FmGridControl* pVclControl = static_cast<FmGridControl*>(GetWindow());
|
|
|
|
|
VclPtr< FmGridControl > pVclControl = GetAs< FmGridControl >();
|
|
|
|
|
Sequence< Any > aSelectionBookmarks = pVclControl->getSelectionBookmarks();
|
|
|
|
|
return makeAny(aSelectionBookmarks);
|
|
|
|
|
}
|
|
|
|
|