summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-24 19:07:27 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-24 21:07:38 -0400
commit1e0c38bb54563788d08336dabe8178a60e4f83e7 (patch)
tree425b09e9c467015b24493cd8ac1b8a10449b5f50 /chart2
parente32b78ebfd9dc6f780e73d17c794c54828471895 (diff)
Unwind this logic a bit.
Change-Id: I320b28fb319b42eeae7cada31b6f27f9e342db15
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 27fedf8ea349..6e0e6c7409fc 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -748,10 +748,14 @@ OUString DataBrowserModel::getRoleOfColumn( sal_Int32 nColumnIndex ) const
bool DataBrowserModel::isCategoriesColumn( sal_Int32 nColumnIndex ) const
{
- bool bIsCategories = false;
- if( nColumnIndex>=0 && nColumnIndex<static_cast< sal_Int32 >(m_aColumns.size()) )
- bIsCategories = !m_aColumns[ nColumnIndex ].m_xDataSeries.is();
- return bIsCategories;
+ if (nColumnIndex < 0)
+ return false;
+
+ if (static_cast<size_t>(nColumnIndex) >= m_aColumns.size())
+ return false;
+
+ // A column is a category when it doesn't have an associated data series.
+ return !m_aColumns[nColumnIndex].m_xDataSeries.is();
}
sal_Int32 DataBrowserModel::getCategoryColumnCount()