sc/source/ui/miscdlgs/solverutil.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4dc25ebbee7f4ff7c8eb561f5bfb03779e944f35
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Tue Sep 10 05:47:28 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Sep 12 08:31:22 2024 +0200

    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.kagan...@collabora.com>
    (cherry picked from commit 2c5718353658fce9f40157ee49c1f0af1f5cc0df)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173175
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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);

Reply via email to