[Libreoffice-commits] core.git: nlpsolver/src
Stephan Bergmann
sbergman at redhat.com
Wed Oct 21 01:58:22 PDT 2015
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 115fa590dc7d4f37714d514309643896a5041ab4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Oct 21 10:56:24 2015 +0200
More plausible fix
...for 7c465e7f9e8b5c34a4926fb0de84de70aee8f37d "coverity#1326260 Explicit null
dereferenced"
Change-Id: I3b7fb8195c29b7e447fbe31f823cd00d7a820e95
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
index 16bb7e8..e1386a6 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
@@ -246,8 +246,10 @@ public abstract class BaseNLPSolver extends WeakBase
RowInfo currentRow = null;
int lastSheet = -1, lastRow = -1;
for (int i = 0; i < m_variableCount; i++) {
- if (lastSheet == m_variables[i].Sheet && lastRow == m_variables[i].Row &&
- currentRow != null && currentRow.EndCol == m_variables[i].Column - 1)
+ boolean match = lastSheet == m_variables[i].Sheet &&
+ lastRow == m_variables[i].Row;
+ assert !match || currentRow != null;
+ if (match && currentRow.EndCol == m_variables[i].Column - 1)
currentRow.EndCol++;
else {
currentRow = new RowInfo(m_variables[i].Sheet, m_variables[i].Row);
More information about the Libreoffice-commits
mailing list