From 4dc25ebbee7f4ff7c8eb561f5bfb03779e944f35 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Tue, 10 Sep 2024 05:47:28 +0200 Subject: tdf#162899 Accept BYTE and SHORT types in the Solver Options dialog ScSolverUtil::GetDefaults should also accept values of types BYTE and SHORT. It currently only accepts LONG. As described in the bug ticket, this is important when creating Solver extensions using Python, since pyObject2Any forces small integer numbers to be either BYTE or SHORT instead of LONG. Change-Id: I17c7a344777c31ea333a4d21a2543d2de0b448fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173093 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 2c5718353658fce9f40157ee49c1f0af1f5cc0df) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173175 Reviewed-by: Xisco Fauli --- sc/source/ui/miscdlgs/solverutil.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx index 31772a05cf9b..7b3ac25c9ada 100644 --- a/sc/source/ui/miscdlgs/solverutil.cxx +++ b/sc/source/ui/miscdlgs/solverutil.cxx @@ -162,7 +162,8 @@ uno::Sequence ScSolverUtil::GetDefaults( std::u16string_vi uno::Any aValue = xPropSet->getPropertyValue( rProp.Name ); uno::TypeClass eClass = aValue.getValueTypeClass(); // only use properties of supported types - if ( eClass == uno::TypeClass_BOOLEAN || eClass == uno::TypeClass_LONG || eClass == uno::TypeClass_DOUBLE ) + if (eClass == uno::TypeClass_BOOLEAN || eClass == uno::TypeClass_LONG || eClass == uno::TypeClass_SHORT + || eClass == uno::TypeClass_BYTE || eClass == uno::TypeClass_DOUBLE) pDefaults[nValid++] = beans::PropertyValue( rProp.Name, -1, aValue, beans::PropertyState_DIRECT_VALUE ); } aDefaults.realloc(nValid); -- cgit