summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-28 15:20:48 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-29 09:49:48 +0000
commitd36ca60964cf20b738ead1020c41c2f586a16660 (patch)
treebafad47f21da450089d2ea79446d551c5bdf65de /sc
parent5a13d6146e21355803b7c803ab98143dd41b8416 (diff)
extensions,sc,sd,vcl: de-obfuscate assignments in conditions to help GCC
GCC 6.2.1 with -Og produces spurious -Werror=maybe-uninitialized on variables that are assigned in conditions; perhaps it's better to de-obfuscate the code if even GCC is confused about it. Change-Id: Ia2f8209df893a8e5659ca72f4cde3d7d847574e1 Reviewed-on: https://gerrit.libreoffice.org/31332 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/token.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 53f4dc49756c..88970ed3d120 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -535,12 +535,14 @@ FormulaTokenRef extendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2
const ScAddress & rPos, bool bReuseDoubleRef )
{
- StackVar sv1, sv2;
+ StackVar sv1 = rTok1.GetType();
// Doing a RangeOp with RefList is probably utter nonsense, but Xcl
// supports it, so do we.
- if (((sv1 = rTok1.GetType()) != svSingleRef && sv1 != svDoubleRef && sv1 != svRefList &&
- sv1 != svExternalSingleRef && sv1 != svExternalDoubleRef ) ||
- ((sv2 = rTok2.GetType()) != svSingleRef && sv2 != svDoubleRef && sv2 != svRefList))
+ if (sv1 != svSingleRef && sv1 != svDoubleRef && sv1 != svRefList
+ && sv1 != svExternalSingleRef && sv1 != svExternalDoubleRef)
+ return nullptr;
+ StackVar sv2 = rTok2.GetType();
+ if (sv2 != svSingleRef && sv2 != svDoubleRef && sv2 != svRefList)
return nullptr;
ScTokenRef xRes;