summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2010-01-08 07:19:18 +0000
committerOliver Bolte <obo@openoffice.org>2010-01-08 07:19:18 +0000
commit317284efe0c33f963da39896ac73452bfd388fd8 (patch)
tree2fcf5bff48ec7ac9ba4f4d202aabe8c7c31467fb
parenta9723cee98e94763dfb445fc99d619240ab5976a (diff)
CWS-TOOLING: integrate CWS calc32stopper8
2010-01-04 18:19:19 +0100 nn r277850 : #i108005# build token array for goal seek with value instead of string token
-rw-r--r--sc/source/core/data/documen4.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index aa9041405..fbac29616 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -76,9 +76,13 @@ BOOL ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
CellType eFType, eVType;
GetCellType(nFCol, nFRow, nFTab, eFType);
GetCellType(nVCol, nVRow, nVTab, eVType);
- // CELLTYPE_NOTE: kein Value aber von Formel referiert
- if (eFType == CELLTYPE_FORMULA && (eVType == CELLTYPE_VALUE
- || eVType == CELLTYPE_NOTE) )
+ // CELLTYPE_NOTE: no value, but referenced by formula
+ // #i108005# convert target value to number using default format,
+ // as previously done in ScInterpreter::GetDouble
+ double nTargetVal = 0.0;
+ sal_uInt32 nFIndex = 0;
+ if (eFType == CELLTYPE_FORMULA && (eVType == CELLTYPE_VALUE || eVType == CELLTYPE_NOTE) &&
+ GetFormatTable()->IsNumberFormat(sValStr, nFIndex, nTargetVal))
{
ScSingleRefData aRefData;
aRefData.InitFlags();
@@ -98,7 +102,7 @@ BOOL ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
aArr.AddSingleReference( aRefData );
aArr.AddOpCode( ocSep );
- aArr.AddString( sValStr.GetBuffer() );
+ aArr.AddDouble( nTargetVal );
aArr.AddOpCode( ocClose );
aArr.AddOpCode( ocStop );