summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-20 12:54:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-20 15:05:43 +0200
commit7925b4de3f9213a1aadfe7a4b1153241f264f439 (patch)
treea1187dbbaf6aeaf4852d4655d3d4a1de11372f38
parent94be0c12fe419cc7f50f5cfc6cdf161805e7490f (diff)
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.grandin@collabora.co.uk>
-rw-r--r--sc/inc/cellvalue.hxx4
-rw-r--r--sc/source/core/data/cellvalue.cxx10
2 files changed, 7 insertions, 7 deletions
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;
}