sc/source/core/data/documen3.cxx |    6 +++---
 sc/source/core/data/validat.cxx  |    6 +++---
 sc/source/ui/app/inputhdl.cxx    |    4 ++--
 sc/source/ui/view/gridwin.cxx    |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit ac1ea5944a236efef75af7c85d0ffe10d374e7fa
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Mon Dec 6 14:53:14 2021 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Fri Dec 10 01:46:41 2021 +0100

    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 <er...@redhat.com>
    Reviewed-by: Eike Rathke <er...@redhat.com>

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index cd10db483ae5..163c374b6406 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1668,7 +1668,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
@@ -1676,7 +1676,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
@@ -1699,7 +1699,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 ade4908df44a..78541960a11c 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -836,7 +836,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));
@@ -873,7 +873,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))
@@ -916,7 +916,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 f4540b11ddee..24d99a658e48 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1033,10 +1033,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 c6a0cac1daf6..568fcb91ccb5 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1439,10 +1439,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)
             {

Reply via email to