https://bugs.freedesktop.org/show_bug.cgi?id=87074

--- Comment #2 from Derka Ladislav <[email protected]> ---
Comment on attachment 110534
  --> https://bugs.freedesktop.org/attachment.cgi?id=110534
Call NPL Solver using macros

Sub RunSolveDEPS
    Dim Solver as Object    
    Set Solver =
CreateUnoService("com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl")
    Solver.Document = ThisComponent

    Dim VariableCells(2) as new com.sun.star.table.CellAddress
    VariableCells(0).Sheet = 0
    VariableCells(0).Row = 1
    VariableCells(0).Column = 1

    VariableCells(1).Sheet = 0
    VariableCells(1).Row = 2
    VariableCells(1).Column = 1

    VariableCells(2).Sheet = 0
    VariableCells(2).Row = 3   
    VariableCells(2).Column = 1

    Solver.Variables = VariableCells

    Dim ObjectiveCell as new com.sun.star.table.CellAddress
    ObjectiveCell.Sheet = 0
    ObjectiveCell.Row = 3
    ObjectiveCell.Column = 3

    Solver.Objective = ObjectiveCell ' <== Error !!!    
    ' Type: com.sun.star.uno.RuntimeException
    ' Message: [jni_uno bridge error] UNO calling Java method Objective:
[map_to_uno():com.sun.star.table.CellAddress] null-ref given!
    ' java stack trace:
    ' .

    Solver.Solve

End Sub

Sub RunSolveSCO
    Dim Solver as Object    
    Set Solver =
CreateUnoService("com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl")
    Solver.Document = ThisComponent

    Dim VariableCells(2) as new com.sun.star.table.CellAddress
    VariableCells(0).Sheet = 0
    VariableCells(0).Row = 1
    VariableCells(0).Column = 1

    VariableCells(1).Sheet = 0
    VariableCells(1).Row = 2
    VariableCells(1).Column = 1

    VariableCells(2).Sheet = 0
    VariableCells(2).Row = 3   
    VariableCells(2).Column = 1

    Solver.Variables = VariableCells

    Dim ObjectiveCell as new com.sun.star.table.CellAddress
    ObjectiveCell.Sheet = 0
    ObjectiveCell.Row = 3
    ObjectiveCell.Column = 3

    Solver.Objective = ObjectiveCell ' <== Error !!!
    ' Type: com.sun.star.uno.RuntimeException
    ' Message: [jni_uno bridge error] UNO calling Java method Objective:
[map_to_uno():com.sun.star.table.CellAddress] null-ref given!
    ' java stack trace:
    ' .

    Solver.Solve

End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to