summaryrefslogtreecommitdiffstats
path: root/basic/source/comp/exprnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/comp/exprnode.cxx')
-rw-r--r--basic/source/comp/exprnode.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index 17bdbca25258..d6733e96d1ee 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -28,6 +28,7 @@
#include <basic/sberrors.hxx>
#include <rtl/math.hxx>
+#include <utility>
SbiExprNode::SbiExprNode( std::unique_ptr<SbiExprNode> l, SbiToken t, std::unique_ptr<SbiExprNode> r ) :
pLeft(std::move(l)),
@@ -50,8 +51,8 @@ SbiExprNode::SbiExprNode( double n, SbxDataType t ):
{
}
-SbiExprNode::SbiExprNode( const OUString& rVal ):
- aStrVal(rVal),
+SbiExprNode::SbiExprNode( OUString aVal ):
+ aStrVal(std::move(aVal)),
pWithParent(nullptr),
eNodeType(SbxSTRVAL),
eType(SbxSTRING),
@@ -117,7 +118,7 @@ SbiExprNode::~SbiExprNode()
SbiSymDef* SbiExprNode::GetVar()
{
- if( eNodeType == SbxVARVAL )
+ if (IsVariable())
return aVar.pDef;
else
return nullptr;
@@ -135,7 +136,7 @@ SbiSymDef* SbiExprNode::GetRealVar()
// From 1995-12-18
SbiExprNode* SbiExprNode::GetRealNode()
{
- if( eNodeType == SbxVARVAL )
+ if (IsVariable())
{
SbiExprNode* p = this;
while( p->aVar.pNext )
@@ -296,8 +297,8 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser)
{
double nl = pLeft->nVal;
double nr = pRight->nVal;
- // tdf#141201 - round MOD literals to Integer values
- if (eTok == MOD)
+ // tdf#141201, tdf#147089 - round MOD/IDIV literals to Integer values
+ if (eTok == MOD || eTok == IDIV)
{
nl = rtl::math::round(nl);
nr = rtl::math::round(nr);