[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kchart
From: Sebastian Sauer <mail () dipe ! org>
Date: 2010-06-02 13:40:36
Message-ID: 20100602134036.B0EF0AC8C9 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1133791 by sebsauer:
Followup of r1126333 which was working around a crash in kdchart that happened if a \
row was added behind our back.
M +10 -4 kdchart/src/KDChartModelDataCache_p.h
M +1 -1 shape/PlotArea.cpp
--- trunk/koffice/kchart/kdchart/src/KDChartModelDataCache_p.h #1133790:1133791
@@ -118,7 +118,7 @@
// apparently, data were added behind our back (w/o signals)
const_cast< ModelDataCache< T, ROLE >* >( this )->rowsInserted( \
m_rootIndex,
\
m_data.count(),
- \
m_model->rowCount( m_rootIndex ) - 1 ); + \
qMax(m_data.count(), m_model->rowCount( m_rootIndex ) - 1) ); Q_ASSERT( index.row() \
< m_data.count() ); }
@@ -129,7 +129,7 @@
// apparently, data were added behind our back (w/o signals)
const_cast< ModelDataCache< T, ROLE >* >( this )->columnsInserted( \
m_rootIndex,
\
m_data.first().count(),
- \
m_model->columnCount( m_rootIndex ) - 1 ); + \
qMax(m_data.first().count(), m_model->columnCount( m_rootIndex ) - 1) ); Q_ASSERT( \
index.column() < m_data.first().count() ); }
@@ -209,8 +209,9 @@
if( parent != m_rootIndex )
return;
+ Q_ASSERT( start >= end );
+
const int rowCount = m_data.count();
-
for( int row = 0; row < rowCount; ++row )
{
m_data[ row ].insert( start, end - start + 1, T() );
@@ -227,8 +228,9 @@
if( parent != m_rootIndex )
return;
+ Q_ASSERT( start >= end );
+
const int rowCount = m_data.count();
-
for( int row = 0; row < rowCount; ++row )
{
m_data[ row ].remove( start, end - start + 1 );
@@ -294,6 +296,8 @@
if( parent != m_rootIndex )
return;
+ Q_ASSERT( start >= end );
+
m_data.insert( start, end - start + 1, QVector< T >( \
m_model->columnCount( m_rootIndex ) ) );
m_cacheValid.insert( start, end - start + 1, QVector< bool >( \
m_model->columnCount( m_rootIndex ), false ) );
@@ -308,6 +312,8 @@
if( parent != m_rootIndex )
return;
+ Q_ASSERT( start >= end );
+
m_data.remove( start, end - start + 1 );
m_cacheValid.remove( start, end - start + 1 );
--- trunk/koffice/kchart/shape/PlotArea.cpp #1133790:1133791
@@ -1107,7 +1107,7 @@
// Only paint the actual chart if there is a certain minimal size,
// because otherwise kdchart will crash.
QRect kdchartRect = ScreenConversions::scaleFromPtToPx(paintRect);
- if (kdchartRect.width() > 20 && kdchartRect.height() > 20) {
+ if (kdchartRect.width() > 10 && kdchartRect.height() > 10) {
d->kdChart->paint(&painter, kdchartRect);
}
//painter.restore();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic