summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2017-05-09 12:53:25 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2017-05-09 13:17:20 +0200
commit24e05b48cb7ceb67c2566bbb212cbc1d752bb59e (patch)
treee7964eda94bff04c18f11fb9b9aa7588a1387a43 /forms
parent9819ded67511683946763bc20e84ef524fc15b65 (diff)
tdf#107720 Bound Control initFromField: consider the case of the insert row
Change-Id: If18e161c994c926fd86453ab5736df1e89bb61de
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/FormComponent.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 97bea91aa8b9..db71eba8e285 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1980,7 +1980,17 @@ void OBoundControlModel::initFromField( const Reference< XRowSet >& _rxRowSet )
// but only if the rowset is positioned on a valid record
if ( hasField() && _rxRowSet.is() )
{
- if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() )
+ bool shouldTransfer(!_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast());
+ if (!shouldTransfer)
+ {
+ const Reference< XPropertySet > xPS(_rxRowSet, UNO_QUERY);
+ if (xPS.is())
+ {
+ assert(shouldTransfer == false);
+ xPS->getPropertyValue("IsNew") >>= shouldTransfer;
+ }
+ }
+ if ( shouldTransfer )
transferDbValueToControl();
else
// reset the field if the row set is empty