Source Code (Use browser search to find items of interest.)
Class Index
kspread'ChartBinding (./koffice/kspread/kspread_table.h:135)
class ChartBinding : public CellBinding
{
Q_OBJECT
public:
ChartBinding( KSpreadTable *_table, const QRect& _area, ChartChild *_child );
virtual ~ChartBinding();
virtual void cellChanged( KSpreadCell *_obj );
private:
ChartChild* m_child;
};
kspread'ChartBinding::ChartBinding() (./koffice/kspread/kspread_table.cc:125)
ChartBinding::ChartBinding( KSpreadTable *_table, const QRect& _area, ChartChild *_child )
: CellBinding( _table, _area )
{
m_child = _child;
}
kspread'ChartBinding::~ChartBinding() (./koffice/kspread/kspread_table.cc:131)
ChartBinding::~ChartBinding()
{
}
kspread'ChartBinding::cellChanged() (./koffice/kspread/kspread_table.cc:135)
void ChartBinding::cellChanged( KSpreadCell* )
{
cout << "######### void ChartBinding::cellChanged( KSpreadCell* )" << endl;
if ( m_bIgnoreChanges )
return;
cout << "with=" << m_rctDataArea.width() << " height=" << m_rctDataArea.height() << endl;
KChartData matrix( m_rctDataArea.height(), m_rctDataArea.width() );
//matrix.matrix.length( ( m_rctDataArea.width() - 1 ) * ( m_rctDataArea.height() - 1 ) );
for ( int y = 0; y < m_rctDataArea.height(); y++ )
for ( int x = 0; x < m_rctDataArea.width(); x++ )
{
KSpreadCell* cell = m_pTable->cellAt( m_rctDataArea.left() + x, m_rctDataArea.top() + y );
matrix.cell( y, x ).exists = TRUE;
if ( cell && cell->isValue() )
matrix.cell( y, x ).value = cell->valueDouble();
else if ( cell )
matrix.cell( y, x ).value = cell->valueString();
else
matrix.cell( y, x ).exists = FALSE;
}
// ######### Kalle may be interested in that, too
/* Chart::Range range;
range.top = m_rctDataArea.top();
range.left = m_rctDataArea.left();
range.right = m_rctDataArea.right();
range.bottom = m_rctDataArea.bottom();
range.table = m_pTable->name(); */
m_child->chart()->setPart( matrix );
}
/*****************************************************************************
*
* KSpreadTable
*
*****************************************************************************/