summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2024-09-10 05:47:28 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-09-12 08:31:22 +0200
commit4dc25ebbee7f4ff7c8eb561f5bfb03779e944f35 (patch)
tree9abbe1a487e3c52fad9aaa2863954ef9ac415af6 /sc
parentccc91f383191dca3f136f266d5f932d6ecf20a47 (diff)
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 <mike.kaganski@collabora.com> (cherry picked from commit 2c5718353658fce9f40157ee49c1f0af1f5cc0df) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173175 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/miscdlgs/solverutil.cxx3
1 files changed, 2 insertions, 1 deletions
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<beans::PropertyValue> 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);