[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - forms/source

Lionel Elie Mamane lionel at mamane.lu
Mon Jun 24 06:10:18 PDT 2013


 forms/source/component/ListBox.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 51c833591bc0959b537199abd174a7dfa7e6e601
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Sun Jun 23 17:32:20 2013 +0200

    Data-aware ListBox: use entry for NULL if the *bound* value is NULL
    
    as opposed to when the display string is empty.
    
    Change-Id: I802955404d2d8d5c91b3fd1633e34be7ef4f0b82
    Reviewed-on: https://gerrit.libreoffice.org/4461
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 68ca37e..14a67b9 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -916,8 +916,13 @@ namespace frm
                             aBoundValue = static_cast<sal_Int16>(xListCursor->getRow()-1);
                         aValueList.push_back( aBoundValue );
 
-                        if ( bUseNULL && ( m_nNULLPos == -1 ) && aStr.isEmpty() )
+                        if ( bUseNULL && ( m_nNULLPos == -1 ) && aBoundValue.isNull() )
                             m_nNULLPos = sal_Int16( aDisplayList.size() - 1 );
+                        if ( bUseNULL && ( m_nNULLPos == -1 ) && aStr.isEmpty() )
+                            // There is already a non-NULL entry with empty display string;
+                            // adding another one for NULL would make things confusing,
+                            // so back off.
+                            bUseNULL = false;
                     }
                 }
                 break;


More information about the Libreoffice-commits mailing list