diff options
author | Eike Rathke <erack@redhat.com> | 2011-11-27 22:15:35 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-11-28 15:25:27 +0100 |
commit | f65345b11259c431e715d7f4f17d2ec035cd23d8 (patch) | |
tree | b68abe73622fc369b0d25734649e97ce139e12e8 /sc/source/core/tool/doubleref.cxx | |
parent | e14b35d3b4333e534007902d28f433a0edc035be (diff) |
dr78: #i115015# proper handling of add-in parameter arrays, merged with database functions QueryParam
# HG changeset patch
# User Niklas Nebel <nn@openoffice.org>
# Date 1290620646 -3600
# Node ID 96608d83032e60946c80e0a5185a55843b74eb6f
# Parent 427eca1ec1adf81ed3016bde2ef2b010c9fd9ed1
Diffstat (limited to 'sc/source/core/tool/doubleref.cxx')
-rw-r--r-- | sc/source/core/tool/doubleref.cxx | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx index 61c6176b2158..a5d582a75821 100644 --- a/sc/source/core/tool/doubleref.cxx +++ b/sc/source/core/tool/doubleref.cxx @@ -321,11 +321,8 @@ OUString ScDBInternalRange::getString(SCCOL nCol, SCROW nRow) const { OUString aStr; const ScAddress& s = maRange.aStart; - ScBaseCell* pCell = getDoc()->GetCell(ScAddress(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab())); - if (!pCell) - return aStr; - - getCellString(aStr, pCell); + // GetStringForFormula is not used here, to allow querying for date values. + getDoc()->GetInputString(s.Col() + nCol, s.Row() + nRow, s.Tab(), aStr); return aStr; } @@ -345,54 +342,6 @@ SCCOL ScDBInternalRange::findFieldColumn(SCCOL nIndex) const return nIndex + nDBCol1 - 1; } -sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) const -{ - sal_uInt16 nErr = 0; - String aStr; - if (pCell) - { - SvNumberFormatter* pFormatter = getDoc()->GetFormatTable(); - switch (pCell->GetCellType()) - { - case CELLTYPE_STRING: - ((ScStringCell*) pCell)->GetString(aStr); - break; - case CELLTYPE_EDIT: - ((ScEditCell*) pCell)->GetString(aStr); - break; - case CELLTYPE_FORMULA: - { - ScFormulaCell* pFCell = (ScFormulaCell*) pCell; - nErr = pFCell->GetErrCode(); - if (pFCell->IsValue()) - { - double fVal = pFCell->GetValue(); - sal_uLong nIndex = pFormatter->GetStandardFormat( - NUMBERFORMAT_NUMBER, - ScGlobal::eLnge); - pFormatter->GetInputLineString(fVal, nIndex, aStr); - } - else - pFCell->GetString(aStr); - } - break; - case CELLTYPE_VALUE: - { - double fVal = ((ScValueCell*) pCell)->GetValue(); - sal_uLong nIndex = pFormatter->GetStandardFormat( - NUMBERFORMAT_NUMBER, - ScGlobal::eLnge); - pFormatter->GetInputLineString(fVal, nIndex, aStr); - } - break; - default: - ; - } - } - rStr = aStr; - return nErr; -} - SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) const { const ScAddress& s = maRange.aStart; @@ -413,8 +362,7 @@ SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) ScAddress aLook( nDBCol1, nDBRow1, nDBTab1 ); while (!bFound && (aLook.Col() <= nDBCol2)) { - ScBaseCell* pCell = getDoc()->GetCell( aLook ); - sal_uInt16 nErr = getCellString( aCellStr, pCell ); + sal_uInt16 nErr = getDoc()->GetStringForFormula( aLook, aCellStr ); if (pErr) *pErr = nErr; lcl_toUpper(aCellStr); |