diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-10-18 05:44:45 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-10-18 05:44:45 +0000 |
commit | 133da7c35609684bbb3e75057326c9916326e566 (patch) | |
tree | eee3fb15d37ea973d071dc20bbcc4141f15c9892 /forms | |
parent | 849804693b803681a2113194b4e6fb315a153a66 (diff) |
#92410# ignore result of subform when masterform moves to insertrow
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 34 | ||||
-rw-r--r-- | forms/source/component/DatabaseForm.hxx | 5 |
2 files changed, 30 insertions, 9 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 93a205bc7..734ac64cc 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 f55a2fc99..06d0252cc 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; |