sc/inc/cellvalue.hxx              |    4 ++--
 sc/source/core/data/cellvalue.cxx |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7925b4de3f9213a1aadfe7a4b1153241f264f439
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jun 20 12:54:44 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jun 20 15:05:43 2022 +0200

    use std::monostate in std::variant
    
    as suggest by llunak
    
    Change-Id: Id22253198bff16eeb596e1a15ddaba1f6ac227d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136146
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/cellvalue.hxx b/sc/inc/cellvalue.hxx
index 5cf4cb3ba57d..75e144c77252 100644
--- a/sc/inc/cellvalue.hxx
+++ b/sc/inc/cellvalue.hxx
@@ -31,8 +31,8 @@ struct ColumnBlockPosition;
 struct SC_DLLPUBLIC ScCellValue
 {
 private:
-    /// bool is there to indicate CellType::NONE
-    std::variant<bool, double, svl::SharedString, EditTextObject*, 
ScFormulaCell*> maData;
+    /// std::monostate is there to indicate CellType::NONE
+    std::variant<std::monostate, double, svl::SharedString, EditTextObject*, 
ScFormulaCell*> maData;
 public:
 
     ScCellValue();
diff --git a/sc/source/core/data/cellvalue.cxx 
b/sc/source/core/data/cellvalue.cxx
index bf4099e023a6..44fde8c7ed03 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -280,7 +280,7 @@ ScCellValue::ScCellValue( const ScCellValue& r )
 ScCellValue::ScCellValue(ScCellValue&& r) noexcept
     : maData(std::move(r.maData))
 {
-    r.maData = true; // reset to empty;
+    r.maData = std::monostate(); // reset to empty;
 }
 
 ScCellValue::~ScCellValue()
@@ -318,7 +318,7 @@ void ScCellValue::clear() noexcept
     }
 
     // Reset to empty value.
-    maData = true;
+    maData = std::monostate();
 }
 
 void ScCellValue::set( double fValue )
@@ -475,7 +475,7 @@ void ScCellValue::release( ScDocument& rDoc, const 
ScAddress& rPos )
             rDoc.SetEmptyCell(rPos);
     }
 
-    maData = true; // reset to empty
+    maData = std::monostate(); // reset to empty
 }
 
 void ScCellValue::release( ScColumn& rColumn, SCROW nRow, 
sc::StartListeningType eListenType )
@@ -503,7 +503,7 @@ void ScCellValue::release( ScColumn& rColumn, SCROW nRow, 
sc::StartListeningType
             rColumn.DeleteContent(nRow);
     }
 
-    maData = true; // reset to empty
+    maData = std::monostate(); // reset to empty
 }
 
 OUString ScCellValue::getString( const ScDocument& rDoc ) const
@@ -532,7 +532,7 @@ ScCellValue& ScCellValue::operator=(ScCellValue&& rCell) 
noexcept
 {
     clear();
     maData = std::move(rCell.maData);
-    rCell.maData = true; // reset to empty;
+    rCell.maData = std::monostate(); // reset to empty;
     return *this;
 }
 

Reply via email to