Created attachment 154900 [details]
Please open the attached spreadsheet. It contains all steps...
CPU-Threads: 8; BS: Linux 4.4; UI-Render: Standard; VCL: gtk2;
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Yep, as described
Build ID: 126.96.36.199-4.fc29
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: kde4;
Locale: en-US (en_US.UTF-8); Calc: group threaded
@Katarina: Thanks for confirming. I think a patch should NOT be very complicated...
The bug still exists. I have track it to two possible reasons:
m_success = (m_objectiveCell.getError() == 0 && checkConstraints());
The model has no constraints. It seems that some fake error appears in the objective cell.
Created attachment 174132 [details]
Test file with missing values in the constraints range.
Created attachment 174133 [details]
Test setup screen 1.
Created attachment 174134 [details]
Test setup screen 2.
Created attachment 174135 [details]
Test setup screen 3.
Created attachment 174136 [details]
Test setup screen 4.
Created attachment 174137 [details]
Test setup screen 5.
Created attachment 174138 [details]
Test setup screen 6.
Created attachment 174139 [details]
Test setup screen 7.
Created attachment 174140 [details]
Test setup screen 8.
Created attachment 174141 [details]
Test setup screen 9.
I have checked the functions calls and the problem comes from the fact that the exact value is searched.
The equality target is converted to extra constraint, which gives not found solution after that.
if ( m_xRbValue->get_active() )
// handle "value of" with an additional constraint (and then minimize)
aConstraint.Left = aObjective;
aConstraint.Operator = sheet::SolverConstraintOperator_EQUAL;
OUString aValStr = m_xEdTargetValue->GetText();
if ( ParseRef( aRightRange, aValStr, false ) )
aConstraint.Right <<= table::CellAddress( aRightRange.aStart.Tab(),
aRightRange.aStart.Col(), aRightRange.aStart.Row() );
sal_uInt32 nFormat = 0; //! explicit language?
double fValue = 0.0;
if ( mrDoc.GetFormatTable()->IsNumberFormat( aValStr, nFormat, fValue ) )
aConstraint.Right <<= fValue;
ShowError( false, m_xEdTargetValue.get() );
aConstraints.realloc( nConstrPos + 1 );
aConstraints[nConstrPos++] = aConstraint;
The problem does not exists if target is converted to minimization of absolute difference.
Created attachment 175778 [details]
Minimization of absolute difference.