summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-28 10:27:20 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-28 17:03:54 -0400
commit91acb4a276acdfaa6f85a68b18104ab87f1abf80 (patch)
tree954d159ade7bc3b686d2e5c550a3c69cde91bde9 /sc
parent86a9278609f3a60d1bf25ac69371789cfa911f85 (diff)
Remove HasCellStringData() and modifiy all its call sites.
Change-Id: I2a127b8433bc6f2629ad8d41b532c630a433c59b
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/inc/interpre.hxx1
-rw-r--r--sc/source/core/tool/interpr1.cxx44
-rw-r--r--sc/source/core/tool/interpr4.cxx5
3 files changed, 24 insertions, 26 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 9e691162561f..fa4d82addddb 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -197,7 +197,6 @@ void GetCellString( String& rStr, const ScBaseCell* pCell );
void GetCellString( OUString& rStr, ScRefCellValue& rCell );
sal_uInt16 GetCellErrCode( const ScRefCellValue& rCell );
bool HasCellValueData( const ScBaseCell* pCell );
-bool HasCellStringData( const ScBaseCell* pCell );
bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 4dc426c5e472..fcdf226b073d 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2449,7 +2449,8 @@ void ScInterpreter::ScCell()
PushIllegalParameter();
else
{
- ScBaseCell* pCell = GetCell( aCellPos );
+ ScRefCellValue aCell;
+ aCell.assign(*pDok, aCellPos);
ScCellKeywordTranslator::transKeyword(aInfoType, ScGlobal::GetLocale(), ocCell);
@@ -2518,22 +2519,22 @@ void ScInterpreter::ScCell()
// *** CELL PROPERTIES ***
else if( aInfoType.EqualsAscii( "CONTENTS" ) )
{ // contents of the cell, no formatting
- if( pCell && pCell->HasStringData() )
+ if (aCell.hasString())
{
- String aStr;
- GetCellString( aStr, pCell );
+ OUString aStr;
+ GetCellString(aStr, aCell);
PushString( aStr );
}
else
- PushDouble( GetCellValue( aCellPos, pCell ) );
+ PushDouble(GetCellValue(aCellPos, aCell));
}
else if( aInfoType.EqualsAscii( "TYPE" ) )
{ // b = blank; l = string (label); v = otherwise (value)
sal_Unicode c;
- if( HasCellStringData( pCell ) )
+ if (aCell.hasString())
c = 'l';
else
- c = HasCellValueData( pCell ) ? 'v' : 'b';
+ c = aCell.hasNumeric() ? 'v' : 'b';
PushString( OUString(c) );
}
else if( aInfoType.EqualsAscii( "WIDTH" ) )
@@ -2556,7 +2557,7 @@ void ScInterpreter::ScCell()
else if( aInfoType.EqualsAscii( "PREFIX" ) )
{ // ' = left; " = right; ^ = centered
sal_Unicode c = 0;
- if( HasCellStringData( pCell ) )
+ if (aCell.hasString())
{
const SvxHorJustifyItem* pJustAttr = (const SvxHorJustifyItem*)
pDok->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_HOR_JUSTIFY );
@@ -3685,14 +3686,15 @@ void ScInterpreter::ScMin( bool bTextAsZero )
case svSingleRef :
{
PopSingleRef( aAdr );
- ScBaseCell* pCell = GetCell( aAdr );
- if (HasCellValueData(pCell))
+ ScRefCellValue aCell;
+ aCell.assign(*pDok, aAdr);
+ if (aCell.hasNumeric())
{
- nVal = GetCellValue( aAdr, pCell );
+ nVal = GetCellValue(aAdr, aCell);
CurFmtToFuncFmt();
if (nMin > nVal) nMin = nVal;
}
- else if ( bTextAsZero && HasCellStringData( pCell ) )
+ else if (bTextAsZero && aCell.hasString())
{
if ( nMin > 0.0 )
nMin = 0.0;
@@ -3808,14 +3810,15 @@ void ScInterpreter::ScMax( bool bTextAsZero )
case svSingleRef :
{
PopSingleRef( aAdr );
- ScBaseCell* pCell = GetCell( aAdr );
- if (HasCellValueData(pCell))
+ ScRefCellValue aCell;
+ aCell.assign(*pDok, aAdr);
+ if (aCell.hasNumeric())
{
- nVal = GetCellValue( aAdr, pCell );
+ nVal = GetCellValue(aAdr, aCell);
CurFmtToFuncFmt();
if (nMax < nVal) nMax = nVal;
}
- else if ( bTextAsZero && HasCellStringData( pCell ) )
+ else if (bTextAsZero && aCell.hasString())
{
if ( nMax < 0.0 )
nMax = 0.0;
@@ -4371,15 +4374,16 @@ void ScInterpreter::GetStVarParams( double& rVal, double& rValCount,
case svSingleRef :
{
PopSingleRef( aAdr );
- ScBaseCell* pCell = GetCell( aAdr );
- if (HasCellValueData(pCell))
+ ScRefCellValue aCell;
+ aCell.assign(*pDok, aAdr);
+ if (aCell.hasNumeric())
{
- fVal = GetCellValue( aAdr, pCell );
+ fVal = GetCellValue(aAdr, aCell);
values.push_back(fVal);
fSum += fVal;
rValCount++;
}
- else if ( bTextAsZero && HasCellStringData( pCell ) )
+ else if (bTextAsZero && aCell.hasString())
{
values.push_back(0.0);
rValCount++;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 361663c2fbcc..92d446762920 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -198,11 +198,6 @@ bool ScInterpreter::HasCellValueData( const ScBaseCell* pCell )
return pCell ? pCell->HasValueData() : false;
}
-bool ScInterpreter::HasCellStringData( const ScBaseCell* pCell )
-{
- return pCell ? pCell->HasStringData() : false;
-}
-
/** Convert string content to numeric value.
Converted are only integer numbers including exponent, and ISO 8601 dates