From 26343a5a3123315795d0352ee01a1fb5ee0a931a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 26 Mar 2013 23:48:30 -0400 Subject: More ScBaseCell reduction... Change-Id: I3a9f9ce79de7117e7b1410c45b217e5bfe005db7 --- sc/source/ui/unoobj/chart2uno.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sc/source/ui/unoobj') diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 8eed3b7b1cfa..60e65dc6038f 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -35,6 +35,7 @@ #include "stlalgorithm.hxx" #include "tokenuno.hxx" #include "docsh.hxx" +#include "cellvalue.hxx" #include "formula/opcode.hxx" @@ -3262,12 +3263,13 @@ sal_uLong getDisplayNumberFormat(ScDocument* pDoc, const ScAddress& rPos) if (!pFormatter) return nFormat; - ScBaseCell* pCell = pDoc->GetCell(rPos); - if (!pCell || pCell->GetCellType() != CELLTYPE_FORMULA || nFormat) + ScRefCellValue aCell; + aCell.assign(*pDoc, rPos); + if (aCell.isEmpty() || aCell.meType != CELLTYPE_FORMULA || nFormat) return nFormat; // With formula cell, the format may be inferred from the formula result. - return static_cast(pCell)->GetStandardFormat(*pFormatter, nFormat); + return aCell.mpFormula->GetStandardFormat(*pFormatter, nFormat); } } @@ -3328,8 +3330,9 @@ sal_uLong getDisplayNumberFormat(ScDocument* pDoc, const ScAddress& rPos) { // TODO: use nicer heuristic // return format of first non-empty cell - ScBaseCell* pCell = m_pDocument->GetCell(aPos); - if (pCell) + ScRefCellValue aCell; + aCell.assign(*m_pDocument, aPos); + if (!aCell.isEmpty()) return static_cast(getDisplayNumberFormat(m_pDocument, aPos)); } else if( nCount == nIndex ) -- cgit