Bug 162899 - Solver Options dialog should accept parameters of TypeClass BYTE and SHORT (it only accepts LONG)
Summary: Solver Options dialog should accept parameters of TypeClass BYTE and SHORT (i...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.0.3 release
Hardware: All All
: medium normal
Assignee: Rafael Lima
URL:
Whiteboard: target:25.2.0 target:24.8.2
Keywords:
Depends on:
Blocks: Solver
  Show dependency treegraph
 
Reported: 2024-09-10 03:45 UTC by Rafael Lima
Modified: 2024-09-12 06:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2024-09-10 03:45:37 UTC
This bug is a bit technical, so let's go.

ScSolverUtil::GetDefaults is used to get the default values of solver engines. However, it only accepts values of types LONG, DOUBLE and BOOLEAN [1].

The problem arises when you're implementing a new solver engine via Python extension... if you set one of the solver parameters to 100, it will be understood as a BYTE type and won't be shown in the Solver Options dialog.

Note that this is forced in Runtime::pyObject2Any (see [2]).

I propose ScSolverUtil::GetDefaults should also accept BYTE and SHORT types as well.

[1] /core/sc/source/ui/miscdlgs/solverutil.cxx

[2] /core/pyuno/source/module/pyuno_runtime.cxx
Comment 1 Rafael Lima 2024-09-10 03:50:51 UTC
This patch implements the proposed solution:
https://gerrit.libreoffice.org/c/core/+/173093
Comment 2 Commit Notification 2024-09-11 17:44:43 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2c5718353658fce9f40157ee49c1f0af1f5cc0df

tdf#162899 Accept BYTE and SHORT types in the Solver Options dialog

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2024-09-12 06:31:33 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/4dc25ebbee7f4ff7c8eb561f5bfb03779e944f35

tdf#162899 Accept BYTE and SHORT types in the Solver Options dialog

It will be available in 24.8.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.