[Libreoffice-commits] core.git: forms/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Mon Nov 21 14:36:32 UTC 2016


 forms/source/component/ListBox.cxx |   26 +++++++++++++++++---------
 forms/source/component/ListBox.hxx |    2 +-
 2 files changed, 18 insertions(+), 10 deletions(-)

New commits:
commit 66ccfcd2908445b8194c364c89778056374b02af
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Fri Oct 21 09:36:10 2016 +0200

    remove use of tryPropertyValue Any specialisation
    
    change return value of getCurrentMultiValue from Any<Sequence<Any> >
    to Sequence<Any>.
    return value of getCurrentSingleValue (Any of connectivity::ORowSetValue)
    can't be changed to use tryPropertyValue.
    inline functionality
    
    Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3
    Reviewed-on: https://gerrit.libreoffice.org/30091
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 840d2a4..00e1e7a 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -271,7 +271,7 @@ namespace frm
             break;
 
         case PROPERTY_ID_SELECT_VALUE_SEQ:
-            _rValue = getCurrentMultiValue();
+            _rValue <<= getCurrentMultiValue();
             break;
 
         case PROPERTY_ID_SELECT_VALUE:
@@ -416,9 +416,17 @@ namespace frm
             break;
 
         case PROPERTY_ID_SELECT_VALUE :
-            bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, getCurrentSingleValue());
+        {
+            // Any from connectivity::ORowSetValue
+            Any _rCurrentValue = getCurrentSingleValue();
+            if (_rCurrentValue != _rValue)
+            {
+                _rOldValue = _rValue;
+                _rConvertedValue = _rCurrentValue;
+                bModified = true;
+            }
             break;
-
+        }
         case PROPERTY_ID_DEFAULT_SELECT_SEQ :
             bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_aDefaultSelectSeq);
             break;
@@ -1517,7 +1525,7 @@ namespace frm
         }
 
 
-        Any lcl_getMultiSelectedEntriesAny( const Sequence< sal_Int16 >& _rSelectSequence, const ValueList& _rStringList )
+        Sequence< Any > lcl_getMultiSelectedEntriesAny( const Sequence< sal_Int16 >& _rSelectSequence, const ValueList& _rStringList )
         {
             Sequence< Any > aSelectedEntriesValues( _rSelectSequence.getLength() );
             ::std::transform(
@@ -1526,7 +1534,7 @@ namespace frm
                 aSelectedEntriesValues.getArray(),
                 ExtractAnyFromValueList_Safe( _rStringList )
             );
-            return makeAny( aSelectedEntriesValues );
+            return aSelectedEntriesValues;
         }
     }
 
@@ -1542,7 +1550,7 @@ namespace frm
         switch ( lcl_getCurrentExchangeType( getExternalValueType() ) )
         {
         case eValueList:
-            aReturn = getCurrentMultiValue();
+            aReturn <<= getCurrentMultiValue();
             break;
 
         case eValue:
@@ -1613,9 +1621,9 @@ namespace frm
         return aCurrentValue;
     }
 
-    Any OListBoxModel::getCurrentMultiValue() const
+    Sequence< Any > OListBoxModel::getCurrentMultiValue() const
     {
-        Any aCurrentValue;
+        Sequence< Any > aCurrentValue;
 
         try
         {
@@ -1648,7 +1656,7 @@ namespace frm
             OSL_VERIFY( const_cast< OListBoxModel* >( this )->getPropertyValue( PROPERTY_MULTISELECTION ) >>= bMultiSelection );
 
             if ( bMultiSelection )
-                aCurrentValue = getCurrentMultiValue();
+                aCurrentValue <<= getCurrentMultiValue();
             else
                 aCurrentValue = getCurrentSingleValue();
         }
diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx
index e1977fe..3946d33 100644
--- a/forms/source/component/ListBox.hxx
+++ b/forms/source/component/ListBox.hxx
@@ -209,7 +209,7 @@ protected:
 
     void init();
     css::uno::Any getCurrentSingleValue() const;
-    css::uno::Any getCurrentMultiValue() const;
+    css::uno::Sequence<css::uno::Any> getCurrentMultiValue() const;
     css::uno::Sequence< sal_Int16 > translateBindingValuesToControlValue(
         const css::uno::Sequence< const css::uno::Any > &i_aValues)
         const;


More information about the Libreoffice-commits mailing list