summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-18 05:44:45 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-18 05:44:45 +0000
commit860c5b795e52acaf75ee501beedde382ac602a2a (patch)
tree1a08c7006998649c0da79bf3d636a9d9a2119662 /forms
parent432592734badd6695e8c71d4bbcea787f7910413 (diff)
#92410# ignore result of subform when masterform moves to insertrow
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx34
-rw-r--r--forms/source/component/DatabaseForm.hxx5
2 files changed, 30 insertions, 9 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index db9542907d2f..123ce010f157 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DatabaseForm.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: oj $ $Date: 2001-09-28 06:58:43 $
+ * last change: $Author: oj $ $Date: 2001-10-18 06:44:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,6 +90,9 @@
#ifndef _COM_SUN_STAR_SDBC_RESULTSETCONCURRENCY_HPP_
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#endif
+#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
+#include <com/sun/star/sdbc/DataType.hpp>
+#endif
#ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_
#include <com/sun/star/io/XObjectInputStream.hpp>
#endif
@@ -1663,10 +1666,6 @@ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const
return true;
}
- // is there a valid parent?
- if (m_bSubForm && !hasValidParent())
- return true;
-
// do we have to fill the parameters again?
if (!m_pParameterInfo)
m_pParameterInfo = createParameterInfo();
@@ -1674,6 +1673,10 @@ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const
if (!m_pParameterInfo || m_pParameterInfo->nCount == 0)
return true;
+ // is there a valid parent?
+ if (m_bSubForm && !hasValidParent())
+ return true;
+
// do we have to fill the parent parameters?
OParametersImpl::Parameters& rParams = m_pParameterInfo->pParameters->getParameters();
@@ -1811,12 +1814,29 @@ sal_Bool ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sa
{
// don't use any parameters if we don't have a valid parent
nConcurrency = ResultSetConcurrency::READ_ONLY;
- clearParameters();
+ // clearParameters();
+ if(m_pParameterInfo && m_pParameterInfo->nCount > 0)
+ {
+ Reference<XParameters> xExecutionParams;
+ query_aggregation( m_xAggregate, xExecutionParams); // we don't have to look if this work otherwise previous calls don't work
+ for (sal_Int32 nPos=1;nPos <= m_pParameterInfo->nCount; ++nPos)
+ xExecutionParams->setNull(nPos,DataType::VARCHAR);
+
+ m_aIgnoreResult = m_xAggregateSet->getPropertyValue(PROPERTY_INSERTONLY);
+ m_xAggregateSet->setPropertyValue(PROPERTY_INSERTONLY,makeAny(sal_True));
+ }
}
else if (m_bAllowInsert || m_bAllowUpdate || m_bAllowDelete)
nConcurrency = ResultSetConcurrency::UPDATABLE;
else
nConcurrency = ResultSetConcurrency::READ_ONLY;
+
+ if (m_bSubForm && hasValidParent() && m_aIgnoreResult.hasValue() && m_pParameterInfo && m_pParameterInfo->nCount > 0)
+ {
+ m_xAggregateSet->setPropertyValue(PROPERTY_INSERTONLY,m_aIgnoreResult);
+ m_aIgnoreResult = Any();
+ }
+
m_xAggregateSet->setPropertyValue(PROPERTY_RESULTSET_CONCURRENCY, makeAny(nConcurrency));
sal_Int32 nResultSetType = ResultSetType::SCROLL_SENSITIVE;
diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx
index d5d0679f2549..8bc407867cc5 100644
--- a/forms/source/component/DatabaseForm.hxx
+++ b/forms/source/component/DatabaseForm.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DatabaseForm.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: vg $ $Date: 2001-09-12 12:04:08 $
+ * last change: $Author: oj $ $Date: 2001-10-18 06:44:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -281,6 +281,7 @@ class ODatabaseForm :public OFormComponents
::cppu::OInterfaceContainerHelper m_aErrorListeners;
::osl::Mutex m_aResetSafety;
::com::sun::star::uno::Any m_aCycle;
+ ::com::sun::star::uno::Any m_aIgnoreResult; // set when we are a subform and our master form positioned on a new row
StringSequence m_aMasterFields;
StringSequence m_aDetailFields;
::std::vector<bool> m_aParameterVisited;