summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-08-22 15:42:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-08-23 11:48:53 +0200
commit63dfd069b3a957361881c12ccba38c5a23b9a42f (patch)
treee7a9bd1027b19f44a7c58ea9c445ded435c838bc /sc/source/core
parent61ed17cafc90d9b4303b52260f729638eed107c7 (diff)
Mark move ctors/assignments noexcept
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/attrib.cxx2
-rw-r--r--sc/source/core/data/cellvalue.cxx6
-rw-r--r--sc/source/core/data/markarr.cxx4
-rw-r--r--sc/source/core/data/mtvelements.cxx2
-rw-r--r--sc/source/core/data/postit.cxx8
-rw-r--r--sc/source/core/tool/formulalogger.cxx2
-rw-r--r--sc/source/core/tool/rangelst.cxx4
-rw-r--r--sc/source/core/tool/scmatrix.cxx16
8 files changed, 22 insertions, 22 deletions
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 1b523f918a41..f35d2c7219d7 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -677,7 +677,7 @@ ScCondFormatItem::ScCondFormatItem( const ScCondFormatIndexes& rIndex ):
{
}
-ScCondFormatItem::ScCondFormatItem( ScCondFormatIndexes&& aIndex ):
+ScCondFormatItem::ScCondFormatItem( ScCondFormatIndexes&& aIndex ) noexcept:
SfxPoolItem( ATTR_CONDITIONAL ),
maIndex( std::move(aIndex) )
{
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index ef662c4818f7..a860b359ee1d 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -244,7 +244,7 @@ ScCellValue::ScCellValue( const ScCellValue& r ) : meType(r.meType), mfValue(r.m
}
}
-ScCellValue::ScCellValue(ScCellValue&& r)
+ScCellValue::ScCellValue(ScCellValue&& r) noexcept
: meType(r.meType)
, mfValue(r.mfValue)
{
@@ -270,7 +270,7 @@ ScCellValue::~ScCellValue()
clear();
}
-void ScCellValue::clear()
+void ScCellValue::clear() noexcept
{
switch (meType)
{
@@ -513,7 +513,7 @@ ScCellValue& ScCellValue::operator= ( const ScCellValue& r )
return *this;
}
-ScCellValue& ScCellValue::operator=(ScCellValue&& rCell)
+ScCellValue& ScCellValue::operator=(ScCellValue&& rCell) noexcept
{
clear();
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx
index eeeda2aeab8b..3db2c9544b2d 100644
--- a/sc/source/core/data/markarr.cxx
+++ b/sc/source/core/data/markarr.cxx
@@ -32,7 +32,7 @@ ScMarkArray::ScMarkArray() :
}
// Move constructor
-ScMarkArray::ScMarkArray( ScMarkArray&& rOther )
+ScMarkArray::ScMarkArray( ScMarkArray&& rOther ) noexcept
{
operator=(std::move(rOther));
}
@@ -338,7 +338,7 @@ ScMarkArray& ScMarkArray::operator=( const ScMarkArray& rOther )
return *this;
}
-ScMarkArray& ScMarkArray::operator=( ScMarkArray&& rOther )
+ScMarkArray& ScMarkArray::operator=(ScMarkArray&& rOther) noexcept
{
nCount = rOther.nCount;
nLimit = rOther.nLimit;
diff --git a/sc/source/core/data/mtvelements.cxx b/sc/source/core/data/mtvelements.cxx
index e15416fb7d99..21eef33cad45 100644
--- a/sc/source/core/data/mtvelements.cxx
+++ b/sc/source/core/data/mtvelements.cxx
@@ -120,7 +120,7 @@ TableColumnBlockPositionSet::TableColumnBlockPositionSet( ScDocument& rDoc, SCTA
}
}
-TableColumnBlockPositionSet::TableColumnBlockPositionSet( TableColumnBlockPositionSet&& rOther ) :
+TableColumnBlockPositionSet::TableColumnBlockPositionSet( TableColumnBlockPositionSet&& rOther ) noexcept :
mpImpl(std::move(rOther.mpImpl)) {}
TableColumnBlockPositionSet::~TableColumnBlockPositionSet() {}
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 5b92edc04e4b..990440b7dbfa 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -482,15 +482,15 @@ ScCaptionPtr::ScCaptionPtr( const ScCaptionPtr& r ) :
}
}
-ScCaptionPtr::ScCaptionPtr( ScCaptionPtr&& r ) :
- mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbNotOwner(false)
+ScCaptionPtr::ScCaptionPtr(ScCaptionPtr&& r) noexcept
+ : mpHead(r.mpHead), mpNext(r.mpNext), mpCaption(r.mpCaption), mbNotOwner(false)
{
r.replaceInList( this );
r.mpCaption = nullptr;
r.mbNotOwner = false;
}
-ScCaptionPtr& ScCaptionPtr::operator=( ScCaptionPtr&& r )
+ScCaptionPtr& ScCaptionPtr::operator=(ScCaptionPtr&& r) noexcept
{
assert(this != &r);
@@ -560,7 +560,7 @@ void ScCaptionPtr::newHead()
mpHead = new Head(this);
}
-void ScCaptionPtr::replaceInList( ScCaptionPtr* pNew )
+void ScCaptionPtr::replaceInList(ScCaptionPtr* pNew) noexcept
{
if (!mpHead && !mpNext)
return;
diff --git a/sc/source/core/tool/formulalogger.cxx b/sc/source/core/tool/formulalogger.cxx
index d877c1e63c5f..06d42f48f407 100644
--- a/sc/source/core/tool/formulalogger.cxx
+++ b/sc/source/core/tool/formulalogger.cxx
@@ -126,7 +126,7 @@ FormulaLogger::GroupScope::GroupScope(
const ScFormulaCell& rCell, bool bOutputEnabled ) :
mpImpl(std::make_unique<Impl>(rLogger, rPrefix, rDoc, rCell, bOutputEnabled)) {}
-FormulaLogger::GroupScope::GroupScope( GroupScope&& r ) : mpImpl(std::move(r.mpImpl)) {}
+FormulaLogger::GroupScope::GroupScope(GroupScope&& r) noexcept : mpImpl(std::move(r.mpImpl)) {}
FormulaLogger::GroupScope::~GroupScope() {}
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index ce5e75bd403c..4e6891658082 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -983,7 +983,7 @@ ScRangeList::ScRangeList( const ScRangeList& rList ) :
{
}
-ScRangeList::ScRangeList( ScRangeList&& rList ) :
+ScRangeList::ScRangeList(ScRangeList&& rList) noexcept :
SvRefBase(),
maRanges(std::move(rList.maRanges)),
mnMaxRowUsed(rList.mnMaxRowUsed)
@@ -1004,7 +1004,7 @@ ScRangeList& ScRangeList::operator=(const ScRangeList& rList)
return *this;
}
-ScRangeList& ScRangeList::operator=(ScRangeList&& rList)
+ScRangeList& ScRangeList::operator=(ScRangeList&& rList) noexcept
{
maRanges = std::move(rList.maRanges);
mnMaxRowUsed = rList.mnMaxRowUsed;
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 2c03fe0a074e..3ced23b3cc50 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -1198,10 +1198,10 @@ public:
WalkElementBlocksMultipleValues( const WalkElementBlocksMultipleValues& ) = delete;
WalkElementBlocksMultipleValues& operator= ( const WalkElementBlocksMultipleValues& ) = delete;
- WalkElementBlocksMultipleValues( WalkElementBlocksMultipleValues&& r ) :
+ WalkElementBlocksMultipleValues(WalkElementBlocksMultipleValues&& r) noexcept :
mpOp(r.mpOp), maRes(std::move(r.maRes)), mbFirst(r.mbFirst) {}
- WalkElementBlocksMultipleValues& operator= ( WalkElementBlocksMultipleValues&& r )
+ WalkElementBlocksMultipleValues& operator=(WalkElementBlocksMultipleValues&& r) noexcept
{
mpOp = r.mpOp;
maRes = std::move(r.maRes);
@@ -1689,13 +1689,13 @@ public:
CompareMatrixFunc( const CompareMatrixFunc& ) = delete;
CompareMatrixFunc& operator= ( const CompareMatrixFunc& ) = delete;
- CompareMatrixFunc( CompareMatrixFunc&& r ) :
+ CompareMatrixFunc(CompareMatrixFunc&& r) noexcept :
mrComp(r.mrComp),
mnMatPos(r.mnMatPos),
mpOptions(r.mpOptions),
maResValues(std::move(r.maResValues)) {}
- CompareMatrixFunc& operator= ( CompareMatrixFunc&& r )
+ CompareMatrixFunc& operator=(CompareMatrixFunc&& r) noexcept
{
mrComp = r.mrComp;
mnMatPos = r.mnMatPos;
@@ -1815,13 +1815,13 @@ public:
CompareMatrixToNumericFunc( const CompareMatrixToNumericFunc& ) = delete;
CompareMatrixToNumericFunc& operator= ( const CompareMatrixToNumericFunc& ) = delete;
- CompareMatrixToNumericFunc( CompareMatrixToNumericFunc&& r ) :
+ CompareMatrixToNumericFunc(CompareMatrixToNumericFunc&& r) noexcept :
mrComp(r.mrComp),
mfRightValue(r.mfRightValue),
mpOptions(r.mpOptions),
maResValues(std::move(r.maResValues)) {}
- CompareMatrixToNumericFunc& operator= ( CompareMatrixToNumericFunc&& r )
+ CompareMatrixToNumericFunc& operator=(CompareMatrixToNumericFunc&& r) noexcept
{
mrComp = r.mrComp;
mfRightValue = r.mfRightValue;
@@ -1913,13 +1913,13 @@ public:
ToDoubleArray( const ToDoubleArray& ) = delete;
ToDoubleArray& operator= ( const ToDoubleArray& ) = delete;
- ToDoubleArray( ToDoubleArray&& r ) :
+ ToDoubleArray(ToDoubleArray&& r) noexcept :
mfNaN(r.mfNaN), mbEmptyAsZero(r.mbEmptyAsZero)
{
moveArray(r);
}
- ToDoubleArray& operator= ( ToDoubleArray&& r )
+ ToDoubleArray& operator=(ToDoubleArray&& r) noexcept
{
mfNaN = r.mfNaN;
mbEmptyAsZero = r.mbEmptyAsZero;