diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-26 23:48:30 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-27 00:07:18 -0400 |
commit | 26343a5a3123315795d0352ee01a1fb5ee0a931a (patch) | |
tree | bd2eded239880e02712b3ba0fb355576c123e324 /sc/source/ui/unoobj | |
parent | 6a2a132661ae2ae535a7259c802d31c817717bd3 (diff) |
More ScBaseCell reduction...
Change-Id: I3a9f9ce79de7117e7b1410c45b217e5bfe005db7
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
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<ScFormulaCell*>(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<sal_Int32>(getDisplayNumberFormat(m_pDocument, aPos)); } else if( nCount == nIndex ) |