summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 35408afbfe05..7f17f84fe001 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -308,11 +308,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
{
FormulaTokenMap* pCol = it1->second;
FormulaTokenMap::const_iterator it2 = pCol->begin();
- for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex; ++nRow)
+ for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow)
{
- if (it2 != pCol->end() && nRow>=nHeaderRowCount)
+ FormulaToken* pToken = it2->second;
+ if (pToken && nRow>=nHeaderRowCount)
{
- FormulaToken* pToken = it2->second;
ScRange aRange;
bool bExternal = false;
StackVar eType = pToken->GetType();