summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-25 21:10:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-09-25 21:10:32 +0100
commit88fe2590901b9c0955b97e0521b20dba9a8a97da (patch)
tree373f2abef972bd8583d762b090d21f2d160a62e1 /sw/source
parentbe214eb2e193707f6bd4d1a279a6cadd1b734948 (diff)
avoid coverity#1371166 Missing move assignment operator
Change-Id: I0c5559c71f8a961bbab6fbd3a647aeca4a10b44f
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/calc.cxx42
1 files changed, 24 insertions, 18 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index cf28e19dcded..6633a1c171b5 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1220,29 +1220,35 @@ SwSbxValue SwCalc::Prim()
SwSbxValue SwCalc::Expr()
{
- SwSbxValue left = Term(), right;
+ SwSbxValue left = Term();
m_nLastLeft = left;
for(;;)
{
switch(m_eCurrOper)
{
- case CALC_PLUS:
- GetToken();
- left.MakeDouble();
- ( right = Term() ).MakeDouble();
- left.Compute( SbxPLUS, right );
- m_nListPor++;
- break;
-
- case CALC_MINUS:
- GetToken();
- left.MakeDouble();
- ( right = Term() ).MakeDouble();
- left.Compute( SbxMINUS, right );
- break;
-
- default:
- return left;
+ case CALC_PLUS:
+ {
+ GetToken();
+ left.MakeDouble();
+ SwSbxValue right(Term());
+ right.MakeDouble();
+ left.Compute(SbxPLUS, right);
+ m_nListPor++;
+ break;
+ }
+ case CALC_MINUS:
+ {
+ GetToken();
+ left.MakeDouble();
+ SwSbxValue right(Term());
+ right.MakeDouble();
+ left.Compute(SbxMINUS, right);
+ break;
+ }
+ default:
+ {
+ return left;
+ }
}
}
}