diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-06-23 17:32:20 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-06-23 17:40:39 +0200 |
commit | d8eafdafe0a86c2fb83855852a12703366b3914e (patch) | |
tree | e4bf06a44e4e018346053c7f203d33d08304f939 /forms | |
parent | 157a9da9340c5b03c598c29aa2a1fe5c709c66f3 (diff) |
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
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/ListBox.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index b3726f3c7cb3..90decec5d2ad 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -915,8 +915,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; |