summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-04-21 15:41:20 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-04-22 17:51:41 +0200
commit3e1a0c9b2f83a44f5e7ff154d6e09d4f7b26a5e5 (patch)
tree2981f793e9d8892d3c0dee4d3e7612906361c684 /forms
parent0202f9b7c4ddabd0d0567ad77a15617904996fec (diff)
Data-aware ListBox: populate ValueList even without bound field
Change-Id: I8742285778962b5be10f3aa300236efd525bdeb9
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/ListBox.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index b4df74660a93..b4152bbbe841 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -808,6 +808,10 @@ namespace frm
ValueList aDisplayList, aValueList;
sal_Bool bUseNULL = hasField() && !isRequired();
+ // empty BoundColumn is treated as BoundColumn=0,
+ if(!aBoundColumn)
+ aBoundColumn = 0;
+
try
{
OSL_ENSURE( xListCursor.is() || ( ListSourceType_TABLEFIELDS == m_eListSourceType ),
@@ -842,8 +846,8 @@ namespace frm
// Get the field of BoundColumn of the ResultSet
m_nBoundColumnType = DataType::SQLNULL;
- if ( !!aBoundColumn && ( *aBoundColumn >= 0 ) && m_xColumn.is() )
- { // don't look for a bound column if we're not connected to a field
+ if ( *aBoundColumn >= 0 )
+ {
try
{
Reference< XPropertySet > xBoundField( xColumns->getByIndex( *aBoundColumn ), UNO_QUERY_THROW );
@@ -867,11 +871,9 @@ namespace frm
aStr = aValueFormatter.getFormattedValue();
aDisplayList.push_back( aStr );
- if ( impl_hasBoundComponent() )
- {
+ if(*aBoundColumn >= 0)
aBoundValue.fill( *aBoundColumn + 1, m_nBoundColumnType, xCursorRow );
- aValueList.push_back( aBoundValue );
- }
+ aValueList.push_back( aBoundValue );
if ( bUseNULL && ( m_nNULLPos == -1 ) && aStr.isEmpty() )
m_nNULLPos = sal_Int16( aDisplayList.size() - 1 );
@@ -914,8 +916,7 @@ namespace frm
// Add NULL entry
if (bUseNULL && m_nNULLPos == -1)
{
- if ( impl_hasBoundComponent() )
- aValueList.insert( aValueList.begin(), ORowSetValue() );
+ aValueList.insert( aValueList.begin(), ORowSetValue() );
aDisplayList.insert( aDisplayList.begin(), ORowSetValue( OUString() ) );
m_nNULLPos = 0;