summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-04-21 19:40:39 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-04-22 17:55:14 +0200
commitbfc0bf6a164f25c6e2af86fb0298ecb0f88c9df9 (patch)
treebfdd455d9f9dbb124e5caf7cbcfc855e88133171 /forms
parentd645a6a17cd03d0f875e1246652664860d91c0c5 (diff)
Data-aware ListBox: BoundValue==-1 to store index in list
Change-Id: I248cd5ec62574f47a27f8b37e1e90333b8748af2
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/ListBox.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 9cfdc70300fb..4941918b6bed 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -858,6 +858,8 @@ namespace frm
DBG_UNHANDLED_EXCEPTION();
}
}
+ else if ( *aBoundColumn == -1)
+ m_nBoundColumnType = DataType::SMALLINT;
// If the LB is bound to a field and empty entries are valid, we remember the position
// for an empty entry
@@ -873,6 +875,9 @@ namespace frm
if(*aBoundColumn >= 0)
aBoundValue.fill( *aBoundColumn + 1, m_nBoundColumnType, xCursorRow );
+ else
+ // -1 because getRow() is 1-indexed, but ListBox positions are 0-indexed
+ aBoundValue = static_cast<sal_uInt16>(xListCursor->getRow()-1);
aValueList.push_back( aBoundValue );
if ( bUseNULL && ( m_nNULLPos == -1 ) && aStr.isEmpty() )