summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-08-22 13:59:56 +0000
committerFrank Schönheit <fs@openoffice.org>2001-08-22 13:59:56 +0000
commite852e11440f4fb00bfd46acae55f3bdf3332a6f1 (patch)
treed0a0b63026f07a1ac431013e857aee545cc9c3e5
parentd5ecba772d36775172a747b89f45f059312ae169 (diff)
#91210# FmXCheckBoxCell::OnClick: let m_pCellControl commit the changes into the data source field immediately
-rw-r--r--svx/source/fmcomp/gridcell.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 12c3064542bd..4c5259b16993 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gridcell.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: fs $ $Date: 2001-07-25 13:57:12 $
+ * last change: $Author: fs $ $Date: 2001-08-22 14:59:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,6 +169,7 @@ using namespace ::connectivity;
using namespace ::connectivity::simple;
using namespace ::svxform;
using namespace ::svt;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
@@ -1199,9 +1200,8 @@ void DbCheckBox::Paint(OutputDevice& rDev, const Rectangle& rRect,
//------------------------------------------------------------------------------
sal_Bool DbCheckBox::Commit()
{
- Any aVal;
- aVal <<= (sal_Int16) (((CheckBoxControl*)m_pWindow)->GetBox().GetState());
- m_rColumn.getModel()->setPropertyValue(FM_PROP_STATE, aVal);
+ Any aVal = makeAny( (sal_Int16)( static_cast< CheckBoxControl* >( m_pWindow )->GetBox().GetState() ) );
+ m_rColumn.getModel()->setPropertyValue( FM_PROP_STATE, aVal );
return sal_True;
}
@@ -2451,7 +2451,7 @@ void FmXGridCell::SetTextLineColor(const Color& _rColor)
//------------------------------------------------------------------
Sequence< sal_Int8 > SAL_CALL FmXGridCell::getImplementationId() throw(RuntimeException)
{
- return form::OImplementationIds::getImplementationId(getTypes());
+ return ::form::OImplementationIds::getImplementationId(getTypes());
}
// OComponentHelper
@@ -2905,6 +2905,12 @@ IMPL_LINK( FmXCheckBoxCell, OnClick, void*, EMPTYARG )
{
if (m_pBox)
{
+ // check boxes are to be committed immediately (this holds for ordinary check box controls in
+ // documents, and this must hold for check boxes in grid columns, too
+ // 91210 - 22.08.2001 - frank.schoenheit@sun.com
+ m_pCellControl->Commit();
+
+ // notify our listeners
::cppu::OInterfaceIteratorHelper aIt( m_aItemListeners );
::com::sun::star::awt::ItemEvent aEvent;
@@ -2912,8 +2918,8 @@ IMPL_LINK( FmXCheckBoxCell, OnClick, void*, EMPTYARG )
aEvent.Highlighted = sal_False;
aEvent.Selected = m_pBox->GetState();
- while( aIt.hasMoreElements() )
- ((::com::sun::star::awt::XItemListener *)aIt.next())->itemStateChanged( aEvent );
+ while ( aIt.hasMoreElements() )
+ static_cast< awt::XItemListener* >( aIt.next() )->itemStateChanged( aEvent );
}
return 1;
}