summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-12-06 14:53:14 +0200
committerEike Rathke <erack@redhat.com>2021-12-10 02:57:53 +0100
commit20c1ab5d85e3f24d4cdf6ab167ea6ce98e2586b4 (patch)
tree466e9687380991e6571f18febfd5ea0542e85248 /sc
parent433c91206991c10b4ce2d7149dafa018f50e39dd (diff)
new ScTypedStrData: typically missed argument in CTOR, tdf#142910 follow-up
Pretty much any attempted use of eType was completely wrong and lost. Regression from commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d CommitDate: Wed Jul 7 17:44:46 2021 +0200 tdf#142910 sc filter: fix "greater than" or "smaller than" etc Most calls to this are missing the "rounded number" argument, so the enumator is actually accepted as the double fRVal, and the StringValue eType was left as the default value (Standard), instead of the intended enumerator. 0.0 looks too much like 0, 0 to even notice in casual code reading. This had rendered the type mostly irrelevant. Change-Id: If4fa69d4b3077981244a2c3a785f80b77f9f9501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126453 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit ac1ea5944a236efef75af7c85d0ffe10d374e7fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126591 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen3.cxx6
-rw-r--r--sc/source/core/data/validat.cxx6
-rw-r--r--sc/source/ui/app/inputhdl.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx4
4 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 92c721fa48ca..a1e7a2d9e73b 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1669,7 +1669,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
if ( pRangeName )
{
for (const auto& rEntry : *pRangeName)
- rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, ScTypedStrData::Name));
+ rStrings.insert(ScTypedStrData(rEntry.second->GetName(), 0.0, 0.0, ScTypedStrData::Name));
}
// Database collection
@@ -1677,7 +1677,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
{
const ScDBCollection::NamedDBs& rDBs = pDBCollection->getNamedDBs();
for (const auto& rxDB : rDBs)
- rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, ScTypedStrData::DbName));
+ rStrings.insert(ScTypedStrData(rxDB->GetName(), 0.0, 0.0, ScTypedStrData::DbName));
}
// Content of name ranges
@@ -1700,7 +1700,7 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
continue;
OUString aStr = aIter.getString();
- rStrings.insert(ScTypedStrData(aStr, 0.0, ScTypedStrData::Header));
+ rStrings.insert(ScTypedStrData(aStr, 0.0, 0.0, ScTypedStrData::Header));
}
}
}
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index d467db7ccf0f..6f578402309d 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -843,7 +843,7 @@ bool ScValidationData::GetSelectionFromFormula(
}
if( nullptr != pStrings )
- pEntry.reset(new ScTypedStrData( aValStr, 0.0, ScTypedStrData::Standard));
+ pEntry.reset(new ScTypedStrData(aValStr, 0.0, 0.0, ScTypedStrData::Standard));
if (!rCell.isEmpty() && rMatch < 0)
aCondTokArr.AddString(rSPool.intern(aValStr));
@@ -880,7 +880,7 @@ bool ScValidationData::GetSelectionFromFormula(
aCondTokArr.AddDouble( nMatVal.fVal );
}
if( nullptr != pStrings )
- pEntry.reset(new ScTypedStrData( aValStr, nMatVal.fVal, ScTypedStrData::Value));
+ pEntry.reset(new ScTypedStrData(aValStr, nMatVal.fVal, nMatVal.fVal, ScTypedStrData::Value));
}
if (rMatch < 0 && !rCell.isEmpty() && IsEqualToTokenArray(rCell, rPos, aCondTokArr))
@@ -923,7 +923,7 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl,
OUString aStr(pString);
bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
rStrColl.emplace_back(
- aStr, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard);
+ aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard);
}
bOk = aIt.Ok();
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f3f672d23d42..7d16794db8b1 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -993,10 +993,10 @@ void ScInputHandler::GetFormulaData()
maFormulaChar.insert( c );
}
OUString aFuncName = *pDesc->mxFuncName + aParenthesesReplacement;
- pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, ScTypedStrData::Standard));
+ pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, 0.0, ScTypedStrData::Standard));
pDesc->initArgumentInfo();
OUString aEntry = pDesc->getSignature();
- pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, ScTypedStrData::Standard));
+ pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 0.0, ScTypedStrData::Standard));
}
}
miAutoPosFormula = pFormulaData->end();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 71b994c75d76..ab7ed3fe45cf 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1266,10 +1266,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
if ( rDoc.HasValueData( nCol, nRow, nTab ) )
{
double fVal = rDoc.GetValue(ScAddress(nCol, nRow, nTab));
- pNew.reset(new ScTypedStrData(aDocStr, fVal, ScTypedStrData::Value));
+ pNew.reset(new ScTypedStrData(aDocStr, fVal, fVal, ScTypedStrData::Value));
}
else
- pNew.reset(new ScTypedStrData(aDocStr, 0.0, ScTypedStrData::Standard));
+ pNew.reset(new ScTypedStrData(aDocStr, 0.0, 0.0, ScTypedStrData::Standard));
if (pData->GetListType() == css::sheet::TableValidationVisibility::SORTEDASCENDING)
{