diff options
Diffstat (limited to 'forms/source/component/DatabaseForm.cxx')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 1121 |
1 files changed, 544 insertions, 577 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index fbdc3e603341..b97d0028cd28 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DatabaseForm.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: fs $ $Date: 2000-11-14 14:53:27 $ + * last change: $Author: oj $ $Date: 2000-11-23 08:48:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -274,27 +274,32 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::task; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::data; +using namespace ::com::sun::star::util; //......................................................................... namespace frm { //......................................................................... - namespace starframe = ::com::sun::star::frame; - namespace stardata = ::com::sun::star::data; //------------------------------------------------------------------ -staruno::Reference< starframe::XModel> getXModel(const staruno::Reference< staruno::XInterface>& xIface) +Reference< XModel> getXModel(const Reference< XInterface>& xIface) { - staruno::Reference< starframe::XModel> xModel(xIface, staruno::UNO_QUERY); + Reference< XModel> xModel(xIface, UNO_QUERY); if (xModel.is()) return xModel; else { - staruno::Reference< starcontainer::XChild> xChild(xIface, staruno::UNO_QUERY); + Reference< XChild> xChild(xIface, UNO_QUERY); if (xChild.is()) { - staruno::Reference< staruno::XInterface> xParent( xChild->getParent()); + Reference< XInterface> xParent( xChild->getParent()); return getXModel(xParent); } else @@ -327,9 +332,9 @@ void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyVal //================================================================== //= OParameterWrapper //=----------------------------------------------------------------- -//= wraps a parameter property set got from an starsdb::SQLQueryComposer +//= wraps a parameter property set got from an SQLQueryComposer //= so it has an additional property "Value", which is forwarded to -//= an starsdbc::XParameters interface +//= an XParameters interface //================================================================== class OParameterWrapper @@ -337,39 +342,39 @@ class OParameterWrapper ,public ::cppu::OPropertySetHelper ,public ::comphelper::OAggregationArrayUsageHelper<OParameterWrapper> { - staruno::Any m_aValue; + Any m_aValue; ::osl::Mutex m_aMutex; ::cppu::OBroadcastHelper m_aBroadcastHelper; OImplementationIdsRef m_aHoldIdHelper; - staruno::Reference<starbeans::XPropertySet> m_xPseudoAggregate; - staruno::Reference<starsdbc::XParameters> m_xValueDestination; - sal_Int32 m_nIndex; + Reference<XPropertySet> m_xPseudoAggregate; + Reference<XParameters> m_xValueDestination; + sal_Int32 m_nIndex; virtual ~OParameterWrapper(); public: - OParameterWrapper(const staruno::Reference<starbeans::XPropertySet>& _rxColumn, const staruno::Reference<starsdbc::XParameters>& _rxAllParameters, sal_Int32 _nIndex); + OParameterWrapper(const Reference<XPropertySet>& _rxColumn, const Reference<XParameters>& _rxAllParameters, sal_Int32 _nIndex); // UNO DECLARE_UNO3_DEFAULTS(OParameterWrapper, OWeakObject); - virtual staruno::Any SAL_CALL queryInterface(const staruno::Type& _rType) throw (staruno::RuntimeException); - virtual staruno::Sequence<sal_Int8> SAL_CALL getImplementationId() throw(staruno::RuntimeException); - virtual staruno::Sequence<staruno::Type> SAL_CALL getTypes() throw(staruno::RuntimeException); + virtual Any SAL_CALL queryInterface(const Type& _rType) throw (RuntimeException); + virtual Sequence<sal_Int8> SAL_CALL getImplementationId() throw(RuntimeException); + virtual Sequence<Type> SAL_CALL getTypes() throw(RuntimeException); - // starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw( staruno::RuntimeException ); + // XPropertySet + virtual Reference<XPropertySetInfo> SAL_CALL getPropertySetInfo() throw( RuntimeException ); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // OPropertySetHelper - virtual sal_Bool SAL_CALL convertFastPropertyValue( staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue) throw( starlang::IllegalArgumentException ); - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) throw( staruno::Exception ); - virtual void SAL_CALL getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) throw( IllegalArgumentException ); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw( Exception ); + virtual void SAL_CALL getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const; // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + Sequence< Property >& /* [out] */ _rProps, + Sequence< Property >& /* [out] */ _rAggregateProps ) const; protected: @@ -378,7 +383,7 @@ protected: DBG_NAME(OParameterWrapper) //------------------------------------------------------------------------------ -OParameterWrapper::OParameterWrapper(const staruno::Reference<starbeans::XPropertySet>& _rxColumn, const staruno::Reference<starsdbc::XParameters>& _rxAllParameters, sal_Int32 _nIndex) +OParameterWrapper::OParameterWrapper(const Reference<XPropertySet>& _rxColumn, const Reference<XParameters>& _rxAllParameters, sal_Int32 _nIndex) :OPropertySetHelper(m_aBroadcastHelper) ,m_aBroadcastHelper(m_aMutex) ,m_xPseudoAggregate(_rxColumn) @@ -395,9 +400,9 @@ OParameterWrapper::~OParameterWrapper() } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OParameterWrapper::queryInterface(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OParameterWrapper::queryInterface(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; + Any aReturn; aReturn = OWeakObject::queryInterface(_rType); if (!aReturn.hasValue()) @@ -407,33 +412,33 @@ staruno::Any SAL_CALL OParameterWrapper::queryInterface(const staruno::Type& _rT } //------------------------------------------------------------------------------ -staruno::Sequence< staruno::Type > SAL_CALL OParameterWrapper::getTypes( ) throw(staruno::RuntimeException) +Sequence< Type > SAL_CALL OParameterWrapper::getTypes( ) throw(RuntimeException) { - staruno::Sequence< staruno::Type > aWeakTypes(1); - aWeakTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<staruno::XWeak>*>(NULL)); + Sequence< Type > aWeakTypes(1); + aWeakTypes.getArray()[0] = ::getCppuType(static_cast<Reference<XWeak>*>(NULL)); - staruno::Sequence< staruno::Type > aPropertyTypes(3); - aPropertyTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertySet>*>(NULL)); - aPropertyTypes.getArray()[1] = ::getCppuType(static_cast<staruno::Reference<starbeans::XFastPropertySet>*>(NULL)); - aPropertyTypes.getArray()[2] = ::getCppuType(static_cast<staruno::Reference<starbeans::XMultiPropertySet>*>(NULL)); + Sequence< Type > aPropertyTypes(3); + aPropertyTypes.getArray()[0] = ::getCppuType(static_cast<Reference<XPropertySet>*>(NULL)); + aPropertyTypes.getArray()[1] = ::getCppuType(static_cast<Reference<XFastPropertySet>*>(NULL)); + aPropertyTypes.getArray()[2] = ::getCppuType(static_cast<Reference<XMultiPropertySet>*>(NULL)); return concatSequences(aWeakTypes, aPropertyTypes); } //------------------------------------------------------------------------------ -staruno::Sequence<sal_Int8> SAL_CALL OParameterWrapper::getImplementationId() throw(staruno::RuntimeException) +Sequence<sal_Int8> SAL_CALL OParameterWrapper::getImplementationId() throw(RuntimeException) { - staruno::Reference<starlang::XTypeProvider> xMyTpes; - query_interface(static_cast<staruno::XWeak*>(this), xMyTpes); + Reference<XTypeProvider> xMyTpes; + query_interface(static_cast<XWeak*>(this), xMyTpes); return OImplementationIds::getImplementationId(xMyTpes); } //------------------------------------------------------------------------------ ::rtl::OUString OParameterWrapper::getPseudoAggregatePropertyName(sal_Int32 _nHandle) const { - staruno::Reference<starbeans::XPropertySetInfo> xInfo = const_cast<OParameterWrapper*>(this)->getPropertySetInfo(); - staruno::Sequence<starbeans::Property> aProperties = xInfo->getProperties(); - const starbeans::Property* pProperties = aProperties.getConstArray(); + Reference<XPropertySetInfo> xInfo = const_cast<OParameterWrapper*>(this)->getPropertySetInfo(); + Sequence<Property> aProperties = xInfo->getProperties(); + const Property* pProperties = aProperties.getConstArray(); for (sal_Int32 i=0; i<aProperties.getLength(); ++i, ++pProperties) { if (pProperties->Handle == _nHandle) @@ -445,16 +450,16 @@ staruno::Sequence<sal_Int8> SAL_CALL OParameterWrapper::getImplementationId() th } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> OParameterWrapper::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> OParameterWrapper::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OParameterWrapper::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { BEGIN_AGGREGATION_PROPERTY_HELPER(1, m_xPseudoAggregate) DECL_PROP2(VALUE, ::rtl::OUString, TRANSIENT, MAYBEVOID); @@ -468,7 +473,7 @@ void OParameterWrapper::fillProperties( } //------------------------------------------------------------------------------ -sal_Bool OParameterWrapper::convertFastPropertyValue(staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue) throw( starlang::IllegalArgumentException ) +sal_Bool OParameterWrapper::convertFastPropertyValue(Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) throw( IllegalArgumentException ) { DBG_ASSERT(PROPERTY_ID_VALUE == nHandle, "OParameterWrapper::convertFastPropertyValue : the only non-readonly prop should be our PROPERTY_VALUE"); // we're lazy here ... @@ -478,18 +483,18 @@ sal_Bool OParameterWrapper::convertFastPropertyValue(staruno::Any& rConvertedVal } //------------------------------------------------------------------------------ -void OParameterWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) throw( staruno::Exception ) +void OParameterWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw( Exception ) { if (nHandle == PROPERTY_ID_VALUE) { // get the type of the param - staruno::Any aParamType = m_xPseudoAggregate->getPropertyValue(PROPERTY_FIELDTYPE); - DBG_ASSERT(aParamType.getValueType().getTypeClass() == staruno::TypeClass_LONG, "ODatabaseForm::setPropertyValue : invalid parameter field !"); + Any aParamType = m_xPseudoAggregate->getPropertyValue(PROPERTY_FIELDTYPE); + DBG_ASSERT(aParamType.getValueType().getTypeClass() == TypeClass_LONG, "ODatabaseForm::setPropertyValue : invalid parameter field !"); sal_Int32 nScale = 0; if (hasProperty(PROPERTY_SCALE, m_xPseudoAggregate)) { - staruno::Any aScale = m_xPseudoAggregate->getPropertyValue(PROPERTY_SCALE); - DBG_ASSERT(aScale.getValueType().getTypeClass() == staruno::TypeClass_LONG, "ODatabaseForm::setPropertyValue : invalid parameter field !"); + Any aScale = m_xPseudoAggregate->getPropertyValue(PROPERTY_SCALE); + DBG_ASSERT(aScale.getValueType().getTypeClass() == TypeClass_LONG, "ODatabaseForm::setPropertyValue : invalid parameter field !"); nScale = getINT32(aScale); } // TODO : aParamType & nScale can be obtained within the constructor .... @@ -500,13 +505,13 @@ void OParameterWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con // the index of the parameters is one-based m_aValue = rValue; } - catch(starsdbc::SQLException& e) + catch(SQLException& e) { - starlang::WrappedTargetException aExceptionWrapper; + WrappedTargetException aExceptionWrapper; aExceptionWrapper.Context = e.Context; aExceptionWrapper.Message = e.Message; aExceptionWrapper.TargetException <<= e; - throw starlang::WrappedTargetException(aExceptionWrapper); + throw WrappedTargetException(aExceptionWrapper); } } else @@ -517,7 +522,7 @@ void OParameterWrapper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con } //------------------------------------------------------------------------------ -void OParameterWrapper::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHandle ) const +void OParameterWrapper::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { if (nHandle == PROPERTY_ID_VALUE) { @@ -536,11 +541,11 @@ void OParameterWrapper::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nH //= class for the parameter event see approveParameter //================================================================== -typedef ::cppu::WeakImplHelper2<starcontainer::XIndexAccess, starcontainer::XEnumerationAccess> OParametersImplBase; +typedef ::cppu::WeakImplHelper2<XIndexAccess, XEnumerationAccess> OParametersImplBase; class OParametersImpl : public OParametersImplBase { public: - typedef ::std::vector<staruno::Reference<starbeans::XPropertySet> > Parameters; + typedef ::std::vector<Reference<XPropertySet> > Parameters; typedef Parameters::iterator ParametersIterator; private: @@ -551,54 +556,54 @@ public: DECLARE_UNO3_AGG_DEFAULTS(OParametersImpl, OParametersImplBase); // XElementAccess - virtual staruno::Type SAL_CALL getElementType() throw( staruno::RuntimeException ); - virtual sal_Bool SAL_CALL hasElements() throw( staruno::RuntimeException ); + virtual Type SAL_CALL getElementType() throw( RuntimeException ); + virtual sal_Bool SAL_CALL hasElements() throw( RuntimeException ); // XEnumerationAccess - virtual staruno::Reference<starcontainer::XEnumeration> SAL_CALL createEnumeration() throw( staruno::RuntimeException ); + virtual Reference<XEnumeration> SAL_CALL createEnumeration() throw( RuntimeException ); // XIndexAccess - virtual sal_Int32 SAL_CALL getCount() throw( staruno::RuntimeException ); - virtual staruno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw( starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException ); + virtual sal_Int32 SAL_CALL getCount() throw( RuntimeException ); + virtual Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); Parameters& getParameters() { return m_aParameters; } }; -// starcontainer::XElementAccess +// XElementAccess //------------------------------------------------------------------------------ -staruno::Type SAL_CALL OParametersImpl::getElementType() throw( staruno::RuntimeException ) +Type SAL_CALL OParametersImpl::getElementType() throw( RuntimeException ) { - return ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertySet>*>(NULL)); + return ::getCppuType(static_cast<Reference<XPropertySet>*>(NULL)); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL OParametersImpl::hasElements() throw( staruno::RuntimeException ) +sal_Bool SAL_CALL OParametersImpl::hasElements() throw( RuntimeException ) { return m_aParameters.size() != 0; } -// starcontainer::XIndexAccess +// XIndexAccess //------------------------------------------------------------------------------ -sal_Int32 SAL_CALL OParametersImpl::getCount() throw( staruno::RuntimeException ) +sal_Int32 SAL_CALL OParametersImpl::getCount() throw( RuntimeException ) { return m_aParameters.size(); } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OParametersImpl::getByIndex(sal_Int32 _nIndex) throw( starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException ) +Any SAL_CALL OParametersImpl::getByIndex(sal_Int32 _nIndex) throw( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ) { if (_nIndex < 0 || _nIndex >= m_aParameters.size()) - throw starlang::IndexOutOfBoundsException(); + throw IndexOutOfBoundsException(); - return staruno::makeAny(m_aParameters[_nIndex]); + return makeAny(m_aParameters[_nIndex]); } -// starcontainer::XEnumerationAccess +// XEnumerationAccess //------------------------------------------------------------------------------ -staruno::Reference<starcontainer::XEnumeration> OParametersImpl::createEnumeration() throw( staruno::RuntimeException ) +Reference<XEnumeration> OParametersImpl::createEnumeration() throw( RuntimeException ) { - return new OEnumerationByIndex(reinterpret_cast<starcontainer::XIndexAccess*>(this)); + return new OEnumerationByIndex(reinterpret_cast<XIndexAccess*>(this)); } //================================================================== @@ -611,8 +616,8 @@ DECLARE_STL_USTRINGACCESS_MAP(sal_Int32, MapUString2INT32); struct OParameterInfoImpl { sal_Int32 nCount; // Number of Parameters - staruno::Reference<starsdb::XSQLQueryComposer> xComposer; - staruno::Reference<starcontainer::XNameAccess> xParamsAsNames; + Reference<XSQLQueryComposer> xComposer; + Reference<XNameAccess> xParamsAsNames; OParametersImpl* pParameters; MapUString2INT32 aParamMapping; @@ -636,13 +641,13 @@ class OFormSubmitResetThread: public OComponentEventThread protected: // duplicate an event with respect to it's type - virtual starlang::EventObject *cloneEvent( const starlang::EventObject *pEvt ) const; + virtual EventObject *cloneEvent( const EventObject *pEvt ) const; // process an event. while processing the mutex isn't locked, and pCompImpl // is made sure to remain valid virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl, - const starlang::EventObject* _pEvt, - const staruno::Reference<starawt::XControl>& _rControl, + const EventObject* _pEvt, + const Reference<XControl>& _rControl, sal_Bool _bSubmit); public: @@ -651,21 +656,21 @@ public: }; //------------------------------------------------------------------ -starlang::EventObject* OFormSubmitResetThread::cloneEvent( - const starlang::EventObject *pEvt ) const +EventObject* OFormSubmitResetThread::cloneEvent( + const EventObject *pEvt ) const { - return new starawt::MouseEvent( *(starawt::MouseEvent *)pEvt ); + return new MouseEvent( *(MouseEvent *)pEvt ); } //------------------------------------------------------------------ void OFormSubmitResetThread::processEvent( ::cppu::OComponentHelper* pCompImpl, - const starlang::EventObject *_pEvt, - const staruno::Reference<starawt::XControl>& _rControl, + const EventObject *_pEvt, + const Reference<XControl>& _rControl, sal_Bool _bSubmit) { if (_bSubmit) - ((ODatabaseForm *)pCompImpl)->submit_impl(_rControl, *reinterpret_cast<const starawt::MouseEvent*>(_pEvt), true); + ((ODatabaseForm *)pCompImpl)->submit_impl(_rControl, *reinterpret_cast<const MouseEvent*>(_pEvt), true); else ((ODatabaseForm *)pCompImpl)->reset_impl(true); } @@ -675,112 +680,69 @@ void OFormSubmitResetThread::processEvent( //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL ODatabaseForm_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL ODatabaseForm_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new ODatabaseForm(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<sal_Int8> SAL_CALL ODatabaseForm::getImplementationId() throw(staruno::RuntimeException) +Sequence<sal_Int8> SAL_CALL ODatabaseForm::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ -staruno::Sequence<staruno::Type> SAL_CALL ODatabaseForm::getTypes() throw(staruno::RuntimeException) +Sequence<Type> SAL_CALL ODatabaseForm::getTypes() throw(RuntimeException) { // ask the aggregate - staruno::Sequence<staruno::Type> aAggregateTypes; - staruno::Reference<starlang::XTypeProvider> xAggregateTypes; + Sequence<Type> aAggregateTypes; + Reference<XTypeProvider> xAggregateTypes; if (query_aggregation(m_xAggregate, xAggregateTypes)) aAggregateTypes = xAggregateTypes->getTypes(); - staruno::Sequence<staruno::Type> aOwnTypes(23); - aOwnTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<starbeans::XFastPropertySet>*>(NULL)); - aOwnTypes.getArray()[1] = ::getCppuType(static_cast<staruno::Reference<starbeans::XMultiPropertySet>*>(NULL)); - aOwnTypes.getArray()[2] = ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertySet>*>(NULL)); - aOwnTypes.getArray()[3] = ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertyState>*>(NULL)); - aOwnTypes.getArray()[4] = ::getCppuType(static_cast<staruno::Reference<starsdb::XSQLErrorBroadcaster>*>(NULL)); - aOwnTypes.getArray()[5] = ::getCppuType(static_cast<staruno::Reference<starform::XForm>*>(NULL)); - aOwnTypes.getArray()[6] = ::getCppuType(static_cast<staruno::Reference<starawt::XTabControllerModel>*>(NULL)); - aOwnTypes.getArray()[7] = ::getCppuType(static_cast<staruno::Reference<starform::XReset>*>(NULL)); - aOwnTypes.getArray()[8] = ::getCppuType(static_cast<staruno::Reference<starform::XSubmit>*>(NULL)); - aOwnTypes.getArray()[9] = ::getCppuType(static_cast<staruno::Reference<starform::XLoadListener>*>(NULL)); - aOwnTypes.getArray()[10] = ::getCppuType(static_cast<staruno::Reference<starform::XLoadable>*>(NULL)); - aOwnTypes.getArray()[11] = ::getCppuType(static_cast<staruno::Reference<starsdbc::XCloseable>*>(NULL)); - aOwnTypes.getArray()[12] = ::getCppuType(static_cast<staruno::Reference<starsdbc::XRowSet>*>(NULL)); - aOwnTypes.getArray()[13] = ::getCppuType(static_cast<staruno::Reference<starsdbc::XRowSetListener>*>(NULL)); - aOwnTypes.getArray()[14] = ::getCppuType(static_cast<staruno::Reference<starsdb::XRowSetApproveListener>*>(NULL)); - aOwnTypes.getArray()[15] = ::getCppuType(static_cast<staruno::Reference<starsdb::XRowSetApproveBroadcaster>*>(NULL)); - aOwnTypes.getArray()[16] = ::getCppuType(static_cast<staruno::Reference<starsdbc::XResultSetUpdate>*>(NULL)); - aOwnTypes.getArray()[17] = ::getCppuType(static_cast<staruno::Reference<starsdbcx::XDeleteRows>*>(NULL)); - aOwnTypes.getArray()[18] = ::getCppuType(static_cast<staruno::Reference<starsdbc::XParameters>*>(NULL)); - aOwnTypes.getArray()[19] = ::getCppuType(static_cast<staruno::Reference<starform::XDatabaseParameterBroadcaster>*>(NULL)); - aOwnTypes.getArray()[20] = ::getCppuType(static_cast<staruno::Reference<starsdb::XSQLErrorListener>*>(NULL)); - aOwnTypes.getArray()[21] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XNamed>*>(NULL)); - aOwnTypes.getArray()[22] = ::getCppuType(static_cast<staruno::Reference<starlang::XServiceInfo>*>(NULL)); - - return concatSequences(aAggregateTypes, aOwnTypes, OFormComponents::getTypes()); + Sequence<Type> aRet = concatSequences(aAggregateTypes, ODatabaseForm_BASE1::getTypes(), OFormComponents::getTypes()); + return concatSequences(aRet,ODatabaseForm_BASE2::getTypes(), ODatabaseForm_BASE3::getTypes()); } //------------------------------------------------------------------ -staruno::Any SAL_CALL ODatabaseForm::queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException) +Any SAL_CALL ODatabaseForm::queryAggregation(const Type& _rType) throw(RuntimeException) { - staruno::Any aReturn; + Any aReturn = ODatabaseForm_BASE1::queryInterface(_rType); // our own interfaces - aReturn = ::cppu::queryInterface(_rType, - static_cast<starform::XForm*>(this), - static_cast<starawt::XTabControllerModel*>(this), - static_cast<starform::XLoadListener*>(this), - static_cast<starform::XLoadable*>(this), - static_cast<starsdbc::XRowSetListener*>(this), - static_cast<starsdb::XRowSetApproveListener*>(this), - static_cast<starform::XDatabaseParameterBroadcaster*>(this), - static_cast<starsdb::XSQLErrorListener*>(this), - static_cast<starsdb::XSQLErrorBroadcaster*>(this), - static_cast<stario::XPersistObject*>(this), - static_cast<starform::XReset*>(this), - static_cast<starform::XSubmit*>(this) - ); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast<starcontainer::XNamed*>(this), - static_cast<starlang::XServiceInfo*>(this), - static_cast<starlang::XEventListener*>(static_cast<starform::XLoadListener*>(this)) - ); - // interfaces already present in the aggregate which we want to reroute - // only available if we could create the aggregate - if (!aReturn.hasValue() && m_xAggregateAsRowSet.is()) - aReturn = ::cppu::queryInterface(_rType, - static_cast<starsdb::XRowSetApproveBroadcaster*>(this), - static_cast<starsdbc::XRowSet*>(this), - static_cast<starsdbc::XResultSetUpdate*>(this), - static_cast<starsdbc::XResultSet*>(this), - static_cast<starsdbc::XCloseable*>(this), - static_cast<starsdbcx::XDeleteRows*>(this), - static_cast<starsdbc::XParameters*>(this) - ); - - // property set related interfaces - if (!aReturn.hasValue()) - aReturn = OPropertySetAggregationHelper::queryInterface(_rType); - // form component collection related interfaces if (!aReturn.hasValue()) - aReturn = OFormComponents::queryAggregation(_rType); + { + aReturn = ODatabaseForm_BASE2::queryInterface(_rType); + // property set related interfaces + if (!aReturn.hasValue()) + { + aReturn = OPropertySetAggregationHelper::queryInterface(_rType); - // aggregate interfaces - // (ask the aggregated object _after_ the OComponentHelper (base of OFormComponents), - // so calls to the starlang::XComponent interface reach us and not the aggreagtion) - if (!aReturn.hasValue() && m_xAggregate.is()) - aReturn = m_xAggregate->queryAggregation(_rType); + // form component collection related interfaces + if (!aReturn.hasValue()) + { + aReturn = OFormComponents::queryAggregation(_rType); + + // interfaces already present in the aggregate which we want to reroute + // only available if we could create the aggregate + if (!aReturn.hasValue() && m_xAggregateAsRowSet.is()) + aReturn = ODatabaseForm_BASE3::queryInterface(_rType); + + // aggregate interfaces + // (ask the aggregated object _after_ the OComponentHelper (base of OFormComponents), + // so calls to the XComponent interface reach us and not the aggreagtion) + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } + } + } return aReturn; } DBG_NAME(ODatabaseForm); //------------------------------------------------------------------ -ODatabaseForm::ODatabaseForm(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ODatabaseForm::ODatabaseForm(const Reference<XMultiServiceFactory>& _rxFactory) :OFormComponents(_rxFactory) ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) ,OPropertyChangeListener(m_aMutex) @@ -793,12 +755,12 @@ ODatabaseForm::ODatabaseForm(const staruno::Reference<starlang::XMultiServiceFac ,m_aErrorListeners(m_aMutex) ,m_bLoaded(sal_False) ,m_bSubForm(sal_False) - ,m_eNavigation(starform::NavigationBarMode_CURRENT) + ,m_eNavigation(NavigationBarMode_CURRENT) ,m_nPrivileges(0) ,m_pParameterInfo(NULL) ,m_pThread(NULL) - ,m_eSubmitMethod(starform::FormSubmitMethod_GET) - ,m_eSubmitEncoding(starform::FormSubmitEncoding_URL) + ,m_eSubmitMethod(FormSubmitMethod_GET) + ,m_eSubmitEncoding(FormSubmitEncoding_URL) ,m_bAllowDelete(sal_True) ,m_bAllowUpdate(sal_True) ,m_bAllowInsert(sal_True) @@ -811,16 +773,16 @@ ODatabaseForm::ODatabaseForm(const staruno::Reference<starlang::XMultiServiceFac increment(m_refCount); { - m_xAggregate = staruno::Reference<staruno::XAggregation>(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), staruno::UNO_QUERY); - // m_xAggregate = staruno::Reference<staruno::XAggregation>(m_xServiceFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.sdb.dbaccess.ORowSet")), staruno::UNO_QUERY); + m_xAggregate = Reference<XAggregation>(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), UNO_QUERY); + // m_xAggregate = Reference<XAggregation>(m_xServiceFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.sdb.dbaccess.ORowSet")), UNO_QUERY); DBG_ASSERT(m_xAggregate.is(), "ODatabaseForm::ODatabaseForm : could not instantiate an SDB rowset !"); - m_xAggregateAsRowSet = staruno::Reference<starsdbc::XRowSet> (m_xAggregate,staruno::UNO_QUERY); + m_xAggregateAsRowSet = Reference<XRowSet> (m_xAggregate,UNO_QUERY); setAggregation(m_xAggregate); } if (m_xAggregate.is()) { - m_xAggregate->setDelegator(static_cast<staruno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } // listen for the properties, important for Parameters @@ -853,7 +815,7 @@ ODatabaseForm::~ODatabaseForm() //============================================================================== // html tools //------------------------------------------------------------------------ -::rtl::OUString ODatabaseForm::GetDataURLEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt) +::rtl::OUString ODatabaseForm::GetDataURLEncoded(const Reference<XControl>& SubmitButton, const MouseEvent& MouseEvt) { // Liste von successful Controls fuellen @@ -875,7 +837,7 @@ ODatabaseForm::~ODatabaseForm() aValue = pSuccObj->aValue; if( pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength() ) { - // Bei File-URLs wird der Dateiname und keine starutil::URL uebertragen, + // Bei File-URLs wird der Dateiname und keine URL uebertragen, // weil Netscape dies so macht. INetURLObject aURL; aURL.SetSmartProtocol(INET_PROT_FILE); @@ -901,7 +863,7 @@ ODatabaseForm::~ODatabaseForm() //============================================================================== // html tools //------------------------------------------------------------------------ -::rtl::OUString ODatabaseForm::GetDataTextEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt) +::rtl::OUString ODatabaseForm::GetDataTextEncoded(const Reference<XControl>& SubmitButton, const MouseEvent& MouseEvt) { // Liste von successful Controls fuellen @@ -921,7 +883,7 @@ ODatabaseForm::~ODatabaseForm() aValue = pSuccObj->aValue; if (pSuccObj->nRepresentation == SUCCESSFUL_REPRESENT_FILE && aValue.getLength()) { - // Bei File-URLs wird der Dateiname und keine starutil::URL uebertragen, + // Bei File-URLs wird der Dateiname und keine URL uebertragen, // weil Netscape dies so macht. INetURLObject aURL; aURL.SetSmartProtocol(INET_PROT_FILE); @@ -946,7 +908,7 @@ ODatabaseForm::~ODatabaseForm() } //------------------------------------------------------------------------ -staruno::Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt, ::rtl::OUString& rContentType) +Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const Reference<XControl>& SubmitButton, const MouseEvent& MouseEvt, ::rtl::OUString& rContentType) { // Parent erzeugen @@ -995,12 +957,12 @@ staruno::Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const staruno sal_Int32 nLen = aMemStream.Seek(STREAM_SEEK_TO_END); rContentType = UniString(aParent.GetContentType()); - return staruno::Sequence<sal_Int8>((sal_Int8*)pData, nLen); + return Sequence<sal_Int8>((sal_Int8*)pData, nLen); } //------------------------------------------------------------------------ -void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno::Reference<starbeans::XPropertySet>& xComponentSet, const ::rtl::OUString& rNamePrefix, - const staruno::Reference<starawt::XControl>& rxSubmitButton, const starawt::MouseEvent& MouseEvt) +void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Reference<XPropertySet>& xComponentSet, const ::rtl::OUString& rNamePrefix, + const Reference<XControl>& rxSubmitButton, const MouseEvent& MouseEvt) { if (!xComponentSet.is()) return; @@ -1018,7 +980,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: xComponentSet->getPropertyValue(PROPERTY_CLASSID) >>= nClassId; ::rtl::OUString aName; xComponentSet->getPropertyValue( PROPERTY_NAME ) >>= aName; - if( !aName.getLength() && nClassId != starform::FormComponentType::IMAGEBUTTON) + if( !aName.getLength() && nClassId != FormComponentType::IMAGEBUTTON) return; else // Name um den Prefix erweitern aName = rNamePrefix + aName; @@ -1026,13 +988,13 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: switch( nClassId ) { // Buttons - case starform::FormComponentType::COMMANDBUTTON: + case FormComponentType::COMMANDBUTTON: { // Es wird nur der gedrueckte Submit-Button ausgewertet // MIB: Sofern ueberhaupt einer uebergeben wurde if( rxSubmitButton.is() ) { - staruno::Reference<starbeans::XPropertySet> xSubmitButtonComponent(rxSubmitButton->getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSubmitButtonComponent(rxSubmitButton->getModel(), UNO_QUERY); if (xSubmitButtonComponent == xComponentSet && hasProperty(PROPERTY_LABEL, xComponentSet)) { // <name>=<label> @@ -1044,13 +1006,13 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // ImageButtons - case starform::FormComponentType::IMAGEBUTTON: + case FormComponentType::IMAGEBUTTON: { // Es wird nur der gedrueckte Submit-Button ausgewertet // MIB: Sofern ueberhaupt einer uebergeben wurde if( rxSubmitButton.is() ) { - staruno::Reference<starbeans::XPropertySet> xSubmitButtonComponent(rxSubmitButton->getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSubmitButtonComponent(rxSubmitButton->getModel(), UNO_QUERY); if (xSubmitButtonComponent == xComponentSet) { // <name>.x=<pos.X>&<name>.y=<pos.Y> @@ -1071,8 +1033,8 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // CheckBoxen / RadioButtons - case starform::FormComponentType::CHECKBOX: - case starform::FormComponentType::RADIOBUTTON: + case FormComponentType::CHECKBOX: + case FormComponentType::RADIOBUTTON: { // <name>=<refValue> if( !hasProperty(PROPERTY_STATE, xComponentSet) ) @@ -1090,7 +1052,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // Edit - case starform::FormComponentType::TEXTFIELD: + case FormComponentType::TEXTFIELD: { // <name>=<text> if( !hasProperty(PROPERTY_TEXT, xComponentSet) ) @@ -1098,30 +1060,30 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: // MIB: Spezial-Behandlung fuer Multiline-Edit nur dann, wenn // es auch ein Control dazu gibt. - staruno::Any aTmp = xComponentSet->getPropertyValue( PROPERTY_MULTILINE ); + Any aTmp = xComponentSet->getPropertyValue( PROPERTY_MULTILINE ); sal_Bool bMulti = rxSubmitButton.is() - && (aTmp.getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN) + && (aTmp.getValueType().getTypeClass() == TypeClass_BOOLEAN) && getBOOL(aTmp); ::rtl::OUString sText; if ( bMulti ) // Bei MultiLineEdit Text am Control abholen { - staruno::Reference<starawt::XControlContainer> xControlContainer(rxSubmitButton->getContext(), staruno::UNO_QUERY); + Reference<XControlContainer> xControlContainer(rxSubmitButton->getContext(), UNO_QUERY); if( !xControlContainer.is() ) break; - staruno::Sequence<staruno::Reference<starawt::XControl> > aControlSeq = xControlContainer->getControls(); - staruno::Reference<starawt::XControl> xControl; - staruno::Reference<starform::XFormComponent> xControlComponent; + Sequence<Reference<XControl> > aControlSeq = xControlContainer->getControls(); + Reference<XControl> xControl; + Reference<XFormComponent> xControlComponent; // Richtiges Control suchen sal_Int32 i; for( i=0; i<aControlSeq.getLength(); i++ ) { xControl = aControlSeq.getConstArray()[i]; - staruno::Reference<starbeans::XPropertySet> xModel(xControl->getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xModel(xControl->getModel(), UNO_QUERY); if (xModel == xComponentSet) { - staruno::Reference<starawt::XTextComponent> xTextComponent(xControl, staruno::UNO_QUERY); + Reference<XTextComponent> xTextComponent(xControl, UNO_QUERY); if( xTextComponent.is() ) sText = xTextComponent->getText(); break; @@ -1138,8 +1100,8 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // ComboBox, Patternfield - case starform::FormComponentType::COMBOBOX: - case starform::FormComponentType::PATTERNFIELD: + case FormComponentType::COMBOBOX: + case FormComponentType::PATTERNFIELD: { // <name>=<text> if( hasProperty(PROPERTY_TEXT, xComponentSet) ) @@ -1149,15 +1111,15 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: rList.push_back( HtmlSuccessfulObj(aName, aText) ); } } break; - case starform::FormComponentType::CURRENCYFIELD: - case starform::FormComponentType::NUMERICFIELD: + case FormComponentType::CURRENCYFIELD: + case FormComponentType::NUMERICFIELD: { // <name>=<wert> // wert wird als double mit Punkt als Decimaltrenner // kein Wert angegeben (NULL) -> wert leer if( hasProperty(PROPERTY_VALUE, xComponentSet) ) { ::rtl::OUString aText; - staruno::Any aVal = xComponentSet->getPropertyValue( PROPERTY_VALUE ); + Any aVal = xComponentSet->getPropertyValue( PROPERTY_VALUE ); double aDoubleVal; if (aVal >>= aDoubleVal) @@ -1171,18 +1133,18 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: rList.push_back( HtmlSuccessfulObj(aName, aText) ); } } break; - case starform::FormComponentType::DATEFIELD: + case FormComponentType::DATEFIELD: { // <name>=<wert> // Wert wird als Datum im Format (MM-DD-YYYY) // kein Wert angegeben (NULL) -> wert leer if( hasProperty(PROPERTY_DATE, xComponentSet) ) { ::rtl::OUString aText; - staruno::Any aVal = xComponentSet->getPropertyValue( PROPERTY_DATE ); + Any aVal = xComponentSet->getPropertyValue( PROPERTY_DATE ); sal_Int32 nInt32Val; if (aVal >>= nInt32Val) { - Date aDate(nInt32Val); + ::Date aDate(nInt32Val); char s[11]; sprintf(s,"%02d-%02d-%04d", (int)aDate.GetMonth(), @@ -1194,18 +1156,18 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: rList.push_back( HtmlSuccessfulObj(aName, aText) ); } } break; - case starform::FormComponentType::TIMEFIELD: + case FormComponentType::TIMEFIELD: { // <name>=<wert> // Wert wird als Zeit im Format (HH:MM:SS) angegeben // kein Wert angegeben (NULL) -> wert leer if( hasProperty(PROPERTY_TIME, xComponentSet) ) { ::rtl::OUString aText; - staruno::Any aVal = xComponentSet->getPropertyValue( PROPERTY_TIME ); + Any aVal = xComponentSet->getPropertyValue( PROPERTY_TIME ); sal_Int32 nInt32Val; if (aVal >>= nInt32Val) { - Time aTime(nInt32Val); + ::Time aTime(nInt32Val); char s[10]; sprintf(s,"%02d:%02d:%02d", (int)aTime.GetHour(), @@ -1219,7 +1181,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // starform - case starform::FormComponentType::HIDDENCONTROL: + case FormComponentType::HIDDENCONTROL: { // <name>=<value> @@ -1232,7 +1194,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // starform - case starform::FormComponentType::FILECONTROL: + case FormComponentType::FILECONTROL: { // <name>=<text> if( hasProperty(PROPERTY_TEXT, xComponentSet) ) @@ -1245,7 +1207,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: } break; // starform - case starform::FormComponentType::LISTBOX: + case FormComponentType::LISTBOX: { // <name>=<Token0>&<name>=<Token1>&...&<name>=<TokenN> (Mehrfachselektion) @@ -1254,20 +1216,20 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: break; // angezeigte Werte - staruno::Sequence< ::rtl::OUString > aVisibleList = - *(staruno::Sequence< ::rtl::OUString >*)xComponentSet->getPropertyValue( PROPERTY_STRINGITEMLIST ).getValue(); + Sequence< ::rtl::OUString > aVisibleList; + xComponentSet->getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= aVisibleList; sal_Int32 nStringCnt = aVisibleList.getLength(); const ::rtl::OUString* pStrings = aVisibleList.getConstArray(); // Werte-Liste - staruno::Sequence< ::rtl::OUString > aValueList = - *(staruno::Sequence< ::rtl::OUString >*)xComponentSet->getPropertyValue( PROPERTY_VALUE_SEQ ).getValue(); + Sequence< ::rtl::OUString > aValueList; + xComponentSet->getPropertyValue( PROPERTY_VALUE_SEQ ) >>= aValueList; sal_Int32 nValCnt = aValueList.getLength(); const ::rtl::OUString* pVals = aValueList.getConstArray(); // Selektion - staruno::Sequence<sal_Int16> aSelectList = - *(staruno::Sequence<sal_Int16>*)xComponentSet->getPropertyValue( PROPERTY_SELECT_SEQ ).getValue(); + Sequence<sal_Int16> aSelectList; + xComponentSet->getPropertyValue( PROPERTY_SELECT_SEQ ) >>= aSelectList; sal_Int32 nSelCount = aSelectList.getLength(); const sal_Int16* pSels = aSelectList.getConstArray(); @@ -1292,7 +1254,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: for(i=0; i<nCurCnt; ++i ) { sal_Int16 nSelPos = pSels[i]; - // Wenn starsdbcx::Index in WerteListe, Eintrag aus Werteliste holen + // Wenn Index in WerteListe, Eintrag aus Werteliste holen // ansonsten angezeigten Wert nehmen. Ein // LISTBOX_EMPTY_VALUE entspricht einem leeren, aber // vorhandenem VALUE des Option-Tags. @@ -1310,20 +1272,21 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: rList.push_back( HtmlSuccessfulObj(aName, aSubValue) ); } } break; - case starform::FormComponentType::GRIDCONTROL: + case FormComponentType::GRIDCONTROL: { // Die einzelnen Spaltenwerte werden verschickt, // der Name wird mit dem Prefix des Names des Grids erweitert - staruno::Reference<starcontainer::XIndexAccess> xContainer(xComponentSet, staruno::UNO_QUERY); + Reference<XIndexAccess> xContainer(xComponentSet, UNO_QUERY); if (!xContainer.is()) break; aName += UniString('.'); + Reference<XPropertySet> xSet; sal_Int32 nCount = xContainer->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) { - staruno::Reference<starbeans::XPropertySet> xSet(*(staruno::Reference<starbeans::XPropertySet> *)xContainer->getByIndex(i).getValue()); + xContainer->getByIndex(i) >>= xSet; if (xSet.is()) AppendComponent(rList, xSet, aName, rxSubmitButton, MouseEvt); } @@ -1333,24 +1296,17 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno: //------------------------------------------------------------------------ void ODatabaseForm::FillSuccessfulList( HtmlSuccessfulObjList& rList, - const staruno::Reference<starawt::XControl>& rxSubmitButton, const starawt::MouseEvent& MouseEvt ) + const Reference<XControl>& rxSubmitButton, const MouseEvent& MouseEvt ) { - // Liste loeschen rList.clear(); - - // Ueber Components iterieren - InterfaceRef xIFace; - staruno::Reference<starform::XFormComponent> xComponent; - staruno::Reference<starbeans::XPropertySet> xComponentSet; + Reference<XPropertySet> xComponentSet; ::rtl::OUString aPrefix; - staruno::Any aElement; for( sal_Int32 nIndex=0; nIndex < getCount(); nIndex++ ) { - aElement = getByIndex( nIndex ); - xComponentSet = staruno::Reference<starbeans::XPropertySet> (*(InterfaceRef *) aElement.getValue(), staruno::UNO_QUERY); + getByIndex( nIndex ) >>= xComponentSet; AppendComponent(rList, xComponentSet, aPrefix, rxSubmitButton, MouseEvt); } } @@ -1517,19 +1473,19 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O //============================================================================== // internals //------------------------------------------------------------------------------ -void ODatabaseForm::onError(const starsdb::SQLErrorEvent& _rEvent) +void ODatabaseForm::onError(const SQLErrorEvent& _rEvent) { - NOTIFY_LISTENERS(m_aErrorListeners, starsdb::XSQLErrorListener, errorOccured, _rEvent); + NOTIFY_LISTENERS(m_aErrorListeners, XSQLErrorListener, errorOccured, _rEvent); } //------------------------------------------------------------------------------ -void ODatabaseForm::onError(starsdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription) +void ODatabaseForm::onError(SQLException& _rException, const ::rtl::OUString& _rContextDescription) { if (!m_aErrorListeners.getLength()) return; - starsdb::SQLContext aError = prependContextInfo(_rException, static_cast<staruno::XWeak*>(this), _rContextDescription); - starsdb::SQLErrorEvent aEvent(static_cast<staruno::XWeak*>(this), staruno::makeAny(aError)); + SQLContext aError = prependContextInfo(_rException, static_cast<XWeak*>(this), _rContextDescription); + SQLErrorEvent aEvent(static_cast<XWeak*>(this), makeAny(aError)); onError(aEvent); } @@ -1540,15 +1496,15 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const OParameterInfoImpl* pParameterInfo = new OParameterInfoImpl(); // create and fill a composer - staruno::Reference<starsdb::XSQLQueryComposer> xComposer = getCurrentSettingsComposer(m_xAggregateSet, m_xServiceFactory); - staruno::Reference<starsdb::XParametersSupplier> xSetParameters = staruno::Reference<starsdb::XParametersSupplier> (xComposer, staruno::UNO_QUERY); + Reference<XSQLQueryComposer> xComposer = getCurrentSettingsComposer(m_xAggregateSet, m_xServiceFactory); + Reference<XParametersSupplier> xSetParameters = Reference<XParametersSupplier> (xComposer, UNO_QUERY); // if there is no parsable statement return if (!xSetParameters.is()) return pParameterInfo; - staruno::Reference<starcontainer::XIndexAccess> xParamsAsIndicies = xSetParameters->getParameters(); - staruno::Reference<starcontainer::XNameAccess> xParamsAsNames(xParamsAsIndicies, staruno::UNO_QUERY); + Reference<XIndexAccess> xParamsAsIndicies = xSetParameters->getParameters(); + Reference<XNameAccess> xParamsAsNames(xParamsAsIndicies, UNO_QUERY); sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0; // without parameters return if (!xParamsAsNames.is() || (nParamCount == 0)) @@ -1562,9 +1518,9 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const OParametersImpl::Parameters& rParams = pParameterInfo->pParameters->getParameters(); // we need to map the parameter names (which is all we can get from our parent) to indicies (which are - // needed by the starsdbc::XParameters interface of the row set) + // needed by the XParameters interface of the row set) MapUString2INT32& rParamMapping = pParameterInfo->aParamMapping; - staruno::Reference<starbeans::XPropertySet> xParam; + Reference<XPropertySet> xParam; for (sal_Int32 i = 0; i<nParamCount; ++i) { ::cppu::extractInterface(xParam, xParamsAsIndicies->getByIndex(i)); @@ -1577,10 +1533,10 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const } // check for a matching of my param master fields with the parent's columns - staruno::Reference<starsdbcx::XColumnsSupplier> xParentColsSuppl(m_xParent, staruno::UNO_QUERY); + Reference<XColumnsSupplier> xParentColsSuppl(m_xParent, UNO_QUERY); if (xParentColsSuppl.is()) { - staruno::Reference<starcontainer::XNameAccess> xParentCols = xParentColsSuppl->getColumns(); + Reference<XNameAccess> xParentCols = xParentColsSuppl->getColumns(); if (xParentCols.is()) { sal_Int32 nMasterLen = m_aMasterFields.getLength(); @@ -1593,7 +1549,7 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const OParametersImpl::ParametersIterator iter; for (sal_Int32 i = 0; i < nMasterLen; i++) { - staruno::Reference<starbeans::XPropertySet> xMasterField, xDetailField; + Reference<XPropertySet> xMasterField, xDetailField; if (xParentCols->hasByName(pMasterFields[i]) && xParamsAsNames->hasByName(pDetailFields[i])) @@ -1601,9 +1557,9 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const // parameter defined by master slave definition ::cppu::extractInterface(xDetailField, xParamsAsNames->getByName(pDetailFields[i])); - DBG_ASSERT(rParamMapping.find(pDetailFields[i]) != rParamMapping.end(), "ODatabaseForm::createParameterInfo: invalid starsdb::XParametersSupplier !"); - // the mapping was build from the starsdb::XParametersSupplier interface of the composer, and the - // starcontainer::XNameAccess interface of the composer said hasByName(...)==sal_True ... so what ? + DBG_ASSERT(rParamMapping.find(pDetailFields[i]) != rParamMapping.end(), "ODatabaseForm::createParameterInfo: invalid XParametersSupplier !"); + // the mapping was build from the XParametersSupplier interface of the composer, and the + // XNameAccess interface of the composer said hasByName(...)==sal_True ... so what ? // delete the wrapper as the parameter is set iter = find(rParams.begin(), rParams.end(), xDetailField); @@ -1620,10 +1576,10 @@ OParameterInfoImpl* ODatabaseForm::createParameterInfo() const sal_Int32 nParamsLeft = rParams.size(); if (nParamsLeft) { - staruno::Reference<starsdbc::XParameters> xExecutionParams(m_xAggregate, staruno::UNO_QUERY); + Reference<XParameters> xExecutionParams(m_xAggregate, UNO_QUERY); ::rtl::OUString sName; - staruno::Reference<starbeans::XPropertySet> xParam; - staruno::Reference<starbeans::XPropertySet> xWrapper; + Reference<XPropertySet> xParam; + Reference<XPropertySet> xWrapper; for (sal_Int32 j = nParamsLeft; j; ) { --j; @@ -1659,7 +1615,7 @@ bool ODatabaseForm::hasValidParent() const // do we have to fill the parameters again? if (m_bSubForm) { - staruno::Reference<starsdbc::XResultSet> xResultSet(m_xParent, staruno::UNO_QUERY); + Reference<XResultSet> xResultSet(m_xParent, UNO_QUERY); if (!xResultSet.is()) { DBG_ERROR("ODatabaseForm::hasValidParent() : no parent resultset !"); @@ -1667,7 +1623,7 @@ bool ODatabaseForm::hasValidParent() const } try { - staruno::Reference<starbeans::XPropertySet> xSet(m_xParent, staruno::UNO_QUERY); + Reference<XPropertySet> xSet(m_xParent, UNO_QUERY); // only if the parent has a command we have to check if the parent is positioned on a valid row if (getString(xSet->getPropertyValue(PROPERTY_COMMAND)).getLength() && (xResultSet->isBeforeFirst() || xResultSet->isAfterLast() || @@ -1686,7 +1642,7 @@ bool ODatabaseForm::hasValidParent() const //------------------------------------------------------------------------------ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const Reference< XInteractionHandler >& _rxCompletionHandler) { - staruno::Reference<starsdbc::XParameters> xExecutionParams; + Reference<XParameters> xExecutionParams; if (!query_aggregation( m_xAggregate, xExecutionParams)) { DBG_ERROR("ODatabaseForm::fillParameters : invalid row set (doesn't support parameters) !"); @@ -1711,20 +1667,20 @@ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const // do we have to fill the parent parameters? if (m_pParameterInfo->nCount > rParams.size()) { - staruno::Reference<starsdbcx::XColumnsSupplier> xParentColsSuppl(m_xParent, staruno::UNO_QUERY); + Reference<XColumnsSupplier> xParentColsSuppl(m_xParent, UNO_QUERY); if (xParentColsSuppl.is()) { - staruno::Reference<starcontainer::XNameAccess> xParentCols = xParentColsSuppl->getColumns(); + Reference<XNameAccess> xParentCols = xParentColsSuppl->getColumns(); sal_Int32 nMasterLen = m_aMasterFields.getLength(); if (xParentCols->hasElements() && (nMasterLen > 0)) { const ::rtl::OUString* pMasterFields = m_aMasterFields.getConstArray(); const ::rtl::OUString* pDetailFields = m_aDetailFields.getConstArray(); - staruno::Any aParamType,aScale,aValue; + Any aParamType,aScale,aValue; for (sal_Int32 i = 0; i < nMasterLen; i++) { - staruno::Reference<starbeans::XPropertySet> xMasterField, xDetailField; + Reference<XPropertySet> xMasterField, xDetailField; if (xParentCols->hasByName(pMasterFields[i]) && m_pParameterInfo->xParamsAsNames->hasByName(pDetailFields[i])) { @@ -1734,12 +1690,12 @@ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const // get the type of the param aParamType = xDetailField->getPropertyValue(PROPERTY_FIELDTYPE); - DBG_ASSERT(aParamType.getValueType().getTypeClass() == staruno::TypeClass_LONG, "ODatabaseForm::fillParameters : invalid parameter field !"); + DBG_ASSERT(aParamType.getValueType().getTypeClass() == TypeClass_LONG, "ODatabaseForm::fillParameters : invalid parameter field !"); sal_Int32 nScale = 0; if (hasProperty(PROPERTY_SCALE, xDetailField)) { aScale = xDetailField->getPropertyValue(PROPERTY_SCALE); - DBG_ASSERT(aScale.getValueType().getTypeClass() == staruno::TypeClass_LONG, "ODatabaseForm::fillParameters : invalid parameter field !"); + DBG_ASSERT(aScale.getValueType().getTypeClass() == TypeClass_LONG, "ODatabaseForm::fillParameters : invalid parameter field !"); nScale = getINT32(aScale); } // and fill the param value @@ -1813,11 +1769,11 @@ bool ODatabaseForm::fillParameters(ReusableMutexGuard& _rClearForNotifies, const if (nParamsLeft) { ::cppu::OInterfaceIteratorHelper aIter(m_aParameterListeners); - starform::DatabaseParameterEvent aEvt(static_cast<staruno::XWeak*>(this), m_pParameterInfo->pParameters); + DatabaseParameterEvent aEvt(static_cast<XWeak*>(this), m_pParameterInfo->pParameters); _rClearForNotifies.clear(); while (aIter.hasMoreElements() && !bCanceled) - bCanceled = !((starform::XDatabaseParameterListener*)aIter.next())->approveParameter(aEvt); + bCanceled = !((XDatabaseParameterListener*)aIter.next())->approveParameter(aEvt); _rClearForNotifies.attach(m_aMutex); } } @@ -1840,17 +1796,17 @@ void ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bo if (m_bSubForm && !hasValidParent()) { // don't use any parameters if we don't have a valid parent - nConcurrency = starsdbc::ResultSetConcurrency::READ_ONLY; + nConcurrency = ResultSetConcurrency::READ_ONLY; clearParameters(); } else if (m_bAllowInsert || m_bAllowUpdate || m_bAllowDelete) - nConcurrency = starsdbc::ResultSetConcurrency::UPDATABLE; + nConcurrency = ResultSetConcurrency::UPDATABLE; else - nConcurrency = starsdbc::ResultSetConcurrency::READ_ONLY; - m_xAggregateSet->setPropertyValue(PROPERTY_RESULTSET_CONCURRENCY, staruno::makeAny(nConcurrency)); + nConcurrency = ResultSetConcurrency::READ_ONLY; + m_xAggregateSet->setPropertyValue(PROPERTY_RESULTSET_CONCURRENCY, makeAny(nConcurrency)); - sal_Int32 nResultSetType = starsdbc::ResultSetType::SCROLL_SENSITIVE; - m_xAggregateSet->setPropertyValue(PROPERTY_RESULTSET_TYPE, staruno::makeAny(nResultSetType)); + sal_Int32 nResultSetType = ResultSetType::SCROLL_SENSITIVE; + m_xAggregateSet->setPropertyValue(PROPERTY_RESULTSET_TYPE, makeAny(nResultSetType)); sal_Bool bSuccess = sal_False; try @@ -1858,11 +1814,11 @@ void ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bo m_xAggregateAsRowSet->execute(); bSuccess = sal_True; } - catch(starsdb::RowSetVetoException& eVeto) + catch(RowSetVetoException& eVeto) { eVeto; } - catch(starsdbc::SQLException& eDb) + catch(SQLException& eDb) { _rClearForNotifies.clear(); if (m_sCurrentErrorContext.getLength()) @@ -1875,14 +1831,14 @@ void ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bo if (bSuccess) { // adjust the privilege property - m_nPrivileges; + // m_nPrivileges; m_xAggregateSet->getPropertyValue(PROPERTY_PRIVILEGES) >>= m_nPrivileges; if (!m_bAllowInsert) - m_nPrivileges &= ~starsdbcx::Privilege::INSERT; + m_nPrivileges &= ~Privilege::INSERT; if (!m_bAllowUpdate) - m_nPrivileges &= ~starsdbcx::Privilege::UPDATE; + m_nPrivileges &= ~Privilege::UPDATE; if (!m_bAllowDelete) - m_nPrivileges &= ~starsdbcx::Privilege::DELETE; + m_nPrivileges &= ~Privilege::DELETE; if (bMoveToFirst) { @@ -1891,18 +1847,18 @@ void ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bo { // if we have an insert only rowset we move to the insert row next(); - if (((m_nPrivileges & starsdbcx::Privilege::INSERT) == starsdbcx::Privilege::INSERT) + if (((m_nPrivileges & Privilege::INSERT) == Privilege::INSERT) && isAfterLast()) { // move on the insert row of set // resetting must be done later, after the load events have been posted // see :moveToInsertRow and load , reload - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->moveToInsertRow(); } } - catch(starsdbc::SQLException& eDB) + catch(SQLException& eDB) { _rClearForNotifies.clear(); if (m_sCurrentErrorContext.getLength()) @@ -1931,7 +1887,7 @@ void ODatabaseForm::disposing() } } - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); m_aLoadListeners.disposeAndClear(aEvt); m_aRowSetApproveListeners.disposeAndClear(aEvt); m_aParameterListeners.disposeAndClear(aEvt); @@ -1946,15 +1902,26 @@ void ODatabaseForm::disposing() if (m_xAggregateAsRowSet.is()) m_xAggregateAsRowSet->removeRowSetListener(this); - staruno::Reference<starlang::XComponent> xAggregationComponent; + Reference<XPropertySet> xProp(m_xAggregate,UNO_QUERY); + OSL_ENSHURE(xProp.is(),"No PropSet!"); + + // dispose the active connection + Reference<XComponent> xConnection; + xProp->getPropertyValue(PROPERTY_ACTIVE_CONNECTION) >>= xConnection; + + Reference<XComponent> xAggregationComponent; if (query_aggregation(m_xAggregate, xAggregationComponent)) xAggregationComponent->dispose(); + + // dispose it after the rowset + if(xConnection.is()) + xConnection->dispose(); } //------------------------------------------------------------------------------ -staruno::Reference< starsdbc::XConnection > ODatabaseForm::getConnection() +Reference< XConnection > ODatabaseForm::getConnection() { - staruno::Reference< starsdbc::XConnection > xReturn; + Reference< XConnection > xReturn; try { ::cppu::extractInterface(xReturn, getPropertyValue(PROPERTY_ACTIVE_CONNECTION)); @@ -1970,8 +1937,8 @@ staruno::Reference< starsdbc::XConnection > ODatabaseForm::getConnection() // property handling //------------------------------------------------------------------------------ void ODatabaseForm::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { BEGIN_AGGREGATION_PROPERTY_HELPER(14, m_xAggregateSet) // this property is overwritten by the form @@ -1984,16 +1951,16 @@ void ODatabaseForm::fillProperties( DECL_PROP1(MASTERFIELDS, StringSequence, BOUND); DECL_PROP1(DETAILFIELDS, StringSequence, BOUND); DECL_PROP2(DATASOURCE, ::rtl::OUString, BOUND, CONSTRAINED); - DECL_PROP3(CYCLE, starform::TabulatorCycle, BOUND, MAYBEVOID, MAYBEDEFAULT); - DECL_PROP1(NAVIGATION, starform::NavigationBarMode, BOUND); + DECL_PROP3(CYCLE, TabulatorCycle, BOUND, MAYBEVOID, MAYBEDEFAULT); + DECL_PROP1(NAVIGATION, NavigationBarMode, BOUND); DECL_BOOL_PROP1(ALLOWADDITIONS, BOUND); DECL_BOOL_PROP1(ALLOWEDITS, BOUND); DECL_BOOL_PROP1(ALLOWDELETIONS, BOUND); DECL_PROP2(PRIVILEGES, sal_Int32, TRANSIENT, READONLY); DECL_PROP1(TARGET_URL, ::rtl::OUString, BOUND); DECL_PROP1(TARGET_FRAME, ::rtl::OUString, BOUND); - DECL_PROP1(SUBMIT_METHOD, starform::FormSubmitMethod, BOUND); - DECL_PROP1(SUBMIT_ENCODING, starform::FormSubmitEncoding, BOUND); + DECL_PROP1(SUBMIT_METHOD, FormSubmitMethod, BOUND); + DECL_PROP1(SUBMIT_ENCODING, FormSubmitEncoding, BOUND); END_AGGREGATION_PROPERTY_HELPER(); } @@ -2004,14 +1971,14 @@ void ODatabaseForm::fillProperties( } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> ODatabaseForm::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> ODatabaseForm::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xDescriptorInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xDescriptorInfo( createPropertySetInfo( getInfoHelper() ) ); return xDescriptorInfo; } //------------------------------------------------------------------------------ -void ODatabaseForm::fire( sal_Int32* pnHandles, const staruno::Any* pNewValues, const staruno::Any* pOldValues, sal_Int32 nCount, sal_Bool bVetoable ) +void ODatabaseForm::fire( sal_Int32* pnHandles, const Any* pNewValues, const Any* pOldValues, sal_Int32 nCount, sal_Bool bVetoable ) { // same as in getFastPropertyValue(INT32) : if we're resetting currently don't fire any changes of the // IsModified property from FALSE to TRUE, as this is only temporary 'til the reset is done @@ -2023,7 +1990,7 @@ void ODatabaseForm::fire( sal_Int32* pnHandles, const staruno::Any* pNewValues, if (pnHandles[nPos] == PROPERTY_ID_ISMODIFIED) break; - if ((nPos < nCount) && (pNewValues[nPos].getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN) && getBOOL(pNewValues[nPos])) + if ((nPos < nCount) && (pNewValues[nPos].getValueType().getTypeClass() == TypeClass_BOOLEAN) && getBOOL(pNewValues[nPos])) { // yeah, we found it, and it changed to TRUE if (nPos == 0) { // just cut the first element @@ -2049,29 +2016,29 @@ void ODatabaseForm::fire( sal_Int32* pnHandles, const staruno::Any* pNewValues, } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL ODatabaseForm::getFastPropertyValue( sal_Int32 nHandle ) - throw(starbeans::UnknownPropertyException, starlang::WrappedTargetException, staruno::RuntimeException) +Any SAL_CALL ODatabaseForm::getFastPropertyValue( sal_Int32 nHandle ) + throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { if ((nHandle == PROPERTY_ID_ISMODIFIED) && (m_nResetsPending > 0)) - return staruno::makeAny(sal_Bool(sal_False)); + return makeAny(sal_Bool(sal_False)); // don't allow the aggregate which is currently reset to return a (temporary) "yes" else return OPropertySetAggregationHelper::getFastPropertyValue(nHandle); } //------------------------------------------------------------------------------ -void ODatabaseForm::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHandle ) const +void ODatabaseForm::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { switch (nHandle) { case PROPERTY_ID_DATASOURCE: { - rValue = staruno::makeAny(::rtl::OUString()); + rValue = makeAny(::rtl::OUString()); try { rValue = m_xAggregateSet->getPropertyValue(PROPERTY_DATASOURCE); } - catch(staruno::Exception&) { } + catch(Exception&) { } } break; case PROPERTY_ID_TARGET_URL: @@ -2117,15 +2084,15 @@ void ODatabaseForm::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHandl } //------------------------------------------------------------------------------ -sal_Bool ODatabaseForm::convertFastPropertyValue( staruno::Any& rConvertedValue, staruno::Any& rOldValue, - sal_Int32 nHandle, const staruno::Any& rValue ) throw( starlang::IllegalArgumentException ) +sal_Bool ODatabaseForm::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, + sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) { sal_Bool bModified(sal_False); switch (nHandle) { case PROPERTY_ID_DATASOURCE: { - staruno::Any aAggregateProperty; + Any aAggregateProperty; getFastPropertyValue(aAggregateProperty, PROPERTY_ID_DATASOURCE); bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, aAggregateProperty, ::getCppuType(static_cast<const ::rtl::OUString*>(NULL))); } @@ -2152,7 +2119,7 @@ sal_Bool ODatabaseForm::convertFastPropertyValue( staruno::Any& rConvertedValue, bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDetailFields); break; case PROPERTY_ID_CYCLE: - bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aCycle, ::getCppuType(static_cast<const starform::TabulatorCycle*>(NULL))); + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aCycle, ::getCppuType(static_cast<const TabulatorCycle*>(NULL))); break; case PROPERTY_ID_NAVIGATION: bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_eNavigation); @@ -2173,7 +2140,7 @@ sal_Bool ODatabaseForm::convertFastPropertyValue( staruno::Any& rConvertedValue, } //------------------------------------------------------------------------------ -void ODatabaseForm::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) +void ODatabaseForm::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) { switch (nHandle) { @@ -2182,7 +2149,7 @@ void ODatabaseForm::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const s { m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCE, rValue); } - catch(staruno::Exception&) { } + catch(Exception&) { } break; case PROPERTY_ID_TARGET_URL: rValue >>= m_aTargetURL; @@ -2228,16 +2195,16 @@ void ODatabaseForm::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const s //============================================================================== // com::sun::star::beans::XPropertyState //------------------------------------------------------------------ -starbeans::PropertyState ODatabaseForm::getPropertyStateByHandle(sal_Int32 nHandle) +PropertyState ODatabaseForm::getPropertyStateByHandle(sal_Int32 nHandle) { - starbeans::PropertyState eState; + PropertyState eState; switch (nHandle) { case PROPERTY_ID_CYCLE: if (!m_aCycle.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; else - eState = starbeans::PropertyState_DIRECT_VALUE; + eState = PropertyState_DIRECT_VALUE; break; default: eState = OPropertySetAggregationHelper::getPropertyStateByHandle(nHandle); @@ -2251,7 +2218,7 @@ void ODatabaseForm::setPropertyToDefaultByHandle(sal_Int32 nHandle) switch (nHandle) { case PROPERTY_ID_CYCLE: - setFastPropertyValue(nHandle, staruno::Any()); + setFastPropertyValue(nHandle, Any()); break; default: OPropertySetAggregationHelper::setPropertyToDefaultByHandle(nHandle); @@ -2259,12 +2226,12 @@ void ODatabaseForm::setPropertyToDefaultByHandle(sal_Int32 nHandle) } //------------------------------------------------------------------ -staruno::Any ODatabaseForm::getPropertyDefaultByHandle( sal_Int32 nHandle ) const +Any ODatabaseForm::getPropertyDefaultByHandle( sal_Int32 nHandle ) const { switch (nHandle) { case PROPERTY_ID_CYCLE: - return staruno::Any(); + return Any(); default: return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle); } @@ -2273,7 +2240,7 @@ staruno::Any ODatabaseForm::getPropertyDefaultByHandle( sal_Int32 nHandle ) cons //============================================================================== // com::sun::star::form::XReset //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::reset() throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::reset() throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); @@ -2297,7 +2264,7 @@ void SAL_CALL ODatabaseForm::reset() throw( staruno::RuntimeException ) m_pThread->acquire(); m_pThread->create(); } - starlang::EventObject aEvt; + EventObject aEvt; m_pThread->addEvent(&aEvt, sal_False); } else @@ -2318,10 +2285,10 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners) { bool bCanceled = false; ::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); while (aIter.hasMoreElements() && !bCanceled) - if (!((starform::XResetListener*)aIter.next())->approveReset(aEvt)) + if (!((XResetListener*)aIter.next())->approveReset(aEvt)) bCanceled = true; if (bCanceled) return; @@ -2335,21 +2302,21 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners) if (bInsertRow && m_bSubForm) { // Iterate through all columns and set the default value - staruno::Reference<starsdbcx::XColumnsSupplier> xColsSuppl(m_xAggregateSet, staruno::UNO_QUERY); + Reference<XColumnsSupplier> xColsSuppl(m_xAggregateSet, UNO_QUERY); // now set the values on which a subform depends - staruno::Reference<starsdbcx::XColumnsSupplier> xParentColsSuppl(m_xParent, staruno::UNO_QUERY); - staruno::Reference<starcontainer::XNameAccess> xParentCols = xParentColsSuppl->getColumns(); + Reference<XColumnsSupplier> xParentColsSuppl(m_xParent, UNO_QUERY); + Reference<XNameAccess> xParentCols = xParentColsSuppl->getColumns(); sal_Int32 nMasterLen = m_aMasterFields.getLength(); if (xParentCols->hasElements() && (nMasterLen > 0)) { - staruno::Reference<starcontainer::XNameAccess> xCols(xColsSuppl->getColumns(), staruno::UNO_QUERY); + Reference<XNameAccess> xCols(xColsSuppl->getColumns(), UNO_QUERY); const ::rtl::OUString* pMasterFields = m_aMasterFields.getConstArray(); const ::rtl::OUString* pDetailFields = m_aDetailFields.getConstArray(); for (sal_Int32 i = 0; i < nMasterLen; ++i) { - staruno::Reference<starbeans::XPropertySet> xMasterField, xField; + Reference<XPropertySet> xMasterField, xField; if (xParentCols->hasByName(pMasterFields[i]) && xCols->hasByName(pDetailFields[i])) { @@ -2362,13 +2329,13 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners) } aResetGuard.clear(); - // iterate through all components. don't use an starcontainer::XIndexAccess as this will cause massive + // iterate through all components. don't use an XIndexAccess as this will cause massive // problems with the count. - staruno::Reference<starcontainer::XEnumeration> xIter = createEnumeration(); + Reference<XEnumeration> xIter = createEnumeration(); while (xIter->hasMoreElements()) { - staruno::Any aElement(xIter->nextElement()); - staruno::Reference<starform::XReset> xReset; + Any aElement(xIter->nextElement()); + Reference<XReset> xReset; ::cppu::extractInterface(xReset, aElement); if (xReset.is()) { @@ -2383,31 +2350,31 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners) // on the modified state of the row // 21.02.00 - 73265 - FS) if (bInsertRow) - m_xAggregateSet->setPropertyValue(PROPERTY_ISMODIFIED, staruno::makeAny(sal_Bool(sal_False))); + m_xAggregateSet->setPropertyValue(PROPERTY_ISMODIFIED, makeAny(sal_Bool(sal_False))); aResetGuard.clear(); { - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); - NOTIFY_LISTENERS(m_aResetListeners, starform::XResetListener, resetted, aEvt); + EventObject aEvt(static_cast<XWeak*>(this)); + NOTIFY_LISTENERS(m_aResetListeners, XResetListener, resetted, aEvt); } aResetGuard.attach(m_aResetSafety); // and again : ensure the row isn't modified // we already did this after we (and maybe our dependents) resetted the values, but the listeners may have changed the row, too if (bInsertRow) - m_xAggregateSet->setPropertyValue(PROPERTY_ISMODIFIED, staruno::makeAny(sal_Bool(sal_False))); + m_xAggregateSet->setPropertyValue(PROPERTY_ISMODIFIED, makeAny(sal_Bool(sal_False))); --m_nResetsPending; } //----------------------------------------------------------------------------- -void SAL_CALL ODatabaseForm::addResetListener(const staruno::Reference<starform::XResetListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addResetListener(const Reference<XResetListener>& _rListener) throw( RuntimeException ) { m_aResetListeners.addInterface(_rListener); } //----------------------------------------------------------------------------- -void SAL_CALL ODatabaseForm::removeResetListener(const staruno::Reference<starform::XResetListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeResetListener(const Reference<XResetListener>& _rListener) throw( RuntimeException ) { m_aResetListeners.removeInterface(_rListener); } @@ -2415,12 +2382,12 @@ void SAL_CALL ODatabaseForm::removeResetListener(const staruno::Reference<starfo //============================================================================== // com::sun::star::form::XSubmit //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::submit( const staruno::Reference<starawt::XControl>& Control, - const starawt::MouseEvent& MouseEvt ) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::submit( const Reference<XControl>& Control, + const MouseEvent& MouseEvt ) throw( RuntimeException ) { { ::osl::MutexGuard aGuard(m_aMutex); - // Sind Controls und eine Submit-starutil::URL vorhanden? + // Sind Controls und eine Submit-URL vorhanden? if( !getCount() || !m_aTargetURL.getLength() ) return; } @@ -2447,17 +2414,17 @@ void SAL_CALL ODatabaseForm::submit( const staruno::Reference<starawt::XControl> } //------------------------------------------------------------------------------ -void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Control, const starawt::MouseEvent& MouseEvt, bool _bAproveByListeners) +void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const MouseEvent& MouseEvt, bool _bAproveByListeners) { if (_bAproveByListeners) { ::cppu::OInterfaceIteratorHelper aIter(m_aSubmitListeners); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); sal_Bool bCanceled = sal_False; while (aIter.hasMoreElements() && !bCanceled) { - if (!((starform::XSubmitListener*)aIter.next())->approveSubmit(aEvt)) + if (!((XSubmitListener*)aIter.next())->approveSubmit(aEvt)) bCanceled = sal_True; } @@ -2465,17 +2432,17 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con return; } - starform::FormSubmitEncoding eSubmitEncoding; - starform::FormSubmitMethod eSubmitMethod; + FormSubmitEncoding eSubmitEncoding; + FormSubmitMethod eSubmitMethod; ::rtl::OUString aURLStr; ::rtl::OUString aReferer; ::rtl::OUString aTargetName; - staruno::Reference< starframe::XModel > xModel; + Reference< XModel > xModel; { ::vos::OGuard aGuard( Application::GetSolarMutex() ); // starform->Forms - staruno::Reference<starcontainer::XChild> xParent(m_xParent, staruno::UNO_QUERY); + Reference<XChild> xParent(m_xParent, UNO_QUERY); if (xParent.is()) xModel = getXModel(xParent->getParent()); @@ -2494,13 +2461,13 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con if (!xModel.is()) return; - staruno::Reference<starutil::XURLTransformer> + Reference<XURLTransformer> xTransformer(m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), staruno::UNO_QUERY); + ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), UNO_QUERY); DBG_ASSERT(xTransformer.is(), "ODatabaseForm::submit_impl : could not create an URL transformer !"); - // starutil::URL-Encoding - if( eSubmitEncoding == starform::FormSubmitEncoding_URL ) + // URL-Encoding + if( eSubmitEncoding == FormSubmitEncoding_URL ) { ::rtl::OUString aData; { @@ -2508,13 +2475,13 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con aData = GetDataURLEncoded( Control, MouseEvt ); } - staruno::Reference< starframe::XFrame > xFrame = xModel->getCurrentController()->getFrame(); + Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); if (!xFrame.is()) return; - starutil::URL aURL; + URL aURL; // FormMethod GET - if( eSubmitMethod == starform::FormSubmitMethod_GET ) + if( eSubmitMethod == FormSubmitMethod_GET ) { INetURLObject aUrlObj( aURLStr ); aUrlObj.SetParam( aData ); @@ -2522,31 +2489,31 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con aURL.Complete = aMainURL; xTransformer->parseStrict(aURL); - staruno::Reference< starframe::XDispatch > xDisp = staruno::Reference< starframe::XDispatchProvider > (xFrame,staruno::UNO_QUERY)->queryDispatch(aURL, aTargetName, - starframe::FrameSearchFlag::SELF | starframe::FrameSearchFlag::PARENT | starframe::FrameSearchFlag::CHILDREN | - starframe::FrameSearchFlag::SIBLINGS | starframe::FrameSearchFlag::CREATE | starframe::FrameSearchFlag::TASKS); + Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, + FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | + FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); if (xDisp.is()) { - staruno::Sequence<starbeans::PropertyValue> aArgs(1); + Sequence<PropertyValue> aArgs(1); aArgs.getArray()->Name = ::rtl::OUString::createFromAscii("Referer"); aArgs.getArray()->Value <<= aReferer; xDisp->dispatch(aURL, aArgs); } } // FormMethod POST - else if( eSubmitMethod == starform::FormSubmitMethod_POST ) + else if( eSubmitMethod == FormSubmitMethod_POST ) { aURL.Complete = aURLStr; xTransformer->parseStrict(aURL); - staruno::Reference< starframe::XDispatch > xDisp = staruno::Reference< starframe::XDispatchProvider > (xFrame,staruno::UNO_QUERY)->queryDispatch(aURL, aTargetName, - starframe::FrameSearchFlag::SELF | starframe::FrameSearchFlag::PARENT | starframe::FrameSearchFlag::CHILDREN | - starframe::FrameSearchFlag::SIBLINGS | starframe::FrameSearchFlag::CREATE | starframe::FrameSearchFlag::TASKS); + Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, + FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | + FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); if (xDisp.is()) { - staruno::Sequence<starbeans::PropertyValue> aArgs(2); + Sequence<PropertyValue> aArgs(2); aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); aArgs.getArray()[0].Value <<= aReferer; aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostString"); @@ -2556,24 +2523,24 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con } } } - else if( eSubmitEncoding == starform::FormSubmitEncoding_MULTIPART ) + else if( eSubmitEncoding == FormSubmitEncoding_MULTIPART ) { - staruno::Reference< starframe::XFrame > xFrame = xModel->getCurrentController()->getFrame(); + Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); if (!xFrame.is()) return; - starutil::URL aURL; + URL aURL; aURL.Complete = aURLStr; xTransformer->parseStrict(aURL); - staruno::Reference< starframe::XDispatch > xDisp = staruno::Reference< starframe::XDispatchProvider > (xFrame,staruno::UNO_QUERY)->queryDispatch(aURL, aTargetName, - starframe::FrameSearchFlag::SELF | starframe::FrameSearchFlag::PARENT | starframe::FrameSearchFlag::CHILDREN | - starframe::FrameSearchFlag::SIBLINGS | starframe::FrameSearchFlag::CREATE | starframe::FrameSearchFlag::TASKS); + Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, + FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | + FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); if (xDisp.is()) { ::rtl::OUString aContentType; - staruno::Sequence<sal_Int8> aData; + Sequence<sal_Int8> aData; { ::vos::OGuard aGuard( Application::GetSolarMutex() ); aData = GetDataMultiPartEncoded(Control, MouseEvt, aContentType); @@ -2581,7 +2548,7 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con if (!aData.getLength()) return; - staruno::Sequence<starbeans::PropertyValue> aArgs(3); + Sequence<PropertyValue> aArgs(3); aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); aArgs.getArray()[0].Value <<= aReferer; aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("ContentType"); @@ -2592,30 +2559,30 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con xDisp->dispatch(aURL, aArgs); } } - else if( eSubmitEncoding == starform::FormSubmitEncoding_TEXT ) + else if( eSubmitEncoding == FormSubmitEncoding_TEXT ) { ::rtl::OUString aData; { ::vos::OGuard aGuard( Application::GetSolarMutex() ); - aData = GetDataTextEncoded( staruno::Reference<starawt::XControl> (), MouseEvt ); + aData = GetDataTextEncoded( Reference<XControl> (), MouseEvt ); } - staruno::Reference< starframe::XFrame > xFrame = xModel->getCurrentController()->getFrame(); + Reference< XFrame > xFrame = xModel->getCurrentController()->getFrame(); if (!xFrame.is()) return; - starutil::URL aURL; + URL aURL; aURL.Complete = aURLStr; xTransformer->parseStrict(aURL); - staruno::Reference< starframe::XDispatch > xDisp = staruno::Reference< starframe::XDispatchProvider > (xFrame,staruno::UNO_QUERY)->queryDispatch(aURL, aTargetName, - starframe::FrameSearchFlag::SELF | starframe::FrameSearchFlag::PARENT | starframe::FrameSearchFlag::CHILDREN | - starframe::FrameSearchFlag::SIBLINGS | starframe::FrameSearchFlag::CREATE | starframe::FrameSearchFlag::TASKS); + Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName, + FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN | + FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS); if (xDisp.is()) { - staruno::Sequence<starbeans::PropertyValue> aArgs(2); + Sequence<PropertyValue> aArgs(2); aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer"); aArgs.getArray()[0].Value <<= aReferer; aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostString"); @@ -2629,15 +2596,15 @@ void ODatabaseForm::submit_impl(const staruno::Reference<starawt::XControl>& Con } -// starform::XSubmit +// XSubmit //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addSubmitListener(const staruno::Reference<starform::XSubmitListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addSubmitListener(const Reference<XSubmitListener>& _rListener) throw( RuntimeException ) { m_aSubmitListeners.addInterface(_rListener); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeSubmitListener(const staruno::Reference<starform::XSubmitListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeSubmitListener(const Reference<XSubmitListener>& _rListener) throw( RuntimeException ) { m_aSubmitListeners.removeInterface(_rListener); } @@ -2645,13 +2612,13 @@ void SAL_CALL ODatabaseForm::removeSubmitListener(const staruno::Reference<starf //============================================================================== // com::sun::star::sdbc::XSQLErrorBroadcaster //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addSQLErrorListener(const Reference<XSQLErrorListener>& _rListener) throw( RuntimeException ) { m_aErrorListeners.addInterface(_rListener); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeSQLErrorListener(const Reference<XSQLErrorListener>& _rListener) throw( RuntimeException ) { m_aErrorListeners.removeInterface(_rListener); } @@ -2659,7 +2626,7 @@ void SAL_CALL ODatabaseForm::removeSQLErrorListener(const staruno::Reference<sta //============================================================================== // OChangeListener //------------------------------------------------------------------------------ -void ODatabaseForm::_propertyChanged(const starbeans::PropertyChangeEvent& evt) throw( staruno::RuntimeException ) +void ODatabaseForm::_propertyChanged(const PropertyChangeEvent& evt) throw( RuntimeException ) { // if the statement has changed we have to delete the parameter info ::osl::MutexGuard aGuard(m_aMutex); @@ -2668,39 +2635,39 @@ void ODatabaseForm::_propertyChanged(const starbeans::PropertyChangeEvent& evt) } //============================================================================== -// smartstarcontainer::XChild +// smartXChild //------------------------------------------------------------------------------ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) { ReusableMutexGuard aGuard(m_aMutex); - staruno::Reference<starform::XForm> xParentForm(getParent(), staruno::UNO_QUERY); + Reference<XForm> xParentForm(getParent(), UNO_QUERY); if (xParentForm.is()) { - staruno::Reference<starsdb::XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, staruno::UNO_QUERY); + Reference<XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, UNO_QUERY); if (xParentApprBroadcast.is()) xParentApprBroadcast->removeRowSetApproveListener(this); - staruno::Reference<starform::XLoadable> xParentLoadable(xParentForm, staruno::UNO_QUERY); + Reference<XLoadable> xParentLoadable(xParentForm, UNO_QUERY); if (xParentLoadable.is()) xParentLoadable->removeLoadListener(this); } OFormComponents::setParent(Parent); - xParentForm = staruno::Reference<starform::XForm> (getParent(), staruno::UNO_QUERY); + xParentForm = Reference<XForm> (getParent(), UNO_QUERY); if (xParentForm.is()) { - staruno::Reference<starsdb::XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, staruno::UNO_QUERY); + Reference<XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, UNO_QUERY); if (xParentApprBroadcast.is()) xParentApprBroadcast->addRowSetApproveListener(this); - staruno::Reference<starform::XLoadable> xParentLoadable(xParentForm, staruno::UNO_QUERY); + Reference<XLoadable> xParentLoadable(xParentForm, UNO_QUERY); if (xParentLoadable.is()) xParentLoadable->addLoadListener(this); } } //============================================================================== -// smartstarawt::XTabControllerModel +// smartXTabControllerModel //------------------------------------------------------------------------------ sal_Bool SAL_CALL ODatabaseForm::getGroupControl() throw(com::sun::star::uno::RuntimeException) { @@ -2711,7 +2678,7 @@ sal_Bool SAL_CALL ODatabaseForm::getGroupControl() throw(com::sun::star::uno::Ru { sal_Int32 nCycle; ::cppu::enum2int(nCycle, m_aCycle); - return nCycle != starform::TabulatorCycle_PAGE; + return nCycle != TabulatorCycle_PAGE; } if (isLoaded() && getConnection().is()) @@ -2721,12 +2688,12 @@ sal_Bool SAL_CALL ODatabaseForm::getGroupControl() throw(com::sun::star::uno::Ru } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setControlModels(const staruno::Sequence<staruno::Reference<starawt::XControlModel> >& rControls) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setControlModels(const Sequence<Reference<XControlModel> >& rControls) throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); // TabIndex in der Reihenfolge der Sequence setzen - const staruno::Reference<starawt::XControlModel>* pControls = rControls.getConstArray(); + const Reference<XControlModel>* pControls = rControls.getConstArray(); sal_Int16 nTabIndex = 1; sal_Int32 nCount = getCount(); sal_Int32 nNewCount = rControls.getLength(); @@ -2734,22 +2701,22 @@ void SAL_CALL ODatabaseForm::setControlModels(const staruno::Sequence<staruno::R // HiddenControls und Formulare werden nicht aufgefuehrt if (nNewCount <= nCount) { - staruno::Any aElement; + Any aElement; for (sal_Int32 i=0; i < nNewCount; ++i, ++pControls) { - staruno::Reference<starform::XFormComponent> xComp(*pControls, staruno::UNO_QUERY); + Reference<XFormComponent> xComp(*pControls, UNO_QUERY); if (xComp.is()) { // suchen der Componente in der Liste for (sal_Int32 j = 0; j < nCount; ++j) { - staruno::Reference<starform::XFormComponent> xElement; + Reference<XFormComponent> xElement; ::cppu::extractInterface(xElement, getByIndex(j)); if (xComp == xElement) { - staruno::Reference<starbeans::XPropertySet> xSet(xComp, staruno::UNO_QUERY); + Reference<XPropertySet> xSet(xComp, UNO_QUERY); if (xSet.is() && hasProperty(PROPERTY_TABINDEX, xSet)) - xSet->setPropertyValue( PROPERTY_TABINDEX, staruno::makeAny(nTabIndex++) ); + xSet->setPropertyValue( PROPERTY_TABINDEX, makeAny(nTabIndex++) ); break; } } @@ -2759,50 +2726,50 @@ void SAL_CALL ODatabaseForm::setControlModels(const staruno::Sequence<staruno::R } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Reference<starawt::XControlModel> > SAL_CALL ODatabaseForm::getControlModels() throw( staruno::RuntimeException ) +Sequence<Reference<XControlModel> > SAL_CALL ODatabaseForm::getControlModels() throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); return m_pGroupManager->getControlModels(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setGroup( const staruno::Sequence<staruno::Reference<starawt::XControlModel> >& _rGroup, const ::rtl::OUString& Name ) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setGroup( const Sequence<Reference<XControlModel> >& _rGroup, const ::rtl::OUString& Name ) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); // Die Controls werden gruppiert, indem ihr Name dem Namen des ersten // Controls der Sequenz angepasst wird - const staruno::Reference<starawt::XControlModel>* pControls = _rGroup.getConstArray(); - staruno::Reference<starbeans::XPropertySet> xSet; + const Reference<XControlModel>* pControls = _rGroup.getConstArray(); + Reference<XPropertySet> xSet; ::rtl::OUString sGroupName; for( sal_Int32 i=0; i<_rGroup.getLength(); ++i, ++pControls ) { - staruno::Reference<starbeans::XPropertySet> xSet(*pControls, staruno::UNO_QUERY); + Reference<XPropertySet> xSet(*pControls, UNO_QUERY); if (!sGroupName.getLength()) xSet->getPropertyValue(PROPERTY_NAME) >>= sGroupName; else - xSet->setPropertyValue(PROPERTY_NAME, staruno::makeAny(sGroupName)); + xSet->setPropertyValue(PROPERTY_NAME, makeAny(sGroupName)); } } //------------------------------------------------------------------------------ -sal_Int32 SAL_CALL ODatabaseForm::getGroupCount() throw( staruno::RuntimeException ) +sal_Int32 SAL_CALL ODatabaseForm::getGroupCount() throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); return m_pGroupManager->getGroupCount(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::getGroup( sal_Int32 nGroup, staruno::Sequence<staruno::Reference<starawt::XControlModel> >& _rGroup, ::rtl::OUString& Name ) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::getGroup( sal_Int32 nGroup, Sequence<Reference<XControlModel> >& _rGroup, ::rtl::OUString& Name ) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); m_pGroupManager->getGroup( nGroup, _rGroup, Name ); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::getGroupByName(const ::rtl::OUString& Name, staruno::Sequence< staruno::Reference<starawt::XControlModel> >& _rGroup) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::getGroupByName(const ::rtl::OUString& Name, Sequence< Reference<XControlModel> >& _rGroup) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); m_pGroupManager->getGroupByName( Name, _rGroup ); @@ -2811,7 +2778,7 @@ void SAL_CALL ODatabaseForm::getGroupByName(const ::rtl::OUString& Name, staruno //============================================================================== // com::sun::star::lang::XEventListener //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::disposing(const starlang::EventObject& Source) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::disposing(const EventObject& Source) throw( RuntimeException ) { OInterfaceContainer::disposing(Source); } @@ -2819,13 +2786,13 @@ void SAL_CALL ODatabaseForm::disposing(const starlang::EventObject& Source) thro //============================================================================== // com::sun::star::form::XLoadListener //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::loaded(const starlang::EventObject& aEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::loaded(const EventObject& aEvent) throw( RuntimeException ) { // now start the rowset listening to recover cursor events load_impl(sal_True); { ::osl::MutexGuard aGuard(m_aMutex); - staruno::Reference<starsdbc::XRowSet> xParentRowSet(m_xParent, staruno::UNO_QUERY); + Reference<XRowSet> xParentRowSet(m_xParent, UNO_QUERY); if (xParentRowSet.is()) xParentRowSet->addRowSetListener(this); @@ -2836,14 +2803,14 @@ void SAL_CALL ODatabaseForm::loaded(const starlang::EventObject& aEvent) throw( } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::unloading(const starlang::EventObject& aEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::unloading(const EventObject& aEvent) throw( RuntimeException ) { { // now stop the rowset listening if we are a subform ::osl::MutexGuard aGuard(m_aMutex); DELETEZ(m_pLoadTimer); - staruno::Reference<starsdbc::XRowSet> xParentRowSet(m_xParent, staruno::UNO_QUERY); + Reference<XRowSet> xParentRowSet(m_xParent, UNO_QUERY); if (xParentRowSet.is()) xParentRowSet->removeRowSetListener(this); } @@ -2851,17 +2818,17 @@ void SAL_CALL ODatabaseForm::unloading(const starlang::EventObject& aEvent) thro } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::unloaded(const starlang::EventObject& aEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::unloaded(const EventObject& aEvent) throw( RuntimeException ) { // nothing to do } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::reloading(const starlang::EventObject& aEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::reloading(const EventObject& aEvent) throw( RuntimeException ) { // now stop the rowset listening if we are a subform ::osl::MutexGuard aGuard(m_aMutex); - staruno::Reference<starsdbc::XRowSet> xParentRowSet(m_xParent, staruno::UNO_QUERY); + Reference<XRowSet> xParentRowSet(m_xParent, UNO_QUERY); if (xParentRowSet.is()) xParentRowSet->removeRowSetListener(this); @@ -2870,12 +2837,12 @@ void SAL_CALL ODatabaseForm::reloading(const starlang::EventObject& aEvent) thro } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::reloaded(const starlang::EventObject& aEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::reloaded(const EventObject& aEvent) throw( RuntimeException ) { reload_impl(sal_True); { ::osl::MutexGuard aGuard(m_aMutex); - staruno::Reference<starsdbc::XRowSet> xParentRowSet(m_xParent, staruno::UNO_QUERY); + Reference<XRowSet> xParentRowSet(m_xParent, UNO_QUERY); if (xParentRowSet.is()) xParentRowSet->addRowSetListener(this); } @@ -2891,7 +2858,7 @@ IMPL_LINK( ODatabaseForm, OnTimeout, void*, EMPTYARG ) //============================================================================== // com::sun::star::form::XLoadable //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::load() throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::load() throw( RuntimeException ) { load_impl(sal_False); } @@ -2905,14 +2872,14 @@ sal_Bool ODatabaseForm::implEnsureConnection() { // do we have a connection in the hierarchy than take that connection // this overwrites all the other connnections - staruno::Reference< starsdbc::XConnection > xConnection = calcConnection( - staruno::Reference<starsdbc::XRowSet> (m_xAggregate, staruno::UNO_QUERY), + Reference< XConnection > xConnection = calcConnection( + Reference<XRowSet> (m_xAggregate, UNO_QUERY), m_xServiceFactory ); // will set a calculated connection implicitly return xConnection.is(); } } - catch(starsdbc::SQLException& eDB) + catch(SQLException& eDB) { onError(eDB, FRM_RES_STRING(RID_STR_CONNECTERROR)); } @@ -2921,7 +2888,7 @@ sal_Bool ODatabaseForm::implEnsureConnection() } //------------------------------------------------------------------------------ -void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( staruno::RuntimeException ) +void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); @@ -2941,7 +2908,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs // a database form always uses caching // we use starting fetchsize with at least 10 rows if (bConnected) - m_xAggregateSet->setPropertyValue(PROPERTY_FETCHSIZE, staruno::makeAny((sal_Int32)10)); + m_xAggregateSet->setPropertyValue(PROPERTY_FETCHSIZE, makeAny((sal_Int32)10)); // if we're loaded as sub form we got a "rowSetChanged" from the parent rowset _before_ we got the "loaded" // so we don't need to execute the statement again, this was already done @@ -2956,8 +2923,8 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs m_bLoaded = sal_True; aGuard.clear(); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); - NOTIFY_LISTENERS(m_aLoadListeners, starform::XLoadListener, loaded, aEvt); + EventObject aEvt(static_cast<XWeak*>(this)); + NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, loaded, aEvt); // if we are on the insert row, we have to reset all controls // to set the default values @@ -2966,7 +2933,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::unload() throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::unload() throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); if (!isLoaded()) @@ -2975,8 +2942,8 @@ void SAL_CALL ODatabaseForm::unload() throw( staruno::RuntimeException ) DELETEZ(m_pLoadTimer); aGuard.clear(); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); - NOTIFY_LISTENERS(m_aLoadListeners, starform::XLoadListener, unloading, aEvt); + EventObject aEvt(static_cast<XWeak*>(this)); + NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, unloading, aEvt); if (m_xAggregateAsRowSet.is()) { @@ -2987,13 +2954,13 @@ void SAL_CALL ODatabaseForm::unload() throw( staruno::RuntimeException ) try { // close the aggregate - staruno::Reference<starsdbc::XCloseable> xCloseable; + Reference<XCloseable> xCloseable; query_aggregation( m_xAggregate, xCloseable); aGuard.clear(); if (xCloseable.is()) xCloseable->close(); } - catch(starsdbc::SQLException& eDB) + catch(SQLException& eDB) { eDB; } @@ -3003,23 +2970,23 @@ void SAL_CALL ODatabaseForm::unload() throw( staruno::RuntimeException ) m_bLoaded = sal_False; aGuard.clear(); - NOTIFY_LISTENERS(m_aLoadListeners, starform::XLoadListener, unloaded, aEvt); + NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, unloaded, aEvt); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::reload() throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::reload() throw( RuntimeException ) { reload_impl(sal_True); } //------------------------------------------------------------------------------ -void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( staruno::RuntimeException ) +void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); if (!isLoaded()) return; - starlang::EventObject aEvent(static_cast<staruno::XWeak*>(this)); + EventObject aEvent(static_cast<XWeak*>(this)); { // only if there is no approve listener we can post the event at this time // otherwise see approveRowsetChange @@ -3030,7 +2997,7 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac aGuard.clear(); while (aIter.hasMoreElements()) - ((starform::XLoadListener*)aIter.next())->reloading(aEvent); + ((XLoadListener*)aIter.next())->reloading(aEvent); aGuard.attach(m_aMutex); } @@ -3041,7 +3008,7 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac m_sCurrentErrorContext = FRM_RES_STRING(RID_ERR_REFRESHING_FORM); executeRowSet(aGuard, bMoveToFirst, _rxCompletionHandler); } - catch(starsdbc::SQLException& e) + catch(SQLException& e) { DBG_ERROR("ODatabaseForm::reload_impl : shouldn't executeRowSet catch this exception ?"); e; @@ -3051,7 +3018,7 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac ::cppu::OInterfaceIteratorHelper aIter(m_aLoadListeners); aGuard.clear(); while (aIter.hasMoreElements()) - ((starform::XLoadListener*)aIter.next())->reloaded(aEvent); + ((XLoadListener*)aIter.next())->reloaded(aEvent); // if we are on the insert row, we have to reset all controls // to set the default values @@ -3061,19 +3028,19 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::isLoaded() throw( staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::isLoaded() throw( RuntimeException ) { return m_bLoaded; } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addLoadListener(const staruno::Reference<starform::XLoadListener>& aListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addLoadListener(const Reference<XLoadListener>& aListener) throw( RuntimeException ) { m_aLoadListeners.addInterface(aListener); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeLoadListener(const staruno::Reference<starform::XLoadListener>& aListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeLoadListener(const Reference<XLoadListener>& aListener) throw( RuntimeException ) { m_aLoadListeners.removeInterface(aListener); } @@ -3081,7 +3048,7 @@ void SAL_CALL ODatabaseForm::removeLoadListener(const staruno::Reference<starfor //============================================================================== // com::sun::star::sdbc::XCloseable //============================================================================== -void SAL_CALL ODatabaseForm::close() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::close() throw( SQLException, RuntimeException ) { // unload will close the aggregate unload(); @@ -3090,7 +3057,7 @@ void SAL_CALL ODatabaseForm::close() throw( starsdbc::SQLException, staruno::Run //============================================================================== // com::sun::star::sdbc::XRowSetListener //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::cursorMoved(const starlang::EventObject& event) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::cursorMoved(const EventObject& event) throw( RuntimeException ) { // reload the subform with the new parameters of the parent // do this handling delayed to provide of execute too many SQL Statements @@ -3103,33 +3070,33 @@ void SAL_CALL ODatabaseForm::cursorMoved(const starlang::EventObject& event) thr } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::rowChanged(const starlang::EventObject& event) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::rowChanged(const EventObject& event) throw( RuntimeException ) { // ignore it } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::rowSetChanged(const starlang::EventObject& event) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::rowSetChanged(const EventObject& event) throw( RuntimeException ) { // not interested in : // if our parent is an ODatabaseForm, too, then after this rowSetChanged we'll get a "reloaded" // or a "loaded" event. - // If somebody gave us another parent which is an starsdbc::XRowSet but doesn't handle an execute as + // If somebody gave us another parent which is an XRowSet but doesn't handle an execute as // "load" respectivly "reload" ... can't do anything .... } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::approveCursorMove(const starlang::EventObject& event) throw( staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::approveCursorMove(const EventObject& event) throw( RuntimeException ) { // is our aggregate calling? - if (event.Source == InterfaceRef(static_cast<staruno::XWeak*>(this))) + if (event.Source == InterfaceRef(static_cast<XWeak*>(this))) { // Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface - // for starsdb::XRowSetApproveBroadcaster-interface. + // for XRowSetApproveBroadcaster-interface. // So we have to multiplex this approve request. ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveCursorMove(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveCursorMove(event)) return sal_False; } else @@ -3139,44 +3106,44 @@ sal_Bool SAL_CALL ODatabaseForm::approveCursorMove(const starlang::EventObject& // ask our own RowSetChangesListeners, too ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) return sal_False; } return sal_True; } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::approveRowChange(const starsdb::RowChangeEvent& event) throw( staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::approveRowChange(const RowChangeEvent& event) throw( RuntimeException ) { // is our aggregate calling? - if (event.Source == InterfaceRef(static_cast<staruno::XWeak*>(this))) + if (event.Source == InterfaceRef(static_cast<XWeak*>(this))) { // Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface - // for starsdb::XRowSetApproveBroadcaster-interface. + // for XRowSetApproveBroadcaster-interface. // So we have to multiplex this approve request. ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowChange(event)) return sal_False; } return sal_True; } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const starlang::EventObject& event) throw( staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const EventObject& event) throw( RuntimeException ) { - if (event.Source == InterfaceRef(static_cast<staruno::XWeak*>(this))) // ignore our aggregate as we handle this approve ourself + if (event.Source == InterfaceRef(static_cast<XWeak*>(this))) // ignore our aggregate as we handle this approve ourself { ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) return sal_False; if (isLoaded()) { ::cppu::OInterfaceIteratorHelper aLoadIter(m_aLoadListeners); while (aLoadIter.hasMoreElements()) - ((starform::XLoadListener*)aLoadIter.next())->reloading(event); + ((XLoadListener*)aLoadIter.next())->reloading(event); } } else @@ -3186,7 +3153,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const starlang::EventObject // ask our own RowSetChangesListeners, too ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) return sal_False; } return sal_True; @@ -3195,7 +3162,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const starlang::EventObject //============================================================================== // com::sun::star::sdb::XRowSetApproveBroadcaster //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addRowSetApproveListener(const staruno::Reference<starsdb::XRowSetApproveListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener) throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); m_aRowSetApproveListeners.addInterface(_rListener); @@ -3203,26 +3170,26 @@ void SAL_CALL ODatabaseForm::addRowSetApproveListener(const staruno::Reference<s // do we have to multiplex ? if (m_aRowSetApproveListeners.getLength() == 1) { - staruno::Reference<starsdb::XRowSetApproveBroadcaster> xBroadcaster; + Reference<XRowSetApproveBroadcaster> xBroadcaster; if (query_aggregation( m_xAggregate, xBroadcaster)) { - staruno::Reference<starsdb::XRowSetApproveListener> xListener((starsdb::XRowSetApproveListener*)this); + Reference<XRowSetApproveListener> xListener((XRowSetApproveListener*)this); xBroadcaster->addRowSetApproveListener(xListener); } } } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeRowSetApproveListener(const staruno::Reference<starsdb::XRowSetApproveListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener) throw( RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); // do we have to remove the multiplex ? if (m_aRowSetApproveListeners.getLength() == 1) { - staruno::Reference<starsdb::XRowSetApproveBroadcaster> xBroadcaster; + Reference<XRowSetApproveBroadcaster> xBroadcaster; if (query_aggregation( m_xAggregate, xBroadcaster)) { - staruno::Reference<starsdb::XRowSetApproveListener> xListener((starsdb::XRowSetApproveListener*)this); + Reference<XRowSetApproveListener> xListener((XRowSetApproveListener*)this); xBroadcaster->removeRowSetApproveListener(xListener); } } @@ -3232,12 +3199,12 @@ void SAL_CALL ODatabaseForm::removeRowSetApproveListener(const staruno::Referenc //============================================================================== // com::sun:star::form::XDatabaseParameterBroadcaster //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addParameterListener(const staruno::Reference<starform::XDatabaseParameterListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addParameterListener(const Reference<XDatabaseParameterListener>& _rListener) throw( RuntimeException ) { m_aParameterListeners.addInterface(_rListener); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeParameterListener(const staruno::Reference<starform::XDatabaseParameterListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeParameterListener(const Reference<XDatabaseParameterListener>& _rListener) throw( RuntimeException ) { m_aParameterListeners.removeInterface(_rListener); } @@ -3257,12 +3224,12 @@ void SAL_CALL ODatabaseForm::executeWithCompletion( const Reference< XInteractio } else { - starlang::EventObject event(static_cast< staruno::XWeak* >(this)); + EventObject event(static_cast< XWeak* >(this)); ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); aGuard.clear(); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) return; // we're loaded and somebody want's to execute ourself -> this means a reload @@ -3273,7 +3240,7 @@ void SAL_CALL ODatabaseForm::executeWithCompletion( const Reference< XInteractio //============================================================================== // com::sun::star::sdbc::XRowSet //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::execute() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::execute() throw( SQLException, RuntimeException ) { ReusableMutexGuard aGuard(m_aMutex); // if somebody calls an execute and we're not loaded we reroute this call to our load method. @@ -3287,12 +3254,12 @@ void SAL_CALL ODatabaseForm::execute() throw( starsdbc::SQLException, staruno::R } else { - starlang::EventObject event(static_cast< staruno::XWeak* >(this)); + EventObject event(static_cast< XWeak* >(this)); ::cppu::OInterfaceIteratorHelper aIter(m_aRowSetApproveListeners); aGuard.clear(); while (aIter.hasMoreElements()) - if (!((starsdb::XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) + if (!((XRowSetApproveListener*)aIter.next())->approveRowSetChange(event)) return; // we're loaded and somebody want's to execute ourself -> this means a reload @@ -3301,14 +3268,14 @@ void SAL_CALL ODatabaseForm::execute() throw( starsdbc::SQLException, staruno::R } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::addRowSetListener(const staruno::Reference<starsdbc::XRowSetListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::addRowSetListener(const Reference<XRowSetListener>& _rListener) throw( RuntimeException ) { if (m_xAggregateAsRowSet.is()) m_xAggregateAsRowSet->addRowSetListener(_rListener); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::removeRowSetListener(const staruno::Reference<starsdbc::XRowSetListener>& _rListener) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::removeRowSetListener(const Reference<XRowSetListener>& _rListener) throw( RuntimeException ) { if (m_xAggregateAsRowSet.is()) m_xAggregateAsRowSet->removeRowSetListener(_rListener); @@ -3317,109 +3284,109 @@ void SAL_CALL ODatabaseForm::removeRowSetListener(const staruno::Reference<stars //============================================================================== // com::sun::star::sdbc::XResultSet //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::next() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::next() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->next(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::isBeforeFirst() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::isBeforeFirst() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->isBeforeFirst(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::isAfterLast() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::isAfterLast() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->isAfterLast(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::isFirst() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::isFirst() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->isFirst(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::isLast() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::isLast() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->isLast(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::beforeFirst() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::beforeFirst() throw( SQLException, RuntimeException ) { m_xAggregateAsRowSet->beforeFirst(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::afterLast() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::afterLast() throw( SQLException, RuntimeException ) { m_xAggregateAsRowSet->afterLast(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::first() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::first() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->first(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::last() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::last() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->last(); } //------------------------------------------------------------------------------ -sal_Int32 SAL_CALL ODatabaseForm::getRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Int32 SAL_CALL ODatabaseForm::getRow() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->getRow(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::absolute(sal_Int32 row) throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::absolute(sal_Int32 row) throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->absolute(row); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::relative(sal_Int32 rows) throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::relative(sal_Int32 rows) throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->relative(rows); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::previous() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::previous() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->previous(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::refreshRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::refreshRow() throw( SQLException, RuntimeException ) { m_xAggregateAsRowSet->refreshRow(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::rowUpdated() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::rowUpdated() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->rowUpdated(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::rowInserted() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::rowInserted() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->rowInserted(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::rowDeleted() throw( starsdbc::SQLException, staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::rowDeleted() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->rowDeleted(); } //------------------------------------------------------------------------------ -InterfaceRef SAL_CALL ODatabaseForm::getStatement() throw( starsdbc::SQLException, staruno::RuntimeException ) +InterfaceRef SAL_CALL ODatabaseForm::getStatement() throw( SQLException, RuntimeException ) { return m_xAggregateAsRowSet->getStatement(); } @@ -3427,20 +3394,20 @@ InterfaceRef SAL_CALL ODatabaseForm::getStatement() throw( starsdbc::SQLExceptio // com::sun::star::sdbc::XResultSetUpdate // exceptions during insert update and delete will be forwarded to the errorlistener //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::insertRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::insertRow() throw( SQLException, RuntimeException ) { try { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->insertRow(); } - catch(starsdb::RowSetVetoException& eVeto) + catch(RowSetVetoException& eVeto) { eVeto; throw; } - catch(starsdbc::SQLException& eDb) + catch(SQLException& eDb) { onError(eDb, FRM_RES_STRING(RID_STR_ERR_INSERTRECORD)); throw; @@ -3448,20 +3415,20 @@ void SAL_CALL ODatabaseForm::insertRow() throw( starsdbc::SQLException, staruno: } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::updateRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::updateRow() throw( SQLException, RuntimeException ) { try { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->updateRow(); } - catch(starsdb::RowSetVetoException& eVeto) + catch(RowSetVetoException& eVeto) { eVeto; throw; } - catch(starsdbc::SQLException& eDb) + catch(SQLException& eDb) { onError(eDb, FRM_RES_STRING(RID_STR_ERR_UPDATERECORD)); throw; @@ -3469,20 +3436,20 @@ void SAL_CALL ODatabaseForm::updateRow() throw( starsdbc::SQLException, staruno: } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::deleteRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::deleteRow() throw( SQLException, RuntimeException ) { try { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->deleteRow(); } - catch(starsdb::RowSetVetoException& eVeto) + catch(RowSetVetoException& eVeto) { eVeto; throw; } - catch(starsdbc::SQLException& eDb) + catch(SQLException& eDb) { onError(eDb, FRM_RES_STRING(RID_STR_ERR_DELETERECORD)); throw; @@ -3490,17 +3457,17 @@ void SAL_CALL ODatabaseForm::deleteRow() throw( starsdbc::SQLException, staruno: } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::cancelRowUpdates() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::cancelRowUpdates() throw( SQLException, RuntimeException ) { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->cancelRowUpdates(); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::moveToInsertRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::moveToInsertRow() throw( SQLException, RuntimeException ) { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) { // do we go on the insert row? @@ -3513,42 +3480,42 @@ void SAL_CALL ODatabaseForm::moveToInsertRow() throw( starsdbc::SQLException, st } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::moveToCurrentRow() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::moveToCurrentRow() throw( SQLException, RuntimeException ) { - staruno::Reference<starsdbc::XResultSetUpdate> xUpdate; + Reference<XResultSetUpdate> xUpdate; if (query_aggregation( m_xAggregate, xUpdate)) xUpdate->moveToCurrentRow(); } // com::sun::star::sdbcx::XDeleteRows //------------------------------------------------------------------------------ -staruno::Sequence<sal_Int32> SAL_CALL ODatabaseForm::deleteRows(const staruno::Sequence<staruno::Any>& rows) throw( starsdbc::SQLException, staruno::RuntimeException ) +Sequence<sal_Int32> SAL_CALL ODatabaseForm::deleteRows(const Sequence<Any>& rows) throw( SQLException, RuntimeException ) { try { - staruno::Reference<starsdbcx::XDeleteRows> xDelete; + Reference<XDeleteRows> xDelete; if (query_aggregation( m_xAggregate, xDelete)) return xDelete->deleteRows(rows); } - catch(starsdb::RowSetVetoException& eVeto) + catch(RowSetVetoException& eVeto) { eVeto; // make compiler happy throw; } - catch(starsdbc::SQLException& eDb) + catch(SQLException& eDb) { onError(eDb, FRM_RES_STRING(RID_STR_ERR_DELETERECORDS)); throw; } - return staruno::Sequence< sal_Int32 >(); + return Sequence< sal_Int32 >(); } // com::sun::star::sdbc::XParameters //------------------------------------------------------------------------------ #define PARAMETER_VISITED(method) \ ::osl::MutexGuard aGuard(m_aMutex); \ - staruno::Reference<starsdbc::XParameters> xParameters; \ + Reference<XParameters> xParameters; \ if (query_aggregation( m_xAggregate, xParameters)) \ xParameters->method; \ \ @@ -3560,142 +3527,142 @@ staruno::Sequence<sal_Int32> SAL_CALL ODatabaseForm::deleteRows(const staruno::S m_aParameterVisited[parameterIndex - 1] = true //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setNull(parameterIndex, sqlType)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setObjectNull(parameterIndex, sqlType, typeName)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setBoolean(sal_Int32 parameterIndex, sal_Bool x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setBoolean(sal_Int32 parameterIndex, sal_Bool x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setBoolean(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setByte(sal_Int32 parameterIndex, sal_Int8 x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setByte(sal_Int32 parameterIndex, sal_Int8 x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setByte(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setShort(sal_Int32 parameterIndex, sal_Int16 x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setShort(sal_Int32 parameterIndex, sal_Int16 x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setShort(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setInt(sal_Int32 parameterIndex, sal_Int32 x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setInt(sal_Int32 parameterIndex, sal_Int32 x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setInt(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setLong(sal_Int32 parameterIndex, Hyper x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setLong(sal_Int32 parameterIndex, Hyper x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setLong(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setFloat(sal_Int32 parameterIndex, float x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setFloat(sal_Int32 parameterIndex, float x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setFloat(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setDouble(sal_Int32 parameterIndex, double x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setDouble(sal_Int32 parameterIndex, double x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setDouble(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setString(sal_Int32 parameterIndex, const ::rtl::OUString& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setString(sal_Int32 parameterIndex, const ::rtl::OUString& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setString(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setBytes(sal_Int32 parameterIndex, const staruno::Sequence< sal_Int8 >& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setBytes(sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setBytes(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setDate(sal_Int32 parameterIndex, const starutil::Date& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setDate(sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setDate(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setTime(sal_Int32 parameterIndex, const starutil::Time& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setTime(sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setTime(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setTimestamp(sal_Int32 parameterIndex, const starutil::DateTime& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setTimestamp(sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setTimestamp(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setBinaryStream(sal_Int32 parameterIndex, const staruno::Reference<stario::XInputStream>& x, sal_Int32 length) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setBinaryStream(sal_Int32 parameterIndex, const Reference<XInputStream>& x, sal_Int32 length) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setBinaryStream(parameterIndex, x, length)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setCharacterStream(sal_Int32 parameterIndex, const staruno::Reference<stario::XInputStream>& x, sal_Int32 length) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setCharacterStream(sal_Int32 parameterIndex, const Reference<XInputStream>& x, sal_Int32 length) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setCharacterStream(parameterIndex, x, length)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setObjectWithInfo(sal_Int32 parameterIndex, const staruno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setObjectWithInfo(sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 scale) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setObjectWithInfo(parameterIndex, x, targetSqlType, scale)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setObject(sal_Int32 parameterIndex, const staruno::Any& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setObject(sal_Int32 parameterIndex, const Any& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setObject(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setRef(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XRef>& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setRef(sal_Int32 parameterIndex, const Reference<XRef>& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setRef(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setBlob(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XBlob>& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setBlob(sal_Int32 parameterIndex, const Reference<XBlob>& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setBlob(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setClob(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XClob>& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setClob(sal_Int32 parameterIndex, const Reference<XClob>& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setClob(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setArray(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XArray>& x) throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setArray(sal_Int32 parameterIndex, const Reference<XArray>& x) throw( SQLException, RuntimeException ) { PARAMETER_VISITED(setArray(parameterIndex, x)); } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::clearParameters() throw( starsdbc::SQLException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::clearParameters() throw( SQLException, RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); - staruno::Reference<starsdbc::XParameters> xParameters; + Reference<XParameters> xParameters; if (query_aggregation(m_xAggregate, xParameters)) xParameters->clearParameters(); m_aParameterVisited.clear(); @@ -3703,13 +3670,13 @@ void SAL_CALL ODatabaseForm::clearParameters() throw( starsdbc::SQLException, st // com::sun::star::lang::XServiceInfo //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL ODatabaseForm::getImplementationName() throw( staruno::RuntimeException ) +::rtl::OUString SAL_CALL ODatabaseForm::getImplementationName() throw( RuntimeException ) { return DATABASEFORM_IMPLEMENTATION_NAME; } //------------------------------------------------------------------------------ -StringSequence SAL_CALL ODatabaseForm::getSupportedServiceNames() throw( staruno::RuntimeException ) +StringSequence SAL_CALL ODatabaseForm::getSupportedServiceNames() throw( RuntimeException ) { StringSequence aServices; aServices.realloc(5); @@ -3722,7 +3689,7 @@ StringSequence SAL_CALL ODatabaseForm::getSupportedServiceNames() throw( staruno } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL ODatabaseForm::supportsService(const ::rtl::OUString& ServiceName) throw( staruno::RuntimeException ) +sal_Bool SAL_CALL ODatabaseForm::supportsService(const ::rtl::OUString& ServiceName) throw( RuntimeException ) { StringSequence aSupported(getSupportedServiceNames()); const ::rtl::OUString* pArray = aSupported.getConstArray(); @@ -3740,13 +3707,13 @@ const sal_uInt16 CYCLE = 0x0001; const sal_uInt16 DONTAPPLYFILTER = 0x0002; //------------------------------------------------------------------------------ -::rtl::OUString ODatabaseForm::getServiceName() throw( staruno::RuntimeException ) +::rtl::OUString ODatabaseForm::getServiceName() throw( RuntimeException ) { return FRM_COMPONENT_FORM; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw( stario::IOException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::write(const Reference<XObjectOutputStream>& _rxOutStream) throw( IOException, RuntimeException ) { DBG_ASSERT(m_xAggregateSet.is(), "ODatabaseForm::write : only to be called if the aggregate exists !"); @@ -3776,19 +3743,19 @@ void SAL_CALL ODatabaseForm::write(const staruno::Reference<stario::XObjectOutpu _rxOutStream << m_aDetailFields; // former DataSelectionType - starform::DataSelectionType eTranslated = starform::DataSelectionType_TABLE; + DataSelectionType eTranslated = DataSelectionType_TABLE; if (m_xAggregateSet.is()) { sal_Int32 nCommandType; m_xAggregateSet->getPropertyValue(PROPERTY_COMMANDTYPE) >>= nCommandType; switch (nCommandType) { - case starsdb::CommandType::TABLE : eTranslated = starform::DataSelectionType_TABLE; break; - case starsdb::CommandType::QUERY : eTranslated = starform::DataSelectionType_QUERY; break; - case starsdb::CommandType::COMMAND: + case CommandType::TABLE : eTranslated = DataSelectionType_TABLE; break; + case CommandType::QUERY : eTranslated = DataSelectionType_QUERY; break; + case CommandType::COMMAND: { sal_Bool bEscapeProcessing = getBOOL(m_xAggregateSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); - eTranslated = bEscapeProcessing ? starform::DataSelectionType_SQL : starform::DataSelectionType_SQLPASSTHROUGH; + eTranslated = bEscapeProcessing ? DataSelectionType_SQL : DataSelectionType_SQLPASSTHROUGH; } break; default : DBG_ERROR("ODatabaseForm::write : wrong CommandType !"); @@ -3797,9 +3764,9 @@ void SAL_CALL ODatabaseForm::write(const staruno::Reference<stario::XObjectOutpu _rxOutStream->writeShort((sal_Int16)eTranslated); // former DataSelectionType // very old versions expect a CursorType here - _rxOutStream->writeShort(stardata::DatabaseCursorType_KEYSET); + _rxOutStream->writeShort(DatabaseCursorType_KEYSET); - _rxOutStream->writeBoolean(m_eNavigation != starform::NavigationBarMode_NONE); + _rxOutStream->writeBoolean(m_eNavigation != NavigationBarMode_NONE); // former DataEntry if (m_xAggregateSet.is()) @@ -3819,13 +3786,13 @@ void SAL_CALL ODatabaseForm::write(const staruno::Reference<stario::XObjectOutpu _rxOutStream << m_aTargetFrame; // version 2 didn't know some options and the "default" state - sal_Int32 nCycle = starform::TabulatorCycle_RECORDS; + sal_Int32 nCycle = TabulatorCycle_RECORDS; if (m_aCycle.hasValue()) { ::cppu::enum2int(nCycle, m_aCycle); - if (m_aCycle == starform::TabulatorCycle_PAGE) + if (m_aCycle == TabulatorCycle_PAGE) // unknown in earlier versions - nCycle = starform::TabulatorCycle_RECORDS; + nCycle = TabulatorCycle_RECORDS; } _rxOutStream->writeShort((sal_Int16) nCycle); @@ -3861,7 +3828,7 @@ void SAL_CALL ODatabaseForm::write(const staruno::Reference<stario::XObjectOutpu } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw( stario::IOException, staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::read(const Reference<XObjectInputStream>& _rxInStream) throw( IOException, RuntimeException ) { DBG_ASSERT(m_xAggregateSet.is(), "ODatabaseForm::read : only to be called if the aggregate exists !"); @@ -3875,32 +3842,32 @@ void SAL_CALL ODatabaseForm::read(const staruno::Reference<stario::XObjectInputS ::rtl::OUString sAggregateProp; _rxInStream >> sAggregateProp; if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCE, staruno::makeAny(sAggregateProp)); + m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCE, makeAny(sAggregateProp)); _rxInStream >> sAggregateProp; if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND, staruno::makeAny(sAggregateProp)); + m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND, makeAny(sAggregateProp)); _rxInStream >> m_aMasterFields; _rxInStream >> m_aDetailFields; sal_Int16 nCursorSourceType = _rxInStream->readShort(); sal_Int32 nCommandType = 0; - switch ((starform::DataSelectionType)nCursorSourceType) + switch ((DataSelectionType)nCursorSourceType) { - case starform::DataSelectionType_TABLE : nCommandType = starsdb::CommandType::TABLE; break; - case starform::DataSelectionType_QUERY : nCommandType = starsdb::CommandType::QUERY; break; - case starform::DataSelectionType_SQL: - case starform::DataSelectionType_SQLPASSTHROUGH: + case DataSelectionType_TABLE : nCommandType = CommandType::TABLE; break; + case DataSelectionType_QUERY : nCommandType = CommandType::QUERY; break; + case DataSelectionType_SQL: + case DataSelectionType_SQLPASSTHROUGH: { - nCommandType = starsdb::CommandType::COMMAND; - sal_Bool bEscapeProcessing = ((starform::DataSelectionType)nCursorSourceType) != starform::DataSelectionType_SQLPASSTHROUGH; - m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, staruno::makeAny((sal_Bool)bEscapeProcessing)); + nCommandType = CommandType::COMMAND; + sal_Bool bEscapeProcessing = ((DataSelectionType)nCursorSourceType) != DataSelectionType_SQLPASSTHROUGH; + m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, makeAny((sal_Bool)bEscapeProcessing)); } break; default : DBG_ERROR("ODatabaseForm::read : wrong CommandType !"); } if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_COMMANDTYPE, staruno::makeAny(nCommandType)); + m_xAggregateSet->setPropertyValue(PROPERTY_COMMANDTYPE, makeAny(nCommandType)); // obsolete sal_Int16 nDummy = _rxInStream->readShort(); @@ -3909,11 +3876,11 @@ void SAL_CALL ODatabaseForm::read(const staruno::Reference<stario::XObjectInputS // war in der version 1 ein sal_Bool sal_Bool bNavigation = _rxInStream->readBoolean(); if (nVersion == 1) - m_eNavigation = bNavigation ? starform::NavigationBarMode_CURRENT : starform::NavigationBarMode_NONE; + m_eNavigation = bNavigation ? NavigationBarMode_CURRENT : NavigationBarMode_NONE; sal_Bool bInsertOnly = _rxInStream->readBoolean(); if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_INSERTONLY, staruno::makeAny(bInsertOnly)); + m_xAggregateSet->setPropertyValue(PROPERTY_INSERTONLY, makeAny(bInsertOnly)); m_bAllowInsert = _rxInStream->readBoolean(); m_bAllowUpdate = _rxInStream->readBoolean(); @@ -3923,22 +3890,22 @@ void SAL_CALL ODatabaseForm::read(const staruno::Reference<stario::XObjectInputS ::rtl::OUString sTmp; _rxInStream >> sTmp; m_aTargetURL = INetURLObject::decode(INetURLObject::RelToAbs( sTmp ), '%', INetURLObject::DECODE_UNAMBIGUOUS); - m_eSubmitMethod = (starform::FormSubmitMethod)_rxInStream->readShort(); - m_eSubmitEncoding = (starform::FormSubmitEncoding)_rxInStream->readShort(); + m_eSubmitMethod = (FormSubmitMethod)_rxInStream->readShort(); + m_eSubmitEncoding = (FormSubmitEncoding)_rxInStream->readShort(); _rxInStream >> m_aTargetFrame; if (nVersion > 1) { sal_Int32 nCycle = _rxInStream->readShort(); - m_aCycle = ::cppu::int2enum(nCycle, ::getCppuType(static_cast<const starform::TabulatorCycle*>(NULL))); - m_eNavigation = (starform::NavigationBarMode)_rxInStream->readShort(); + m_aCycle = ::cppu::int2enum(nCycle, ::getCppuType(static_cast<const TabulatorCycle*>(NULL))); + m_eNavigation = (NavigationBarMode)_rxInStream->readShort(); _rxInStream >> sAggregateProp; if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_FILTER_CRITERIA, staruno::makeAny(sAggregateProp)); + m_xAggregateSet->setPropertyValue(PROPERTY_FILTER_CRITERIA, makeAny(sAggregateProp)); _rxInStream >> sAggregateProp; if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_SORT, staruno::makeAny(sAggregateProp)); + m_xAggregateSet->setPropertyValue(PROPERTY_SORT, makeAny(sAggregateProp)); } sal_uInt16 nAnyMask = 0; @@ -3948,13 +3915,13 @@ void SAL_CALL ODatabaseForm::read(const staruno::Reference<stario::XObjectInputS if (nAnyMask & CYCLE) { sal_Int32 nCycle = _rxInStream->readShort(); - m_aCycle = ::cppu::int2enum(nCycle, ::getCppuType(static_cast<const starform::TabulatorCycle*>(NULL))); + m_aCycle = ::cppu::int2enum(nCycle, ::getCppuType(static_cast<const TabulatorCycle*>(NULL))); } else m_aCycle.clear(); } if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_APPLYFILTER, staruno::makeAny((sal_Bool)((nAnyMask & DONTAPPLYFILTER) == 0))); + m_xAggregateSet->setPropertyValue(PROPERTY_APPLYFILTER, makeAny((sal_Bool)((nAnyMask & DONTAPPLYFILTER) == 0))); } //------------------------------------------------------------------------------ @@ -3962,8 +3929,8 @@ void ODatabaseForm::implInserted(const InterfaceRef& _rxObject) { OFormComponents::implInserted(_rxObject); - staruno::Reference<starsdb::XSQLErrorBroadcaster> xBroadcaster(_rxObject, staruno::UNO_QUERY); - staruno::Reference<starform::XForm> xForm(_rxObject, staruno::UNO_QUERY); + Reference<XSQLErrorBroadcaster> xBroadcaster(_rxObject, UNO_QUERY); + Reference<XForm> xForm(_rxObject, UNO_QUERY); if (xBroadcaster.is() && !xForm.is()) { // the object is an error broadcaster, but no form itself -> add ourself as listener xBroadcaster->addSQLErrorListener(this); @@ -3975,8 +3942,8 @@ void ODatabaseForm::implRemoved(const InterfaceRef& _rxObject) { OFormComponents::implInserted(_rxObject); - staruno::Reference<starsdb::XSQLErrorBroadcaster> xBroadcaster(_rxObject, staruno::UNO_QUERY); - staruno::Reference<starform::XForm> xForm(_rxObject, staruno::UNO_QUERY); + Reference<XSQLErrorBroadcaster> xBroadcaster(_rxObject, UNO_QUERY); + Reference<XForm> xForm(_rxObject, UNO_QUERY); if (xBroadcaster.is() && !xForm.is()) { // the object is an error broadcaster, but no form itself -> remove ourself as listener xBroadcaster->removeSQLErrorListener(this); @@ -3984,17 +3951,17 @@ void ODatabaseForm::implRemoved(const InterfaceRef& _rxObject) } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::errorOccured(const starsdb::SQLErrorEvent& _rEvent) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::errorOccured(const SQLErrorEvent& _rEvent) throw( RuntimeException ) { // give it to my own error listener onError(_rEvent); - // TODO : think about extending the chain with an starsdb::SQLContext object saying + // TODO : think about extending the chain with an SQLContext object saying // "this was an error of one of my children" } // com::sun::star::container::XNamed //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL ODatabaseForm::getName() throw( staruno::RuntimeException ) +::rtl::OUString SAL_CALL ODatabaseForm::getName() throw( RuntimeException ) { ::rtl::OUString sReturn; OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= sReturn; @@ -4002,9 +3969,9 @@ void SAL_CALL ODatabaseForm::errorOccured(const starsdb::SQLErrorEvent& _rEvent) } //------------------------------------------------------------------------------ -void SAL_CALL ODatabaseForm::setName(const ::rtl::OUString& aName) throw( staruno::RuntimeException ) +void SAL_CALL ODatabaseForm::setName(const ::rtl::OUString& aName) throw( RuntimeException ) { - setFastPropertyValue(PROPERTY_ID_NAME, staruno::makeAny(aName)); + setFastPropertyValue(PROPERTY_ID_NAME, makeAny(aName)); } //......................................................................... |