diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-08-29 10:42:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-08-29 12:32:59 +0200 |
commit | f41cbea9a49c3059498a1ff432ac545b296db5a5 (patch) | |
tree | 4d86eecdf73f622a069ca9b9181ec10ac50d8515 /starmath/source | |
parent | 5288887d0028115611bf4ea3d497cf27bfcdb182 (diff) |
More -Werror=redundant-move
...similar to dc06c8f4989fc28d0c31ebd333e53dfe0e0f5f66 "-Werror=redundant-move
(GCC 9), take two"
Change-Id: I53c181887e254aa3d924c134c77d7d0230717d5c
Reviewed-on: https://gerrit.libreoffice.org/59750
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/parse.cxx | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index 051c62d5de8d..56d778f9b44c 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -19,6 +19,7 @@ #include <memory> #include <com/sun/star/i18n/UnicodeType.hpp> +#include <config_global.h> #include <i18nlangtag/lang.h> #include <tools/lineend.hxx> #include <unotools/configmgr.hxx> @@ -995,7 +996,11 @@ std::unique_ptr<SmNode> SmParser::DoAlign(bool bUseExtraSpaces) if (xSNode) { xSNode->SetSubNode(0, pNode.release()); - return std::move(xSNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return xSNode; +#else + return std::move(xSNode); +#endif } return pNode; } @@ -1030,7 +1035,11 @@ std::unique_ptr<SmNode> SmParser::DoLine() auto xSNode = o3tl::make_unique<SmLineNode>(m_aCurToken); xSNode->SetSubNodes(buildNodeArray(ExpressionArray)); - return std::move(xSNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return xSNode; +#else + return std::move(xSNode); +#endif } std::unique_ptr<SmNode> SmParser::DoExpression(bool bUseExtraSpaces) @@ -1049,9 +1058,11 @@ std::unique_ptr<SmNode> SmParser::DoExpression(bool bUseExtraSpaces) std::unique_ptr<SmExpressionNode> xSNode(new SmExpressionNode(m_aCurToken)); xSNode->SetSubNodes(buildNodeArray(RelationArray)); xSNode->SetUseExtraSpaces(bUseExtraSpaces); - // the following explicit move can be omitted since C++14: - // https://stackoverflow.com/questions/22018115/converting-stdunique-ptrderived-to-stdunique-ptrbase +#if HAVE_CXX_CWG1579_FIX + return xSNode; +#else return std::move(xSNode); +#endif } else { @@ -1256,7 +1267,11 @@ std::unique_ptr<SmNode> SmParser::DoSubSup(TG nActiveGroup, SmNode *pGivenNode) } pNode->SetSubNodes(buildNodeArray(aSubNodes)); - return std::move(pNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return pNode; +#else + return std::move(pNode); +#endif } std::unique_ptr<SmNode> SmParser::DoOpSubSup() @@ -1272,7 +1287,11 @@ std::unique_ptr<SmNode> SmParser::DoOpSubSup() // get sub- supscripts if any if (m_aCurToken.nGroup == TG::Power) return DoSubSup(TG::Power, pNode.release()); - return std::move(pNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return pNode; +#else + return std::move(pNode); +#endif } std::unique_ptr<SmNode> SmParser::DoPower() @@ -1776,7 +1795,11 @@ std::unique_ptr<SmStructureNode> SmParser::DoAttribut() xSNode->SetSubNodes(xAttr.release(), nullptr); // the body will be filled later xSNode->SetScaleMode(eScaleMode); - return std::move(xSNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return xSNode; +#else + return std::move(xSNode); +#endif } std::unique_ptr<SmStructureNode> SmParser::DoFontAttribut() @@ -1797,7 +1820,11 @@ std::unique_ptr<SmStructureNode> SmParser::DoFontAttribut() { auto pNode = o3tl::make_unique<SmFontNode>(m_aCurToken); NextToken(); - return std::move(pNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return pNode; +#else + return std::move(pNode); +#endif } case TSIZE : @@ -1959,7 +1986,11 @@ std::unique_ptr<SmStructureNode> SmParser::DoFontSize() NextToken(); pFontNode->SetSizeParameter(aValue, Type); - return std::move(pFontNode); // this explicit move can be omitted since C++14 +#if HAVE_CXX_CWG1579_FIX + return pFontNode; +#else + return std::move(pFontNode); +#endif } SmStructureNode *SmParser::DoBrace() |