diff options
51 files changed, 3175 insertions, 3090 deletions
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index d8facdb67c32..ca7ad0b98898 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Button.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:04 $ + * 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 @@ -77,24 +77,35 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== //= OButtonModel //================================================================== DBG_NAME(OButtonModel) //------------------------------------------------------------------ -InterfaceRef SAL_CALL OButtonModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OButtonModel(_rxFactory)); } //------------------------------------------------------------------ -OButtonModel::OButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OButtonModel::OButtonModel(const Reference<XMultiServiceFactory>& _rxFactory) :OImageModel(_rxFactory, VCL_CONTROLMODEL_COMMANDBUTTON, FRM_CONTROL_COMMANDBUTTON) // use the old control name for compytibility reasons { DBG_CTOR(OButtonModel, NULL); - m_nClassId = starform::FormComponentType::COMMANDBUTTON; + m_nClassId = FormComponentType::COMMANDBUTTON; } //------------------------------------------------------------------------------ @@ -104,20 +115,20 @@ OButtonModel::~OButtonModel() } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OButtonModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OButtonModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OButtonModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(8) DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); - DECL_PROP1(BUTTONTYPE, starform::FormButtonType, BOUND); + DECL_PROP1(BUTTONTYPE, FormButtonType, BOUND); DECL_PROP1(TARGET_URL, ::rtl::OUString, BOUND); DECL_PROP1(TARGET_FRAME, ::rtl::OUString, BOUND); DECL_PROP1(NAME, ::rtl::OUString, BOUND); @@ -133,7 +144,7 @@ void OButtonModel::fillProperties( return *const_cast<OButtonModel*>(this)->getArrayHelper(); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OButtonModel::getSupportedServiceNames() throw() { @@ -152,7 +163,7 @@ StringSequence OButtonModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -void OButtonModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { OImageModel::write(_rxOutStream); @@ -166,7 +177,7 @@ void OButtonModel::write(const staruno::Reference<stario::XObjectOutputStream>& } //------------------------------------------------------------------------------ -void OButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream) { OImageModel::read(_rxInStream); @@ -175,7 +186,7 @@ void OButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _r { case 0x0001: { - m_eButtonType = (starform::FormButtonType)_rxInStream->readShort(); + m_eButtonType = (FormButtonType)_rxInStream->readShort(); ::rtl::OUString sTmp; _rxInStream >> sTmp; @@ -185,7 +196,7 @@ void OButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _r break; case 0x0002: { - m_eButtonType = (starform::FormButtonType)_rxInStream->readShort(); + m_eButtonType = (FormButtonType)_rxInStream->readShort(); ::rtl::OUString sTmp; _rxInStream >> sTmp; @@ -196,7 +207,7 @@ void OButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _r break; default : DBG_ERROR("OButtonModel::read : unknown version !"); - m_eButtonType = starform::FormButtonType_PUSH; + m_eButtonType = FormButtonType_PUSH; m_sTargetURL = ::rtl::OUString(); m_sTargetFrame = ::rtl::OUString(); break; @@ -207,24 +218,24 @@ void OButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _r // OButtonControl //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OButtonControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OButtonControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OButtonControl::_getTypes() +Sequence<Type> OButtonControl::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my base class - staruno::Sequence<staruno::Type> aBaseClassTypes = OImageControl::_getTypes(); + Sequence<Type> aBaseClassTypes = OImageControl::_getTypes(); - staruno::Sequence<staruno::Type> aOwnTypes(2); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starawt::XButton>*)NULL); - pOwnTypes[1] = getCppuType((staruno::Reference<starawt::XActionListener>*)NULL); + Sequence<Type> aOwnTypes(2); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference<XButton>*)NULL); + pOwnTypes[1] = getCppuType((Reference<XActionListener>*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -243,14 +254,14 @@ StringSequence OButtonControl::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -OButtonControl::OButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OButtonControl::OButtonControl(const Reference<XMultiServiceFactory>& _rxFactory) :OImageControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON) ,nClickEvent(0) { increment(m_refCount); { // als ActionListener anmelden - staruno::Reference<starawt::XButton> xButton; + Reference<XButton> xButton; query_aggregation( m_xAggregate, xButton); if (xButton.is()) xButton->addActionListener(this); @@ -268,27 +279,21 @@ OButtonControl::~OButtonControl() // UNO Anbindung //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OButtonControl::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OImageControl::queryAggregation(_rType); + Any aReturn = OImageControl::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XActionListener*>(this) - ,static_cast<starawt::XButton*>(this) - ); + aReturn = OButtonControl_BASE::queryInterface(_rType); return aReturn; } // ActionListener //------------------------------------------------------------------------------ -void OButtonControl::actionPerformed(const starawt::ActionEvent& rEvent) +void OButtonControl::actionPerformed(const ActionEvent& rEvent) { // Asynchron fuer starutil::URL-Button - sal_uInt32 n = Application::PostUserEvent( LINK(this, OButtonControl, - OnClick) ); + sal_uInt32 n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) ); { ::osl::MutexGuard aGuard( m_aMutex ); nClickEvent = n; @@ -320,18 +325,18 @@ IMPL_LINK( OButtonControl, OnClick, void*, EMPTYARG ) aGuard.clear(); // recognize the button type - staruno::Reference<starbeans::XPropertySet> xSet(getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (!xSet.is()) return 0L; - if (starform::FormButtonType_PUSH == *(starform::FormButtonType*)xSet->getPropertyValue(PROPERTY_BUTTONTYPE).getValue()) + if (FormButtonType_PUSH == *(FormButtonType*)xSet->getPropertyValue(PROPERTY_BUTTONTYPE).getValue()) { // notify the action listeners for a push button ::cppu::OInterfaceIteratorHelper aIter(m_aActionListeners); - starawt::ActionEvent aEvt(static_cast<staruno::XWeak*>(this), m_aActionCommand); + ActionEvent aEvt(static_cast<XWeak*>(this), m_aActionCommand); while(aIter.hasMoreElements() ) { - ((starawt::XActionListener*)aIter.next())->actionPerformed(aEvt); + ((XActionListener*)aIter.next())->actionPerformed(aEvt); } } else @@ -340,38 +345,38 @@ IMPL_LINK( OButtonControl, OnClick, void*, EMPTYARG ) return 0L; } -// starawt::XButton +// XButton //------------------------------------------------------------------------------ -void OButtonControl::setLabel(const ::rtl::OUString& Label) throw( staruno::RuntimeException ) +void OButtonControl::setLabel(const ::rtl::OUString& Label) throw( RuntimeException ) { - staruno::Reference<starawt::XButton> xButton; + Reference<XButton> xButton; query_aggregation( m_xAggregate, xButton); if (xButton.is()) xButton->setLabel(Label); } //------------------------------------------------------------------------------ -void SAL_CALL OButtonControl::setActionCommand(const ::rtl::OUString& _rCommand) throw( staruno::RuntimeException ) +void SAL_CALL OButtonControl::setActionCommand(const ::rtl::OUString& _rCommand) throw( RuntimeException ) { { ::osl::MutexGuard aGuard( m_aMutex ); m_aActionCommand = _rCommand; } - staruno::Reference<starawt::XButton> xButton; + Reference<XButton> xButton; query_aggregation( m_xAggregate, xButton); if (xButton.is()) xButton->setActionCommand(_rCommand); } //------------------------------------------------------------------------------ -void SAL_CALL OButtonControl::addActionListener(const staruno::Reference<starawt::XActionListener>& _rxListener) throw( staruno::RuntimeException ) +void SAL_CALL OButtonControl::addActionListener(const Reference<XActionListener>& _rxListener) throw( RuntimeException ) { m_aActionListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OButtonControl::removeActionListener(const staruno::Reference<starawt::XActionListener>& _rxListener) throw( staruno::RuntimeException ) +void SAL_CALL OButtonControl::removeActionListener(const Reference<XActionListener>& _rxListener) throw( RuntimeException ) { m_aActionListeners.removeInterface(_rxListener); } diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx index bf89b0d17dfb..4db2bbd5427b 100644 --- a/forms/source/component/Button.hxx +++ b/forms/source/component/Button.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Button.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -98,25 +98,25 @@ class OButtonModel ,public ::comphelper::OAggregationArrayUsageHelper<OButtonModel> { public: - OButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OButtonModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); ~OButtonModel(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OButtonModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -// stario::XPersistObject +// ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -124,40 +124,41 @@ public: //================================================================== // OButtonControl //================================================================== -class OButtonControl: public starawt::XButton, - public starawt::XActionListener, - public OImageControl +typedef ::cppu::ImplHelper2< ::com::sun::star::awt::XButton, + ::com::sun::star::awt::XActionListener> OButtonControl_BASE; +class OButtonControl : public OButtonControl_BASE, + public OImageControl { sal_uInt32 nClickEvent; protected: // UNO Anbindung - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OButtonControl(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OButtonControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OButtonControl, OImageControl); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// starawt::XActionListener - virtual void SAL_CALL actionPerformed(const starawt::ActionEvent& rEvent); +// ::com::sun::star::awt::XActionListener + virtual void SAL_CALL actionPerformed(const ::com::sun::star::awt::ActionEvent& rEvent); -// starawt::XButton - virtual void SAL_CALL addActionListener(const staruno::Reference<starawt::XActionListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeActionListener(const staruno::Reference<starawt::XActionListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(staruno::RuntimeException); - virtual void SAL_CALL setActionCommand(const ::rtl::OUString& _rCommand) throw(staruno::RuntimeException); +// ::com::sun::star::awt::XButton + virtual void SAL_CALL addActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActionCommand(const ::rtl::OUString& _rCommand) throw(::com::sun::star::uno::RuntimeException); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException) +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) { OControl::disposing(_rSource); } private: DECL_LINK( OnClick, void* ); diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index b4ec521670de..984f506fa0e9 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: CheckBox.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:04 $ + * 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 @@ -78,19 +78,30 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== //= OCheckBoxControl //================================================================== //------------------------------------------------------------------ -OCheckBoxControl::OCheckBoxControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OCheckBoxControl::OCheckBoxControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_CHECKBOX) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OCheckBoxControl(_rxFactory)); } @@ -111,19 +122,19 @@ StringSequence SAL_CALL OCheckBoxControl::getSupportedServiceNames() throw(::com //================================================================== //================================================================== -InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OCheckBoxModel(_rxFactory)); } //------------------------------------------------------------------ -OCheckBoxModel::OCheckBoxModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OCheckBoxModel::OCheckBoxModel(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_CHECKBOX, FRM_CONTROL_CHECKBOX, sal_False) // use the old control name for compytibility reasons ,OPropertyChangeListener(m_aMutex) ,m_bInReset(sal_False) { - m_nClassId = starform::FormComponentType::CHECKBOX; + m_nClassId = FormComponentType::CHECKBOX; m_nDefaultChecked = CB_NOCHECK; m_sDataFieldConnectivityProperty = PROPERTY_STATE; @@ -137,7 +148,7 @@ OCheckBoxModel::OCheckBoxModel(const staruno::Reference<starlang::XMultiServiceF } //------------------------------------------------------------------------------ -void OCheckBoxModel::_propertyChanged(const starbeans::PropertyChangeEvent& _rEvent) throw(staruno::RuntimeException) +void OCheckBoxModel::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(RuntimeException) { // as we aren't commitable we have to take care of the field we are bound to ourself osl::MutexGuard aGuard(m_aMutex); @@ -178,7 +189,7 @@ StringSequence SAL_CALL OCheckBoxModel::getSupportedServiceNames() throw(::com:: } //------------------------------------------------------------------------------ -void OCheckBoxModel::getFastPropertyValue(staruno::Any& _rValue, sal_Int32 _nHandle) const +void OCheckBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { switch (_nHandle) { @@ -190,17 +201,17 @@ void OCheckBoxModel::getFastPropertyValue(staruno::Any& _rValue, sal_Int32 _nHan } //------------------------------------------------------------------------------ -void OCheckBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const staruno::Any& _rValue) throw (com::sun::star::uno::Exception) +void OCheckBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::uno::Exception) { switch (_nHandle) { case PROPERTY_ID_REFVALUE : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_sReferenceValue; break; case PROPERTY_ID_DEFAULTCHECKED : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == staruno::TypeClass_SHORT, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_SHORT, "OCheckBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_nDefaultChecked; _reset(); break; @@ -212,8 +223,8 @@ void OCheckBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const //------------------------------------------------------------------------------ sal_Bool OCheckBoxModel::convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue) - throw (starlang::IllegalArgumentException) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) { sal_Bool bModified(sal_False); switch (_nHandle) @@ -232,9 +243,9 @@ sal_Bool OCheckBoxModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OCheckBoxModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OCheckBoxModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -246,12 +257,12 @@ cppu::IPropertyArrayHelper& OCheckBoxModel::getInfoHelper() //------------------------------------------------------------------------------ void OCheckBoxModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(11) // the "State" property is transient, so change this -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_STATE, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_STATE, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(REFVALUE, ::rtl::OUString, BOUND); @@ -261,21 +272,21 @@ void OCheckBoxModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OCheckBoxModel::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OCheckBoxModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_CHECKBOX; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OCheckBoxModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OCheckBoxModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); @@ -290,7 +301,7 @@ void SAL_CALL OCheckBoxModel::write(const staruno::Reference<stario::XObjectOutp } //------------------------------------------------------------------------------ -void SAL_CALL OCheckBoxModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OCheckBoxModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, RuntimeException) { OBoundControlModel::read(_rxInStream); osl::MutexGuard aGuard(m_aMutex); @@ -327,7 +338,7 @@ void SAL_CALL OCheckBoxModel::read(const staruno::Reference<stario::XObjectInput } //------------------------------------------------------------------------------ -void OCheckBoxModel::_loaded(const starlang::EventObject& rEvent) +void OCheckBoxModel::_loaded(const EventObject& rEvent) { OBoundControlModel::_loaded(rEvent); } @@ -339,7 +350,7 @@ void OCheckBoxModel::_onValueChanged() // Wert an ControlModel setzen if (m_xAggregateSet.is()) { - staruno::Any aValue; + Any aValue; if (m_xColumn->getBoolean()) aValue <<= (sal_Int16)CB_CHECK; else if (m_xColumn->wasNull()) @@ -363,7 +374,7 @@ void OCheckBoxModel::_onValueChanged() } //------------------------------------------------------------------------------ -staruno::Any OCheckBoxModel::_getControlValue() const +Any OCheckBoxModel::_getControlValue() const { return m_xAggregateSet->getPropertyValue(PROPERTY_STATE); } @@ -371,7 +382,7 @@ staruno::Any OCheckBoxModel::_getControlValue() const //------------------------------------------------------------------------------ void OCheckBoxModel::_reset( void ) { - staruno::Any aValue; + Any aValue; aValue <<= (sal_Int16)m_nDefaultChecked; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with @@ -413,7 +424,7 @@ sal_Bool OCheckBoxModel::_commit() DBG_ERROR("OCheckBoxModel::_commit : invalid value !"); } } - catch(...) + catch(Exception&) { DBG_ERROR("OCheckBoxModel::_commit : could not commit !"); } diff --git a/forms/source/component/CheckBox.hxx b/forms/source/component/CheckBox.hxx index a4a37f8089c0..0f087ad9b824 100644 --- a/forms/source/component/CheckBox.hxx +++ b/forms/source/component/CheckBox.hxx @@ -2,9 +2,9 @@ * * $RCSfile: CheckBox.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -88,48 +88,48 @@ class OCheckBoxModel :public OBoundControlModel sal_Bool m_bInReset; protected: - sal_Int16 getState(const staruno::Any& rValue); + sal_Int16 getState(const ::com::sun::star::uno::Any& rValue); virtual void _onValueChanged(); - virtual void _loaded(const starlang::EventObject& rEvent); - virtual staruno::Any _getControlValue() const; + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); + virtual ::com::sun::star::uno::Any _getControlValue() const; public: - OCheckBoxModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OCheckBoxModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(OCheckBoxModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // OPropertySetHelper - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) - throw (staruno::Exception); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); virtual sal_Bool SAL_CALL convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue ) - throw (starlang::IllegalArgumentException); + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); // XPropertySetRef - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // OPropertyChangeListener - virtual void _propertyChanged(const starbeans::PropertyChangeEvent& evt) throw(staruno::RuntimeException); + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); // XReset - virtual void SAL_CALL reset() throw(staruno::RuntimeException); + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() @@ -144,7 +144,7 @@ protected: class OCheckBoxControl : public OBoundControl { public: - OCheckBoxControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OCheckBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(OCheckBoxControl); diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index 24e29958a53a..bd8b26e29437 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Columns.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -124,8 +124,13 @@ sal_Int32 findPos(const ::rtl::OUString& aStr, const StringSequence& rList); namespace frm { //......................................................................... - - namespace starform = ::com::sun::star::form; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; const sal_uInt16 WIDTH = 0x0001; const sal_uInt16 ALIGN = 0x0002; @@ -150,16 +155,16 @@ const StringSequence& getColumnTypes() if (!aColumnTypes.getConstArray()[0].getLength()) { ::rtl::OUString* pNames = aColumnTypes.getArray(); - pNames[TYPE_CHECKBOX] = FRM_COL_CHECKBOX; - pNames[TYPE_COMBOBOX] = FRM_COL_COMBOBOX; - pNames[TYPE_CURRENCYFIELD] = FRM_COL_CURRENCYFIELD; - pNames[TYPE_DATEFIELD] = FRM_COL_DATEFIELD; + pNames[TYPE_CHECKBOX] = FRM_COL_CHECKBOX; + pNames[TYPE_COMBOBOX] = FRM_COL_COMBOBOX; + pNames[TYPE_CURRENCYFIELD] = FRM_COL_CURRENCYFIELD; + pNames[TYPE_DATEFIELD] = FRM_COL_DATEFIELD; pNames[TYPE_FORMATTEDFIELD] = FRM_COL_FORMATTEDFIELD; - pNames[TYPE_LISTBOX] = FRM_COL_LISTBOX; - pNames[TYPE_NUMERICFIELD] = FRM_COL_NUMERICFIELD; - pNames[TYPE_PATTERNFIELD] = FRM_COL_PATTERNFIELD; - pNames[TYPE_TEXTFIELD] = FRM_COL_TEXTFIELD; - pNames[TYPE_TIMEFIELD] = FRM_COL_TIMEFIELD; + pNames[TYPE_LISTBOX] = FRM_COL_LISTBOX; + pNames[TYPE_NUMERICFIELD] = FRM_COL_NUMERICFIELD; + pNames[TYPE_PATTERNFIELD] = FRM_COL_PATTERNFIELD; + pNames[TYPE_TEXTFIELD] = FRM_COL_TEXTFIELD; + pNames[TYPE_TIMEFIELD] = FRM_COL_TIMEFIELD; } return aColumnTypes; } @@ -193,21 +198,21 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName) /*************************************************************************/ //------------------------------------------------------------------ -InterfaceRef SAL_CALL OGridColumn_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OGridColumn_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OGridColumn(_rxFactory)); } //------------------------------------------------------------------ -const staruno::Sequence<sal_Int8>& OGridColumn::getUnoTunnelImplementationId() +const Sequence<sal_Int8>& OGridColumn::getUnoTunnelImplementationId() { - static staruno::Sequence< sal_Int8 > * pSeq = 0; + static Sequence< sal_Int8 > * pSeq = 0; if( !pSeq ) { ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); if( !pSeq ) { - static staruno::Sequence< sal_Int8 > aSeq( 16 ); + static Sequence< sal_Int8 > aSeq( 16 ); rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); pSeq = &aSeq; } @@ -216,7 +221,7 @@ const staruno::Sequence<sal_Int8>& OGridColumn::getUnoTunnelImplementationId() } //------------------------------------------------------------------ -sal_Int64 SAL_CALL OGridColumn::getSomething( const staruno::Sequence<sal_Int8>& _rIdentifier) throw(staruno::RuntimeException) +sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdentifier) throw(RuntimeException) { sal_Int64 nReturn(0); @@ -228,7 +233,7 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const staruno::Sequence<sal_Int8>& } else { - staruno::Reference<starlang::XUnoTunnel> xAggregateTunnel(m_xAggregate, staruno::UNO_QUERY); + Reference<XUnoTunnel> xAggregateTunnel(m_xAggregate, UNO_QUERY); if (xAggregateTunnel.is()) nReturn = xAggregateTunnel->getSomething(_rIdentifier); } @@ -236,60 +241,47 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const staruno::Sequence<sal_Int8>& } //------------------------------------------------------------------ -staruno::Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(staruno::RuntimeException) +Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ -staruno::Sequence<staruno::Type> SAL_CALL OGridColumn::getTypes() throw(staruno::RuntimeException) +Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException) { - staruno::Sequence<staruno::Type> aOwnTypes(5); - aOwnTypes.getArray()[0] = ::getCppuType((staruno::Reference<starbeans::XPropertySet>*)NULL); - aOwnTypes.getArray()[1] = ::getCppuType((staruno::Reference<starbeans::XFastPropertySet>*)NULL); - aOwnTypes.getArray()[2] = ::getCppuType((staruno::Reference<starbeans::XMultiPropertySet>*)NULL); - aOwnTypes.getArray()[3] = ::getCppuType((staruno::Reference<starbeans::XPropertyState>*)NULL); - aOwnTypes.getArray()[4] = ::getCppuType((staruno::Reference<starcontainer::XChild>*)NULL); - - staruno::Reference<starlang::XTypeProvider> xProv; + Reference<XTypeProvider> xProv; if (query_aggregation(m_xAggregate, xProv)) - return concatSequences(aOwnTypes, OComponentHelper::getTypes(), xProv->getTypes()); - else - return concatSequences(aOwnTypes, OComponentHelper::getTypes(), xProv->getTypes()); + return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); + return OGridColumn_BASE::getTypes(); } //------------------------------------------------------------------ -staruno::Any SAL_CALL OGridColumn::queryAggregation( const staruno::Type& _rType ) throw (staruno::RuntimeException) +Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType ) throw (RuntimeException) { - staruno::Any aReturn; + Any aReturn; // though our aggregate may be an XFormComponent or an XServiceInfo, we aren't anymore - if ( _rType.equals(::getCppuType(static_cast< staruno::Reference< starform::XFormComponent >* >(NULL))) - || _rType.equals(::getCppuType(static_cast< staruno::Reference< starlang::XServiceInfo >* >(NULL))) + if ( _rType.equals(::getCppuType(static_cast< Reference< XFormComponent >* >(NULL))) + || _rType.equals(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL))) ) return aReturn; - aReturn = OComponentHelper::queryAggregation(_rType); + aReturn = OGridColumn_BASE::queryAggregation(_rType); if (!aReturn.hasValue()) + { aReturn = OPropertySetAggregationHelper::queryInterface(_rType); - - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast<starcontainer::XChild*>(this), - static_cast<starlang::XUnoTunnel*>(this) - ); - - if (!aReturn.hasValue() && m_xAggregate.is()) - aReturn = m_xAggregate->queryAggregation(_rType); + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } return aReturn; } DBG_NAME(OGridColumn); //------------------------------------------------------------------------------ -OGridColumn::OGridColumn(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName) - :OComponentHelper(m_aMutex) - ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) +OGridColumn::OGridColumn(const Reference<XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName) + :OGridColumn_BASE(m_aMutex) + ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper) ,m_aModelName(_sModelName) { DBG_CTOR(OGridColumn,NULL); @@ -301,7 +293,7 @@ OGridColumn::OGridColumn(const staruno::Reference<starlang::XMultiServiceFactory // Muss im eigenen Block, // da xAgg vor dem delegator setzen wieder freigesetzt sein mu ! { - m_xAggregate = staruno::Reference<staruno::XAggregation> (_rxFactory->createInstance(m_aModelName), staruno::UNO_QUERY); + m_xAggregate = Reference<XAggregation> (_rxFactory->createInstance(m_aModelName), UNO_QUERY); setAggregation(m_xAggregate); } @@ -320,7 +312,7 @@ OGridColumn::OGridColumn(const staruno::Reference<starlang::XMultiServiceFactory //------------------------------------------------------------------------------ OGridColumn::~OGridColumn() { - if (!OComponentHelper::rBHelper.bDisposed) + if (!OGridColumn_BASE::rBHelper.bDisposed) { acquire(); dispose(); @@ -335,32 +327,32 @@ OGridColumn::~OGridColumn() DBG_DTOR(OGridColumn,NULL); } -// starcontainer::XChild +// XChild //------------------------------------------------------------------------------ -void SAL_CALL OGridColumn::setParent(const InterfaceRef& Parent) throw(starlang::NoSupportException, staruno::RuntimeException) +void SAL_CALL OGridColumn::setParent(const InterfaceRef& Parent) throw(NoSupportException, RuntimeException) { m_xParent = Parent; } -// starlang::XEventListener +// XEventListener //------------------------------------------------------------------------------ -void SAL_CALL OGridColumn::disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException) +void SAL_CALL OGridColumn::disposing(const EventObject& _rSource) throw(RuntimeException) { OPropertySetAggregationHelper::disposing(_rSource); - staruno::Reference<starlang::XEventListener> xEvtLstner; + Reference<XEventListener> xEvtLstner; if (query_aggregation(m_xAggregate, xEvtLstner)) xEvtLstner->disposing(_rSource); } -// OComponentHelper +// OGridColumn_BASE //----------------------------------------------------------------------------- void OGridColumn::disposing() { - OComponentHelper::disposing(); + OGridColumn_BASE::disposing(); OPropertySetAggregationHelper::disposing(); - staruno::Reference<starlang::XComponent> xComp; + Reference<XComponent> xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->dispose(); @@ -368,7 +360,7 @@ void OGridColumn::disposing() } //------------------------------------------------------------------------------ -void OGridColumn::clearAggregateProperties(staruno::Sequence<starbeans::Property>& seqProps, sal_Bool bAllowDropDown) +void OGridColumn::clearAggregateProperties(Sequence<Property>& seqProps, sal_Bool bAllowDropDown) { RemoveProperty(seqProps, PROPERTY_ALIGN); RemoveProperty(seqProps, PROPERTY_AUTOCOMPLETE); @@ -405,10 +397,10 @@ void OGridColumn::clearAggregateProperties(staruno::Sequence<starbeans::Property } //------------------------------------------------------------------------------ -void OGridColumn::setOwnProperties(staruno::Sequence<starbeans::Property>& aDescriptor) +void OGridColumn::setOwnProperties(Sequence<Property>& aDescriptor) { aDescriptor.realloc(5); - starbeans::Property* pProps = aDescriptor.getArray(); + Property* pProps = aDescriptor.getArray(); sal_Int32 nPos = 0; DECL_PROP1(LABEL, ::rtl::OUString, BOUND); DECL_PROP3(WIDTH, sal_Int32, BOUND, MAYBEVOID, MAYBEDEFAULT); @@ -417,12 +409,12 @@ void OGridColumn::setOwnProperties(staruno::Sequence<starbeans::Property>& aDesc DECL_PROP1(COLUMNSERVICENAME, ::rtl::OUString, READONLY); } -// staruno::Reference<starbeans::XPropertySet> +// Reference<XPropertySet> //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OGridColumn::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OGridColumn::getPropertySetInfo() throw(RuntimeException) { DBG_ERROR("OGridColumn::getPropertySetInfo() : Dummy Called"); - return staruno::Reference<starbeans::XPropertySetInfo> (); + return Reference<XPropertySetInfo> (); } //------------------------------------------------------------------------------ @@ -430,13 +422,13 @@ staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OGridColumn::getPropert { DBG_ERROR("OGridColumn::getInfoHelper() : Dummy Called"); - staruno::Sequence<starbeans::Property> aDescriptor, aAggProperties; + Sequence<Property> aDescriptor, aAggProperties; static OPropertyArrayAggregationHelper aDescAry(aDescriptor, aAggProperties); return aDescAry; } //------------------------------------------------------------------------------ -void OGridColumn::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const +void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const { switch (nHandle) { @@ -461,8 +453,8 @@ void OGridColumn::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) } //------------------------------------------------------------------------------ -sal_Bool OGridColumn::convertFastPropertyValue( staruno::Any& rConvertedValue, staruno::Any& rOldValue, - sal_Int32 nHandle, const staruno::Any& rValue )throw( starlang::IllegalArgumentException ) +sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, + sal_Int32 nHandle, const Any& rValue )throw( IllegalArgumentException ) { sal_Bool bModified(sal_False); switch (nHandle) @@ -484,12 +476,12 @@ sal_Bool OGridColumn::convertFastPropertyValue( staruno::Any& rConvertedValue, s } //------------------------------------------------------------------------------ -void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) +void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) { switch (nHandle) { case PROPERTY_ID_LABEL: - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "invalid type" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" ); rValue >>= m_aLabel; break; case PROPERTY_ID_WIDTH: @@ -505,24 +497,24 @@ void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const sta } -// starbeans::XPropertyState +// XPropertyState //------------------------------------------------------------------------------ -starbeans::PropertyState OGridColumn::getPropertyStateByHandle(sal_Int32 nHandle) +PropertyState OGridColumn::getPropertyStateByHandle(sal_Int32 nHandle) { - starbeans::PropertyState eState; + PropertyState eState; switch (nHandle) { case PROPERTY_ID_WIDTH: if (!m_aWidth.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; else - eState = starbeans::PropertyState_DIRECT_VALUE; + eState = PropertyState_DIRECT_VALUE; break; case PROPERTY_ID_ALIGN: if (!m_aAlign.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); @@ -537,10 +529,10 @@ void OGridColumn::setPropertyToDefaultByHandle(sal_Int32 nHandle) { case PROPERTY_ID_WIDTH: case PROPERTY_ID_ALIGN: - setFastPropertyValue(nHandle, staruno::Any()); + setFastPropertyValue(nHandle, Any()); break; case PROPERTY_ID_HIDDEN: - setFastPropertyValue(nHandle, staruno::makeAny((sal_Bool)sal_True)); + setFastPropertyValue(nHandle, makeAny((sal_Bool)sal_True)); break; default: OPropertySetAggregationHelper::setPropertyToDefaultByHandle(nHandle); @@ -548,15 +540,15 @@ void OGridColumn::setPropertyToDefaultByHandle(sal_Int32 nHandle) } //------------------------------------------------------------------------------ -staruno::Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const +Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const { switch (nHandle) { case PROPERTY_ID_WIDTH: case PROPERTY_ID_ALIGN: - return staruno::Any(); + return Any(); case PROPERTY_ID_HIDDEN: - return staruno::makeAny((sal_Bool)sal_False); + return makeAny((sal_Bool)sal_False); default: return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle); } @@ -564,16 +556,16 @@ staruno::Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const //XPersistObject //------------------------------------------------------------------------------ -void SAL_CALL OGridColumn::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void SAL_CALL OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream) { // 1. Schreiben des UnoControls - staruno::Reference<stario::XMarkableStream> xMark(_rxOutStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); sal_Int32 nLen = 0; _rxOutStream->writeLong(nLen); - staruno::Reference<stario::XPersistObject> xPersist; + Reference<XPersistObject> xPersist; if (query_aggregation(m_xAggregate, xPersist)) xPersist->write(_rxOutStream); @@ -588,10 +580,10 @@ void SAL_CALL OGridColumn::write(const staruno::Reference<stario::XObjectOutputS _rxOutStream->writeShort(0x0002); sal_uInt16 nAnyMask = 0; - if (m_aWidth.getValueType().getTypeClass() == staruno::TypeClass_LONG) + if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= WIDTH; - if (m_aAlign.getValueType().getTypeClass() == staruno::TypeClass_SHORT) + if (m_aAlign.getValueType().getTypeClass() == TypeClass_SHORT) nAnyMask |= ALIGN; nAnyMask |= COMPATIBLE_HIDDEN; @@ -612,15 +604,15 @@ void SAL_CALL OGridColumn::write(const staruno::Reference<stario::XObjectOutputS } //------------------------------------------------------------------------------ -void SAL_CALL OGridColumn::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void SAL_CALL OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream) { // 1. Lesen des UnoControls sal_Int32 nLen = _rxInStream->readLong(); if (nLen) { - staruno::Reference<stario::XMarkableStream> xMark(_rxInStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); - staruno::Reference<stario::XPersistObject> xPersist; + Reference<XPersistObject> xPersist; if (query_aggregation(m_xAggregate, xPersist)) xPersist->read(_rxInStream); diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx index 2356c94dad43..2d8e4c52b5ab 100644 --- a/forms/source/component/Columns.hxx +++ b/forms/source/component/Columns.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Columns.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -88,6 +88,12 @@ #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ #include <com/sun/star/lang/XUnoTunnel.hpp> #endif +#ifndef _CPPUHELPER_COMPBASE2_HXX_ +#include <cppuhelper/compbase2.hxx> +#endif +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include <comphelper/broadcasthelper.hxx> +#endif using namespace comphelper; @@ -96,84 +102,80 @@ namespace frm { //......................................................................... - namespace starcontainer = ::com::sun::star::container; - namespace stario = ::com::sun::star::io; - //================================================================== // OGridColumn //================================================================== -class OGridColumn - :public ::cppu::OComponentHelper - ,public OPropertySetAggregationHelper - ,public starcontainer::XChild - ,public starlang::XUnoTunnel +typedef ::cppu::WeakAggComponentImplHelper2< ::com::sun::star::container::XChild, + ::com::sun::star::lang::XUnoTunnel > OGridColumn_BASE; +class OGridColumn : public ::comphelper::OBaseMutex + ,public OGridColumn_BASE + ,public OPropertySetAggregationHelper { protected: // [properties] - staruno::Any m_aWidth; // Spaltenbreite - staruno::Any m_aAlign; - staruno::Any m_aHidden; // Spalte ist versteckt ? + ::com::sun::star::uno::Any m_aWidth; // Spaltenbreite + ::com::sun::star::uno::Any m_aAlign; + ::com::sun::star::uno::Any m_aHidden; // Spalte ist versteckt ? // [properties] - ::osl::Mutex m_aMutex; InterfaceRef m_xParent; - staruno::Reference<staruno::XAggregation> m_xAggregate; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; ::rtl::OUString m_aModelName; // [properties] - ::rtl::OUString m_aLabel; // Name der Spalte + ::rtl::OUString m_aLabel; // Name der Spalte // [properties] public: - OGridColumn(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName = ::rtl::OUString()); + OGridColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sModelName = ::rtl::OUString()); virtual ~OGridColumn(); // UNO Anbindung - DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OComponentHelper); - virtual staruno::Any SAL_CALL queryAggregation( const staruno::Type& _rType ) throw (staruno::RuntimeException); + DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OGridColumn_BASE); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); - static const staruno::Sequence<sal_Int8>& getUnoTunnelImplementationId(); + static const ::com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelImplementationId(); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const staruno::Sequence<sal_Int8>& _rIdentifier) throw(staruno::RuntimeException); + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<sal_Int8>& _rIdentifier) throw(::com::sun::star::uno::RuntimeException); // XTypeProvider - virtual staruno::Sequence<sal_Int8> SAL_CALL getImplementationId() throw(staruno::RuntimeException); - virtual staruno::Sequence<staruno::Type> SAL_CALL getTypes() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException); +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); -// starcontainer::XChild - virtual InterfaceRef SAL_CALL getParent() throw(staruno::RuntimeException){return m_xParent;} - virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(starlang::NoSupportException, staruno::RuntimeException); +// ::com::sun::star::container::XChild + virtual InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException){return m_xParent;} + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); -// stario::XPersistObject - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); +// ::com::sun::star::io::XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - 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); - -// starbeans::XPropertyState - virtual starbeans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); - virtual staruno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; const ::rtl::OUString& getModelName() const { return m_aModelName; } protected: - static void clearAggregateProperties(staruno::Sequence<starbeans::Property>& seqProps, sal_Bool bAllowDropDown); - static void setOwnProperties(staruno::Sequence<starbeans::Property>& seqProps); + static void clearAggregateProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& seqProps, sal_Bool bAllowDropDown); + static void setOwnProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property>& seqProps); }; #define DECL_COLUMN(ClassName) \ @@ -182,9 +184,9 @@ class ClassName \ ,public OAggregationArrayUsageHelper< ClassName > \ { \ public: \ - ClassName(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory);\ + ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);\ \ - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); \ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); \ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); \ \ virtual void fillProperties( \ @@ -195,11 +197,11 @@ public: #define IMPL_COLUMN(ClassName, Model, bAllowDropDown) \ -ClassName::ClassName(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) \ +ClassName::ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory) \ :OGridColumn(_rxFactory, Model){} \ -staruno::Reference<starbeans::XPropertySetInfo> ClassName::getPropertySetInfo() throw(staruno::RuntimeException)\ +::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> ClassName::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)\ { \ - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); \ + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); \ return xInfo; \ } \ ::cppu::IPropertyArrayHelper& ClassName::getInfoHelper() \ diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 0a1e5ecafb4f..fd63d0e213a8 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ComboBox.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obo $ $Date: 2000-10-24 13:02:32 $ + * 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 @@ -135,6 +135,17 @@ using namespace dbtools; //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //======================================================================== // class OComboBoxModel @@ -142,23 +153,23 @@ namespace frm sal_Int32 OComboBoxModel::nTextHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OComboBoxModel_CreateInstance(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) throw (com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OComboBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return (*new OComboBoxModel(_rxFactory)); } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> OComboBoxModel::_getTypes() +Sequence<Type> OComboBoxModel::_getTypes() { - static com::sun::star::uno::Sequence<com::sun::star::uno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my two base classes - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aBaseClassTypes = OBoundControlModel::_getTypes(); + Sequence<Type> aBaseClassTypes = OBoundControlModel::_getTypes(); - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes(1); - com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((com::sun::star::uno::Reference<starsdb::XSQLErrorBroadcaster>*)NULL); + Sequence<Type> aOwnTypes(1); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference<XSQLErrorBroadcaster>*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -167,7 +178,7 @@ com::sun::star::uno::Sequence<com::sun::star::uno::Type> OComboBoxModel::_getTyp // XServiceInfo //------------------------------------------------------------------------------ -StringSequence SAL_CALL OComboBoxModel::getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL OComboBoxModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 2); @@ -179,32 +190,32 @@ StringSequence SAL_CALL OComboBoxModel::getSupportedServiceNames() throw(com::su } //------------------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OComboBoxModel::queryAggregation(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException) +Any SAL_CALL OComboBoxModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - com::sun::star::uno::Any aReturn; + Any aReturn; aReturn = OBoundControlModel::queryAggregation(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType - ,static_cast<starsdb::XSQLErrorBroadcaster*>(this) + ,static_cast<XSQLErrorBroadcaster*>(this) ); return aReturn; } //------------------------------------------------------------------ -OComboBoxModel::OComboBoxModel(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OComboBoxModel::OComboBoxModel(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_COMBOBOX, FRM_CONTROL_COMBOBOX) // use the old control name for compytibility reasons - ,m_eListSourceType(starform::ListSourceType_TABLE) + ,m_eListSourceType(ListSourceType_TABLE) ,m_bEmptyIsNull(sal_True) ,m_aNullDate(DBTypeConversion::STANDARD_DB_DATE) - ,m_nKeyType(starutil::NumberFormat::UNDEFINED) + ,m_nKeyType(NumberFormat::UNDEFINED) ,m_nFormatKey(0) - ,m_nFieldType(starsdbc::DataType::OTHER) + ,m_nFieldType(DataType::OTHER) ,m_aErrorListeners(m_aMutex) { - m_nClassId = starform::FormComponentType::COMBOBOX; + m_nClassId = FormComponentType::COMBOBOX; m_sDataFieldConnectivityProperty = PROPERTY_TEXT; if (OComboBoxModel::nTextHandle == -1) OComboBoxModel::nTextHandle = getOriginalHandle(PROPERTY_ID_TEXT); @@ -228,7 +239,7 @@ void OComboBoxModel::disposing() } //------------------------------------------------------------------------------ -void OComboBoxModel::getFastPropertyValue(com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle) const +void OComboBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { switch (_nHandle) { @@ -242,23 +253,23 @@ void OComboBoxModel::getFastPropertyValue(com::sun::star::uno::Any& _rValue, sal } //------------------------------------------------------------------------------ -void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) - throw (com::sun::star::uno::Exception) +void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) + throw (Exception) { switch (_nHandle) { case PROPERTY_ID_LISTSOURCETYPE : - DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast<starform::ListSourceType*>(NULL))), + DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast<ListSourceType*>(NULL))), "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_eListSourceType; break; case PROPERTY_ID_LISTSOURCE : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_STRING, + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_aListSource; // die ListSource hat sich geaendert -> neu laden - if (starform::ListSourceType_VALUELIST != m_eListSourceType) + if (ListSourceType_VALUELIST != m_eListSourceType) { if (m_xCursor.is() && !m_xField.is()) // combobox bereits mit Datenbank verbunden ? // neu laden @@ -267,13 +278,13 @@ void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const break; case PROPERTY_ID_EMPTY_IS_NULL : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_BOOLEAN, + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_bEmptyIsNull; break; case PROPERTY_ID_DEFAULT_TEXT : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_STRING, + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_aDefaultText; _reset(); @@ -286,8 +297,8 @@ void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const //------------------------------------------------------------------------------ sal_Bool OComboBoxModel::convertFastPropertyValue( - com::sun::star::uno::Any& _rConvertedValue, com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) - throw (com::sun::star::lang::IllegalArgumentException) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) { sal_Bool bModified(sal_False); switch (_nHandle) @@ -316,9 +327,9 @@ sal_Bool OComboBoxModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL OComboBoxModel::getPropertySetInfo() throw(com::sun::star::uno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OComboBoxModel::getPropertySetInfo() throw(RuntimeException) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -330,38 +341,38 @@ cppu::IPropertyArrayHelper& OComboBoxModel::getInfoHelper() //------------------------------------------------------------------------------ void OComboBoxModel::fillProperties( - com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rProps, - com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(13) // Text auf transient setzen - ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, com::sun::star::beans::PropertyAttribute::TRANSIENT, 0); + ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP1(TAG, ::rtl::OUString, BOUND); DECL_PROP1(TABINDEX, sal_Int16, BOUND); - DECL_PROP1(LISTSOURCETYPE, starform::ListSourceType, BOUND); + DECL_PROP1(LISTSOURCETYPE, ListSourceType, BOUND); DECL_PROP1(LISTSOURCE, ::rtl::OUString, BOUND); DECL_BOOL_PROP1(EMPTY_IS_NULL, BOUND); DECL_PROP1(DEFAULT_TEXT, ::rtl::OUString, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, com::sun::star::beans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, com::sun::star::beans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OComboBoxModel::getServiceName() throw(com::sun::star::uno::RuntimeException) +::rtl::OUString SAL_CALL OComboBoxModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_COMBOBOX; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::write(const com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); @@ -374,7 +385,7 @@ void SAL_CALL OComboBoxModel::write(const com::sun::star::uno::Reference<stario: // Maskierung fuer any sal_uInt16 nAnyMask = 0; - if (m_aBoundColumn.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_SHORT) + if (m_aBoundColumn.getValueType().getTypeClass() == TypeClass_SHORT) nAnyMask |= BOUNDCOLUMN; _rxOutStream << nAnyMask; @@ -398,7 +409,7 @@ void SAL_CALL OComboBoxModel::write(const com::sun::star::uno::Reference<stario: } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::read(const com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, RuntimeException) { OBoundControlModel::read(_rxInStream); ::osl::MutexGuard aGuard(m_aMutex); @@ -413,7 +424,7 @@ void SAL_CALL OComboBoxModel::read(const com::sun::star::uno::Reference<stario:: m_aListSource = ::rtl::OUString(); m_aBoundColumn <<= (sal_Int16)0; m_aDefaultText = ::rtl::OUString(); - m_eListSourceType = starform::ListSourceType_TABLE; + m_eListSourceType = ListSourceType_TABLE; m_bEmptyIsNull = sal_True; defaultCommonProperties(); return; @@ -442,7 +453,7 @@ void SAL_CALL OComboBoxModel::read(const com::sun::star::uno::Reference<stario:: sal_Int16 nValue; _rxInStream >> nValue; - m_eListSourceType = (starform::ListSourceType)nValue; + m_eListSourceType = (ListSourceType)nValue; if ((nAnyMask & BOUNDCOLUMN) == BOUNDCOLUMN) { @@ -466,7 +477,7 @@ void SAL_CALL OComboBoxModel::read(const com::sun::star::uno::Reference<stario:: if (m_aListSource.len() && m_xAggregateSet.is()) { StringSequence aSequence; - m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, com::sun::star::uno::makeAny(aSequence)); + m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, makeAny(aSequence)); } if (nVersion > 0x0004) @@ -484,44 +495,44 @@ void SAL_CALL OComboBoxModel::read(const com::sun::star::uno::Reference<stario:: //------------------------------------------------------------------------------ void OComboBoxModel::loadData() { - DBG_ASSERT(m_eListSourceType != starform::ListSourceType_VALUELIST, "OComboBoxModel::loadData : do not call for a value list !"); + DBG_ASSERT(m_eListSourceType != ListSourceType_VALUELIST, "OComboBoxModel::loadData : do not call for a value list !"); //// // Connection holen - com::sun::star::uno::Reference<starsdbc::XRowSet> xForm(m_xCursor, com::sun::star::uno::UNO_QUERY); + Reference<XRowSet> xForm(m_xCursor, UNO_QUERY); if (!xForm.is()) return; - com::sun::star::uno::Reference<starsdbc::XConnection> xConnection = getConnection(xForm); + Reference<XConnection> xConnection = getConnection(xForm); if (!xConnection.is()) return; // we need a com::sun::star::sdb::Connection for some of the code below ... - com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo> xServiceInfo(xConnection, com::sun::star::uno::UNO_QUERY); + Reference<XServiceInfo> xServiceInfo(xConnection, UNO_QUERY); if (!xServiceInfo.is() || !xServiceInfo->supportsService(SRV_SDB_CONNECTION)) { DBG_ERROR("OComboBoxModel::loadData : invalid connection !"); return; } - com::sun::star::uno::Reference<starsdbc::XResultSet> xListCursor; + Reference<XResultSet> xListCursor; - if (!m_aListSource.len() || m_eListSourceType == starform::ListSourceType_VALUELIST) + if (!m_aListSource.len() || m_eListSourceType == ListSourceType_VALUELIST) return; try { switch (m_eListSourceType) { - case starform::ListSourceType_TABLEFIELDS: + case ListSourceType_TABLEFIELDS: // don't work with a statement here, the fields will be collected below break; - case starform::ListSourceType_TABLE: + case ListSourceType_TABLE: { // does the bound field belong to the table ? // if we use an alias for the bound field, we won't find it // in that case we use the first field of the table - com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldsByName = getTableFields(xConnection, m_aListSource); - com::sun::star::uno::Reference<starcontainer::XIndexAccess> xFieldsByIndex(xFieldsByName, com::sun::star::uno::UNO_QUERY); + Reference<XNameAccess> xFieldsByName = getTableFields(xConnection, m_aListSource); + Reference<XIndexAccess> xFieldsByIndex(xFieldsByName, UNO_QUERY); ::rtl::OUString aFieldName; if (xFieldsByName.is() && xFieldsByName->hasByName(m_aControlSource)) @@ -531,32 +542,32 @@ void OComboBoxModel::loadData() else { // otherwise look for the alias - com::sun::star::uno::Reference<starsdb::XSQLQueryComposerFactory> xFactory(xConnection, com::sun::star::uno::UNO_QUERY); + Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY); if (!xFactory.is()) break; - com::sun::star::uno::Reference<starsdb::XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); + Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); try { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFormAsSet(xForm, com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xFormAsSet(xForm, UNO_QUERY); ::rtl::OUString aStatement; xFormAsSet->getPropertyValue(PROPERTY_ACTIVECOMMAND) >>= aStatement; xComposer->setQuery(aStatement); } - catch(...) + catch(Exception&) { disposeComponent(xComposer); break; } // search the field - com::sun::star::uno::Reference<starsdbcx::XColumnsSupplier> xSupplyFields(xComposer, com::sun::star::uno::UNO_QUERY); + Reference<XColumnsSupplier> xSupplyFields(xComposer, UNO_QUERY); DBG_ASSERT(xSupplyFields.is(), "OComboBoxModel::loadData : invalid query composer !"); - com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldNames = xSupplyFields->getColumns(); + Reference<XNameAccess> xFieldNames = xSupplyFields->getColumns(); if (xFieldNames->hasByName(m_aControlSource)) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xComposerFieldAsSet(*(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>*)xFieldNames->getByName(m_aControlSource).getValue()); + Reference<XPropertySet> xComposerFieldAsSet(*(Reference<XPropertySet>*)xFieldNames->getByName(m_aControlSource).getValue()); if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet)) xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName; } @@ -567,7 +578,7 @@ void OComboBoxModel::loadData() if (!aFieldName.len()) break; - com::sun::star::uno::Reference<starsdbc::XDatabaseMetaData> xMeta = xConnection->getMetaData(); + Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); ::rtl::OUString aQuote = xMeta->getIdentifierQuoteString(); ::rtl::OUString aStatement = ::rtl::OUString::createFromAscii("SELECT DISTINCT "); @@ -575,15 +586,15 @@ void OComboBoxModel::loadData() aStatement += ::rtl::OUString::createFromAscii(" FROM "); aStatement += quoteTableName(xMeta, m_aListSource); - com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); + Reference<XStatement> xStmt = xConnection->createStatement(); xListCursor = xStmt->executeQuery(aStatement); } break; - case starform::ListSourceType_QUERY: + case ListSourceType_QUERY: { - com::sun::star::uno::Reference<starsdb::XQueriesSupplier> xSupplyQueries(xConnection, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(m_aListSource).getValue(), com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>(xStmt, com::sun::star::uno::UNO_QUERY)->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); + Reference<XQueriesSupplier> xSupplyQueries(xConnection, UNO_QUERY); + Reference<XPropertySet> xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(m_aListSource).getValue(), UNO_QUERY); + Reference<XStatement> xStmt = xConnection->createStatement(); + Reference<XPropertySet>(xStmt, UNO_QUERY)->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); ::rtl::OUString sStatement; xQuery->getPropertyValue(PROPERTY_COMMAND) >>= sStatement; @@ -591,30 +602,30 @@ void OComboBoxModel::loadData() } break; default: { - com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); - if (starform::ListSourceType_SQLPASSTHROUGH == m_eListSourceType) + Reference<XStatement> xStmt = xConnection->createStatement(); + if (ListSourceType_SQLPASSTHROUGH == m_eListSourceType) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xStatementProps(xStmt, com::sun::star::uno::UNO_QUERY); - xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, com::sun::star::uno::makeAny(sal_Bool(sal_False))); + Reference<XPropertySet> xStatementProps(xStmt, UNO_QUERY); + xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, makeAny(sal_Bool(sal_False))); } xListCursor = xStmt->executeQuery(m_aListSource); } } } - catch(starsdbc::SQLException& eSQL) + catch(SQLException& eSQL) { onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); disposeComponent(xListCursor); return; } - catch(com::sun::star::uno::Exception& eUnknown) + catch(Exception& eUnknown) { eUnknown; disposeComponent(xListCursor); return; } - if (starform::ListSourceType_TABLEFIELDS != m_eListSourceType && !xListCursor.is()) + if (ListSourceType_TABLEFIELDS != m_eListSourceType && !xListCursor.is()) // something went wrong ... return; @@ -624,23 +635,23 @@ void OComboBoxModel::loadData() { switch (m_eListSourceType) { - case starform::ListSourceType_SQL: - case starform::ListSourceType_SQLPASSTHROUGH: - case starform::ListSourceType_TABLE: - case starform::ListSourceType_QUERY: + case ListSourceType_SQL: + case ListSourceType_SQLPASSTHROUGH: + case ListSourceType_TABLE: + case ListSourceType_QUERY: { // die XDatabaseVAriant der ersten Spalte - com::sun::star::uno::Reference<starsdbcx::XColumnsSupplier> xSupplyCols(xListCursor, com::sun::star::uno::UNO_QUERY); + Reference<XColumnsSupplier> xSupplyCols(xListCursor, UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "OComboBoxModel::loadData : cursor supports the row set service but is no column supplier ??!"); - com::sun::star::uno::Reference<starcontainer::XIndexAccess> xColumns; + Reference<XIndexAccess> xColumns; if (xSupplyCols.is()) { - xColumns = com::sun::star::uno::Reference<starcontainer::XIndexAccess>(xSupplyCols->getColumns(), com::sun::star::uno::UNO_QUERY); + xColumns = Reference<XIndexAccess>(xSupplyCols->getColumns(), UNO_QUERY); DBG_ASSERT(xColumns.is(), "OComboBoxModel::loadData : no columns supplied by the row set !"); } - com::sun::star::uno::Reference<starsdb::XColumn> xDataField; + Reference<XColumn> xDataField; if (xColumns.is()) - xDataField = com::sun::star::uno::Reference<starsdb::XColumn>(*(InterfaceRef*)xColumns->getByIndex(0).getValue(), com::sun::star::uno::UNO_QUERY); + xDataField = Reference<XColumn>(*(InterfaceRef*)xColumns->getByIndex(0).getValue(), UNO_QUERY); if (!xDataField.is()) { disposeComponent(xListCursor); @@ -661,9 +672,9 @@ void OComboBoxModel::loadData() } } break; - case starform::ListSourceType_TABLEFIELDS: + case ListSourceType_TABLEFIELDS: { - com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldNames = getTableFields(xConnection, m_aListSource); + Reference<XNameAccess> xFieldNames = getTableFields(xConnection, m_aListSource); if (xFieldNames.is()) { StringSequence seqNames = xFieldNames->getElementNames(); @@ -677,34 +688,34 @@ void OComboBoxModel::loadData() break; } } - catch(starsdbc::SQLException& eSQL) + catch(SQLException& eSQL) { onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); disposeComponent(xListCursor); return; } - catch(com::sun::star::uno::Exception& eUnknown) + catch(Exception& eUnknown) { eUnknown; disposeComponent(xListCursor); return; } - // String-com::sun::star::uno::Sequence fuer ListBox erzeugen + // String-Sequence fuer ListBox erzeugen StringSequence aStringSeq(aStringList.size()); ::rtl::OUString* pStringAry = aStringSeq.getArray(); for (sal_Int32 i = 0; i<aStringSeq.getLength(); ++i) pStringAry[i] = aStringList[i]; - // String-com::sun::star::uno::Sequence an ListBox setzen - m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, com::sun::star::uno::makeAny(aStringSeq)); + // String-Sequence an ListBox setzen + m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, makeAny(aStringSeq)); // Statement + Cursor zerstoeren disposeComponent(xListCursor); } //------------------------------------------------------------------------------ -void OComboBoxModel::_loaded(const com::sun::star::lang::EventObject& rEvent) +void OComboBoxModel::_loaded(const EventObject& rEvent) { if (m_xField.is()) { @@ -713,13 +724,13 @@ void OComboBoxModel::_loaded(const com::sun::star::lang::EventObject& rEvent) m_xField->getPropertyValue(PROPERTY_FORMATKEY) >>= m_nFormatKey; // XNumberFormatter besorgen - com::sun::star::uno::Reference<starsdbc::XRowSet> xRowSet(rEvent.Source, com::sun::star::uno::UNO_QUERY); + Reference<XRowSet> xRowSet(rEvent.Source, UNO_QUERY); DBG_ASSERT(xRowSet.is(), "OComboBoxModel::_loaded : invalid event source !"); - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); + Reference<XNumberFormatsSupplier> xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); if (xSupplier.is()) { - m_xFormatter = com::sun::star::uno::Reference<starutil::XNumberFormatter>( - m_xServiceFactory->createInstance(FRM_NUMBER_FORMATTER), com::sun::star::uno::UNO_QUERY + m_xFormatter = Reference<XNumberFormatter>( + m_xServiceFactory->createInstance(FRM_NUMBER_FORMATTER), UNO_QUERY ); if (m_xFormatter.is()) m_xFormatter->attachNumberFormatsSupplier(xSupplier); @@ -740,9 +751,9 @@ void OComboBoxModel::_unloaded() if (m_xField.is()) { m_xFormatter = 0; - m_nFieldType = starsdbc::DataType::OTHER; + m_nFieldType = DataType::OTHER; m_nFormatKey = 0; - m_nKeyType = starutil::NumberFormat::UNDEFINED; + m_nKeyType = NumberFormat::UNDEFINED; m_aNullDate = DBTypeConversion::STANDARD_DB_DATE; } @@ -750,12 +761,12 @@ void OComboBoxModel::_unloaded() if (m_aListSource.len() && m_xCursor.is()) { StringSequence aSequence; - m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, com::sun::star::uno::makeAny(aSequence)); + m_xAggregateSet->setPropertyValue(PROPERTY_STRINGITEMLIST, makeAny(aSequence)); } } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::reloaded( const com::sun::star::lang::EventObject& aEvent ) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::reloaded( const EventObject& aEvent ) throw(RuntimeException) { OBoundControlModel::reloaded(aEvent); @@ -781,7 +792,7 @@ sal_Bool OComboBoxModel::_commit() DBTypeConversion::setValue(m_xColumnUpdate, m_xFormatter, m_aNullDate, aNewValue, m_nFormatKey, m_nFieldType, m_nKeyType); } - catch(...) + catch(Exception&) { return sal_False; } @@ -795,7 +806,7 @@ sal_Bool OComboBoxModel::_commit() if (m_bResetting) bAddToList = sal_False; - com::sun::star::uno::Any aAnyList = m_xAggregateSet->getPropertyValue(PROPERTY_STRINGITEMLIST); + Any aAnyList = m_xAggregateSet->getPropertyValue(PROPERTY_STRINGITEMLIST); if (bAddToList && aAnyList.getValueType().equals(::getCppuType(reinterpret_cast<StringSequence*>(NULL)))) { StringSequence aStringItemList = *(StringSequence*)aAnyList.getValue(); @@ -840,7 +851,7 @@ void OComboBoxModel::_onValueChanged() m_nFormatKey, m_nKeyType); - m_xAggregateFastSet->setFastPropertyValue(OComboBoxModel::nTextHandle, com::sun::star::uno::makeAny(m_aSaveValue)); + m_xAggregateFastSet->setFastPropertyValue(OComboBoxModel::nTextHandle, makeAny(m_aSaveValue)); } //------------------------------------------------------------------------------ @@ -851,34 +862,34 @@ void OComboBoxModel::_reset() // our own mutex locked // FS - 72451 - 31.01.00 MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OComboBoxModel::nTextHandle, com::sun::star::uno::makeAny(m_aDefaultText)); + m_xAggregateFastSet->setFastPropertyValue(OComboBoxModel::nTextHandle, makeAny(m_aDefaultText)); } } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::addSQLErrorListener(const com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::addSQLErrorListener(const Reference<XSQLErrorListener>& _rxListener) throw(RuntimeException) { m_aErrorListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::removeSQLErrorListener(const com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::removeSQLErrorListener(const Reference<XSQLErrorListener>& _rxListener) throw(RuntimeException) { m_aErrorListeners.removeInterface(_rxListener); } //------------------------------------------------------------------------------ -void OComboBoxModel::onError(starsdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription) +void OComboBoxModel::onError(SQLException& _rException, const ::rtl::OUString& _rContextDescription) { - starsdb::SQLContext aError = prependContextInfo(_rException, static_cast<com::sun::star::uno::XWeak*>(this), _rContextDescription); + SQLContext aError = prependContextInfo(_rException, static_cast<XWeak*>(this), _rContextDescription); if (m_aErrorListeners.getLength()) { - starsdb::SQLErrorEvent aEvent(static_cast<com::sun::star::uno::XWeak*>(this), com::sun::star::uno::makeAny(aError)); + SQLErrorEvent aEvent(static_cast<XWeak*>(this), makeAny(aError)); ::cppu::OInterfaceIteratorHelper aIter(m_aErrorListeners); while (aIter.hasMoreElements()) - static_cast<starsdb::XSQLErrorListener*>(aIter.next())->errorOccured(aEvent); + static_cast<XSQLErrorListener*>(aIter.next())->errorOccured(aEvent); } } @@ -887,19 +898,19 @@ void OComboBoxModel::onError(starsdbc::SQLException& _rException, const ::rtl::O //======================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OComboBoxControl_CreateInstance(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) throw (com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OComboBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OComboBoxControl(_rxFactory)); } //------------------------------------------------------------------------------ -OComboBoxControl::OComboBoxControl(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OComboBoxControl::OComboBoxControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_COMBOBOX) { } //------------------------------------------------------------------------------ -StringSequence SAL_CALL OComboBoxControl::getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL OComboBoxControl::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControl::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index 2901d7130460..0acf1198c10f 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ComboBox.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -75,13 +75,27 @@ #include <vcl/timer.hxx> #endif +#ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_ #include <com/sun/star/util/XRefreshable.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include <com/sun/star/util/XNumberFormatter.hpp> +#endif +#ifndef _COM_SUN_STAR_SDB_XSQLERRORBROADCASTER_HPP_ #include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_LISTSOURCETYPE_HPP_ #include <com/sun/star/form/ListSourceType.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XITEMLISTENER_HPP_ #include <com/sun/star/awt/XItemListener.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XFOCUSLISTENER_HPP_ #include <com/sun/star/awt/XFocusListener.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ #include <com/sun/star/form/XChangeBroadcaster.hpp> +#endif //......................................................................... namespace frm @@ -92,89 +106,92 @@ namespace frm //================================================================== class OComboBoxModel :public OBoundControlModel - ,public starsdb::XSQLErrorBroadcaster + ,public ::com::sun::star::sdb::XSQLErrorBroadcaster ,public ::comphelper::OAggregationArrayUsageHelper< OComboBoxModel > { - staruno::Reference<starutil::XNumberFormatter> m_xFormatter; - starform::ListSourceType m_eListSourceType; // type der list source - staruno::Any m_aBoundColumn; // obsolet - ::rtl::OUString m_aListSource; // - ::rtl::OUString m_aDefaultText; // DefaultText - ::rtl::OUString m_aSaveValue; - sal_Int32 m_nFormatKey; - starutil::Date m_aNullDate; - sal_Int32 m_nFieldType; - sal_Int16 m_nKeyType; - sal_Bool m_bEmptyIsNull; // LeerString wird als NULL interpretiert - - ::cppu::OInterfaceContainerHelper m_aErrorListeners; + ::cppu::OInterfaceContainerHelper m_aErrorListeners; + ::com::sun::star::uno::Any m_aBoundColumn; // obsolet + ::rtl::OUString m_aListSource; // + ::rtl::OUString m_aDefaultText; // DefaultText + ::rtl::OUString m_aSaveValue; + + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> m_xFormatter; + + ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source + sal_Int32 m_nFormatKey; + ::com::sun::star::util::Date m_aNullDate; + sal_Int32 m_nFieldType; + sal_Int16 m_nKeyType; + sal_Bool m_bEmptyIsNull; // LeerString wird als NULL interpretiert + + static sal_Int32 nTextHandle; protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OComboBoxModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OComboBoxModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); ~OComboBoxModel(); virtual void SAL_CALL disposing(); // OPropertySetHelper - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) - throw (staruno::Exception); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); virtual sal_Bool SAL_CALL convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue ) - throw (starlang::IllegalArgumentException); + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); // XLoadListener - virtual void _loaded(const starlang::EventObject& rEvent); + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); virtual void _unloaded(); - virtual void SAL_CALL reloaded( const starlang::EventObject& aEvent ) throw(staruno::RuntimeException); + virtual void SAL_CALL reloaded( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); // XServiceInfo IMPLEMENTATION_NAME(OComboBoxModel); - virtual StringSequence SAL_CALL getSupportedServiceNames() throw(staruno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // UNO DECLARE_UNO3_AGG_DEFAULTS(OComboBoxModel, OBoundControlModel); - virtual staruno::Any SAL_CALL queryAggregation( const staruno::Type& _rType ) throw (staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); // XBoundComponent virtual sal_Bool _commit(); // XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XReset virtual void _reset(); // XSQLErrorBroadcaster - virtual void SAL_CALL addSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL addSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() protected: void loadData(); - void onError(starsdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription); + void onError(::com::sun::star::sdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription); }; //================================================================== @@ -184,11 +201,11 @@ protected: class OComboBoxControl : public OBoundControl { public: - OComboBoxControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OComboBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(OComboBoxControl); - virtual StringSequence SAL_CALL getSupportedServiceNames() throw(staruno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); }; //......................................................................... diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx index f06d300a92fc..e4d3cc5fb198 100644 --- a/forms/source/component/Currency.cxx +++ b/forms/source/component/Currency.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Currency.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:04 $ + * 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 @@ -74,24 +74,35 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // OCurrencyControl //================================================================== //------------------------------------------------------------------ -OCurrencyControl::OCurrencyControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OCurrencyControl::OCurrencyControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_CURRENCYFIELD) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OCurrencyControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OCurrencyControl::_getTypes() +Sequence<Type> OCurrencyControl::_getTypes() { return OBoundControl::_getTypes(); } @@ -113,23 +124,23 @@ StringSequence SAL_CALL OCurrencyControl::getSupportedServiceNames() throw() sal_Int32 OCurrencyModel::nValueHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OCurrencyModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OCurrencyModel::_getTypes() +Sequence<Type> OCurrencyModel::_getTypes() { return OEditBaseModel::_getTypes(); } //------------------------------------------------------------------ -OCurrencyModel::OCurrencyModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OCurrencyModel::OCurrencyModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_CURRENCYFIELD, FRM_CONTROL_CURRENCYFIELD) // use the old control name for compytibility reasons { - m_nClassId = starform::FormComponentType::CURRENCYFIELD; + m_nClassId = FormComponentType::CURRENCYFIELD; m_sDataFieldConnectivityProperty = PROPERTY_VALUE; if (OCurrencyModel::nValueHandle == -1) OCurrencyModel::nValueHandle = getOriginalHandle(PROPERTY_ID_VALUE); @@ -163,11 +174,11 @@ OCurrencyModel::OCurrencyModel(const staruno::Reference<starlang::XMultiServiceF } if (sCurrencySymbol.getLength()) { - m_xAggregateSet->setPropertyValue(PROPERTY_CURRENCYSYMBOL, staruno::makeAny(sCurrencySymbol)); - m_xAggregateSet->setPropertyValue(PROPERTY_CURRSYM_POSITION, staruno::makeAny(bPrependCurrencySymbol)); + m_xAggregateSet->setPropertyValue(PROPERTY_CURRENCYSYMBOL, makeAny(sCurrencySymbol)); + m_xAggregateSet->setPropertyValue(PROPERTY_CURRSYM_POSITION, makeAny(bPrependCurrencySymbol)); } } - catch(...) + catch(Exception&) { } } @@ -178,7 +189,7 @@ OCurrencyModel::~OCurrencyModel() { } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence SAL_CALL OCurrencyModel::getSupportedServiceNames() throw() { @@ -192,20 +203,20 @@ StringSequence SAL_CALL OCurrencyModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OCurrencyModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OCurrencyModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OCurrencyModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(10) // Value auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_VALUE, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_VALUE, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP3(DEFAULT_VALUE, double, BOUND, MAYBEDEFAULT, MAYBEVOID); @@ -214,8 +225,8 @@ void OCurrencyModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -232,14 +243,14 @@ void OCurrencyModel::fillProperties( return FRM_COMPONENT_CURRENCYFIELD; // old (non-sun) name for compatibility ! } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ sal_Bool OCurrencyModel::_commit() { - staruno::Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OCurrencyModel::nValueHandle ); + Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OCurrencyModel::nValueHandle ); if (!compare(aNewValue, m_aSaveValue)) { - if (aNewValue.getValueType().getTypeClass() == staruno::TypeClass_VOID) + if (aNewValue.getValueType().getTypeClass() == TypeClass_VOID) m_xColumnUpdate->updateNull(); else { @@ -247,7 +258,7 @@ sal_Bool OCurrencyModel::_commit() { m_xColumnUpdate->updateDouble(getDouble(aNewValue)); } - catch(...) + catch(Exception&) { return sal_False; } @@ -272,12 +283,12 @@ void OCurrencyModel::_onValueChanged() } } -// starform::XReset +// XReset //------------------------------------------------------------------------------ void OCurrencyModel::_reset( void ) { - staruno::Any aValue; - if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_DOUBLE) + Any aValue; + if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE) aValue = m_aDefault; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties diff --git a/forms/source/component/Currency.hxx b/forms/source/component/Currency.hxx index 263db2f8e17e..357491ae23ec 100644 --- a/forms/source/component/Currency.hxx +++ b/forms/source/component/Currency.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Currency.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -78,30 +78,30 @@ class OCurrencyModel :public OEditBaseModel ,public ::comphelper::OAggregationArrayUsageHelper< OCurrencyModel > { - staruno::Any m_aSaveValue; + ::com::sun::star::uno::Any m_aSaveValue; static sal_Int32 nValueHandle; protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OCurrencyModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OCurrencyModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OCurrencyModel(); // starform::XBoundComponent virtual sal_Bool _commit(); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OCurrencyModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); - // staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - // stario::XPersistObject + // ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); // starform::XReset @@ -109,8 +109,8 @@ public: // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -121,11 +121,11 @@ public: class OCurrencyControl: public OBoundControl { protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OCurrencyControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); - // starlang::XServiceInfo + OCurrencyControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OCurrencyControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); }; 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)); } //......................................................................... diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx index 6b99b207ce9e..47978b5ed3ad 100644 --- a/forms/source/component/DatabaseForm.hxx +++ b/forms/source/component/DatabaseForm.hxx @@ -2,9 +2,9 @@ * * $RCSfile: DatabaseForm.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: fs $ $Date: 2000-10-31 16:03:14 $ + * 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 @@ -173,6 +173,15 @@ #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ #include <comphelper/proparrhlp.hxx> #endif +#ifndef _CPPUHELPER_IMPLBASE11_HXX_ +#include <cppuhelper/implbase11.hxx> +#endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif +#ifndef _CPPUHELPER_IMPLBASE7_HXX_ +#include <cppuhelper/implbase7.hxx> +#endif namespace com { namespace sun { namespace star { namespace sdbc { class SQLException; @@ -188,12 +197,6 @@ namespace frm { //......................................................................... - namespace starsdb = ::com::sun::star::sdb; - namespace starsdbc = ::com::sun::star::sdbc; - namespace starsdbcx = ::com::sun::star::sdbcx; - namespace starform = ::com::sun::star::form; - namespace starutil = ::com::sun::star::util; - //======================================================================== //= html tools //======================================================================== @@ -231,39 +234,42 @@ DECLARE_STL_VECTOR(HtmlSuccessfulObj, HtmlSuccessfulObjList); class OGroupManager; class OFormSubmitResetThread; struct OParameterInfoImpl; +typedef ::cppu::ImplHelper11< ::com::sun::star::form::XForm, + ::com::sun::star::awt::XTabControllerModel, + ::com::sun::star::form::XLoadListener, + ::com::sun::star::sdbc::XRowSetListener, + ::com::sun::star::sdb::XRowSetApproveListener, + ::com::sun::star::form::XDatabaseParameterBroadcaster, + ::com::sun::star::sdb::XSQLErrorListener, + ::com::sun::star::sdb::XSQLErrorBroadcaster, + ::com::sun::star::form::XReset, + ::com::sun::star::form::XSubmit, + ::com::sun::star::form::XLoadable > ODatabaseForm_BASE1; + + +typedef ::cppu::ImplHelper2< ::com::sun::star::container::XNamed, + ::com::sun::star::lang::XServiceInfo> ODatabaseForm_BASE2; + +typedef ::cppu::ImplHelper7< ::com::sun::star::sdbc::XCloseable, + ::com::sun::star::sdbc::XRowSet, + ::com::sun::star::sdb::XCompletedExecution, + ::com::sun::star::sdb::XRowSetApproveBroadcaster, + ::com::sun::star::sdbc::XResultSetUpdate, + ::com::sun::star::sdbcx::XDeleteRows, + ::com::sun::star::sdbc::XParameters > ODatabaseForm_BASE3; + + class ODatabaseForm :public OFormComponents ,public OPropertySetAggregationHelper ,public OPropertyChangeListener ,public ::comphelper::OAggregationArrayUsageHelper<ODatabaseForm> - ,public starsdb::XSQLErrorBroadcaster - // service com::sun::star::form::component::Form (supported by com::sun::star::form::component::DataForm) - ,public starform::XForm - ,public starawt::XTabControllerModel - // already present (via OFormComponents) : com::sun::star::script::XEventAttacherManager - // service com::sun::star::form::component::HTMLForm - ,public starform::XReset - ,public starform::XSubmit - // other stuff (new or re-routed interfaces) - ,public starform::XLoadListener - ,public starform::XLoadable - ,public starsdbc::XCloseable - ,public starsdbc::XRowSet - ,public starsdb::XCompletedExecution - ,public starsdbc::XRowSetListener - ,public starsdb::XRowSetApproveListener - ,public starsdb::XRowSetApproveBroadcaster - ,public starsdbc::XResultSetUpdate - ,public starsdbcx::XDeleteRows - ,public starsdbc::XParameters - ,public starform::XDatabaseParameterBroadcaster - // already preset (via OFormComponents) : stario::XPersistObject - ,public starsdb::XSQLErrorListener - ,public starcontainer::XNamed - ,public starlang::XServiceInfo + ,public ODatabaseForm_BASE1 + ,public ODatabaseForm_BASE2 + ,public ODatabaseForm_BASE3 { friend class OFormSubmitResetThread; - OImplementationIdsRef m_aHoldIdHelper; + OImplementationIdsRef m_aHoldIdHelper; // listener administration ::cppu::OInterfaceContainerHelper m_aLoadListeners; @@ -273,41 +279,39 @@ class ODatabaseForm :public OFormComponents ::cppu::OInterfaceContainerHelper m_aResetListeners; ::cppu::OInterfaceContainerHelper m_aSubmitListeners; ::cppu::OInterfaceContainerHelper m_aErrorListeners; - - staruno::Any m_aCycle; - StringSequence m_aMasterFields; - StringSequence m_aDetailFields; - ::std::vector<bool> m_aParameterVisited; + ::osl::Mutex m_aResetSafety; + ::com::sun::star::uno::Any m_aCycle; + StringSequence m_aMasterFields; + StringSequence m_aDetailFields; + ::std::vector<bool> m_aParameterVisited; // the object doin' most of the work - an SDB-rowset - staruno::Reference<staruno::XAggregation> m_xAggregate; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; // same object, interface as member because of performance reasons - staruno::Reference<starsdbc::XRowSet> m_xAggregateAsRowSet; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet> m_xAggregateAsRowSet; // Verwaltung der ControlGruppen - OGroupManager* m_pGroupManager; - OParameterInfoImpl* m_pParameterInfo; - Timer* m_pLoadTimer; + OGroupManager* m_pGroupManager; + OParameterInfoImpl* m_pParameterInfo; + Timer* m_pLoadTimer; - OFormSubmitResetThread* m_pThread; - ::rtl::OUString m_sCurrentErrorContext; + OFormSubmitResetThread* m_pThread; + ::rtl::OUString m_sCurrentErrorContext; // will be used as additional context information // when an exception is catched and forwarded to the listeners - ::osl::Mutex m_aResetSafety; - INT32 m_nResetsPending; - + INT32 m_nResetsPending; // <overwritten_properties> - sal_Int32 m_nPrivileges; + sal_Int32 m_nPrivileges; // </overwritten_properties> // <properties> ::rtl::OUString m_sName; ::rtl::OUString m_aTargetURL; ::rtl::OUString m_aTargetFrame; - starform::FormSubmitMethod m_eSubmitMethod; - starform::FormSubmitEncoding m_eSubmitEncoding; - starform::NavigationBarMode m_eNavigation; + ::com::sun::star::form::FormSubmitMethod m_eSubmitMethod; + ::com::sun::star::form::FormSubmitEncoding m_eSubmitEncoding; + ::com::sun::star::form::NavigationBarMode m_eNavigation; sal_Bool m_bAllowInsert : 1; sal_Bool m_bAllowUpdate : 1; sal_Bool m_bAllowDelete : 1; @@ -316,206 +320,206 @@ class ODatabaseForm :public OFormComponents sal_Bool m_bSubForm : 1; public: - ODatabaseForm(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ODatabaseForm(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); ~ODatabaseForm(); // UNO binding DECLARE_UNO3_AGG_DEFAULTS(ODatabaseForm, OFormComponents); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); // XTypeProvider - virtual staruno::Sequence<staruno::Type> SAL_CALL getTypes( ) throw(staruno::RuntimeException); - virtual staruno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - // starlang::XComponent + // ::com::sun::star::lang::XComponent virtual void SAL_CALL disposing(); // property handling - virtual staruno::Reference< starbeans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - 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); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); - staruno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) - throw(starbeans::UnknownPropertyException, starlang::WrappedTargetException, staruno::RuntimeException); - void fire( sal_Int32 * pnHandles, const staruno::Any * pNewValues, const staruno::Any * pOldValues, sal_Int32 nCount, sal_Bool bVetoable ); + ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + void fire( sal_Int32 * pnHandles, const ::com::sun::star::uno::Any * pNewValues, const ::com::sun::star::uno::Any * pOldValues, sal_Int32 nCount, sal_Bool bVetoable ); virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; // com::sun::star::beans::XPropertyState - virtual starbeans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); - virtual staruno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; // com::sun::star::sdbc::XSQLErrorBroadcaster - virtual void SAL_CALL addSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeSQLErrorListener(const staruno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL addSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::form::XForm // nothing to implement // com::sun::star::form::XReset - virtual void SAL_CALL reset() throw(staruno::RuntimeException); - virtual void SAL_CALL addResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::form::XSubmit - virtual void SAL_CALL submit(const staruno::Reference<starawt::XControl>& aControl, const starawt::MouseEvent& aMouseEvt) throw(staruno::RuntimeException); - virtual void SAL_CALL addSubmitListener(const staruno::Reference<starform::XSubmitListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeSubmitListener(const staruno::Reference<starform::XSubmitListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL submit(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& aControl, const ::com::sun::star::awt::MouseEvent& aMouseEvt) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSubmitListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XSubmitListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSubmitListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XSubmitListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::container::XChild virtual InterfaceRef SAL_CALL getParent() { return OFormComponents::getParent(); } virtual void SAL_CALL setParent(const InterfaceRef& Parent); // com::sun::star::container::XNamed - virtual ::rtl::OUString SAL_CALL getName() throw(staruno::RuntimeException); - virtual void SAL_CALL setName(const ::rtl::OUString& aName) throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& aName) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::awt::XTabControllerModel - virtual sal_Bool SAL_CALL getGroupControl() throw(staruno::RuntimeException); - virtual void SAL_CALL setGroupControl(sal_Bool _bGroupControl) throw(staruno::RuntimeException) { } - virtual void SAL_CALL setControlModels(const staruno::Sequence< staruno::Reference< starawt::XControlModel > >& _rControls) throw(staruno::RuntimeException); - virtual staruno::Sequence< staruno::Reference< starawt::XControlModel > > SAL_CALL getControlModels() throw(staruno::RuntimeException); - virtual void SAL_CALL setGroup(const staruno::Sequence< staruno::Reference< starawt::XControlModel > >& _rGroup, const ::rtl::OUString& _rGroupName) throw(staruno::RuntimeException); - virtual sal_Int32 SAL_CALL getGroupCount() throw(staruno::RuntimeException); - virtual void SAL_CALL getGroup(sal_Int32 _nGroup, staruno::Sequence< staruno::Reference< starawt::XControlModel > >& _rxGroup, ::rtl::OUString& _rName) throw(staruno::RuntimeException); - virtual void SAL_CALL getGroupByName(const ::rtl::OUString& _rName, staruno::Sequence< staruno::Reference< starawt::XControlModel > >& _rxGroup) throw(staruno::RuntimeException); + virtual sal_Bool SAL_CALL getGroupControl() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroupControl(sal_Bool _bGroupControl) throw(::com::sun::star::uno::RuntimeException) { } + virtual void SAL_CALL setControlModels(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rControls) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroup(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rGroup, const ::rtl::OUString& _rGroupName) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getGroupCount() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroup(sal_Int32 _nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rxGroup, ::rtl::OUString& _rName) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroupByName(const ::rtl::OUString& _rName, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& _rxGroup) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::lang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException); + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::form::XLoadListener - virtual void SAL_CALL loaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL unloading(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL unloaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL reloading(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL reloaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::form::XLoadable - virtual void SAL_CALL load() throw(staruno::RuntimeException); - virtual void SAL_CALL unload() throw(staruno::RuntimeException); - virtual void SAL_CALL reload() throw(staruno::RuntimeException); - virtual sal_Bool SAL_CALL isLoaded() throw(staruno::RuntimeException); - virtual void SAL_CALL addLoadListener(const staruno::Reference<starform::XLoadListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeLoadListener(const staruno::Reference<starform::XLoadListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL load() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unload() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reload() throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isLoaded() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addLoadListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeLoadListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XCloseable - virtual void SAL_CALL close() throw(starsdbc::SQLException, staruno::RuntimeException); + virtual void SAL_CALL close() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XRowSetListener - virtual void SAL_CALL cursorMoved(const starlang::EventObject& event) throw(staruno::RuntimeException); - virtual void SAL_CALL rowChanged(const starlang::EventObject& event) throw(staruno::RuntimeException); - virtual void SAL_CALL rowSetChanged(const starlang::EventObject& event) throw(staruno::RuntimeException); + virtual void SAL_CALL cursorMoved(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdb::XRowSetApproveListener - virtual sal_Bool SAL_CALL approveCursorMove(const starlang::EventObject& event) throw(staruno::RuntimeException); - virtual sal_Bool SAL_CALL approveRowChange(const starsdb::RowChangeEvent& event) throw(staruno::RuntimeException); - virtual sal_Bool SAL_CALL approveRowSetChange(const starlang::EventObject& event) throw(staruno::RuntimeException); + virtual sal_Bool SAL_CALL approveCursorMove(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL approveRowChange(const ::com::sun::star::sdb::RowChangeEvent& event) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL approveRowSetChange(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdb::XRowSetApproveBroadcaster - virtual void SAL_CALL addRowSetApproveListener(const staruno::Reference<starsdb::XRowSetApproveListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeRowSetApproveListener(const staruno::Reference<starsdb::XRowSetApproveListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL addRowSetApproveListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetApproveListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun:star::form::XDatabaseParameterBroadcaster - virtual void SAL_CALL addParameterListener(const staruno::Reference<starform::XDatabaseParameterListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeParameterListener(const staruno::Reference<starform::XDatabaseParameterListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL addParameterListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeParameterListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XRowSet - virtual void SAL_CALL execute() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL addRowSetListener(const staruno::Reference<starsdbc::XRowSetListener>& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeRowSetListener(const staruno::Reference<starsdbc::XRowSetListener>& _rxListener) throw(staruno::RuntimeException); + virtual void SAL_CALL execute() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addRowSetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdb::XCompletedExecution virtual void SAL_CALL executeWithCompletion( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& handler ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XResultSet - virtual sal_Bool SAL_CALL next() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL isBeforeFirst() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL isAfterLast() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL isFirst() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL isLast() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL beforeFirst() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL afterLast() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL first() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL last() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Int32 SAL_CALL getRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL absolute(sal_Int32 row) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL relative(sal_Int32 rows) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL previous() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL refreshRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL rowUpdated() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL rowInserted() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual sal_Bool SAL_CALL rowDeleted() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual InterfaceRef SAL_CALL getStatement() throw(starsdbc::SQLException, staruno::RuntimeException); + virtual sal_Bool SAL_CALL next() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isBeforeFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAfterLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL beforeFirst() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL afterLast() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL first() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL last() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL absolute(sal_Int32 row) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL relative(sal_Int32 rows) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL previous() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL refreshRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowUpdated() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowInserted() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL rowDeleted() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual InterfaceRef SAL_CALL getStatement() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XResultSetUpdate - virtual void SAL_CALL insertRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL updateRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL deleteRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL cancelRowUpdates() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL moveToInsertRow() throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL moveToCurrentRow() throw(starsdbc::SQLException, staruno::RuntimeException); + virtual void SAL_CALL insertRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL updateRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deleteRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancelRowUpdates() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL moveToInsertRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL moveToCurrentRow() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // com::sun::star::sdbcx::XDeleteRows - virtual staruno::Sequence< sal_Int32 > SAL_CALL deleteRows(const staruno::Sequence<staruno::Any>& rows) throw(starsdbc::SQLException, staruno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& rows) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // com::sun::star::lang::XServiceInfo - virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(staruno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getImplementationName() throw(staruno::RuntimeException); - virtual StringSequence SAL_CALL getSupportedServiceNames() throw(staruno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // com::sun::star::io::XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XSQLErrorListener - virtual void SAL_CALL errorOccured(const starsdb::SQLErrorEvent& aEvent) throw(staruno::RuntimeException); + virtual void SAL_CALL errorOccured(const ::com::sun::star::sdb::SQLErrorEvent& aEvent) throw(::com::sun::star::uno::RuntimeException); // com::sun::star::sdbc::XParameters - virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setLong(sal_Int32 parameterIndex, Hyper x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setString(sal_Int32 parameterIndex, const ::rtl::OUString& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const staruno::Sequence< sal_Int8 >& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const starutil::Date& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const starutil::Time& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const starutil::DateTime& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const staruno::Reference<stario::XInputStream>& x, sal_Int32 length) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const staruno::Reference<stario::XInputStream>& x, sal_Int32 length) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const staruno::Any& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const staruno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XRef>& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XBlob>& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XClob>& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const staruno::Reference<starsdbc::XArray>& x) throw(starsdbc::SQLException, staruno::RuntimeException); - virtual void SAL_CALL clearParameters() throw(starsdbc::SQLException, staruno::RuntimeException); - - inline void submitNBC( const staruno::Reference<starawt::XControl>& Control, const starawt::MouseEvent& MouseEvt ); + virtual void SAL_CALL setNull(sal_Int32 parameterIndex, sal_Int32 sqlType) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBoolean(sal_Int32 parameterIndex, sal_Bool x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setByte(sal_Int32 parameterIndex, sal_Int8 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setShort(sal_Int32 parameterIndex, sal_Int16 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInt(sal_Int32 parameterIndex, sal_Int32 x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLong(sal_Int32 parameterIndex, Hyper x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFloat(sal_Int32 parameterIndex, float x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDouble(sal_Int32 parameterIndex, double x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(sal_Int32 parameterIndex, const ::rtl::OUString& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBytes(sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDate(sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTime(sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTimestamp(sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBinaryStream(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setCharacterStream(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream>& x, sal_Int32 length) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObject(sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setObjectWithInfo(sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRef(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setBlob(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setClob(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setArray(sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray>& x) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearParameters() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + inline void submitNBC( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt ); protected: virtual void implInserted(const InterfaceRef& _rxObject); virtual void implRemoved(const InterfaceRef& _rxObject); // OPropertyChangeListener - virtual void _propertyChanged( const starbeans::PropertyChangeEvent& ) throw(staruno::RuntimeException); + virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); private: void executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bool bMoveToFirst = sal_True, - const staruno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = staruno::Reference< ::com::sun::star::task::XInteractionHandler >()); + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()); bool fillParameters(ReusableMutexGuard& _rClearForNotifies, - const staruno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = staruno::Reference< ::com::sun::star::task::XInteractionHandler >()); + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()); OParameterInfoImpl* createParameterInfo() const; bool hasValidParent() const; // if there are no parameter infos we now that we have a complete new statement to execute @@ -523,41 +527,41 @@ private: // impl methods void load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirst = sal_True, - const staruno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = staruno::Reference< ::com::sun::star::task::XInteractionHandler >()) - throw(staruno::RuntimeException); + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()) + throw(::com::sun::star::uno::RuntimeException); void reload_impl(sal_Bool bMoveToFirst, - const staruno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = staruno::Reference< ::com::sun::star::task::XInteractionHandler >()) - throw(staruno::RuntimeException); - void submit_impl(const staruno::Reference<starawt::XControl>& Control, const starawt::MouseEvent& MouseEvt, bool _bAproveByListeners); + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxCompletionHandler = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >()) + throw(::com::sun::star::uno::RuntimeException); + void submit_impl(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt, bool _bAproveByListeners); void reset_impl(bool _bAproveByListeners); sal_Bool implEnsureConnection(); // error handling - void onError(const starsdb::SQLErrorEvent& _rEvent); - void onError(starsdbc::SQLException&, const ::rtl::OUString& _rContextDescription); + void onError(const ::com::sun::star::sdb::SQLErrorEvent& _rEvent); + void onError(::com::sun::star::sdbc::SQLException&, const ::rtl::OUString& _rContextDescription); // html tools - ::rtl::OUString GetDataURLEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt); - ::rtl::OUString GetDataTextEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt); - staruno::Sequence<sal_Int8> GetDataMultiPartEncoded(const staruno::Reference<starawt::XControl>& SubmitButton, const starawt::MouseEvent& MouseEvt, + ::rtl::OUString GetDataURLEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + ::rtl::OUString GetDataTextEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); + ::com::sun::star::uno::Sequence<sal_Int8> GetDataMultiPartEncoded(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& SubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt, ::rtl::OUString& rContentType); - void AppendComponent(HtmlSuccessfulObjList& rList, const staruno::Reference<starbeans::XPropertySet>& xComponentSet, const ::rtl::OUString& rNamePrefix, - const staruno::Reference<starawt::XControl>& rxSubmitButton, const starawt::MouseEvent& MouseEvt); + void AppendComponent(HtmlSuccessfulObjList& rList, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xComponentSet, const ::rtl::OUString& rNamePrefix, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rxSubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); - void FillSuccessfulList(HtmlSuccessfulObjList& rList, const staruno::Reference<starawt::XControl>& rxSubmitButton, const starawt::MouseEvent& MouseEvt); + void FillSuccessfulList(HtmlSuccessfulObjList& rList, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rxSubmitButton, const ::com::sun::star::awt::MouseEvent& MouseEvt); void InsertTextPart(INetMIMEMessage& rParent, const ::rtl::OUString& rName, const ::rtl::OUString& rData); sal_Bool InsertFilePart(INetMIMEMessage& rParent, const ::rtl::OUString& rName, const ::rtl::OUString& rFileName); void Encode(::rtl::OUString& rString) const; - staruno::Reference< starsdbc::XConnection > getConnection(); + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(); DECL_LINK( OnTimeout, void* ); }; -inline void ODatabaseForm::submitNBC(const staruno::Reference<starawt::XControl>& Control, const starawt::MouseEvent& MouseEvt) +inline void ODatabaseForm::submitNBC(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& Control, const ::com::sun::star::awt::MouseEvent& MouseEvt) { submit_impl(Control, MouseEvt, sal_False); } diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx index 1585b5170da7..9acff48c0ea0 100644 --- a/forms/source/component/Date.cxx +++ b/forms/source/component/Date.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Date.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -86,21 +86,31 @@ using namespace dbtools; namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; //------------------------------------------------------------------ -ODateControl::ODateControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ODateControl::ODateControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_DATEFIELD) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL ODateControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL ODateControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new ODateControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> ODateControl::_getTypes() +Sequence<Type> ODateControl::_getTypes() { return OBoundControl::_getTypes(); } @@ -119,29 +129,29 @@ StringSequence SAL_CALL ODateControl::getSupportedServiceNames() throw() /*************************************************************************/ sal_Int32 ODateModel::nDateHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL ODateModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL ODateModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new ODateModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> ODateModel::_getTypes() +Sequence<Type> ODateModel::_getTypes() { return OEditBaseModel::_getTypes(); } //------------------------------------------------------------------ -ODateModel::ODateModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ODateModel::ODateModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_DATEFIELD, FRM_CONTROL_DATEFIELD ) // use the old control name for compytibility reasons { - m_nClassId = starform::FormComponentType::DATEFIELD; + m_nClassId = FormComponentType::DATEFIELD; m_sDataFieldConnectivityProperty = PROPERTY_DATE; if (ODateModel::nDateHandle == -1) ODateModel::nDateHandle = getOriginalHandle(PROPERTY_ID_DATE); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence SAL_CALL ODateModel::getSupportedServiceNames() throw() { @@ -160,22 +170,22 @@ StringSequence SAL_CALL ODateModel::getSupportedServiceNames() throw() return FRM_COMPONENT_DATEFIELD; // old (non-sun) name for compatibility ! } -// starbeans::XPropertySet +// XPropertySet //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL ODateModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL ODateModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void ODateModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(10) // Date auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_DATE, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_DATE, PropertyAttribute::TRANSIENT, 0); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); @@ -184,8 +194,8 @@ void ODateModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -196,9 +206,9 @@ void ODateModel::fillProperties( return *const_cast<ODateModel*>(this)->getArrayHelper(); } -// starform::XLoadListener +// XLoadListener //------------------------------------------------------------------------------ -void ODateModel::_loaded(const starlang::EventObject& rEvent) +void ODateModel::_loaded(const EventObject& rEvent) { OBoundControlModel::_loaded(rEvent); if (m_xField.is()) @@ -208,19 +218,19 @@ void ODateModel::_loaded(const starlang::EventObject& rEvent) { sal_Int32 nFieldType; m_xField->getPropertyValue(PROPERTY_FIELDTYPE) >>= nFieldType; - m_bDateTimeField = (nFieldType == starsdbc::DataType::TIMESTAMP); + m_bDateTimeField = (nFieldType == DataType::TIMESTAMP); } - catch(...) + catch(Exception&) { } } } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ sal_Bool ODateModel::_commit() { - staruno::Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( ODateModel::nDateHandle ); + Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( ODateModel::nDateHandle ); if (!compare(aNewValue, m_aSaveValue)) { if (!aNewValue.hasValue()) @@ -248,7 +258,7 @@ sal_Bool ODateModel::_commit() m_xColumnUpdate->updateTimestamp(aDateTime); } } - catch(...) + catch(Exception&) { return sal_False; } @@ -280,8 +290,8 @@ void ODateModel::_onValueChanged() //------------------------------------------------------------------------------ void ODateModel::_reset() { - staruno::Any aValue; - if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_LONG) + Any aValue; + if (m_aDefault.getValueType().getTypeClass() == TypeClass_LONG) aValue = m_aDefault; else { // aktuelles Datum einstellen diff --git a/forms/source/component/Date.hxx b/forms/source/component/Date.hxx index 65b079e077f3..75a768b64a44 100644 --- a/forms/source/component/Date.hxx +++ b/forms/source/component/Date.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Date.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -78,16 +78,16 @@ class ODateModel :public OEditBaseModel ,public ::comphelper::OAggregationArrayUsageHelper< ODateModel > { - staruno::Any m_aSaveValue; + ::com::sun::star::uno::Any m_aSaveValue; sal_Bool m_bDateTimeField; static sal_Int32 nDateHandle; protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - ODateModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ODateModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // starform::XBoundComponent virtual sal_Bool _commit(); @@ -95,24 +95,24 @@ public: // stario::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(ODateModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // starform::XReset virtual void _reset( void ); // starform::XLoadListener - virtual void _loaded(const starlang::EventObject& rEvent); + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -123,13 +123,13 @@ public: class ODateControl: public OBoundControl { protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - ODateControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ODateControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); DECLARE_UNO3_AGG_DEFAULTS(ODateControl, OBoundControl); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(ODateControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); }; diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 5ee5bbfa9f90..96e4c24a9b7a 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Edit.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2000-10-24 08:53:13 $ + * 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 @@ -115,59 +115,49 @@ using namespace dbtools; //......................................................................... namespace frm { -namespace staruno = ::com::sun::star::uno; -namespace starawt = ::com::sun::star::awt; -namespace starlang = ::com::sun::star::lang; -namespace starform = ::com::sun::star::form; -namespace starutil = ::com::sun::star::util; -namespace starbeans = ::com::sun::star::beans; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OEditControl_CreateInstance(const -com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & _rxFactory) +InterfaceRef SAL_CALL OEditControl_CreateInstance(const Reference< XMultiServiceFactory > & _rxFactory) { return *(new OEditControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OEditControl::_getTypes() +Sequence<Type> OEditControl::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my two base classes - staruno::Sequence<staruno::Type> aBaseClassTypes = OBoundControl::_getTypes(); - - staruno::Sequence<staruno::Type> aOwnTypes(3); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starawt::XFocusListener>*)NULL); - pOwnTypes[1] = getCppuType((staruno::Reference<starawt::XKeyListener>*)NULL); - pOwnTypes[2] = getCppuType((staruno::Reference<starform::XChangeBroadcaster>*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); + aTypes = concatSequences(OBoundControl::_getTypes(), OEditControl_BASE::getTypes()); } return aTypes; } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OEditControl::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OEditControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OBoundControl::queryAggregation(_rType); + Any aReturn = OBoundControl::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XFocusListener*>(this) - ,static_cast<starawt::XKeyListener*>(this) - ,static_cast<starform::XChangeBroadcaster*>(this) - ); + aReturn = OEditControl_BASE::queryInterface(_rType); return aReturn; } DBG_NAME(OEditControl); //------------------------------------------------------------------------------ -OEditControl::OEditControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OEditControl::OEditControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_EDIT) ,m_aChangeListeners(m_aMutex) ,m_nKeyEvent( 0 ) @@ -176,7 +166,7 @@ OEditControl::OEditControl(const staruno::Reference<starlang::XMultiServiceFacto increment(m_refCount); { // als FocusListener anmelden - staruno::Reference<starawt::XWindow> xComp; + Reference<XWindow> xComp; if (query_aggregation(m_xAggregate, xComp)) { xComp->addFocusListener(this); @@ -202,15 +192,15 @@ OEditControl::~OEditControl() DBG_DTOR(OEditControl,NULL); } -// starform::XChangeBroadcaster +// XChangeBroadcaster //------------------------------------------------------------------------------ -void OEditControl::addChangeListener(const staruno::Reference<starform::XChangeListener>& l) +void OEditControl::addChangeListener(const Reference<XChangeListener>& l) { m_aChangeListeners.addInterface( l ); } //------------------------------------------------------------------------------ -void OEditControl::removeChangeListener(const staruno::Reference<starform::XChangeListener>& l) +void OEditControl::removeChangeListener(const Reference<XChangeListener>& l) { m_aChangeListeners.removeInterface( l ); } @@ -221,11 +211,11 @@ void OEditControl::disposing() { OBoundControl::disposing(); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); m_aChangeListeners.disposeAndClear(aEvt); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OEditControl::getSupportedServiceNames() throw() { @@ -237,62 +227,62 @@ StringSequence OEditControl::getSupportedServiceNames() throw() return aSupported; } -// starlang::XEventListener +// XEventListener //------------------------------------------------------------------------------ -void OEditControl::disposing(const starlang::EventObject& Source) throw( staruno::RuntimeException ) +void OEditControl::disposing(const EventObject& Source) throw( RuntimeException ) { OBoundControl::disposing(Source); } -// starawt::XFocusListener +// XFocusListener //------------------------------------------------------------------------------ -void OEditControl::focusGained( const starawt::FocusEvent& e ) +void OEditControl::focusGained( const FocusEvent& e ) { - staruno::Reference<starbeans::XPropertySet> xSet(getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (xSet.is()) xSet->getPropertyValue( PROPERTY_TEXT ) >>= m_aHtmlChangeValue; } //------------------------------------------------------------------------------ -void OEditControl::focusLost( const starawt::FocusEvent& e ) +void OEditControl::focusLost( const FocusEvent& e ) { - staruno::Reference<starbeans::XPropertySet> xSet(getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (xSet.is()) { ::rtl::OUString sNewHtmlChangeValue; xSet->getPropertyValue( PROPERTY_TEXT ) >>= sNewHtmlChangeValue; if( sNewHtmlChangeValue != m_aHtmlChangeValue ) { - starlang::EventObject aEvt; + EventObject aEvt; aEvt.Source = *this; - NOTIFY_LISTENERS(m_aChangeListeners, starform::XChangeListener, changed, aEvt); + NOTIFY_LISTENERS(m_aChangeListeners, XChangeListener, changed, aEvt); } } } -// starawt::XKeyListener +// XKeyListener //------------------------------------------------------------------------------ -void OEditControl::keyPressed(const starawt::KeyEvent& e) +void OEditControl::keyPressed(const KeyEvent& e) { if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 ) return; - // Steht das Control in einem Formular mit einer Submit-starutil::URL? - staruno::Reference<starbeans::XPropertySet> xSet(getModel(), staruno::UNO_QUERY); + // Steht das Control in einem Formular mit einer Submit-URL? + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if( !xSet.is() ) return; // nicht fuer multiline edits - staruno::Any aTmp( xSet->getPropertyValue(PROPERTY_MULTILINE)); + Any aTmp( xSet->getPropertyValue(PROPERTY_MULTILINE)); if ((aTmp.getValueType().equals(::getBooleanCppuType())) && getBOOL(aTmp)) return; - staruno::Reference<starform::XFormComponent> xFComp(xSet, staruno::UNO_QUERY); + Reference<XFormComponent> xFComp(xSet, UNO_QUERY); InterfaceRef xParent = xFComp->getParent(); if( !xParent.is() ) return; - staruno::Reference<starbeans::XPropertySet> xFormSet(xParent, staruno::UNO_QUERY); + Reference<XPropertySet> xFormSet(xParent, UNO_QUERY); if( !xFormSet.is() ) return; @@ -301,17 +291,19 @@ void OEditControl::keyPressed(const starawt::KeyEvent& e) !getString(aTmp).getLength() ) return; - staruno::Reference<starcontainer::XIndexAccess> xElements(xParent, staruno::UNO_QUERY); + Reference<XIndexAccess> xElements(xParent, UNO_QUERY); sal_Int32 nCount = xElements->getCount(); if( nCount > 1 ) { + Reference<XPropertySet> xFCSet; for( sal_Int32 nIndex=0; nIndex < nCount; nIndex++ ) { - // staruno::Any aElement(xElements->getByIndex(nIndex)); - staruno::Reference<starbeans::XPropertySet> xFCSet(*(InterfaceRef *)xElements->getByIndex(nIndex).getValue(), staruno::UNO_QUERY); + // Any aElement(xElements->getByIndex(nIndex)); + xElements->getByIndex(nIndex) >>= xFCSet; + OSL_ENSHURE(xFCSet.is(),"OEditControl::keyPressed: No XPropertySet!"); if (hasProperty(PROPERTY_CLASSID, xFCSet) && - getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == starform::FormComponentType::TEXTFIELD) + getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD) { // Noch ein weiteres Edit gefunden ==> dann nicht submitten if (xFCSet != xSet) @@ -323,12 +315,11 @@ void OEditControl::keyPressed(const starawt::KeyEvent& e) // Da wir noch im Haender stehen, submit asynchron ausloesen if( m_nKeyEvent ) Application::RemoveUserEvent( m_nKeyEvent ); - m_nKeyEvent = Application::PostUserEvent( LINK(this, OEditControl, - OnKeyPressed) ); + m_nKeyEvent = Application::PostUserEvent( LINK(this, OEditControl,OnKeyPressed) ); } //------------------------------------------------------------------------------ -void OEditControl::keyReleased(const starawt::KeyEvent& e) +void OEditControl::keyReleased(const KeyEvent& e) { } @@ -337,11 +328,11 @@ IMPL_LINK(OEditControl, OnKeyPressed, void*, EMPTYARG) { m_nKeyEvent = 0; - staruno::Reference<starform::XFormComponent> xFComp(getModel(), staruno::UNO_QUERY); + Reference<XFormComponent> xFComp(getModel(), UNO_QUERY); InterfaceRef xParent = xFComp->getParent(); - staruno::Reference<starform::XSubmit> xSubmit(xParent, staruno::UNO_QUERY); + Reference<XSubmit> xSubmit(xParent, UNO_QUERY); if (xSubmit.is()) - xSubmit->submit( staruno::Reference<starawt::XControl>(), starawt::MouseEvent() ); + xSubmit->submit( Reference<XControl>(), MouseEvent() ); return 0L; } @@ -349,13 +340,13 @@ IMPL_LINK(OEditControl, OnKeyPressed, void*, EMPTYARG) sal_Int32 OEditModel::nTextHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OEditModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OEditModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OEditModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OEditModel::_getTypes() +Sequence<Type> OEditModel::_getTypes() { return OEditBaseModel::_getTypes(); } @@ -363,19 +354,19 @@ staruno::Sequence<staruno::Type> OEditModel::_getTypes() DBG_NAME(OEditModel); //------------------------------------------------------------------ -OEditModel::OEditModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OEditModel::OEditModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_EDIT, FRM_CONTROL_EDIT ) // use the old control name for compytibility reasons ,m_nMaxLen(0) ,m_aNullDate(DBTypeConversion::STANDARD_DB_DATE) - ,m_nKeyType(starutil::NumberFormat::UNDEFINED) + ,m_nKeyType(NumberFormat::UNDEFINED) ,m_nFormatKey(0) - ,m_nFieldType(starsdbc::DataType::OTHER) + ,m_nFieldType(DataType::OTHER) ,m_bWritingFormattedFake(sal_False) { DBG_CTOR(OEditModel,NULL); - m_nClassId = starform::FormComponentType::TEXTFIELD; + m_nClassId = FormComponentType::TEXTFIELD; m_sDataFieldConnectivityProperty = PROPERTY_TEXT; if (OEditModel::nTextHandle == -1) OEditModel::nTextHandle = getOriginalHandle(PROPERTY_ID_TEXT); @@ -400,14 +391,14 @@ void OEditModel::disposing() m_xFormatter = NULL; } -// stario::XPersistObject +// XPersistObject //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OEditModel::getServiceName() { return FRM_COMPONENT_EDIT; // old (non-sun) name for compatibility ! } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence SAL_CALL OEditModel::getSupportedServiceNames() throw() { @@ -416,26 +407,26 @@ StringSequence SAL_CALL OEditModel::getSupportedServiceNames() throw() ::rtl::OUString*pArray = aSupported.getArray(); pArray[aSupported.getLength()-1] = ::rtl::OUString::createFromAscii("com.sun.star.form.component.DatabaseTextField"); - pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_TEXTFIELD; + pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_TEXTFIELD; return aSupported; } -// starbeans::XPropertySet +// XPropertySet //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OEditModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OEditModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OEditModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(12) // Text auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, PropertyAttribute::TRANSIENT, 0); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); @@ -445,9 +436,9 @@ void OEditModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet,READONLY, TRANSIENT); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet,READONLY, TRANSIENT); DECL_BOOL_PROP2(FILTERPROPOSAL, BOUND, MAYBEDEFAULT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet,BOUND, MAYBEVOID); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet,BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -459,9 +450,9 @@ void OEditModel::fillProperties( } //------------------------------------------------------------------------------ -void OEditModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OEditModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { - staruno::Any aCurrentText; + Any aCurrentText; // bin ich gerade loaded und habe dazu zeitweilig die MaxTextLen umgesetzt ? if (m_nMaxLen) { // -> fuer die Dauer des Speicherns meinem aggregierten Model die alte TextLen einreden @@ -470,25 +461,25 @@ void OEditModel::write(const staruno::Reference<stario::XObjectOutputStream>& _r // FS - 08.12.99 - 70606 aCurrentText = m_xAggregateSet->getPropertyValue(PROPERTY_TEXT); - m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, staruno::makeAny((sal_Int16)0)); + m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, makeAny((sal_Int16)0)); } OEditBaseModel::write(_rxOutStream); if (m_nMaxLen) { // wieder zuruecksetzen - m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, staruno::makeAny((sal_Int16)m_nMaxLen)); + m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, makeAny((sal_Int16)m_nMaxLen)); // and reset the text // First we set it to an empty string : Without this the second setPropertyValue would not do anything as it thinks // we aren't changing the prop (it didn't notify the - implicite - change of the text prop while setting the max text len) // This seems to be a bug with in toolkit's EditControl-implementation. - m_xAggregateSet->setPropertyValue(PROPERTY_TEXT, staruno::makeAny(::rtl::OUString())); + m_xAggregateSet->setPropertyValue(PROPERTY_TEXT, makeAny(::rtl::OUString())); m_xAggregateSet->setPropertyValue(PROPERTY_TEXT, aCurrentText); } } //------------------------------------------------------------------------------ -void OEditModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OEditModel::read(const Reference<XObjectInputStream>& _rxInStream) { OEditBaseModel::read(_rxInStream); @@ -497,12 +488,12 @@ void OEditModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxI // correct this ... if (m_xAggregateSet.is()) { - staruno::Any aDefaultControl = m_xAggregateSet->getPropertyValue(PROPERTY_DEFAULTCONTROL); - if ( (aDefaultControl.getValueType().getTypeClass() == staruno::TypeClass_STRING) + Any aDefaultControl = m_xAggregateSet->getPropertyValue(PROPERTY_DEFAULTCONTROL); + if ( (aDefaultControl.getValueType().getTypeClass() == TypeClass_STRING) && (getString(aDefaultControl).compareTo(FRM_CONTROL_TEXTFIELD) == COMPARE_EQUAL) ) { - m_xAggregateSet->setPropertyValue(PROPERTY_DEFAULTCONTROL, staruno::makeAny(::rtl::OUString(FRM_CONTROL_EDIT))); + m_xAggregateSet->setPropertyValue(PROPERTY_DEFAULTCONTROL, makeAny(::rtl::OUString(FRM_CONTROL_EDIT))); // Older as well as current versions should understand this : the former knew only the FRM_CONTROL_EDIT, // the latter are registered for both FRM_CONTROL_EDIT and FRM_CONTROL_TEXTFIELD. } @@ -520,9 +511,9 @@ sal_Int16 OEditModel::getPersistenceFlags() const return nFlags; } -// starform::XLoadListener +// XLoadListener //------------------------------------------------------------------------------ -void OEditModel::_loaded(const starlang::EventObject& rEvent) +void OEditModel::_loaded(const EventObject& rEvent) { if (m_xField.is()) { @@ -530,14 +521,14 @@ void OEditModel::_loaded(const starlang::EventObject& rEvent) m_nFieldType = getINT32(m_xField->getPropertyValue(PROPERTY_FIELDTYPE)); m_nFormatKey = getINT32(m_xField->getPropertyValue(PROPERTY_FORMATKEY)); - // starutil::XNumberFormatter besorgen - staruno::Reference<starsdbc::XRowSet> xRowSet(rEvent.Source, staruno::UNO_QUERY); + // XNumberFormatter besorgen + Reference<XRowSet> xRowSet(rEvent.Source, UNO_QUERY); DBG_ASSERT(xRowSet.is(), "OEditModel::_loaded : source is not a row set ?"); - staruno::Reference<starutil::XNumberFormatsSupplier> xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); + Reference<XNumberFormatsSupplier> xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); if (xSupplier.is()) { - m_xFormatter = staruno::Reference<starutil::XNumberFormatter>(m_xServiceFactory - ->createInstance(FRM_NUMBER_FORMATTER), staruno::UNO_QUERY); + m_xFormatter = Reference<XNumberFormatter>(m_xServiceFactory + ->createInstance(FRM_NUMBER_FORMATTER), UNO_QUERY); if (m_xFormatter.is()) m_xFormatter->attachNumberFormatsSupplier(xSupplier); @@ -546,7 +537,7 @@ void OEditModel::_loaded(const starlang::EventObject& rEvent) >>= m_aNullDate; } - if (m_nKeyType != starutil::NumberFormat::SCIENTIFIC) + if (m_nKeyType != NumberFormat::SCIENTIFIC) { m_nMaxLen = getINT16(m_xAggregateSet->getPropertyValue(PROPERTY_MAXTEXTLEN)); if (!m_nMaxLen) @@ -556,7 +547,7 @@ void OEditModel::_loaded(const starlang::EventObject& rEvent) if (nFieldLen && nFieldLen <= USHRT_MAX) { - staruno::Any aVal; + Any aVal; aVal <<= (sal_Int16)nFieldLen; m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, aVal); @@ -577,16 +568,16 @@ void OEditModel::_unloaded() { if (m_nMaxLen) { - staruno::Any aVal; + Any aVal; aVal <<= (sal_Int16)0; // nur wenn es 0 war, habe ich es in _loaded umgesetzt m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, aVal); m_nMaxLen = 0; } m_xFormatter = 0; - m_nFieldType = starsdbc::DataType::OTHER; + m_nFieldType = DataType::OTHER; m_nFormatKey = 0; - m_nKeyType = starutil::NumberFormat::UNDEFINED; + m_nKeyType = NumberFormat::UNDEFINED; m_aNullDate = DBTypeConversion::STANDARD_DB_DATE; } } @@ -607,7 +598,7 @@ sal_Bool OEditModel::_commit() DBTypeConversion::setValue(m_xColumnUpdate, m_xFormatter, m_aNullDate, aNewValue, m_nFormatKey, m_nFieldType, m_nKeyType); } - catch(...) + catch(Exception&) { return sal_False; } @@ -617,7 +608,7 @@ sal_Bool OEditModel::_commit() return sal_True; } -// starbeans::XPropertyChangeListener +// XPropertyChangeListener //------------------------------------------------------------------------------ void OEditModel::_onValueChanged() { @@ -635,10 +626,10 @@ void OEditModel::_onValueChanged() m_nFormatKey, m_nKeyType); - m_xAggregateFastSet->setFastPropertyValue(OEditModel::nTextHandle, staruno::makeAny(m_aSaveValue)); + m_xAggregateFastSet->setFastPropertyValue(OEditModel::nTextHandle, makeAny(m_aSaveValue)); } -// starform::XReset +// XReset //------------------------------------------------------------------------------ void OEditModel::_reset() { @@ -647,7 +638,7 @@ void OEditModel::_reset() // our own mutex locked // FS - 72451 - 31.01.00 MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OEditModel::nTextHandle, staruno::makeAny(m_aDefaultText)); + m_xAggregateFastSet->setFastPropertyValue(OEditModel::nTextHandle, makeAny(m_aDefaultText)); } } diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx index 8c8e5bb9949a..9e41c3854738 100644 --- a/forms/source/component/Edit.hxx +++ b/forms/source/component/Edit.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Edit.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -65,6 +65,9 @@ #ifndef _FORMS_EDITBASE_HXX_ #include "EditBase.hxx" #endif +#ifndef _CPPUHELPER_IMPLBASE3_HXX_ +#include <cppuhelper/implbase3.hxx> +#endif //......................................................................... namespace frm @@ -77,10 +80,10 @@ class OEditModel :public OEditBaseModel ,public ::comphelper::OAggregationArrayUsageHelper< OEditModel > { - staruno::Reference<starutil::XNumberFormatter> m_xFormatter; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> m_xFormatter; ::rtl::OUString m_aSaveValue; sal_Int32 m_nFormatKey; - starutil::Date m_aNullDate; + ::com::sun::star::util::Date m_aNullDate; sal_Int32 m_nFieldType; sal_Int16 m_nKeyType; sal_Int16 m_nMaxLen; @@ -92,49 +95,49 @@ class OEditModel protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); - OEditModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OEditModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OEditModel(); void enableFormattedWriteFake() { m_bWritingFormattedFake = sal_True; } void disableFormattedWriteFake() { m_bWritingFormattedFake = sal_False; } sal_Bool lastReadWasFormattedFake() const { return (getLastReadVersion() & PF_FAKE_FORMATTED_FIELD) != 0; } - friend InterfaceRef SAL_CALL OEditModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + friend InterfaceRef SAL_CALL OEditModel_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); friend class OFormattedFieldWrapper; friend class OFormattedModel; // temporary public: virtual void SAL_CALL disposing(); -// starform::XBoundComponent +// ::com::sun::star::form::XBoundComponent virtual sal_Bool _commit(); -// stario::XPersistObject - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); +// ::com::sun::star::io::XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); virtual ::rtl::OUString SAL_CALL getServiceName(); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OEditModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// starform::XLoadListener - virtual void _loaded(const starlang::EventObject& rEvent); +// ::com::sun::star::form::XLoadListener + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); virtual void _unloaded(); -// starform::XReset +// ::com::sun::star::form::XReset virtual void _reset(); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() @@ -145,10 +148,12 @@ protected: //================================================================== //= OEditControl //================================================================== +typedef ::cppu::ImplHelper3< ::com::sun::star::awt::XFocusListener, + ::com::sun::star::awt::XKeyListener, + ::com::sun::star::form::XChangeBroadcaster > OEditControl_BASE; + class OEditControl : public OBoundControl - ,public starawt::XFocusListener - ,public starawt::XKeyListener - ,public starform::XChangeBroadcaster + ,public OEditControl_BASE { ::cppu::OInterfaceContainerHelper m_aChangeListeners; @@ -157,35 +162,35 @@ class OEditControl : public OBoundControl sal_uInt32 m_nKeyEvent; public: - OEditControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OEditControl(); DECLARE_UNO3_AGG_DEFAULTS(OEditControl, OBoundControl); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); // OComponentHelper virtual void SAL_CALL disposing(); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException); +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OEditControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// starform::XChangeBroadcaster - virtual void SAL_CALL addChangeListener(const staruno::Reference<starform::XChangeListener>& _rxListener); - virtual void SAL_CALL removeChangeListener(const staruno::Reference<starform::XChangeListener>& _rxListener); +// ::com::sun::star::form::XChangeBroadcaster + virtual void SAL_CALL addChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener); + virtual void SAL_CALL removeChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener); -// starawt::XFocusListener - virtual void SAL_CALL focusGained( const starawt::FocusEvent& e ); - virtual void SAL_CALL focusLost( const starawt::FocusEvent& e ); +// ::com::sun::star::awt::XFocusListener + virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ); + virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ); -// starawt::XKeyListener - virtual void SAL_CALL keyPressed(const starawt::KeyEvent& e); - virtual void SAL_CALL keyReleased(const starawt::KeyEvent& e); +// ::com::sun::star::awt::XKeyListener + virtual void SAL_CALL keyPressed(const ::com::sun::star::awt::KeyEvent& e); + virtual void SAL_CALL keyReleased(const ::com::sun::star::awt::KeyEvent& e); private: DECL_LINK( OnKeyPressed, void* ); diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx index 8e8bb5d761b7..ca21734d2986 100644 --- a/forms/source/component/EditBase.cxx +++ b/forms/source/component/EditBase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EditBase.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -87,6 +87,17 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; const sal_uInt16 DEFAULT_LONG = 0x0001; const sal_uInt16 DEFAULT_DOUBLE = 0x0002; @@ -94,7 +105,7 @@ const sal_uInt16 FILTERPROPOSAL = 0x0004; //------------------------------------------------------------------ OEditBaseModel::OEditBaseModel( - const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, + const Reference<XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& rUnoControlModelName, const ::rtl::OUString& rDefault ) :OBoundControlModel( _rxFactory, rUnoControlModelName, rDefault ) @@ -104,9 +115,9 @@ OEditBaseModel::OEditBaseModel( { } -// stario::XPersist +// XPersist //------------------------------------------------------------------------------ -void OEditBaseModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OEditBaseModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { OBoundControlModel::write(_rxOutStream); @@ -125,9 +136,9 @@ void OEditBaseModel::write(const staruno::Reference<stario::XObjectOutputStream> // Maskierung fuer any sal_uInt16 nAnyMask = 0; - if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_LONG) + if (m_aDefault.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= DEFAULT_LONG; - else if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_DOUBLE) + else if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE) nAnyMask |= DEFAULT_DOUBLE; if (m_bFilterProposal) // da boolean, kein Wert speichern @@ -164,7 +175,7 @@ sal_Int16 OEditBaseModel::getPersistenceFlags() const } //------------------------------------------------------------------------------ -void OEditBaseModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OEditBaseModel::read(const Reference<XObjectInputStream>& _rxInStream) { OBoundControlModel::read(_rxInStream); ::osl::MutexGuard aGuard(m_aMutex); @@ -219,11 +230,11 @@ void OEditBaseModel::defaultCommonEditProperties() } //------------------------------------------------------------------------------ -void OEditBaseModel::readCommonEditProperties(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OEditBaseModel::readCommonEditProperties(const Reference<XObjectInputStream>& _rxInStream) { sal_Int32 nLen = _rxInStream->readLong(); - staruno::Reference<stario::XMarkableStream> xMark(_rxInStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY); DBG_ASSERT(xMark.is(), "OBoundControlModel::readCommonProperties : can only work with markable streams !"); sal_Int32 nMark = xMark->createMark(); @@ -239,9 +250,9 @@ void OEditBaseModel::readCommonEditProperties(const staruno::Reference<stario::X } //------------------------------------------------------------------------------ -void OEditBaseModel::writeCommonEditProperties(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OEditBaseModel::writeCommonEditProperties(const Reference<XObjectOutputStream>& _rxOutStream) { - staruno::Reference<stario::XMarkableStream> xMark(_rxOutStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY); DBG_ASSERT(xMark.is(), "OEditBaseModel::writeCommonProperties : can only work with markable streams !"); sal_Int32 nMark = xMark->createMark(); @@ -263,7 +274,7 @@ void OEditBaseModel::writeCommonEditProperties(const staruno::Reference<stario:: } //------------------------------------------------------------------------------ -void OEditBaseModel::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHandle ) const +void OEditBaseModel::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { switch (nHandle) { @@ -287,8 +298,8 @@ void OEditBaseModel::getFastPropertyValue( staruno::Any& rValue, sal_Int32 nHand } //------------------------------------------------------------------------------ -sal_Bool OEditBaseModel::convertFastPropertyValue( staruno::Any& rConvertedValue, staruno::Any& rOldValue, - sal_Int32 nHandle, const staruno::Any& rValue ) throw( starlang::IllegalArgumentException ) +sal_Bool OEditBaseModel::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, + sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) { sal_Bool bModified(sal_False); switch (nHandle) @@ -320,21 +331,21 @@ sal_Bool OEditBaseModel::convertFastPropertyValue( staruno::Any& rConvertedValue } //------------------------------------------------------------------------------ -void OEditBaseModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) +void OEditBaseModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) { switch (nHandle) { case PROPERTY_ID_EMPTY_IS_NULL: - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN, "invalid type" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, "invalid type" ); m_bEmptyIsNull = getBOOL(rValue); break; case PROPERTY_ID_FILTERPROPOSAL: - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN, "invalid type" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, "invalid type" ); m_bFilterProposal = getBOOL(rValue); break; // Aenderung der defaultwerte fuehrt zu reset case PROPERTY_ID_DEFAULT_TEXT: - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "invalid type" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" ); rValue >>= m_aDefaultText; _reset(); break; @@ -351,30 +362,30 @@ void OEditBaseModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const //XPropertyState //------------------------------------------------------------------------------ -starbeans::PropertyState OEditBaseModel::getPropertyStateByHandle(sal_Int32 nHandle) +PropertyState OEditBaseModel::getPropertyStateByHandle(sal_Int32 nHandle) { - starbeans::PropertyState eState; + PropertyState eState; switch (nHandle) { case PROPERTY_ID_DEFAULT_TEXT: if (!m_aDefaultText.len()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; else - eState = starbeans::PropertyState_DIRECT_VALUE; + eState = PropertyState_DIRECT_VALUE; break; case PROPERTY_ID_FILTERPROPOSAL: if (!m_bFilterProposal) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; else - eState = starbeans::PropertyState_DIRECT_VALUE; + eState = PropertyState_DIRECT_VALUE; break; case PROPERTY_ID_DEFAULT_VALUE: case PROPERTY_ID_DEFAULT_DATE: case PROPERTY_ID_DEFAULT_TIME: if (!m_aDefault.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; else - eState = starbeans::PropertyState_DIRECT_VALUE; + eState = PropertyState_DIRECT_VALUE; break; default: eState = OBoundControlModel::getPropertyStateByHandle(nHandle); @@ -388,15 +399,15 @@ void OEditBaseModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) switch (nHandle) { case PROPERTY_ID_DEFAULT_TEXT: - setFastPropertyValue(nHandle, staruno::makeAny(::rtl::OUString())); + setFastPropertyValue(nHandle, makeAny(::rtl::OUString())); break; case PROPERTY_ID_FILTERPROPOSAL: - setFastPropertyValue(nHandle, staruno::makeAny((sal_Bool)sal_False)); + setFastPropertyValue(nHandle, makeAny((sal_Bool)sal_False)); break; case PROPERTY_ID_DEFAULT_VALUE: case PROPERTY_ID_DEFAULT_DATE: case PROPERTY_ID_DEFAULT_TIME: - setFastPropertyValue(nHandle, staruno::Any()); + setFastPropertyValue(nHandle, Any()); break; default: OBoundControlModel::setPropertyToDefaultByHandle(nHandle); @@ -404,20 +415,20 @@ void OEditBaseModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) } //------------------------------------------------------------------------------ -staruno::Any OEditBaseModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const +Any OEditBaseModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const { switch (nHandle) { case PROPERTY_ID_DEFAULT_TEXT: - return staruno::makeAny(::rtl::OUString()); + return makeAny(::rtl::OUString()); break; case PROPERTY_ID_FILTERPROPOSAL: - return staruno::Any(staruno::makeAny((sal_Bool)sal_False)); + return Any(makeAny((sal_Bool)sal_False)); break; case PROPERTY_ID_DEFAULT_VALUE: case PROPERTY_ID_DEFAULT_DATE: case PROPERTY_ID_DEFAULT_TIME: - return staruno::Any(); + return Any(); default: return OBoundControlModel::getPropertyDefaultByHandle(nHandle); } diff --git a/forms/source/component/EditBase.hxx b/forms/source/component/EditBase.hxx index 87e40a3a3523..3d431306ba50 100644 --- a/forms/source/component/EditBase.hxx +++ b/forms/source/component/EditBase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: EditBase.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -72,13 +72,27 @@ #include <tools/link.hxx> #endif +#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include <com/sun/star/util/XNumberFormatter.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XFOCUSLISTENER_HPP_ #include <com/sun/star/awt/XFocusListener.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XKEYLISTENER_HPP_ #include <com/sun/star/awt/XKeyListener.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ #include <com/sun/star/form/XChangeBroadcaster.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_ #include <com/sun/star/lang/XEventListener.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ #include <com/sun/star/lang/XComponent.hpp> +#endif // persistence flags for use with the version id #define PF_HANDLE_COMMON_PROPS 0x8000 @@ -109,7 +123,7 @@ class OEditBaseModel : public OBoundControlModel protected: // [properties] fuer all Editierfelder - staruno::Any m_aDefault; + ::com::sun::star::uno::Any m_aDefault; ::rtl::OUString m_aDefaultText; // Defaultwert sal_Bool m_bEmptyIsNull : 1; // LeerString ist NULL sal_Bool m_bFilterProposal : 1; // use a list of possible value in filtermode @@ -119,30 +133,30 @@ protected: public: OEditBaseModel( - const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& rUnoControlModelName, const ::rtl::OUString& rDefault ); -// stario::XPersistObject - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); +// ::com::sun::star::io::XPersistObject + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); -// starbeans::XPropertySet - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - 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); +// ::com::sun::star::beans::XPropertySet + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); -// starbeans::XPropertyState - virtual starbeans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); - virtual staruno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const; protected: // new properties common to all edit models should be handled with the following two methods - void SAL_CALL readCommonEditProperties(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); - void SAL_CALL writeCommonEditProperties(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); + void SAL_CALL readCommonEditProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); + void SAL_CALL writeCommonEditProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); void defaultCommonEditProperties(); virtual sal_Int16 getPersistenceFlags() const; diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index e7e538a92e2d..b33becaafeb1 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EventThread.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -71,6 +71,10 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::lang; + OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImpl ) : m_pCompImpl( pCompImpl ) @@ -79,13 +83,13 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp // Eine Referenz des Controls halten { - InterfaceRef xIFace(static_cast<staruno::XWeak*>(pCompImpl)); + InterfaceRef xIFace(static_cast<XWeak*>(pCompImpl)); query_interface(xIFace, m_xComp); } // und uns an dem Control anmelden { - staruno::Reference<starlang::XEventListener> xEvtLstnr = static_cast<starlang::XEventListener*>(this); + Reference<XEventListener> xEvtLstnr = static_cast<XEventListener*>(this); m_xComp->addEventListener( xEvtLstnr ); } @@ -100,28 +104,28 @@ OComponentEventThread::~OComponentEventThread() delete *m_aEvents.erase(m_aEvents.begin()); } -staruno::Any SAL_CALL OComponentEventThread::queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) +Any SAL_CALL OComponentEventThread::queryInterface(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; + Any aReturn; aReturn = OWeakObject::queryInterface(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType, - static_cast<starlang::XEventListener*>(this) + static_cast<XEventListener*>(this) ); return aReturn; } -void OComponentEventThread::disposing( const starlang::EventObject& evt ) +void OComponentEventThread::disposing( const EventObject& evt ) { if( evt.Source == m_xComp ) { ::osl::MutexGuard aGuard( m_aMutex ); // Event-Listener abmelden - staruno::Reference<starlang::XEventListener> xEvtLstnr = static_cast<starlang::XEventListener*>(this); + Reference<XEventListener> xEvtLstnr = static_cast<XEventListener*>(this); m_xComp->removeEventListener( xEvtLstnr ); // Event-Queue loeschen @@ -141,14 +145,14 @@ void OComponentEventThread::disposing( const starlang::EventObject& evt ) } } -void OComponentEventThread::addEvent( const starlang::EventObject* _pEvt, sal_Bool bFlag ) +void OComponentEventThread::addEvent( const EventObject* _pEvt, sal_Bool bFlag ) { - staruno::Reference<starawt::XControl> xTmp; + Reference<XControl> xTmp; addEvent( _pEvt, xTmp, bFlag ); } -void OComponentEventThread::addEvent( const starlang::EventObject* _pEvt, - const staruno::Reference<starawt::XControl>& rControl, +void OComponentEventThread::addEvent( const EventObject* _pEvt, + const Reference<XControl>& rControl, sal_Bool bFlag ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -156,8 +160,8 @@ void OComponentEventThread::addEvent( const starlang::EventObject* _pEvt, // Daten in die Queue stellen m_aEvents.push_back( cloneEvent( _pEvt ) ); - staruno::Reference<staruno::XWeak> xWeakControl(rControl, staruno::UNO_QUERY); - staruno::Reference<staruno::XAdapter> xControlAdapter = xWeakControl.is() ? xWeakControl->queryAdapter() : staruno::Reference<staruno::XAdapter>(); + Reference<XWeak> xWeakControl(rControl, UNO_QUERY); + Reference<XAdapter> xControlAdapter = xWeakControl.is() ? xWeakControl->queryAdapter() : Reference<XAdapter>(); m_aControls.push_back( xControlAdapter ); m_aFlags.push_back( bFlag ); @@ -170,7 +174,7 @@ void OComponentEventThread::run() { // uns selbst festhalten, damit wir nicht geloescht werden, // wenn zwischendrinne mal ein dispose gerufen wird. - InterfaceRef xThis(static_cast<staruno::XWeak*>(this)); + InterfaceRef xThis(static_cast<XWeak*>(this)); do { @@ -180,18 +184,18 @@ void OComponentEventThread::run() { // Das Control holen und festhalten, damit es waehrend des // actionPerformed nicht geloescht werden kann. - staruno::Reference<starlang::XComponent> xComp = m_xComp; + Reference<XComponent> xComp = m_xComp; ::cppu::OComponentHelper *pCompImpl = m_pCompImpl; - starlang::EventObject* pEvt = *m_aEvents.erase( m_aEvents.begin() ); - staruno::Reference<staruno::XAdapter> xControlAdapter = *m_aControls.erase( m_aControls.begin() ); + EventObject* pEvt = *m_aEvents.erase( m_aEvents.begin() ); + Reference<XAdapter> xControlAdapter = *m_aControls.erase( m_aControls.begin() ); sal_Bool bFlag = *m_aFlags.erase( m_aFlags.begin() ); { MutexRelease aReleaseOnce(m_aMutex); - // Weil ein queryHardRef eine staruno::Exception schmeissen kann sollte + // Weil ein queryHardRef eine Exception schmeissen kann sollte // es nicht bei gelocktem Mutex aufgerufen werden. - staruno::Reference<starawt::XControl> xControl; + Reference<XControl> xControl; if ( xControlAdapter.is() ) query_interface(xControlAdapter->queryAdapted(), xControl); diff --git a/forms/source/component/EventThread.hxx b/forms/source/component/EventThread.hxx index deaae8911e1d..f50bff59a488 100644 --- a/forms/source/component/EventThread.hxx +++ b/forms/source/component/EventThread.hxx @@ -2,9 +2,9 @@ * * $RCSfile: EventThread.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -92,19 +92,16 @@ namespace frm { //......................................................................... - namespace starlang = ::com::sun::star::lang; - namespace staruno = ::com::sun::star::uno; - // *************************************************************************************************** // *************************************************************************************************** class OComponentEventThread :public ::vos::OThread - ,public starlang::XEventListener + ,public ::com::sun::star::lang::XEventListener ,public ::cppu::OWeakObject { - DECLARE_STL_VECTOR(starlang::EventObject*, ThreadEvents); - DECLARE_STL_VECTOR(staruno::Reference<staruno::XAdapter> , ThreadObjects); + DECLARE_STL_VECTOR(::com::sun::star::lang::EventObject*, ThreadEvents); + DECLARE_STL_VECTOR(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAdapter> , ThreadObjects); DECLARE_STL_VECTOR(sal_Bool, ThreadBools); OCountedMutex m_aMutex; @@ -114,7 +111,7 @@ class OComponentEventThread ThreadBools m_aFlags; // Flags fuer Submit/Reset ::cppu::OComponentHelper* m_pCompImpl; // Implementierung des Controls - staruno::Reference<starlang::XComponent> m_xComp; // starlang::XComponent des Controls + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xComp; // ::com::sun::star::lang::XComponent des Controls protected: @@ -123,7 +120,7 @@ protected: // Die folgende Methode wird gerufen um das Event unter Beruecksichtigung // seines Typs zu duplizieren. - virtual starlang::EventObject* cloneEvent(const starlang::EventObject* _pEvt) const = 0; + virtual ::com::sun::star::lang::EventObject* cloneEvent(const ::com::sun::star::lang::EventObject* _pEvt) const = 0; // Ein Event bearbeiten. Der Mutex ist dabei nicht gelockt, pCompImpl // bleibt aber in jedem Fall gueltig. Bei pEvt kann es sich auch um @@ -132,25 +129,25 @@ protected: // Control uebergeben wurde. Da das Control nur als WeakRef gehalten // wird kann es auch zwischenzeitlich verschwinden. virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl, - const starlang::EventObject* _pEvt, - const staruno::Reference<starawt::XControl>& _rControl, + const ::com::sun::star::lang::EventObject* _pEvt, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& _rControl, sal_Bool _bFlag) = 0; public: // UNO Anbindung DECLARE_UNO3_DEFAULTS(OComponentEventThread, OWeakObject); - virtual staruno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); OComponentEventThread(::cppu::OComponentHelper* pCompImpl); virtual ~OComponentEventThread(); - void addEvent( const starlang::EventObject* _pEvt, sal_Bool bFlag = sal_False ); - void addEvent( const starlang::EventObject* _pEvt, const staruno::Reference<starawt::XControl>& rControl, + void addEvent( const ::com::sun::star::lang::EventObject* _pEvt, sal_Bool bFlag = sal_False ); + void addEvent( const ::com::sun::star::lang::EventObject* _pEvt, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& rControl, sal_Bool bFlag = sal_False ); - // starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource ); + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource ); /* resolve ambiguity : both OWeakObject and OObject have these memory operators */ void * SAL_CALL operator new( size_t size ) throw() { return OThread::operator new(size); } diff --git a/forms/source/component/File.cxx b/forms/source/component/File.cxx index 691f8e58126d..4dc4ac2c8c59 100644 --- a/forms/source/component/File.cxx +++ b/forms/source/component/File.cxx @@ -2,9 +2,9 @@ * * $RCSfile: File.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -84,25 +84,36 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFileControlModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFileControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFileControlModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OFileControlModel::_getTypes() +Sequence<Type> OFileControlModel::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my base class - staruno::Sequence<staruno::Type> aBaseClassTypes = OControlModel::_getTypes(); + Sequence<Type> aBaseClassTypes = OControlModel::_getTypes(); - staruno::Sequence<staruno::Type> aOwnTypes(1); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starform::XReset>*)NULL); + Sequence<Type> aOwnTypes(1); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference<XReset>*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -110,9 +121,9 @@ staruno::Sequence<staruno::Type> OFileControlModel::_getTypes() } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ -StringSequence OFileControlModel::getSupportedServiceNames() throw(staruno::RuntimeException) +StringSequence OFileControlModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); @@ -123,11 +134,11 @@ StringSequence OFileControlModel::getSupportedServiceNames() throw(staruno::Run } //------------------------------------------------------------------ -OFileControlModel::OFileControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OFileControlModel::OFileControlModel(const Reference<XMultiServiceFactory>& _rxFactory) :OControlModel(_rxFactory, VCL_CONTROLMODEL_FILECONTROL) ,m_aResetListeners(m_aMutex) { - m_nClassId = starform::FormComponentType::FILECONTROL; + m_nClassId = FormComponentType::FILECONTROL; } //------------------------------------------------------------------ @@ -141,14 +152,12 @@ OFileControlModel::~OFileControlModel() } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OFileControlModel::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OFileControlModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OControlModel::queryAggregation(_rType); + Any aReturn = OControlModel::queryAggregation(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType - ,static_cast<starform::XReset*>(this) + ,static_cast<XReset*>(this) ); return aReturn; @@ -160,12 +169,12 @@ void OFileControlModel::disposing() { OControlModel::disposing(); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); m_aResetListeners.disposeAndClear(aEvt); } //------------------------------------------------------------------------------ -void OFileControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const +void OFileControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { switch (nHandle) { @@ -176,12 +185,12 @@ void OFileControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHa } //------------------------------------------------------------------------------ -void OFileControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const staruno::Any& rValue) +void OFileControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) { switch (nHandle) { case PROPERTY_ID_DEFAULT_TEXT : - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "OFileControlModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "OFileControlModel::setFastPropertyValue_NoBroadcast : invalid type !" ); rValue >>= m_sDefaultValue; break; default: @@ -190,8 +199,8 @@ void OFileControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons } //------------------------------------------------------------------------------ -sal_Bool OFileControlModel::convertFastPropertyValue(staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue) - throw( starlang::IllegalArgumentException ) +sal_Bool OFileControlModel::convertFastPropertyValue(Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) + throw( IllegalArgumentException ) { switch (nHandle) { @@ -203,16 +212,16 @@ sal_Bool OFileControlModel::convertFastPropertyValue(staruno::Any& rConvertedVal } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OFileControlModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OFileControlModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OFileControlModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(6) DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); @@ -223,7 +232,7 @@ void OFileControlModel::fillProperties( DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); // in den agregierten Properties muss ich noch PROPERTY_ID_TEXT auf transient setzen ... -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, PropertyAttribute::TRANSIENT, 0); FRM_END_PROP_HELPER(); } @@ -240,7 +249,7 @@ void OFileControlModel::fillProperties( } //------------------------------------------------------------------------------ -void OFileControlModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OFileControlModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) { OControlModel::write(_rxOutStream); @@ -254,7 +263,7 @@ void OFileControlModel::write(const staruno::Reference<stario::XObjectOutputStre } //------------------------------------------------------------------------------ -void OFileControlModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OFileControlModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) { OControlModel::read(_rxInStream); ::osl::MutexGuard aGuard(m_aMutex); @@ -283,10 +292,10 @@ void OFileControlModel::read(const staruno::Reference<stario::XObjectInputStream void SAL_CALL OFileControlModel::reset() { ::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); sal_Bool bContinue = sal_True; while (aIter.hasMoreElements() && bContinue) - bContinue =((starform::XResetListener*)aIter.next())->approveReset(aEvt); + bContinue =((XResetListener*)aIter.next())->approveReset(aEvt); if (bContinue) { @@ -295,18 +304,18 @@ void SAL_CALL OFileControlModel::reset() ::osl::MutexGuard aGuard(m_aMutex); _reset(); } - NOTIFY_LISTENERS(m_aResetListeners, starform::XResetListener, resetted, aEvt); + NOTIFY_LISTENERS(m_aResetListeners, XResetListener, resetted, aEvt); } } //----------------------------------------------------------------------------- -void OFileControlModel::addResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) +void OFileControlModel::addResetListener(const Reference<XResetListener>& _rxListener) { m_aResetListeners.addInterface(_rxListener); } //----------------------------------------------------------------------------- -void OFileControlModel::removeResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) +void OFileControlModel::removeResetListener(const Reference<XResetListener>& _rxListener) { m_aResetListeners.removeInterface(_rxListener); } @@ -319,7 +328,7 @@ void OFileControlModel::_reset() // our own mutex locked // FS - 72451 - 31.01.00 MutexRelease aRelease(m_aMutex); - m_xAggregateSet->setPropertyValue(PROPERTY_TEXT, staruno::makeAny(m_sDefaultValue)); + m_xAggregateSet->setPropertyValue(PROPERTY_TEXT, makeAny(m_sDefaultValue)); } } diff --git a/forms/source/component/File.hxx b/forms/source/component/File.hxx index 8539a4389dbb..b038c4057ba1 100644 --- a/forms/source/component/File.hxx +++ b/forms/source/component/File.hxx @@ -2,9 +2,9 @@ * * $RCSfile: File.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -76,53 +76,53 @@ namespace frm //================================================================== class OFileControlModel :public OControlModel - ,public starform::XReset + ,public ::com::sun::star::form::XReset ,public ::comphelper::OAggregationArrayUsageHelper< OFileControlModel > { ::cppu::OInterfaceContainerHelper m_aResetListeners; ::rtl::OUString m_sDefaultValue; protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OFileControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OFileControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); ~OFileControlModel(); DECLARE_UNO3_AGG_DEFAULTS(OFileControlModel, OControlModel); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OFileControlModel); - virtual StringSequence SAL_CALL getSupportedServiceNames() throw(staruno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const staruno::Any& rValue); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); - virtual sal_Bool SAL_CALL convertFastPropertyValue(staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue ) - throw(starlang::IllegalArgumentException); + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -// stario::XPersistObject +// ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); -// starform::XReset +// ::com::sun::star::form::XReset virtual void SAL_CALL reset(); - virtual void SAL_CALL addResetListener(const staruno::Reference<starform::XResetListener>& _rxListener); - virtual void SAL_CALL removeResetListener(const staruno::Reference<starform::XResetListener>& _rxListener); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() diff --git a/forms/source/component/FixedText.cxx b/forms/source/component/FixedText.cxx index edc7567d448b..de8240b95d3f 100644 --- a/forms/source/component/FixedText.cxx +++ b/forms/source/component/FixedText.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FixedText.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -79,26 +79,37 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //------------------------------------------------------------------------------ -InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OFixedTextModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OFixedTextModel::_getTypes() +Sequence<Type> OFixedTextModel::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes = OControlModel::_getTypes(); + static Sequence<Type> aTypes = OControlModel::_getTypes(); return aTypes; } //------------------------------------------------------------------ -OFixedTextModel::OFixedTextModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rFactory) +OFixedTextModel::OFixedTextModel(const Reference<XMultiServiceFactory>& _rFactory) :OControlModel(_rFactory, VCL_CONTROLMODEL_FIXEDTEXT) { - m_nClassId = starform::FormComponentType::FIXEDTEXT; + m_nClassId = FormComponentType::FIXEDTEXT; } //------------------------------------------------------------------------------ @@ -113,9 +124,9 @@ StringSequence SAL_CALL OFixedTextModel::getSupportedServiceNames() throw(::com: } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OFixedTextModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<starbeans::XPropertySetInfo> SAL_CALL OFixedTextModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo(createPropertySetInfo(getInfoHelper())); + Reference<starbeans::XPropertySetInfo> xInfo(createPropertySetInfo(getInfoHelper())); return xInfo; } @@ -127,8 +138,8 @@ cppu::IPropertyArrayHelper& OFixedTextModel::getInfoHelper() //------------------------------------------------------------------------------ void OFixedTextModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< starbeans::Property >& _rProps, + Sequence< starbeans::Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(4) RemoveProperty(_rAggregateProps, PROPERTY_TABSTOP); @@ -141,14 +152,14 @@ void OFixedTextModel::fillProperties( } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OFixedTextModel::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OFixedTextModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_FIXEDTEXT; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OFixedTextModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream) + throw(IOException, RuntimeException) { OControlModel::write(_rxOutStream); @@ -158,7 +169,7 @@ void SAL_CALL OFixedTextModel::write(const staruno::Reference<stario::XObjectOut } //------------------------------------------------------------------------------ -void SAL_CALL OFixedTextModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException) { OControlModel::read(_rxInStream); diff --git a/forms/source/component/FixedText.hxx b/forms/source/component/FixedText.hxx index e224843ae458..e7cc669966cd 100644 --- a/forms/source/component/FixedText.hxx +++ b/forms/source/component/FixedText.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FixedText.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -79,15 +79,15 @@ class OFixedTextModel { protected: // UNO Anbindung - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: OFixedTextModel( - const staruno::Reference<starlang::XMultiServiceFactory>& _rFactory // factory to create the aggregate with + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rFactory // factory to create the aggregate with ); // XPropertySetRef - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XServiceInfo @@ -95,16 +95,16 @@ public: virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index b9ca56acf57f..821790525d25 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormComponent.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2000-10-24 13:02:32 $ + * 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 @@ -112,13 +112,23 @@ using namespace dbtools; namespace frm { //......................................................................... - +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //========================================================================= //= base class for form layer controls //========================================================================= DBG_NAME(frm_OControl) //------------------------------------------------------------------------------ -OControl::OControl(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const rtl::OUString& _sService) +OControl::OControl(const Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const rtl::OUString& _sService) :OComponentHelper(m_aMutex) ,m_aService(_sService) ,m_xServiceFactory(_rxFactory) @@ -129,14 +139,14 @@ OControl::OControl(const com::sun::star::uno::Reference<com::sun::star::lang::XM // das Aggregat selbst den Refcount erhoeht increment(m_refCount); { - m_xAggregate = com::sun::star::uno::Reference<com::sun::star::uno::XAggregation>( - _rxFactory->createInstance(_sService), com::sun::star::uno::UNO_QUERY); - m_xControl = com::sun::star::uno::Reference<starawt::XControl>(m_xAggregate, com::sun::star::uno::UNO_QUERY); + m_xAggregate = Reference<XAggregation>( + _rxFactory->createInstance(_sService), UNO_QUERY); + m_xControl = Reference<starawt::XControl>(m_xAggregate, UNO_QUERY); } if (m_xAggregate.is()) { - m_xAggregate->setDelegator(static_cast<com::sun::star::uno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } // Refcount wieder bei NULL @@ -156,38 +166,33 @@ OControl::~OControl() // UNO Anbindung //------------------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OControl::queryAggregation( const com::sun::star::uno::Type& _rType ) throw(com::sun::star::uno::RuntimeException) +Any SAL_CALL OControl::queryAggregation( const Type& _rType ) throw(RuntimeException) { - com::sun::star::uno::Any aReturn; - // ask the base class - aReturn = OComponentHelper::queryAggregation(_rType); + Any aReturn = OComponentHelper::queryAggregation(_rType); // ask our own interfaces if (!aReturn.hasValue()) - aReturn = cppu::queryInterface(_rType - ,static_cast<starawt::XControl*>(this) - ,static_cast<com::sun::star::lang::XEventListener*>(this) - ,static_cast<com::sun::star::lang::XServiceInfo*>(this) - ); - - // ask our aggregate - if (!aReturn.hasValue() && m_xAggregate.is()) - aReturn = m_xAggregate->queryAggregation(_rType); + { + aReturn = OControl_BASE::queryInterface(_rType); + // ask our aggregate + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } return aReturn; } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OControl::getImplementationId() throw(com::sun::star::uno::RuntimeException) +Sequence<sal_Int8> SAL_CALL OControl::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL OControl::getTypes() throw(com::sun::star::uno::RuntimeException) +Sequence<Type> SAL_CALL OControl::getTypes() throw(RuntimeException) { - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes = _getTypes(); - com::sun::star::uno::Reference<com::sun::star::lang::XTypeProvider> xProv; + Sequence<Type> aOwnTypes = _getTypes(); + Reference<com::sun::star::lang::XTypeProvider> xProv; if (query_aggregation(m_xAggregate, xProv)) return concatSequences(aOwnTypes, xProv->getTypes()); @@ -196,22 +201,11 @@ com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL OControl::getT } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> OControl::_getTypes() +Sequence<Type> OControl::_getTypes() { - static com::sun::star::uno::Sequence<com::sun::star::uno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) - { - // my base class types - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aBaseTypes = OComponentHelper::getTypes(); - - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes(3); - com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((com::sun::star::uno::Reference<starawt::XControl>*)NULL); - pOwnTypes[1] = getCppuType((com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>*)NULL); - pOwnTypes[2] = getCppuType((com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo>*)NULL); - - aTypes = concatSequences(aTypes, aOwnTypes); - } + aTypes = concatSequences(OComponentHelper::getTypes(), OControl_BASE::getTypes()); return aTypes; } @@ -221,7 +215,7 @@ void OControl::disposing() { OComponentHelper::disposing(); - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp; + Reference<com::sun::star::lang::XComponent> xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->dispose(); } @@ -230,7 +224,7 @@ void OControl::disposing() //------------------------------------------------------------------------------ sal_Bool SAL_CALL OControl::supportsService(const rtl::OUString& _rsServiceName) { - com::sun::star::uno::Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); + Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); const rtl::OUString* pSupported = aSupported.getConstArray(); for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) if (pSupported->equals(_rsServiceName)) @@ -239,12 +233,12 @@ sal_Bool SAL_CALL OControl::supportsService(const rtl::OUString& _rsServiceName) } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL OControl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +Sequence<rtl::OUString> SAL_CALL OControl::getSupportedServiceNames() throw(RuntimeException) { - com::sun::star::uno::Sequence<rtl::OUString> aSupported; + Sequence<rtl::OUString> aSupported; // ask our aggregate - com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo> xInfo; + Reference<com::sun::star::lang::XServiceInfo> xInfo; if (query_aggregation(m_xAggregate, xInfo)) aSupported = xInfo->getSupportedServiceNames(); @@ -253,15 +247,15 @@ com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL OControl::getSupportedServ // XEventListener //------------------------------------------------------------------------------ -void SAL_CALL OControl::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (com::sun::star::uno::RuntimeException) +void SAL_CALL OControl::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (RuntimeException) { InterfaceRef xAggAsIface; query_aggregation(m_xAggregate, xAggAsIface); // does the disposing come from the aggregate ? - if (xAggAsIface != InterfaceRef(_rEvent.Source, com::sun::star::uno::UNO_QUERY)) + if (xAggAsIface != InterfaceRef(_rEvent.Source, UNO_QUERY)) { // no -> forward it - com::sun::star::uno::Reference<com::sun::star::lang::XEventListener> xListener; + Reference<com::sun::star::lang::XEventListener> xListener; if (query_aggregation(m_xAggregate, xListener)) xListener->disposing(_rEvent); } @@ -269,47 +263,47 @@ void SAL_CALL OControl::disposing(const com::sun::star::lang::EventObject& _rEve // XControl //------------------------------------------------------------------------------ -void SAL_CALL OControl::setContext(const InterfaceRef& Context) throw (com::sun::star::uno::RuntimeException) +void SAL_CALL OControl::setContext(const InterfaceRef& Context) throw (RuntimeException) { if (m_xControl.is()) m_xControl->setContext(Context); } //------------------------------------------------------------------------------ -InterfaceRef SAL_CALL OControl::getContext() throw (com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OControl::getContext() throw (RuntimeException) { return m_xControl.is() ? m_xControl->getContext() : InterfaceRef(); } //------------------------------------------------------------------------------ -void SAL_CALL OControl::createPeer(const com::sun::star::uno::Reference<starawt::XToolkit>& Toolkit, const com::sun::star::uno::Reference<starawt::XWindowPeer>& Parent) throw (com::sun::star::uno::RuntimeException) +void SAL_CALL OControl::createPeer(const Reference<starawt::XToolkit>& Toolkit, const Reference<starawt::XWindowPeer>& Parent) throw (RuntimeException) { if (m_xControl.is()) m_xControl->createPeer(Toolkit, Parent); } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starawt::XWindowPeer> SAL_CALL OControl::getPeer() +Reference<starawt::XWindowPeer> SAL_CALL OControl::getPeer() { - return m_xControl.is() ? m_xControl->getPeer() : com::sun::star::uno::Reference<starawt::XWindowPeer>(); + return m_xControl.is() ? m_xControl->getPeer() : Reference<starawt::XWindowPeer>(); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL OControl::setModel(const com::sun::star::uno::Reference<starawt::XControlModel>& Model) +sal_Bool SAL_CALL OControl::setModel(const Reference<starawt::XControlModel>& Model) { return m_xControl.is() ? m_xControl->setModel( Model ) : sal_False; } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starawt::XControlModel> SAL_CALL OControl::getModel() +Reference<starawt::XControlModel> SAL_CALL OControl::getModel() { - return m_xControl.is() ? m_xControl->getModel() : com::sun::star::uno::Reference<starawt::XControlModel>(); + return m_xControl.is() ? m_xControl->getModel() : Reference<starawt::XControlModel>(); } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starawt::XView> SAL_CALL OControl::getView() +Reference<starawt::XView> SAL_CALL OControl::getView() { - return m_xControl.is() ? m_xControl->getView() : com::sun::star::uno::Reference<starawt::XView>(); + return m_xControl.is() ? m_xControl->getView() : Reference<starawt::XView>(); } //------------------------------------------------------------------------------ @@ -336,7 +330,7 @@ sal_Bool SAL_CALL OControl::isTransparent() //================================================================== DBG_NAME(frm_OBoundControl); //------------------------------------------------------------------ -OBoundControl::OBoundControl(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sService) +OBoundControl::OBoundControl(const Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _sService) :OControl(_rxFactory, _sService) ,m_bLocked(sal_False) { @@ -348,29 +342,34 @@ OBoundControl::~OBoundControl() { DBG_DTOR(frm_OBoundControl, NULL); } - +// ----------------------------------------------------------------------------- +Sequence< Type> OBoundControl::_getTypes() +{ + static Sequence<Type> aTypes; + if (!aTypes.getLength()) + aTypes = concatSequences(OControl::_getTypes(), OBoundControl_BASE::getTypes()); + return aTypes; +} //------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OBoundControl::queryAggregation(const com::sun::star::uno::Type& _rType) throw(com::sun::star::uno::RuntimeException) +Any SAL_CALL OBoundControl::queryAggregation(const Type& _rType) throw(RuntimeException) { - com::sun::star::uno::Any aReturn; - // ask the base class - aReturn = OControl::queryAggregation(_rType); + Any aReturn = OControl::queryAggregation(_rType); // ask our own interfaces if (!aReturn.hasValue()) - aReturn = cppu::queryInterface(_rType, static_cast<starform::XBoundControl*>(this)); + aReturn = OBoundControl_BASE::queryInterface(_rType); return aReturn; } //------------------------------------------------------------------ -sal_Bool SAL_CALL OBoundControl::getLock() throw(com::sun::star::uno::RuntimeException) +sal_Bool SAL_CALL OBoundControl::getLock() throw(RuntimeException) { return m_bLocked; } //------------------------------------------------------------------ -void SAL_CALL OBoundControl::setLock(sal_Bool _bLock) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControl::setLock(sal_Bool _bLock) throw(RuntimeException) { if (m_bLocked == _bLock) return; @@ -384,15 +383,15 @@ void SAL_CALL OBoundControl::setLock(sal_Bool _bLock) throw(com::sun::star::uno: void OBoundControl::_setLock(sal_Bool _bLock) { // try to set the text component to readonly - com::sun::star::uno::Reference<starawt::XWindowPeer> xPeer = getPeer(); - com::sun::star::uno::Reference<com::sun::star::awt::XTextComponent> xText(xPeer, com::sun::star::uno::UNO_QUERY); + Reference<starawt::XWindowPeer> xPeer = getPeer(); + Reference<com::sun::star::awt::XTextComponent> xText(xPeer, UNO_QUERY); if (xText.is()) xText->setEditable(!_bLock); else { // disable the window - com::sun::star::uno::Reference<starawt::XWindow> xComp(xPeer, com::sun::star::uno::UNO_QUERY); + Reference<starawt::XWindow> xComp(xPeer, UNO_QUERY); if (xComp.is()) xComp->setEnable(!_bLock); } @@ -404,16 +403,16 @@ void OBoundControl::_setLock(sal_Bool _bLock) ConcretInfoService OControlModel::s_aPropInfos; DBG_NAME(OControlModel) //------------------------------------------------------------------ -com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OControlModel::getImplementationId() throw(com::sun::star::uno::RuntimeException) +Sequence<sal_Int8> SAL_CALL OControlModel::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL OControlModel::getTypes() throw(com::sun::star::uno::RuntimeException) +Sequence<Type> SAL_CALL OControlModel::getTypes() throw(RuntimeException) { - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes = _getTypes(); - com::sun::star::uno::Reference<com::sun::star::lang::XTypeProvider> xProv; + Sequence<Type> aOwnTypes = _getTypes(); + Reference<com::sun::star::lang::XTypeProvider> xProv; if (query_aggregation(m_xAggregate, xProv)) return concatSequences(aOwnTypes, xProv->getTypes()); @@ -422,65 +421,50 @@ com::sun::star::uno::Sequence<com::sun::star::uno::Type> SAL_CALL OControlModel: } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> OControlModel::_getTypes() +Sequence<Type> OControlModel::_getTypes() { - static com::sun::star::uno::Sequence<com::sun::star::uno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my two base classes - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aComponentTypes = OComponentHelper::getTypes(); - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aPropertyTypes = OPropertySetAggregationHelper::getTypes(); - - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes(4); - com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((com::sun::star::uno::Reference<starform::XFormComponent>*)NULL); - pOwnTypes[1] = getCppuType((com::sun::star::uno::Reference<stario::XPersistObject>*)NULL); - pOwnTypes[1] = getCppuType((com::sun::star::uno::Reference<starcontainer::XNamed>*)NULL); - pOwnTypes[3] = getCppuType((com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo>*)NULL); - - aTypes = concatSequences(aComponentTypes, aPropertyTypes, aOwnTypes); + aTypes = concatSequences(OComponentHelper::getTypes(), OPropertySetAggregationHelper::getTypes(), OControlModel_BASE::getTypes()); } return aTypes; } //------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OControlModel::queryAggregation(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException) +Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - com::sun::star::uno::Any aReturn; - // base class 1 - aReturn = OComponentHelper::queryAggregation(_rType); + Any aReturn = OComponentHelper::queryAggregation(_rType); // base class 2 if (!aReturn.hasValue()) + { aReturn = OPropertySetAggregationHelper::queryInterface(_rType); - // our own interfaces - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starform::XFormComponent*>(this) - ,static_cast<starcontainer::XChild*>(this) - ,static_cast<stario::XPersistObject*>(this) - ,static_cast<starcontainer::XNamed*>(this) - ,static_cast<com::sun::star::lang::XServiceInfo*>(this) - ); - - // our aggregate - if (!aReturn.hasValue() && m_xAggregate.is()) - aReturn = m_xAggregate->queryAggregation(_rType); + // our own interfaces + if (!aReturn.hasValue()) + { + aReturn = OControlModel_BASE::queryInterface(_rType); + // our aggregate + if (!aReturn.hasValue() && m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } + } return aReturn; } //------------------------------------------------------------------ OControlModel::OControlModel( - const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, + const Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _rUnoControlModelTypeName, const ::rtl::OUString& rDefault) :OComponentHelper(m_aMutex) ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) ,m_aUnoControlModelTypeName(_rUnoControlModelTypeName) ,m_nTabIndex(FRM_DEFAULT_TABINDEX) - ,m_nClassId(starform::FormComponentType::CONTROL) + ,m_nClassId(FormComponentType::CONTROL) ,m_xServiceFactory(_rxFactory) { DBG_CTOR(OControlModel, NULL); @@ -491,16 +475,16 @@ OControlModel::OControlModel( // Muss im eigenen Block, // da xAgg vor dem delegator setzen wieder freigesetzt sein mu! { - m_xAggregate = com::sun::star::uno::Reference<com::sun::star::uno::XAggregation>(_rxFactory->createInstance(_rUnoControlModelTypeName), com::sun::star::uno::UNO_QUERY); + m_xAggregate = Reference<XAggregation>(_rxFactory->createInstance(_rUnoControlModelTypeName), UNO_QUERY); setAggregation(m_xAggregate); if (m_xAggregateSet.is() && rDefault.len()) - m_xAggregateSet->setPropertyValue(PROPERTY_DEFAULTCONTROL, com::sun::star::uno::makeAny(rDefault)); + m_xAggregateSet->setPropertyValue(PROPERTY_DEFAULTCONTROL, makeAny(rDefault)); } if (m_xAggregate.is()) { - m_xAggregate->setDelegator(static_cast<com::sun::star::uno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } // Refcount wieder bei NULL @@ -519,23 +503,23 @@ OControlModel::~OControlModel() // XChild //------------------------------------------------------------------------------ -void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, com::sun::star::uno::RuntimeException) +void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException) { osl::MutexGuard aGuard(m_aMutex); - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xParent, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xParent, UNO_QUERY); if (xComp.is()) - xComp->removeEventListener(static_cast<com::sun::star::beans::XPropertiesChangeListener*>(this)); + xComp->removeEventListener(static_cast<XPropertiesChangeListener*>(this)); - xComp = com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(_rxParent, com::sun::star::uno::UNO_QUERY); + xComp = Reference<com::sun::star::lang::XComponent>(_rxParent, UNO_QUERY); if (xComp.is()) - xComp->addEventListener(static_cast<com::sun::star::beans::XPropertiesChangeListener*>(this)); + xComp->addEventListener(static_cast<XPropertiesChangeListener*>(this)); m_xParent = _rxParent; } // XNamed //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OControlModel::getName() throw(com::sun::star::uno::RuntimeException) +::rtl::OUString SAL_CALL OControlModel::getName() throw(RuntimeException) { ::rtl::OUString aReturn; OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= aReturn; @@ -543,16 +527,16 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: } //------------------------------------------------------------------------------ -void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(RuntimeException) { - setFastPropertyValue(PROPERTY_ID_NAME, com::sun::star::uno::makeAny(_rName)); + setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName)); } // XServiceInfo //------------------------------------------------------------------------------ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceName) { - com::sun::star::uno::Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); + Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); const rtl::OUString* pSupported = aSupported.getConstArray(); for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) if (pSupported->equals(_rServiceName)) @@ -561,12 +545,12 @@ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceN } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException) { - com::sun::star::uno::Sequence<rtl::OUString> aSupported; + Sequence<rtl::OUString> aSupported; // ask our aggregate - com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo> xInfo; + Reference<com::sun::star::lang::XServiceInfo> xInfo; if (query_aggregation(m_xAggregate, xInfo)) aSupported = xInfo->getSupportedServiceNames(); @@ -580,7 +564,7 @@ com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL OControlModel::getSupporte // XEventListener //------------------------------------------------------------------------------ -void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (com::sun::star::uno::RuntimeException) +void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (RuntimeException) { // release the parent if (_rSource.Source == m_xParent) @@ -590,7 +574,7 @@ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& } else { - com::sun::star::uno::Reference<com::sun::star::lang::XEventListener> xEvtLst; + Reference<com::sun::star::lang::XEventListener> xEvtLst; if (query_aggregation(m_xAggregate, xEvtLst)) { osl::MutexGuard aGuard(m_aMutex); @@ -605,27 +589,27 @@ void OControlModel::disposing() { OPropertySetAggregationHelper::disposing(); - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp; + Reference<com::sun::star::lang::XComponent> xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->dispose(); - setParent(com::sun::star::uno::Reference<starform::XFormComponent>()); + setParent(Reference<XFormComponent>()); } //------------------------------------------------------------------------------ -void SAL_CALL OControlModel::write(const com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OControlModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { osl::MutexGuard aGuard(m_aMutex); // 1. Schreiben des UnoControls - com::sun::star::uno::Reference<stario::XMarkableStream> xMark(_rxOutStream, com::sun::star::uno::UNO_QUERY); + Reference<stario::XMarkableStream> xMark(_rxOutStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); sal_Int32 nLen = 0; _rxOutStream->writeLong(nLen); - com::sun::star::uno::Reference<stario::XPersistObject> xPersist; + Reference<stario::XPersistObject> xPersist; if (query_aggregation(m_xAggregate, xPersist)) xPersist->write(_rxOutStream); @@ -653,7 +637,7 @@ void SAL_CALL OControlModel::write(const com::sun::star::uno::Reference<stario:: } //------------------------------------------------------------------------------ -void OControlModel::read(const com::sun::star::uno::Reference<stario::XObjectInputStream>& InStream) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) +void OControlModel::read(const Reference<stario::XObjectInputStream>& InStream) throw (::com::sun::star::io::IOException, RuntimeException) { osl::MutexGuard aGuard(m_aMutex); @@ -661,10 +645,10 @@ void OControlModel::read(const com::sun::star::uno::Reference<stario::XObjectInp sal_Int32 nLen = InStream->readLong(); if (nLen) { - com::sun::star::uno::Reference<stario::XMarkableStream> xMark(InStream, com::sun::star::uno::UNO_QUERY); + Reference<stario::XMarkableStream> xMark(InStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); - com::sun::star::uno::Reference<stario::XPersistObject> xPersist; + Reference<stario::XPersistObject> xPersist; if (query_aggregation(m_xAggregate, xPersist)) xPersist->read(InStream); @@ -693,7 +677,7 @@ void OControlModel::read(const com::sun::star::uno::Reference<stario::XObjectInp } //------------------------------------------------------------------------------ -void OControlModel::getFastPropertyValue( com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const +void OControlModel::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const { switch (nHandle) { @@ -719,7 +703,7 @@ void OControlModel::getFastPropertyValue( com::sun::star::uno::Any& rValue, sal_ //------------------------------------------------------------------------------ sal_Bool OControlModel::convertFastPropertyValue( - com::sun::star::uno::Any& _rConvertedValue, com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::lang::IllegalArgumentException) { sal_Bool bModified(sal_False); @@ -742,8 +726,8 @@ sal_Bool OControlModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) - throw (com::sun::star::uno::Exception) +void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) + throw (Exception) { switch (_nHandle) { @@ -775,31 +759,24 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const c //================================================================== DBG_NAME(frm_OBoundControlModel); //------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OBoundControlModel::queryAggregation( const com::sun::star::uno::Type& _rType ) throw (com::sun::star::uno::RuntimeException) +Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (RuntimeException) { - com::sun::star::uno::Any aReturn; + Any aReturn; aReturn = OControlModel::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = cppu::queryInterface(_rType - ,static_cast<com::sun::star::beans::XPropertyChangeListener*>(this) - ,static_cast<starform::XReset*>(this) - ,static_cast<starform::XLoadListener*>(this) - ,static_cast<com::sun::star::lang::XEventListener*>(static_cast<starform::XLoadListener*>(this)) - ); - - if (!aReturn.hasValue() && m_bCommitable) - aReturn = cppu::queryInterface(_rType - ,static_cast<starform::XBoundComponent*>(this) - ,static_cast<starform::XUpdateBroadcaster*>(this) - ); + { + aReturn = OBoundControlModel_BASE1::queryInterface(_rType); + if (!aReturn.hasValue() && m_bCommitable) + aReturn = OBoundControlModel_BASE2::queryInterface(_rType); + } return aReturn; } //------------------------------------------------------------------ OBoundControlModel::OBoundControlModel( - const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, + const Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory, const ::rtl::OUString& _rUnoControlModelTypeName, const ::rtl::OUString& _rDefault, sal_Bool _bCommitable) @@ -823,20 +800,12 @@ OBoundControlModel::~OBoundControlModel() } //----------------------------------------------------------------------------- -com::sun::star::uno::Sequence<com::sun::star::uno::Type> OBoundControlModel::_getTypes() +Sequence<Type> OBoundControlModel::_getTypes() { - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aReturn = OControlModel::_getTypes(); - - sal_Int32 nBaseLen = aReturn.getLength(); - aReturn.realloc(nBaseLen + (m_bCommitable ? 4 : 3)); - com::sun::star::uno::Type* pReturn = aReturn.getArray() + nBaseLen; - pReturn[0] = ::getCppuType((com::sun::star::uno::Reference<starform::XLoadListener>*)NULL); - pReturn[1] = ::getCppuType((com::sun::star::uno::Reference<starform::XReset>*)NULL); - pReturn[2] = ::getCppuType((com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>*)NULL); if (m_bCommitable) - pReturn[3] = ::getCppuType((com::sun::star::uno::Reference<starform::XBoundComponent>*)NULL); + return concatSequences(OControlModel::_getTypes(),OBoundControlModel_BASE1::getTypes(),OBoundControlModel_BASE2::getTypes()); - return aReturn; + return concatSequences(OControlModel::_getTypes(),OBoundControlModel_BASE1::getTypes()); } // OComponentHelper @@ -846,7 +815,7 @@ void OBoundControlModel::disposing() OControlModel::disposing(); osl::MutexGuard aGuard(m_aMutex); - com::sun::star::lang::EventObject aEvt(static_cast<com::sun::star::uno::XWeak*>(this)); + com::sun::star::lang::EventObject aEvt(static_cast<XWeak*>(this)); m_aResetListeners.disposeAndClear(aEvt); m_aUpdateListeners.disposeAndClear(aEvt); @@ -857,24 +826,24 @@ void OBoundControlModel::disposing() } m_xCursor = NULL; - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) - xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<com::sun::star::beans::XPropertyChangeListener*>(this))); + xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this))); } // XChild //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::setParent(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& _rxParent) throw(com::sun::star::lang::NoSupportException, com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::setParent(const Reference<XInterface>& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException) { osl::MutexGuard aGuard(m_aMutex); // log off old listeners - com::sun::star::uno::Reference<starform::XLoadable> xLoadable(m_xParent, com::sun::star::uno::UNO_QUERY); + Reference<XLoadable> xLoadable(m_xParent, UNO_QUERY); if (xLoadable.is()) xLoadable->removeLoadListener(this); // log on new listeners - xLoadable = com::sun::star::uno::Reference<starform::XLoadable>(_rxParent, com::sun::star::uno::UNO_QUERY); + xLoadable = Reference<XLoadable>(_rxParent, UNO_QUERY); if (xLoadable.is()) xLoadable->addLoadListener(this); @@ -883,7 +852,7 @@ void SAL_CALL OBoundControlModel::setParent(const com::sun::star::uno::Reference // XEventListener //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObject& _rEvent) throw (RuntimeException) { osl::MutexGuard aGuard(m_aMutex); if (m_xField == _rEvent.Source) @@ -892,12 +861,12 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj } else if (m_xLabelControl == _rEvent.Source) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xOldValue = m_xLabelControl; + Reference<XPropertySet> xOldValue = m_xLabelControl; m_xLabelControl = NULL; // fire a property change event - com::sun::star::uno::Any aOldValue; aOldValue <<= xOldValue; - com::sun::star::uno::Any aNewValue; aNewValue <<= m_xLabelControl; + Any aOldValue; aOldValue <<= xOldValue; + Any aNewValue; aNewValue <<= m_xLabelControl; sal_Int32 nHandle = PROPERTY_ID_CONTROLLABEL; OPropertySetHelper::fire(&nHandle, &aNewValue, &aOldValue, 1, sal_False); } @@ -907,7 +876,7 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj // XServiceInfo //------------------------------------------------------------------------------ -StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); @@ -920,7 +889,7 @@ StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(com // XPersist //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::write( const com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream ) throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::write( const Reference<stario::XObjectOutputStream>& _rxOutStream ) throw(stario::IOException, RuntimeException) { OControlModel::write(_rxOutStream); @@ -945,31 +914,31 @@ void SAL_CALL OBoundControlModel::write( const com::sun::star::uno::Reference<st //------------------------------------------------------------------------------ void OBoundControlModel::defaultCommonProperties() { - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) - xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<com::sun::star::beans::XPropertyChangeListener*>(this))); + xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this))); m_xLabelControl = NULL; } //------------------------------------------------------------------------------ -void OBoundControlModel::readCommonProperties(const com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream) +void OBoundControlModel::readCommonProperties(const Reference<stario::XObjectInputStream>& _rxInStream) { sal_Int32 nLen = _rxInStream->readLong(); - com::sun::star::uno::Reference<stario::XMarkableStream> xMark(_rxInStream, com::sun::star::uno::UNO_QUERY); + Reference<stario::XMarkableStream> xMark(_rxInStream, UNO_QUERY); DBG_ASSERT(xMark.is(), "OBoundControlModel::readCommonProperties : can only work with markable streams !"); sal_Int32 nMark = xMark->createMark(); // read the reference to the label control - com::sun::star::uno::Reference<stario::XPersistObject> xPersist; + Reference<stario::XPersistObject> xPersist; sal_Int32 nUsedFlag; nUsedFlag = _rxInStream->readLong(); if (nUsedFlag) xPersist = _rxInStream->readObject(); - m_xLabelControl = com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>(xPersist, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + m_xLabelControl = Reference<XPropertySet>(xPersist, UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) - xComp->addEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<com::sun::star::beans::XPropertyChangeListener*>(this))); + xComp->addEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this))); // read any other new common properties here @@ -980,9 +949,9 @@ void OBoundControlModel::readCommonProperties(const com::sun::star::uno::Referen } //------------------------------------------------------------------------------ -void OBoundControlModel::writeCommonProperties(const com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OBoundControlModel::writeCommonProperties(const Reference<stario::XObjectOutputStream>& _rxOutStream) { - com::sun::star::uno::Reference<stario::XMarkableStream> xMark(_rxOutStream, com::sun::star::uno::UNO_QUERY); + Reference<stario::XMarkableStream> xMark(_rxOutStream, UNO_QUERY); DBG_ASSERT(xMark.is(), "OBoundControlModel::writeCommonProperties : can only work with markable streams !"); sal_Int32 nMark = xMark->createMark(); @@ -991,7 +960,7 @@ void OBoundControlModel::writeCommonProperties(const com::sun::star::uno::Refere _rxOutStream->writeLong(nLen); // write the reference to the label control - com::sun::star::uno::Reference<stario::XPersistObject> xPersist(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + Reference<stario::XPersistObject> xPersist(m_xLabelControl, UNO_QUERY); sal_Int32 nUsedFlag = 0; if (xPersist.is()) nUsedFlag = 1; @@ -1010,7 +979,7 @@ void OBoundControlModel::writeCommonProperties(const com::sun::star::uno::Refere } //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::read( const com::sun::star::uno::Reference< stario::XObjectInputStream >& _rxInStream ) throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::read( const Reference< stario::XObjectInputStream >& _rxInStream ) throw(stario::IOException, RuntimeException) { OControlModel::read(_rxInStream); @@ -1020,7 +989,7 @@ void SAL_CALL OBoundControlModel::read( const com::sun::star::uno::Reference< st } //------------------------------------------------------------------------------ -void OBoundControlModel::getFastPropertyValue(com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const +void OBoundControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { switch (nHandle) { @@ -1046,9 +1015,9 @@ void OBoundControlModel::getFastPropertyValue(com::sun::star::uno::Any& rValue, //------------------------------------------------------------------------------ sal_Bool OBoundControlModel::convertFastPropertyValue( - com::sun::star::uno::Any& _rConvertedValue, com::sun::star::uno::Any& _rOldValue, + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, - const com::sun::star::uno::Any& _rValue) + const Any& _rValue) throw (com::sun::star::lang::IllegalArgumentException) { sal_Bool bModified(sal_False); @@ -1063,7 +1032,7 @@ sal_Bool OBoundControlModel::convertFastPropertyValue( case PROPERTY_ID_CONTROLLABEL: if (!_rValue.hasValue()) { // property set to void - _rConvertedValue = com::sun::star::uno::Any(); + _rConvertedValue = Any(); getFastPropertyValue(_rOldValue, _nHandle); bModified = m_xLabelControl.is(); } @@ -1077,81 +1046,82 @@ sal_Bool OBoundControlModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const com::sun::star::uno::Any& rValue ) throw (com::sun::star::uno::Exception) +void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) { switch (nHandle) { case PROPERTY_ID_CONTROLSOURCE: - DBG_ASSERT(rValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_STRING, "invalid type" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" ); rValue >>= m_aControlSource; break; case PROPERTY_ID_BOUNDFIELD: DBG_ERROR("OBoundControlModel::setFastPropertyValue_NoBroadcast : BoundField should be a read-only property !"); - throw com::sun::star::lang::IllegalArgumentException(); + throw com::sun::star::lang::IllegalArgumentException(); break; case PROPERTY_ID_CONTROLLABEL: { - DBG_ASSERT(!rValue.hasValue() || (rValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_INTERFACE), + DBG_ASSERT(!rValue.hasValue() || (rValue.getValueType().getTypeClass() == TypeClass_INTERFACE), "OBoundControlModel::setFastPropertyValue_NoBroadcast : invalid argument !"); if (!rValue.hasValue()) { // set property to "void" - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) - xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<com::sun::star::beans::XPropertyChangeListener*>(this))); + xComp->removeEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this))); m_xLabelControl = NULL; break; } - InterfaceRef xNewValue = *(InterfaceRef*)rValue.getValue(); + InterfaceRef xNewValue; + rValue >>= xNewValue; - com::sun::star::uno::Reference<starawt::XControlModel> xAsModel(xNewValue, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo> xAsServiceInfo(xNewValue, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xAsPropSet(xNewValue, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<starcontainer::XChild> xAsChild(xNewValue, com::sun::star::uno::UNO_QUERY); + Reference<starawt::XControlModel> xAsModel(xNewValue, UNO_QUERY); + Reference<com::sun::star::lang::XServiceInfo> xAsServiceInfo(xNewValue, UNO_QUERY); + Reference<XPropertySet> xAsPropSet(xNewValue, UNO_QUERY); + Reference<XChild> xAsChild(xNewValue, UNO_QUERY); if (!xAsModel.is() || !xAsServiceInfo.is() || !xAsPropSet.is() || !xAsChild.is()) { - throw com::sun::star::lang::IllegalArgumentException(); + throw com::sun::star::lang::IllegalArgumentException(); } if (!xAsServiceInfo->supportsService(m_aLabelServiceName)) { - throw com::sun::star::lang::IllegalArgumentException(); + throw com::sun::star::lang::IllegalArgumentException(); } // check if weself and the given model have a common anchestor (up to the forms collection) - com::sun::star::uno::Reference<starcontainer::XChild> xCont; - query_interface(static_cast<com::sun::star::uno::XWeak*>(this), xCont); + Reference<XChild> xCont; + query_interface(static_cast<XWeak*>(this), xCont); InterfaceRef xMyTopLevel = xCont->getParent(); while (xMyTopLevel.is()) { - com::sun::star::uno::Reference<starform::XForm> xAsForm(xMyTopLevel, com::sun::star::uno::UNO_QUERY); + Reference<XForm> xAsForm(xMyTopLevel, UNO_QUERY); if (!xAsForm.is()) // found my root break; - com::sun::star::uno::Reference<starcontainer::XChild> xAsChild(xMyTopLevel, com::sun::star::uno::UNO_QUERY); + Reference<XChild> xAsChild(xMyTopLevel, UNO_QUERY); xMyTopLevel = xAsChild.is() ? xAsChild->getParent() : InterfaceRef(); } InterfaceRef xNewTopLevel = xAsChild->getParent(); while (xNewTopLevel.is()) { - com::sun::star::uno::Reference<starform::XForm> xAsForm(xNewTopLevel, com::sun::star::uno::UNO_QUERY); + Reference<XForm> xAsForm(xNewTopLevel, UNO_QUERY); if (!xAsForm.is()) break; - com::sun::star::uno::Reference<starcontainer::XChild> xAsChild(xNewTopLevel, com::sun::star::uno::UNO_QUERY); + Reference<XChild> xAsChild(xNewTopLevel, UNO_QUERY); xNewTopLevel = xAsChild.is() ? xAsChild->getParent() : InterfaceRef(); } if (xNewTopLevel != xMyTopLevel) { // the both objects don't belong to the same forms collection -> not acceptable - throw com::sun::star::lang::IllegalArgumentException(); + throw com::sun::star::lang::IllegalArgumentException(); } m_xLabelControl = xAsPropSet; - com::sun::star::uno::Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::lang::XComponent> xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) - xComp->addEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<com::sun::star::beans::XPropertyChangeListener*>(this))); + xComp->addEventListener(static_cast<com::sun::star::lang::XEventListener*>(static_cast<XPropertyChangeListener*>(this))); } break; default: @@ -1161,7 +1131,7 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co // XPropertyChangeListener //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::propertyChange( const com::sun::star::beans::PropertyChangeEvent& evt ) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException) { // Bei Wertaenderung neu initialisieren if (evt.PropertyName.equals(PROPERTY_VALUE)) @@ -1174,19 +1144,19 @@ void SAL_CALL OBoundControlModel::propertyChange( const com::sun::star::beans::P // XBoundComponent //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::addUpdateListener(const com::sun::star::uno::Reference<starform::XUpdateListener>& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::addUpdateListener(const Reference<XUpdateListener>& _rxListener) throw(RuntimeException) { m_aUpdateListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::removeUpdateListener(const com::sun::star::uno::Reference< starform::XUpdateListener>& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::removeUpdateListener(const Reference< XUpdateListener>& _rxListener) throw(RuntimeException) { m_aUpdateListeners.removeInterface(_rxListener); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL OBoundControlModel::commit() throw(com::sun::star::uno::RuntimeException) +sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException) { DBG_ASSERT(m_bCommitable, "OBoundControlModel::commit : invalid call (I'm not commitable !) "); { @@ -1196,11 +1166,11 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(com::sun::star::uno::Runtim } cppu::OInterfaceIteratorHelper aIter(m_aUpdateListeners); - com::sun::star::lang::EventObject aEvt; - aEvt.Source = static_cast<com::sun::star::uno::XWeak*>(this); + com::sun::star::lang::EventObject aEvt; + aEvt.Source = static_cast<XWeak*>(this); sal_Bool bSucceed = sal_True; while (aIter.hasMoreElements() && bSucceed) - bSucceed = ((starform::XUpdateListener*)aIter.next())->approveUpdate(aEvt); + bSucceed = ((XUpdateListener*)aIter.next())->approveUpdate(aEvt); if (bSucceed) { @@ -1209,7 +1179,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(com::sun::star::uno::Runtim { bSucceed = _commit(); } - catch(...) + catch(Exception&) { bSucceed = sal_False; } @@ -1219,33 +1189,33 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(com::sun::star::uno::Runtim { cppu::OInterfaceIteratorHelper aIter(m_aUpdateListeners); while (aIter.hasMoreElements()) - ((starform::XUpdateListener*)aIter.next())->updated(aEvt); + ((XUpdateListener*)aIter.next())->updated(aEvt); } return bSucceed; } //------------------------------------------------------------------------------ -sal_Bool OBoundControlModel::connectToField(const com::sun::star::uno::Reference<starsdbc::XRowSet>& rForm) +sal_Bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm) { // wenn eine Verbindung zur Datenbank existiert if (rForm.is() && getConnection(rForm).is()) { // Feld bestimmen und PropertyChangeListener m_xCursor = rForm; - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFieldCandidate; + Reference<XPropertySet> xFieldCandidate; if (m_xCursor.is()) { - com::sun::star::uno::Reference<starsdbcx::XColumnsSupplier> xColumnsSupplier(m_xCursor, com::sun::star::uno::UNO_QUERY); + Reference<XColumnsSupplier> xColumnsSupplier(m_xCursor, UNO_QUERY); DBG_ASSERT(xColumnsSupplier.is(), "OBoundControlModel::connectToField : the row set should support the com::sun::star::sdb::ResultSet service !"); if (xColumnsSupplier.is()) { - com::sun::star::uno::Reference<starcontainer::XNameAccess> xColumns(xColumnsSupplier->getColumns(), com::sun::star::uno::UNO_QUERY); + Reference<XNameAccess> xColumns(xColumnsSupplier->getColumns(), UNO_QUERY); if (xColumns.is() && xColumns->hasByName(m_aControlSource)) { - com::sun::star::uno::Any aElement(xColumns->getByName(m_aControlSource)); - DBG_ASSERT(xColumns->getElementType().equals(::getCppuType(reinterpret_cast<com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>*>(NULL))), + Any aElement(xColumns->getByName(m_aControlSource)); + DBG_ASSERT(xColumns->getElementType().equals(::getCppuType(reinterpret_cast<Reference<XPropertySet>*>(NULL))), "OBoundControlModel::connectToField : the columns container should contain XPropertySets !"); // if this assertion fails we probably should do a queryInterface .... aElement >>= xFieldCandidate; @@ -1270,10 +1240,10 @@ sal_Bool OBoundControlModel::connectToField(const com::sun::star::uno::Reference { // an wertaenderungen horchen m_xField->addPropertyChangeListener(PROPERTY_VALUE, this); - m_xColumnUpdate = com::sun::star::uno::Reference<starsdb::XColumnUpdate>(m_xField, com::sun::star::uno::UNO_QUERY); - m_xColumn = com::sun::star::uno::Reference<starsdb::XColumn>(m_xField, com::sun::star::uno::UNO_QUERY); + m_xColumnUpdate = Reference<XColumnUpdate>(m_xField, UNO_QUERY); + m_xColumn = Reference<XColumn>(m_xField, UNO_QUERY); INT32 nNullableFlag; m_xField->getPropertyValue(PROPERTY_ISNULLABLE) >>= nNullableFlag; - m_bRequired = (starsdbc::ColumnValue::NO_NULLS == nNullableFlag); + m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag); // we're optimistic : in case of ColumnValue_NULLABLE_UNKNOWN we assume nullability .... } else @@ -1289,12 +1259,12 @@ sal_Bool OBoundControlModel::connectToField(const com::sun::star::uno::Reference //------------------------------------------------------------------------------ sal_Bool OBoundControlModel::_approve(sal_Int32 _nColumnType) { - if ((_nColumnType == starsdbc::DataType::BINARY) || (_nColumnType == starsdbc::DataType::VARBINARY) - || (_nColumnType == starsdbc::DataType::LONGVARBINARY) || (_nColumnType == starsdbc::DataType::OTHER) - || (_nColumnType == starsdbc::DataType::OBJECT) || (_nColumnType == starsdbc::DataType::DISTINCT) - || (_nColumnType == starsdbc::DataType::STRUCT) || (_nColumnType == starsdbc::DataType::ARRAY) - || (_nColumnType == starsdbc::DataType::BLOB) || (_nColumnType == starsdbc::DataType::CLOB) - || (_nColumnType == starsdbc::DataType::REF) || (_nColumnType == starsdbc::DataType::SQLNULL)) + if ((_nColumnType == DataType::BINARY) || (_nColumnType == DataType::VARBINARY) + || (_nColumnType == DataType::LONGVARBINARY) || (_nColumnType == DataType::OTHER) + || (_nColumnType == DataType::OBJECT) || (_nColumnType == DataType::DISTINCT) + || (_nColumnType == DataType::STRUCT) || (_nColumnType == DataType::ARRAY) + || (_nColumnType == DataType::BLOB) || (_nColumnType == DataType::CLOB) + || (_nColumnType == DataType::REF) || (_nColumnType == DataType::SQLNULL)) return sal_False; return sal_True; @@ -1302,10 +1272,10 @@ sal_Bool OBoundControlModel::_approve(sal_Int32 _nColumnType) // XLoadListener //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::loaded(const com::sun::star::lang::EventObject& _rEvent) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::loaded(const com::sun::star::lang::EventObject& _rEvent) throw(RuntimeException) { osl::MutexGuard aGuard(m_aMutex); - com::sun::star::uno::Reference<starsdbc::XRowSet> xForm(_rEvent.Source, com::sun::star::uno::UNO_QUERY); + Reference<XRowSet> xForm(_rEvent.Source, UNO_QUERY); connectToField(xForm); m_bLoaded = sal_True; @@ -1317,19 +1287,19 @@ void SAL_CALL OBoundControlModel::loaded(const com::sun::star::lang::EventObject //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::unloaded( const com::sun::star::lang::EventObject& aEvent ) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::unloaded( const com::sun::star::lang::EventObject& aEvent ) throw(RuntimeException) { } //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::reloading( const com::sun::star::lang::EventObject& aEvent ) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::reloading( const com::sun::star::lang::EventObject& aEvent ) throw(RuntimeException) { osl::MutexGuard aGuard(m_aMutex); m_bForwardValueChanges = sal_False; } //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::unloading(const com::sun::star::lang::EventObject& aEvent) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::unloading(const com::sun::star::lang::EventObject& aEvent) throw(RuntimeException) { osl::MutexGuard aGuard(m_aMutex); _unloaded(); @@ -1344,13 +1314,13 @@ void SAL_CALL OBoundControlModel::unloading(const com::sun::star::lang::EventObj } //------------------------------------------------------------------------------ -void SAL_CALL OBoundControlModel::reloaded(const com::sun::star::lang::EventObject& aEvent) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OBoundControlModel::reloaded(const com::sun::star::lang::EventObject& aEvent) throw(RuntimeException) { osl::MutexGuard aGuard(m_aMutex); // did we lost the connection to the field because there was a new created? if (!m_xField.is()) { - com::sun::star::uno::Reference<starsdbc::XRowSet> xForm(aEvent.Source, com::sun::star::uno::UNO_QUERY); + Reference<XRowSet> xForm(aEvent.Source, UNO_QUERY); connectToField(xForm); } @@ -1378,25 +1348,25 @@ void OBoundControlModel::_reset() } //----------------------------------------------------------------------------- -void OBoundControlModel::addResetListener(const com::sun::star::uno::Reference<starform::XResetListener>& l) throw (com::sun::star::uno::RuntimeException) +void OBoundControlModel::addResetListener(const Reference<XResetListener>& l) throw (RuntimeException) { m_aResetListeners.addInterface(l); } //----------------------------------------------------------------------------- -void OBoundControlModel::removeResetListener(const com::sun::star::uno::Reference<starform::XResetListener>& l) throw (com::sun::star::uno::RuntimeException) +void OBoundControlModel::removeResetListener(const Reference<XResetListener>& l) throw (RuntimeException) { m_aResetListeners.removeInterface(l); } //----------------------------------------------------------------------------- -void OBoundControlModel::reset() throw (com::sun::star::uno::RuntimeException) +void OBoundControlModel::reset() throw (RuntimeException) { cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); - com::sun::star::lang::EventObject aResetEvent(static_cast<com::sun::star::uno::XWeak*>(this)); + com::sun::star::lang::EventObject aResetEvent(static_cast<XWeak*>(this)); sal_Bool bContinue = sal_True; while (aIter.hasMoreElements() && bContinue) - bContinue = reinterpret_cast<starform::XResetListener*>(aIter.next())->approveReset(aResetEvent); + bContinue = reinterpret_cast<XResetListener*>(aIter.next())->approveReset(aResetEvent); if (!bContinue) return; @@ -1419,7 +1389,7 @@ void OBoundControlModel::reset() throw (com::sun::star::uno::RuntimeException) { m_xColumn->getString(); } - catch(...) + catch(Exception&) { DBG_ERROR("OBoundControlModel::reset : XColumn::getString is expected to always succeed !"); } @@ -1427,7 +1397,7 @@ void OBoundControlModel::reset() throw (com::sun::star::uno::RuntimeException) if (bIsNull) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xSet(m_xCursor, com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xSet(m_xCursor, UNO_QUERY); sal_Bool bIsNewRecord = sal_False; if (xSet.is()) xSet->getPropertyValue(PROPERTY_ISNEW) >>= bIsNewRecord; @@ -1451,7 +1421,7 @@ void OBoundControlModel::reset() throw (com::sun::star::uno::RuntimeException) cppu::OInterfaceIteratorHelper aIterDone(m_aResetListeners); while (aIterDone.hasMoreElements()) - reinterpret_cast<starform::XResetListener*>(aIterDone.next())->resetted(aResetEvent); + reinterpret_cast<XResetListener*>(aIterDone.next())->resetted(aResetEvent); } //......................................................................... diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 94ca30cb7e8b..ff2aff0edf92 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedField.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obo $ $Date: 2000-11-09 17:25:12 $ + * 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 @@ -149,16 +149,20 @@ #include <vos/mutex.hxx> #endif // needed as long as we use the SolarMutex +using namespace dbtools; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; -// temporary, 'til the base class of StandardFormatsSupplier is implemented with new UNO -#if SUPD<583 -#ifndef _USR_SMARTCONV_HXX_ -#include <usr/smartconv.hxx> -#endif -#endif -using namespace dbtools; -namespace staruno = ::com::sun::star::uno; //namespace stario = ::com::sun::star::io; /** implements handling for compatibly reading/writing data from/into an input/output stream. @@ -169,9 +173,9 @@ namespace staruno = ::com::sun::star::uno; class OMarkableStreamBlock { - com::sun::star::uno::Reference< com::sun::star::io::XMarkableStream > m_xMarkStream; - com::sun::star::uno::Reference< com::sun::star::io::XDataInputStream > m_xInStream; - com::sun::star::uno::Reference< com::sun::star::io::XDataOutputStream > m_xOutStream; + Reference< XMarkableStream > m_xMarkStream; + Reference< XDataInputStream > m_xInStream; + Reference< XDataOutputStream > m_xOutStream; sal_Int32 m_nBlockStart; sal_Int32 m_nBlockLen; @@ -180,19 +184,19 @@ public: /** starts reading of a "skippable" block of data within the given input stream<BR> The object given by _rxInput must support the XMarkableStream interface. */ - OMarkableStreamBlock(const com::sun::star::uno::Reference< com::sun::star::io::XDataInputStream >& _rxInput); + OMarkableStreamBlock(const Reference< XDataInputStream >& _rxInput); /** starts writing of a "skippable" block of data into the given output stream The object given by _rxOutput must support the XMarkableStream interface. */ - OMarkableStreamBlock(const com::sun::star::uno::Reference< com::sun::star::io::XDataOutputStream >& _rxOutput); + OMarkableStreamBlock(const Reference< XDataOutputStream >& _rxOutput); ~OMarkableStreamBlock(); }; //------------------------------------------------------------------------- -OMarkableStreamBlock::OMarkableStreamBlock(const com::sun::star::uno::Reference< com::sun::star::io::XDataInputStream >& _rxInput) +OMarkableStreamBlock::OMarkableStreamBlock(const Reference< XDataInputStream >& _rxInput) :m_xInStream(_rxInput) - ,m_xMarkStream(_rxInput, ::com::sun::star::uno::UNO_QUERY) + ,m_xMarkStream(_rxInput, UNO_QUERY) ,m_nBlockStart(-1) ,m_nBlockLen(-1) { @@ -205,9 +209,9 @@ OMarkableStreamBlock::OMarkableStreamBlock(const com::sun::star::uno::Reference< } //------------------------------------------------------------------------- -OMarkableStreamBlock::OMarkableStreamBlock(const com::sun::star::uno::Reference< com::sun::star::io::XDataOutputStream >& _rxOutput) +OMarkableStreamBlock::OMarkableStreamBlock(const Reference< XDataOutputStream >& _rxOutput) :m_xOutStream(_rxOutput) - ,m_xMarkStream(_rxOutput, ::com::sun::star::uno::UNO_QUERY) + ,m_xMarkStream(_rxOutput, UNO_QUERY) ,m_nBlockStart(-1) ,m_nBlockLen(-1) { @@ -240,9 +244,6 @@ OMarkableStreamBlock::~OMarkableStreamBlock() } } -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; - //......................................................................... namespace frm { @@ -257,7 +258,7 @@ protected: public: StandardFormatsSupplier(const Reference<XMultiServiceFactory>& _rxFactory); - operator com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> (); + operator Reference<XNumberFormatsSupplier> (); SvNumberFormatsSupplierObj::operator new; SvNumberFormatsSupplierObj::operator delete; @@ -267,7 +268,7 @@ protected: //------------------------------------------------------------------ -StandardFormatsSupplier::StandardFormatsSupplier(const com::sun::star::uno::Reference< starlang::XMultiServiceFactory > & _rxFactory) +StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XMultiServiceFactory > & _rxFactory) :SvNumberFormatsSupplierObj() ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxFactory, Application::GetAppInternational().GetLanguage())) { @@ -275,76 +276,44 @@ StandardFormatsSupplier::StandardFormatsSupplier(const com::sun::star::uno::Refe } //------------------------------------------------------------------ -StandardFormatsSupplier::operator com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> () +StandardFormatsSupplier::operator Reference<XNumberFormatsSupplier> () { -#if SUPD<583 - // our base class is still implemented with old UNO - com::sun::star::uno::Any aOldUno; - XNumberFormatsSupplierRef xOldUnoRef = static_cast<XNumberFormatsSupplier*>(static_cast<SvNumberFormatsSupplierObj*>(this)); - aOldUno.set(&xOldUnoRef, XNumberFormatsSupplier_getReflection()); - - com::sun::star::uno::Any aNewUno; - ::usr::convertUsr2UnoAny(aNewUno, aOldUno); - DBG_ASSERT(isAReference(aNewUno, static_cast<starutil::XNumberFormatsSupplier*>(NULL)), - "StandardFormatsSupplier::operator.... : unexpected conversion result !"); - - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xNewUnoRef; - if (isAReference(aNewUno, static_cast<starutil::XNumberFormatsSupplier*>(NULL))) - aNewUno >>= xNewUnoRef; - - return xNewUnoRef; -#endif - - return static_cast<starutil::XNumberFormatsSupplier*>(static_cast<SvNumberFormatsSupplierObj*>(this)); + return static_cast<XNumberFormatsSupplier*>(static_cast<SvNumberFormatsSupplierObj*>(this)); } //------------------------------------------------------------------ -com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedModel::s_xDefaultFormatter; +Reference<XNumberFormatsSupplier> OFormattedModel::s_xDefaultFormatter; sal_Int32 OFormattedModel::nValueHandle = -1; /*************************************************************************/ //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFormattedControl_CreateInstance(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFormattedControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFormattedControl(_rxFactory)); } //------------------------------------------------------------------ -com::sun::star::uno::Sequence<com::sun::star::uno::Type> OFormattedControl::_getTypes() +Sequence<Type> OFormattedControl::_getTypes() { - static com::sun::star::uno::Sequence<com::sun::star::uno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) - { - // my two base classes - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aBaseClassTypes = OBoundControl::_getTypes(); - - com::sun::star::uno::Sequence<com::sun::star::uno::Type> aOwnTypes(1); - com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((com::sun::star::uno::Reference<starawt::XKeyListener>*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); - } + aTypes = concatSequences(OFormattedControl_BASE::getTypes(), OBoundControl::_getTypes()); return aTypes; } //------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OFormattedControl::queryAggregation(const com::sun::star::uno::Type& _rType) throw (com::sun::star::uno::RuntimeException) +Any SAL_CALL OFormattedControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - com::sun::star::uno::Any aReturn; - - aReturn = OBoundControl::queryAggregation(_rType); + Any aReturn = OBoundControl::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XKeyListener*>(this) - ); - + aReturn = OFormattedControl_BASE::queryInterface(_rType); return aReturn; } DBG_NAME(OFormattedControl); //------------------------------------------------------------------------------ -OFormattedControl::OFormattedControl(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OFormattedControl::OFormattedControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_FORMATTEDFIELD) ,m_nKeyEvent(0) { @@ -352,7 +321,7 @@ OFormattedControl::OFormattedControl(const com::sun::star::uno::Reference<com::s increment(m_refCount); { // als FocusListener anmelden - com::sun::star::uno::Reference<starawt::XWindow> xComp; + Reference<XWindow> xComp; if (query_aggregation(m_xAggregate, xComp)) { xComp->addKeyListener(this); @@ -377,49 +346,51 @@ OFormattedControl::~OFormattedControl() DBG_DTOR(OFormattedControl,NULL); } -// starawt::XKeyListener +// XKeyListener //------------------------------------------------------------------------------ -void OFormattedControl::disposing(const com::sun::star::lang::EventObject& _rSource) throw(com::sun::star::uno::RuntimeException) +void OFormattedControl::disposing(const EventObject& _rSource) throw(RuntimeException) { OBoundControl::disposing(_rSource); } //------------------------------------------------------------------------------ -void OFormattedControl::keyPressed(const starawt::KeyEvent& e) +void OFormattedControl::keyPressed(const KeyEvent& e) { if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 ) return; // Steht das Control in einem Formular mit einer Submit-URL? - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), UNO_QUERY); if( !xSet.is() ) return; - com::sun::star::uno::Reference<starform::XFormComponent> xFComp(xSet, com::sun::star::uno::UNO_QUERY); + Reference<XFormComponent> xFComp(xSet, UNO_QUERY); InterfaceRef xParent = xFComp->getParent(); if( !xParent.is() ) return; - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFormSet(xParent, com::sun::star::uno::UNO_QUERY); + Reference<com::sun::star::beans::XPropertySet> xFormSet(xParent, UNO_QUERY); if( !xFormSet.is() ) return; - com::sun::star::uno::Any aTmp(xFormSet->getPropertyValue( PROPERTY_TARGET_URL )); + Any aTmp(xFormSet->getPropertyValue( PROPERTY_TARGET_URL )); if (!isA(aTmp, static_cast< ::rtl::OUString* >(NULL)) || !getString(aTmp).getLength() ) return; - com::sun::star::uno::Reference<starcontainer::XIndexAccess> xElements(xParent, com::sun::star::uno::UNO_QUERY); + Reference<XIndexAccess> xElements(xParent, UNO_QUERY); sal_Int32 nCount = xElements->getCount(); if( nCount > 1 ) { + + Reference<com::sun::star::beans::XPropertySet> xFCSet; for( sal_Int32 nIndex=0; nIndex < nCount; nIndex++ ) { - // staruno::Any aElement(xElements->getByIndex(nIndex)); - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFCSet(*(InterfaceRef *)xElements->getByIndex(nIndex).getValue(), com::sun::star::uno::UNO_QUERY); + // Any aElement(xElements->getByIndex(nIndex)); + xElements->getByIndex(nIndex) >>= xFCSet; if (hasProperty(PROPERTY_CLASSID, xFCSet) && - getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == starform::FormComponentType::TEXTFIELD) + getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD) { // Noch ein weiteres Edit gefunden ==> dann nicht submitten if (xFCSet != xSet) @@ -436,7 +407,7 @@ void OFormattedControl::keyPressed(const starawt::KeyEvent& e) } //------------------------------------------------------------------------------ -void OFormattedControl::keyReleased(const starawt::KeyEvent& e) +void OFormattedControl::keyReleased(const KeyEvent& e) { } @@ -445,11 +416,11 @@ IMPL_LINK(OFormattedControl, OnKeyPressed, void*, EMPTYARG) { m_nKeyEvent = 0; - com::sun::star::uno::Reference<starform::XFormComponent> xFComp(getModel(), com::sun::star::uno::UNO_QUERY); + Reference<XFormComponent> xFComp(getModel(), UNO_QUERY); InterfaceRef xParent = xFComp->getParent(); - com::sun::star::uno::Reference<starform::XSubmit> xSubmit(xParent, com::sun::star::uno::UNO_QUERY); + Reference<XSubmit> xSubmit(xParent, UNO_QUERY); if (xSubmit.is()) - xSubmit->submit( com::sun::star::uno::Reference<starawt::XControl> (), starawt::MouseEvent() ); + xSubmit->submit( Reference<XControl> (), MouseEvent() ); return 0L; } @@ -472,13 +443,13 @@ void OFormattedControl::setDesignMode(sal_Bool bOn) /*************************************************************************/ //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFormattedModel_CreateInstance(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFormattedModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFormattedModel(_rxFactory)); } //------------------------------------------------------------------ -OFormattedModel::OFormattedModel(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OFormattedModel::OFormattedModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_FORMATTEDFIELD, FRM_CONTROL_FORMATTEDFIELD ) // use the old control name for compytibility reasons ,OPropertyChangeListener(m_aMutex) @@ -486,9 +457,9 @@ OFormattedModel::OFormattedModel(const com::sun::star::uno::Reference<com::sun:: ,m_bNumeric(sal_False) ,m_xOriginalFormatter(NULL) ,m_aNullDate(DBTypeConversion::STANDARD_DB_DATE) - ,m_nKeyType(starutil::NumberFormat::UNDEFINED) + ,m_nKeyType(NumberFormat::UNDEFINED) { - m_nClassId = starform::FormComponentType::TEXTFIELD; + m_nClassId = FormComponentType::TEXTFIELD; increment(m_refCount); setPropertyToDefaultByHandle(PROPERTY_ID_FORMATSSUPPLIER); @@ -507,7 +478,7 @@ OFormattedModel::OFormattedModel(const com::sun::star::uno::Reference<com::sun:: decrement(m_refCount); } -// com::sun::star::lang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OFormattedModel::getSupportedServiceNames() throw() { @@ -520,7 +491,7 @@ StringSequence OFormattedModel::getSupportedServiceNames() throw() return aSupported; } -// stario::XPersistObject +// XPersistObject //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OFormattedModel::getServiceName() { @@ -528,11 +499,11 @@ StringSequence OFormattedModel::getSupportedServiceNames() throw() // return ::rtl::OUString(FRM_COMPONENT_FORMATTEDFIELD); // old (non-sun) name for compatibility ! } -// starbeans::XPropertySet +// XPropertySet //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL OFormattedModel::getPropertySetInfo() throw(com::sun::star::uno::RuntimeException) +Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL OFormattedModel::getPropertySetInfo() throw(RuntimeException) { - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -544,8 +515,8 @@ com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL //------------------------------------------------------------------------------ void OFormattedModel::fillProperties( - com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rProps, - com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rAggregateProps ) const + Sequence< com::sun::star::beans::Property >& _rProps, + Sequence< com::sun::star::beans::Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(11) @@ -556,16 +527,16 @@ void OFormattedModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, com::sun::star::beans::XPropertySet,READONLY, TRANSIENT); + DECL_IFACE_PROP2(BOUNDFIELD, com::sun::star::beans::XPropertySet,READONLY, TRANSIENT); DECL_BOOL_PROP2(FILTERPROPOSAL, BOUND, MAYBEDEFAULT); - DECL_IFACE_PROP2(CONTROLLABEL, com::sun::star::beans::XPropertySet,BOUND, MAYBEVOID); + DECL_IFACE_PROP2(CONTROLLABEL, com::sun::star::beans::XPropertySet,BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); // den Value auf transient, damit das Dokument waehrend der Eingabe nicht als modifiziert gilt .... // (und da der selbstverstaendlich nicht gespeichert werden muss) // ModifyPropertyAttributes(_rAggregateProps, PROPERTY_EFFECTIVE_VALUE, com::sun::star::beans::PropertyAttribute::TRANSIENT, 0); // der Supplier ist fuer uns nur read-only - ModifyPropertyAttributes(_rAggregateProps, PROPERTY_FORMATSSUPPLIER, com::sun::star::beans::PropertyAttribute::READONLY, 0); + ModifyPropertyAttributes(_rAggregateProps, PROPERTY_FORMATSSUPPLIER, com::sun::star::beans::PropertyAttribute::READONLY, 0); // TreatAsNumeric nicht transient : wir wollen es an der UI anbinden (ist noetig, um dem EffectiveDefault // - der kann Text oder Zahl sein - einen Sinn zu geben) ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TREATASNUMERIC, 0, com::sun::star::beans::PropertyAttribute::TRANSIENT); @@ -574,20 +545,20 @@ void OFormattedModel::fillProperties( } //------------------------------------------------------------------------------ -void OFormattedModel::getFastPropertyValue(com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const +void OFormattedModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { OEditBaseModel::getFastPropertyValue(rValue, nHandle); } //------------------------------------------------------------------------------ -void OFormattedModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) +void OFormattedModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) { OEditBaseModel::setFastPropertyValue_NoBroadcast(nHandle, rValue); } //------------------------------------------------------------------------------ -sal_Bool OFormattedModel::convertFastPropertyValue(com::sun::star::uno::Any& rConvertedValue, com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const com::sun::star::uno::Any& rValue) - throw( com::sun::star::lang::IllegalArgumentException ) +sal_Bool OFormattedModel::convertFastPropertyValue(Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) + throw( IllegalArgumentException ) { return OEditBaseModel::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue); } @@ -597,17 +568,17 @@ void OFormattedModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) { if (nHandle == PROPERTY_ID_FORMATSSUPPLIER) { // das aggregierte Model koennte auf die Idee kommen - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = calcDefaultFormatsSupplier(); + Reference<XNumberFormatsSupplier> xSupplier = calcDefaultFormatsSupplier(); DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::setPropertyToDefaultByHandle(FORMATSSUPPLIER) : have no aggregate !"); if (m_xAggregateSet.is()) - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, com::sun::star::uno::makeAny(xSupplier)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier)); } else OEditBaseModel::setPropertyToDefaultByHandle(nHandle); } //------------------------------------------------------------------------------ -void OFormattedModel::setPropertyToDefault(const ::rtl::OUString& aPropertyName) throw( com::sun::star::beans::UnknownPropertyException, com::sun::star::uno::RuntimeException ) +void OFormattedModel::setPropertyToDefault(const ::rtl::OUString& aPropertyName) throw( com::sun::star::beans::UnknownPropertyException, RuntimeException ) { OPropertyArrayAggregationHelper& rPH = (OPropertyArrayAggregationHelper&)getInfoHelper(); sal_Int32 nHandle = rPH.getHandleByName( aPropertyName ); @@ -619,19 +590,19 @@ void OFormattedModel::setPropertyToDefault(const ::rtl::OUString& aPropertyName) } //------------------------------------------------------------------------------ -com::sun::star::uno::Any OFormattedModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const +Any OFormattedModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const { if (nHandle == PROPERTY_ID_FORMATSSUPPLIER) { - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = calcFormFormatsSupplier(); - return com::sun::star::uno::makeAny(xSupplier); + Reference<XNumberFormatsSupplier> xSupplier = calcFormFormatsSupplier(); + return makeAny(xSupplier); } else return OEditBaseModel::getPropertyDefaultByHandle(nHandle); } //------------------------------------------------------------------------------ -com::sun::star::uno::Any SAL_CALL OFormattedModel::getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw( com::sun::star::beans::UnknownPropertyException, com::sun::star::uno::RuntimeException ) +Any SAL_CALL OFormattedModel::getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw( com::sun::star::beans::UnknownPropertyException, RuntimeException ) { OPropertyArrayAggregationHelper& rPH = (OPropertyArrayAggregationHelper&)getInfoHelper(); sal_Int32 nHandle = rPH.getHandleByName( aPropertyName ); @@ -643,17 +614,17 @@ com::sun::star::uno::Any SAL_CALL OFormattedModel::getPropertyDefault( const ::r } //------------------------------------------------------------------------------ -void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyChangeEvent& evt ) throw(com::sun::star::uno::RuntimeException) +void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyChangeEvent& evt ) throw(RuntimeException) { if (evt.Source == m_xAggregate) { if (evt.PropertyName.equals(PROPERTY_FORMATKEY)) { - if (evt.NewValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_LONG) + if (evt.NewValue.getValueType().getTypeClass() == TypeClass_LONG) { try { - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier(calcFormatsSupplier()); + Reference<XNumberFormatsSupplier> xSupplier(calcFormatsSupplier()); m_nKeyType = getNumberFormatType(xSupplier->getNumberFormats(), getINT32(evt.NewValue)); // as m_aSaveValue (which is used by _commit) is format dependent we have // to recalc it, which is done by _onValueChanged @@ -663,7 +634,7 @@ void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyCha _onValueChanged(); } } - catch(...) + catch(Exception&) { } } @@ -676,16 +647,15 @@ void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyCha } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedModel::calcFormatsSupplier() const +Reference<XNumberFormatsSupplier> OFormattedModel::calcFormatsSupplier() const { - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier; + Reference<XNumberFormatsSupplier> xSupplier; DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::calcFormatsSupplier : have no aggregate !"); // hat mein aggregiertes Model einen FormatSupplier ? - com::sun::star::uno::Any aSupplier( m_xAggregateSet.is() ? m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER) : com::sun::star::uno::Any()); - if (aSupplier.hasValue()) - xSupplier = *(com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> *)aSupplier.getValue(); + if( m_xAggregateSet.is() ) + m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xSupplier; if (!xSupplier.is()) // testen, ob meine Parent-starform einen Formatter hat xSupplier = calcFormFormatsSupplier(); @@ -699,21 +669,21 @@ com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedMode } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() const +Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() const { - com::sun::star::uno::Reference<starcontainer::XChild> xMe; - query_interface(static_cast<com::sun::star::uno::XWeak*>(const_cast<OFormattedModel*>(this)), xMe); + Reference<XChild> xMe; + query_interface(static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), xMe); // damit stellen wir sicher, dass wir auch fuer den Fall der Aggregation das richtige // Objekt bekommen DBG_ASSERT(xMe.is(), "OFormattedModel::calcFormFormatsSupplier : I should have a content interface !"); // jetzt durchhangeln nach oben, bis wir auf eine starform treffen (angefangen mit meinem eigenen Parent) - com::sun::star::uno::Reference<starcontainer::XChild> xParent(xMe->getParent(), com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<starform::XForm> xNextParentForm(xParent, com::sun::star::uno::UNO_QUERY); + Reference<XChild> xParent(xMe->getParent(), UNO_QUERY); + Reference<XForm> xNextParentForm(xParent, UNO_QUERY); while (!xNextParentForm.is() && xParent.is()) { - xParent = com::sun::star::uno::Reference<starcontainer::XChild> (xParent->getParent(), com::sun::star::uno::UNO_QUERY); - xNextParentForm = com::sun::star::uno::Reference<starform::XForm> (xParent, com::sun::star::uno::UNO_QUERY); + xParent = Reference<XChild> (xParent->getParent(), UNO_QUERY); + xNextParentForm = Reference<XForm> (xParent, UNO_QUERY); } if (!xNextParentForm.is()) @@ -723,15 +693,15 @@ com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedMode } // den FormatSupplier von meinem Vorfahren (falls der einen hat) - com::sun::star::uno::Reference<starsdbc::XRowSet> xRowSet(xNextParentForm, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier; + Reference<XRowSet> xRowSet(xNextParentForm, UNO_QUERY); + Reference<XNumberFormatsSupplier> xSupplier; if (xRowSet.is()) xSupplier = getNumberFormats(getConnection(xRowSet), sal_True, m_xServiceFactory); return xSupplier; } //------------------------------------------------------------------------------ -com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> OFormattedModel::calcDefaultFormatsSupplier() const +Reference<XNumberFormatsSupplier> OFormattedModel::calcDefaultFormatsSupplier() const { if (!s_xDefaultFormatter.is()) s_xDefaultFormatter = *new StandardFormatsSupplier(m_xServiceFactory); @@ -743,7 +713,7 @@ sal_Int32 OFormattedModel::calcFormatKey() const { DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::calcFormatKey : have no aggregate !"); // hat mein aggregiertes Model einen FormatSupplier ? - com::sun::star::uno::Any aFormatKey = m_xAggregateSet.is() ? m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY): com::sun::star::uno::Any(); + Any aFormatKey = m_xAggregateSet.is() ? m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY): Any(); if (aFormatKey.hasValue()) return getINT32(aFormatKey); @@ -758,9 +728,9 @@ void OFormattedModel::getFormatDescription(::rtl::OUString& sFormat, LanguageTyp { } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ -void OFormattedModel::loaded(const com::sun::star::lang::EventObject& rEvent) +void OFormattedModel::loaded(const EventObject& rEvent) { // HACK : our _loaded accesses our NumberFormatter which locks the solar mutex (as it doesn't have // an own one). To prevent deadlocks with other threads which may request a property from us in an @@ -777,7 +747,7 @@ void OFormattedModel::loaded(const com::sun::star::lang::EventObject& rEvent) } //------------------------------------------------------------------------------ -void OFormattedModel::_loaded(const com::sun::star::lang::EventObject& rEvent) +void OFormattedModel::_loaded(const EventObject& rEvent) { static const ::rtl::OUString s_aNullDataProp = ::rtl::OUString::createFromAscii("NullDate"); @@ -786,66 +756,66 @@ void OFormattedModel::_loaded(const com::sun::star::lang::EventObject& rEvent) DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::_loaded : have no aggregate !"); if (m_xAggregateSet.is()) { // all the following doesn't make any sense if we have no aggregate ... - com::sun::star::uno::Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER); - DBG_ASSERT(((com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> *)aSupplier.getValue())->is(), "OFormattedModel::_loaded : invalid property value !"); - // das sollte im Constructor oder im read auf was richtiges gesetzt worden sein + Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER); + DBG_ASSERT(((Reference<XNumberFormatsSupplier> *)aSupplier.getValue())->is(), "OFormattedModel::_loaded : invalid property value !"); + // das sollte im Constructor oder im read auf was richtiges gesetzt worden sein - com::sun::star::uno::Any aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); + Any aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); if (!aFmtKey.hasValue()) { // unser aggregiertes Model hat noch keine Format-Informationen, also geben wir die von dem Feld, an das // wir gebunden sind, weiter - sal_Int32 nType = starsdbc::DataType::VARCHAR; + sal_Int32 nType = DataType::VARCHAR; if (m_xField.is()) { aFmtKey = m_xField->getPropertyValue(PROPERTY_FORMATKEY); m_xField->getPropertyValue(PROPERTY_FIELDTYPE) >>= nType ; } - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = calcFormFormatsSupplier(); + Reference<XNumberFormatsSupplier> xSupplier = calcFormFormatsSupplier(); DBG_ASSERT(xSupplier.is(), "OFormattedModel::_loaded : bound to a field but no parent with a formatter ? how this ?"); if (xSupplier.is()) { if (!aFmtKey.hasValue()) { // we aren't bound to a field (or this field's format is invalid) // -> determine the standard text format of the supplier - com::sun::star::uno::Reference<starutil::XNumberFormatTypes> xTypes(xSupplier->getNumberFormats(), com::sun::star::uno::UNO_QUERY); + Reference<XNumberFormatTypes> xTypes(xSupplier->getNumberFormats(), UNO_QUERY); if (xTypes.is()) { UniString sLanguage, sCountry; ConvertLanguageToIsoNames(Application::GetAppInternational().GetLanguage(), sLanguage, sCountry); - com::sun::star::lang::Locale aNewLanguage( + Locale aNewLanguage( sLanguage, sCountry, ::rtl::OUString()); } } - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, com::sun::star::uno::makeAny(xSupplier)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier)); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, aFmtKey); - m_xOriginalFormatter = *(com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> *)aSupplier.getValue(); + m_xOriginalFormatter = *(Reference<XNumberFormatsSupplier> *)aSupplier.getValue(); // das Numeric-Flag an mein gebundenes Feld anpassen m_bNumeric = sal_False; switch (nType) { - case starsdbc::DataType::BIT: - case starsdbc::DataType::TINYINT: - case starsdbc::DataType::SMALLINT: - case starsdbc::DataType::INTEGER: - case starsdbc::DataType::BIGINT: - case starsdbc::DataType::FLOAT: - case starsdbc::DataType::REAL: - case starsdbc::DataType::DOUBLE: - case starsdbc::DataType::NUMERIC: - case starsdbc::DataType::DECIMAL: - case starsdbc::DataType::DATE: - case starsdbc::DataType::TIME: - case starsdbc::DataType::TIMESTAMP: + case DataType::BIT: + case DataType::TINYINT: + case DataType::SMALLINT: + case DataType::INTEGER: + case DataType::BIGINT: + case DataType::FLOAT: + case DataType::REAL: + case DataType::DOUBLE: + case DataType::NUMERIC: + case DataType::DECIMAL: + case DataType::DATE: + case DataType::TIME: + case DataType::TIMESTAMP: m_bNumeric = sal_True; break; } m_bOriginalNumeric = getBOOL(getPropertyValue(PROPERTY_TREATASNUMERIC)); - setPropertyValue(PROPERTY_TREATASNUMERIC, com::sun::star::uno::makeAny((sal_Bool)m_bNumeric)); + setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny((sal_Bool)m_bNumeric)); m_nKeyType = getNumberFormatType(xSupplier->getNumberFormats(), getINT32(aFmtKey)); xSupplier->getNumberFormatSettings()->getPropertyValue(s_aNullDataProp) @@ -854,7 +824,7 @@ void OFormattedModel::_loaded(const com::sun::star::lang::EventObject& rEvent) } else { - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = calcFormatsSupplier(); + Reference<XNumberFormatsSupplier> xSupplier = calcFormatsSupplier(); m_bNumeric = getBOOL(getPropertyValue(PROPERTY_TREATASNUMERIC)); m_nKeyType = getNumberFormatType(xSupplier->getNumberFormats(), getINT32(aFmtKey)); @@ -864,7 +834,7 @@ void OFormattedModel::_loaded(const com::sun::star::lang::EventObject& rEvent) } else { // try to get some defaults ... - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = calcFormatsSupplier(); + Reference<XNumberFormatsSupplier> xSupplier = calcFormatsSupplier(); m_bNumeric = getBOOL(getPropertyValue(PROPERTY_TREATASNUMERIC)); m_nKeyType = getNumberFormatType(xSupplier->getNumberFormats(), 0); @@ -881,18 +851,18 @@ void OFormattedModel::_unloaded() OEditBaseModel::_unloaded(); if (m_xOriginalFormatter.is()) { // unser aggregiertes Model hatte keinerlei Format-Informationen - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, com::sun::star::uno::makeAny(m_xOriginalFormatter)); - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, com::sun::star::uno::Any()); - setPropertyValue(PROPERTY_TREATASNUMERIC, com::sun::star::uno::makeAny((sal_Bool)m_bOriginalNumeric)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(m_xOriginalFormatter)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, Any()); + setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny((sal_Bool)m_bOriginalNumeric)); m_xOriginalFormatter = NULL; } - m_nKeyType = starutil::NumberFormat::UNDEFINED; + m_nKeyType = NumberFormat::UNDEFINED; m_aNullDate = DBTypeConversion::STANDARD_DB_DATE; } //------------------------------------------------------------------------------ -void OFormattedModel::write(const com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { OEditBaseModel::write(_rxOutStream); _rxOutStream->writeShort(0x0003); @@ -902,17 +872,17 @@ void OFormattedModel::write(const com::sun::star::uno::Reference<stario::XObject // mein Format (evtl. void) in ein persistentes Format bringen (der Supplier zusammen mit dem Key ist es zwar auch, // aber deswegen muessen wir ja nicht gleich den ganzen Supplier speichern, das waere ein klein wenig Overhead ;) - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier; - com::sun::star::uno::Any aFmtKey; + Reference<XNumberFormatsSupplier> xSupplier; + Any aFmtKey; sal_Bool bVoidKey = sal_True; if (m_xAggregateSet.is()) { - com::sun::star::uno::Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER); - if (aSupplier.getValueType().getTypeClass() != com::sun::star::uno::TypeClass_VOID) + Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER); + if (aSupplier.getValueType().getTypeClass() != TypeClass_VOID) { - DBG_ASSERT(isAReference(aSupplier, static_cast<starutil::XNumberFormatsSupplier*>(NULL)), + DBG_ASSERT(isAReference(aSupplier, static_cast<XNumberFormatsSupplier*>(NULL)), "OFormattedModel::write : invalid formats supplier !"); - xSupplier = *(com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> *)aSupplier.getValue(); + xSupplier = *(Reference<XNumberFormatsSupplier> *)aSupplier.getValue(); } aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); @@ -925,23 +895,23 @@ void OFormattedModel::write(const com::sun::star::uno::Reference<stario::XObject { // aus dem FormatKey und dem Formatter persistente Angaben basteln - com::sun::star::uno::Any aKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); + Any aKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); sal_Int32 nKey = aKey.hasValue() ? getINT32(aKey) : 0; - com::sun::star::uno::Reference<starutil::XNumberFormats> xFormats = xSupplier->getNumberFormats(); + Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats(); ::rtl::OUString sFormatDescription; LanguageType eFormatLanguage = LANGUAGE_DONTKNOW; static const ::rtl::OUString s_aLocaleProp = ::rtl::OUString::createFromAscii("Locale"); - com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFormat = xFormats->getByKey(nKey); + Reference<com::sun::star::beans::XPropertySet> xFormat = xFormats->getByKey(nKey); if (hasProperty(s_aLocaleProp, xFormat)) { - com::sun::star::uno::Any aLocale = xFormat->getPropertyValue(s_aLocaleProp); - DBG_ASSERT(isA(aLocale, static_cast<com::sun::star::lang::Locale*>(NULL)), "OFormattedModel::write : invalid language property !"); - if (isA(aLocale, static_cast<com::sun::star::lang::Locale*>(NULL))) + Any aLocale = xFormat->getPropertyValue(s_aLocaleProp); + DBG_ASSERT(isA(aLocale, static_cast<Locale*>(NULL)), "OFormattedModel::write : invalid language property !"); + if (isA(aLocale, static_cast<Locale*>(NULL))) { - com::sun::star::lang::Locale* pLocale = (com::sun::star::lang::Locale*)aLocale.getValue(); + Locale* pLocale = (Locale*)aLocale.getValue(); eFormatLanguage = ConvertIsoNamesToLanguage( ::rtl::OUStringToOString(pLocale->Language, RTL_TEXTENCODING_ASCII_US).getStr(), ::rtl::OUStringToOString(pLocale->Country, RTL_TEXTENCODING_ASCII_US).getStr() @@ -967,28 +937,28 @@ void OFormattedModel::write(const com::sun::star::uno::Reference<stario::XObject // and to be a little bit more compatible we make the following section skippable { - com::sun::star::uno::Reference< stario::XDataOutputStream > xOut(_rxOutStream, com::sun::star::uno::UNO_QUERY); + Reference< XDataOutputStream > xOut(_rxOutStream, UNO_QUERY); OMarkableStreamBlock aDownCompat(xOut); // a sub version within the skippable block _rxOutStream->writeShort(0x0000); // version 0: the effective value of the aggregate - com::sun::star::uno::Any aEffectiveValue; + Any aEffectiveValue; if (m_xAggregateSet.is()) { - try { aEffectiveValue = m_xAggregateSet->getPropertyValue(PROPERTY_EFFECTIVE_VALUE); } catch(...) { } + try { aEffectiveValue = m_xAggregateSet->getPropertyValue(PROPERTY_EFFECTIVE_VALUE); } catch(Exception&) { } } { OMarkableStreamBlock aDownCompat2(xOut); switch (aEffectiveValue.getValueType().getTypeClass()) { - case com::sun::star::uno::TypeClass_STRING: + case TypeClass_STRING: _rxOutStream->writeShort(0x0000); _rxOutStream->writeUTF(::comphelper::getString(aEffectiveValue)); break; - case com::sun::star::uno::TypeClass_DOUBLE: + case TypeClass_DOUBLE: _rxOutStream->writeShort(0x0001); _rxOutStream->writeDouble(::comphelper::getDouble(aEffectiveValue)); break; @@ -1002,12 +972,12 @@ void OFormattedModel::write(const com::sun::star::uno::Reference<stario::XObject } //------------------------------------------------------------------------------ -void OFormattedModel::read(const com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream) +void OFormattedModel::read(const Reference<XObjectInputStream>& _rxInStream) { OEditBaseModel::read(_rxInStream); sal_uInt16 nVersion = _rxInStream->readShort(); - com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier; + Reference<XNumberFormatsSupplier> xSupplier; sal_Int32 nKey = -1; switch (nVersion) { @@ -1018,20 +988,20 @@ void OFormattedModel::read(const com::sun::star::uno::Reference<stario::XObjectI sal_Bool bNonVoidKey = _rxInStream->readBoolean(); if (bNonVoidKey) { - // den String und die starutil::Language lesen .... + // den String und die Language lesen .... ::rtl::OUString sFormatDescription = _rxInStream->readUTF(); LanguageType eDescriptionLanguage = (LanguageType)_rxInStream->readLong(); // und daraus von einem Formatter zu einem Key zusammenwuerfeln lassen ... xSupplier = calcFormatsSupplier(); // calcFormatsSupplier nimmt erst den vom Model, dann einen von der starform, dann einen ganz neuen .... - com::sun::star::uno::Reference<starutil::XNumberFormats> xFormats = xSupplier->getNumberFormats(); + Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats(); if (xFormats.is()) { UniString sLanguage, sCountry; ConvertLanguageToIsoNames(eDescriptionLanguage, sLanguage, sCountry); - com::sun::star::lang::Locale aDescriptionLanguage( + Locale aDescriptionLanguage( sLanguage, sCountry, ::rtl::OUString()); @@ -1047,13 +1017,13 @@ void OFormattedModel::read(const com::sun::star::uno::Reference<stario::XObjectI if (nVersion == 0x0003) { // since version 3 there is a "skippable" block at this position - com::sun::star::uno::Reference< stario::XDataInputStream > xIn(_rxInStream, com::sun::star::uno::UNO_QUERY); + Reference< XDataInputStream > xIn(_rxInStream, UNO_QUERY); OMarkableStreamBlock aDownCompat(xIn); sal_Int16 nSubVersion = _rxInStream->readShort(); // version 0 and higher : the "effective value" property - com::sun::star::uno::Any aEffectiveValue; + Any aEffectiveValue; { OMarkableStreamBlock aDownCompat2(xIn); switch (_rxInStream->readShort()) @@ -1079,7 +1049,7 @@ void OFormattedModel::read(const com::sun::star::uno::Reference<stario::XObjectI { m_xAggregateSet->setPropertyValue(PROPERTY_EFFECTIVE_VALUE, aEffectiveValue); } - catch(...) + catch(Exception&) { } } @@ -1095,8 +1065,8 @@ void OFormattedModel::read(const com::sun::star::uno::Reference<stario::XObjectI if ((nKey != -1) && m_xAggregateSet.is()) { - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, com::sun::star::uno::makeAny(xSupplier)); - m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, com::sun::star::uno::makeAny((sal_Int32)nKey)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier)); + m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, makeAny((sal_Int32)nKey)); } else { @@ -1114,12 +1084,12 @@ sal_Int16 OFormattedModel::getPersistenceFlags() const //------------------------------------------------------------------------------ sal_Bool OFormattedModel::_commit() { - com::sun::star::uno::Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OFormattedModel::nValueHandle ); + Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OFormattedModel::nValueHandle ); if (!compare(aNewValue, m_aSaveValue)) { // Leerstring + EmptyIsNull = void if (!aNewValue.hasValue() || - (aNewValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_STRING) + (aNewValue.getValueType().getTypeClass() == TypeClass_STRING) && (getString(aNewValue).getLength() == 0) && m_bEmptyIsNull) m_xColumnUpdate->updateNull(); else @@ -1127,17 +1097,17 @@ sal_Bool OFormattedModel::_commit() // als Value koennen nur double, string oder void auftreten try { - if (aNewValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_DOUBLE) + if (aNewValue.getValueType().getTypeClass() == TypeClass_DOUBLE) { DBTypeConversion::setValue(m_xColumnUpdate, m_aNullDate, getDouble(aNewValue), m_nKeyType); } else { - DBG_ASSERT(aNewValue.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_STRING, "OFormattedModel::_commit : invalud value type !"); + DBG_ASSERT(aNewValue.getValueType().getTypeClass() == TypeClass_STRING, "OFormattedModel::_commit : invalud value type !"); m_xColumnUpdate->updateString(getString(aNewValue)); } } - catch(...) + catch(Exception&) { return sal_False; } @@ -1147,7 +1117,7 @@ sal_Bool OFormattedModel::_commit() return sal_True; } -// starbeans::XPropertyChangeListener +// XPropertyChangeListener //------------------------------------------------------------------------------ void OFormattedModel::_onValueChanged() { @@ -1168,7 +1138,7 @@ void OFormattedModel::_onValueChanged() } } -// starform::XReset +// XReset //------------------------------------------------------------------------------ void OFormattedModel::_reset( void ) { @@ -1177,7 +1147,7 @@ void OFormattedModel::_reset( void ) DBG_ERROR("OFormattedModel::_reset : no aggregate !"); return; } - com::sun::star::uno::Any aValue = m_xAggregateSet->getPropertyValue(PROPERTY_EFFECTIVE_DEFAULT); + Any aValue = m_xAggregateSet->getPropertyValue(PROPERTY_EFFECTIVE_DEFAULT); { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with // our own mutex locked @@ -1191,3 +1161,7 @@ void OFormattedModel::_reset( void ) } //......................................................................... + + + + diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx index c1374dd87751..e161ac99f823 100644 --- a/forms/source/component/FormattedField.hxx +++ b/forms/source/component/FormattedField.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedField.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -73,6 +73,10 @@ #ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_ #include <comphelper/propmultiplex.hxx> #endif +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif + //......................................................................... namespace frm @@ -88,35 +92,35 @@ class OFormattedModel { // das Original, falls ich die Format-Properties meines aggregierten Models gefaket, d.h. von dem Feld, an das // ich gebunden bin, weitergereicht habe (nur gueltig wenn loaded) - staruno::Reference<starutil::XNumberFormatsSupplier> m_xOriginalFormatter; - starutil::Date m_aNullDate; - staruno::Any m_aSaveValue; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> m_xOriginalFormatter; + ::com::sun::star::util::Date m_aNullDate; + ::com::sun::star::uno::Any m_aSaveValue; sal_Int16 m_nKeyType; sal_Bool m_bOriginalNumeric : 1, m_bNumeric : 1; // analog fuer TreatAsNumeric-Property - static staruno::Reference<starutil::XNumberFormatsSupplier> s_xDefaultFormatter; + static ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> s_xDefaultFormatter; static sal_Int32 nValueHandle; // falls ich wirklich mal einen selber benutzen muss, wird der zwischen allen Instanzen geteilt protected: virtual void _onValueChanged(); - staruno::Reference<starutil::XNumberFormatsSupplier> calcDefaultFormatsSupplier() const; - staruno::Reference<starutil::XNumberFormatsSupplier> calcFormFormatsSupplier() const; - staruno::Reference<starutil::XNumberFormatsSupplier> calcFormatsSupplier() const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcDefaultFormatsSupplier() const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcFormFormatsSupplier() const; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier> calcFormatsSupplier() const; sal_Int32 calcFormatKey() const; void getFormatDescription(::rtl::OUString& sFormat, LanguageType& eLanguage); - OFormattedModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OFormattedModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); - friend InterfaceRef SAL_CALL OFormattedModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + friend InterfaceRef SAL_CALL OFormattedModel_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); friend class OFormattedFieldWrapper; public: -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OFormattedModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); @@ -124,44 +128,44 @@ public: virtual sal_Bool _commit(); // stario::XPersistObject - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream); virtual ::rtl::OUString SAL_CALL getServiceName(); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - 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); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); // starform::XLoadListener - virtual void SAL_CALL loaded(const starlang::EventObject& rEvent); - virtual void _loaded(const starlang::EventObject& rEvent); + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& rEvent); + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); virtual void _unloaded(); // starform::XReset virtual void _reset( void ); -// starbeans::XPropertyState +// ::com::sun::star::beans::XPropertyState void setPropertyToDefaultByHandle(sal_Int32 nHandle); - staruno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; + ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; - void SAL_CALL setPropertyToDefault(const ::rtl::OUString& aPropertyName) throw(starbeans::UnknownPropertyException, staruno::RuntimeException); - staruno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(starbeans::UnknownPropertyException, staruno::RuntimeException); + void SAL_CALL setPropertyToDefault(const ::rtl::OUString& aPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() // OPropertyChangeListener - virtual void _propertyChanged(const starbeans::PropertyChangeEvent& evt) throw(staruno::RuntimeException); + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); protected: virtual sal_Int16 getPersistenceFlags() const; @@ -171,32 +175,33 @@ protected: //================================================================== //= OFormattedControl //================================================================== +typedef ::cppu::ImplHelper1< ::com::sun::star::awt::XKeyListener> OFormattedControl_BASE; class OFormattedControl : public OBoundControl - ,public starawt::XKeyListener + ,public OFormattedControl_BASE { sal_uInt32 m_nKeyEvent; public: - OFormattedControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OFormattedControl(); DECLARE_UNO3_AGG_DEFAULTS(OFormattedControl, OBoundControl); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OFormattedControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException); +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); -// starawt::XKeyListener - virtual void SAL_CALL keyPressed(const starawt::KeyEvent& e); - virtual void SAL_CALL keyReleased(const starawt::KeyEvent& e); +// ::com::sun::star::awt::XKeyListener + virtual void SAL_CALL keyPressed(const ::com::sun::star::awt::KeyEvent& e); + virtual void SAL_CALL keyReleased(const ::com::sun::star::awt::KeyEvent& e); -// starawt::XControl +// ::com::sun::star::awt::XControl virtual void SAL_CALL setDesignMode(sal_Bool bOn); private: diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx index c994f4738e8f..c5ff407f42cb 100644 --- a/forms/source/component/FormattedFieldWrapper.cxx +++ b/forms/source/component/FormattedFieldWrapper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedFieldWrapper.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -94,24 +94,35 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // OFormattedFieldWrapper //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFormattedFieldWrapper(_rxFactory, sal_True)); } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFormattedFieldWrapper(_rxFactory, sal_False)); } //------------------------------------------------------------------ -OFormattedFieldWrapper::OFormattedFieldWrapper(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, sal_Bool _bActAsFormatted) +OFormattedFieldWrapper::OFormattedFieldWrapper(const Reference<XMultiServiceFactory>& _rxFactory, sal_Bool _bActAsFormatted) :m_pEditPart(NULL) ,m_xServiceFactory(_rxFactory) { @@ -123,10 +134,10 @@ OFormattedFieldWrapper::OFormattedFieldWrapper(const staruno::Reference<starlang InterfaceRef xFormattedModel; // (instantiate it directly ..., as the OFormattedModel isn't registered for any service names anymore) OFormattedModel* pModel = new OFormattedModel(m_xServiceFactory); - query_interface(static_cast<staruno::XWeak*>(pModel), xFormattedModel); + query_interface(static_cast<XWeak*>(pModel), xFormattedModel); - m_xAggregate = staruno::Reference<staruno::XAggregation> (xFormattedModel, staruno::UNO_QUERY); - DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::OFormattedFieldWrapper : the OFormattedModel didn't have an staruno::XAggregation interface !"); + m_xAggregate = Reference<XAggregation> (xFormattedModel, UNO_QUERY); + DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::OFormattedFieldWrapper : the OFormattedModel didn't have an XAggregation interface !"); // _before_ setting the delegator, give it to the member references query_interface(xFormattedModel, m_xFormattedPart); @@ -135,7 +146,7 @@ OFormattedFieldWrapper::OFormattedFieldWrapper(const staruno::Reference<starlang } if (m_xAggregate.is()) { // has to be in it's own block because of the temporary variable created by *this - m_xAggregate->setDelegator(static_cast<staruno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } decrement(m_refCount); } @@ -153,11 +164,11 @@ OFormattedFieldWrapper::~OFormattedFieldWrapper() } //------------------------------------------------------------------ -staruno::Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; + Any aReturn; - if (_rType.equals( ::getCppuType( static_cast< staruno::Reference< starlang::XTypeProvider >* >(NULL) ) ) ) + if (_rType.equals( ::getCppuType( static_cast< Reference< XTypeProvider >* >(NULL) ) ) ) { // a XTypeProvider interface needs a working aggregate - we don't want to give the type provider // of our base class (OWeakAggObject) to the caller as it supplies nearly nothing ensureAggregate(); @@ -166,34 +177,36 @@ staruno::Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const staruno::Ty } if (!aReturn.hasValue()) + { aReturn = OWeakAggObject::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<stario::XPersistObject*>(this) - ); - - if (!aReturn.hasValue()) - { - // somebody requests an interface other than the basics (staruno::XInterface) and other than - // the only one we can supply without an aggregate. So ensure the aggregate exists. - ensureAggregate(); - if (m_xAggregate.is()) - aReturn = m_xAggregate->queryAggregation(_rType); + if (!aReturn.hasValue()) + { + aReturn = ::cppu::queryInterface(_rType,static_cast<XPersistObject*>(this)); + + if (!aReturn.hasValue()) + { + // somebody requests an interface other than the basics (XInterface) and other than + // the only one we can supply without an aggregate. So ensure the aggregate exists. + ensureAggregate(); + if (m_xAggregate.is()) + aReturn = m_xAggregate->queryAggregation(_rType); + } + } } return aReturn; } //------------------------------------------------------------------ -::rtl::OUString SAL_CALL OFormattedFieldWrapper::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OFormattedFieldWrapper::getServiceName() throw(RuntimeException) { // return the old compatibility name for an EditModel return FRM_COMPONENT_EDIT; } //------------------------------------------------------------------ -void SAL_CALL OFormattedFieldWrapper::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw( stario::IOException, staruno::RuntimeException ) +void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>& _rxOutStream) throw( IOException, RuntimeException ) { // can't write myself ensureAggregate(); @@ -201,10 +214,10 @@ void SAL_CALL OFormattedFieldWrapper::write(const staruno::Reference<stario::XOb // if we act as real edit field, we can simple forward this write request if (!m_xFormattedPart.is()) { - staruno::Reference<stario::XPersistObject> xAggregatePersistence; + Reference<XPersistObject> xAggregatePersistence; query_aggregation(m_xAggregate, xAggregatePersistence); DBG_ASSERT(xAggregatePersistence.is(), "OFormattedFieldWrapper::write : don't know how to handle this : can't write !"); - // oops ... We gave an stario::XPersistObject interface to the caller but now we aren't an stario::XPersistObject ... + // oops ... We gave an XPersistObject interface to the caller but now we aren't an XPersistObject ... if (xAggregatePersistence.is()) xAggregatePersistence->write(_rxOutStream); return; @@ -214,13 +227,13 @@ void SAL_CALL OFormattedFieldWrapper::write(const staruno::Reference<stario::XOb DBG_ASSERT(m_pEditPart, "OFormattedFieldWrapper::write : formatted part without edit part ?"); // for this we transfer the current props of the formatted part to the edit part - staruno::Reference<starbeans::XPropertySet> xFormatProps(m_xFormattedPart, staruno::UNO_QUERY); - staruno::Reference<starbeans::XPropertySet> xEditProps; - query_interface(static_cast<staruno::XWeak*>(m_pEditPart), xEditProps); + Reference<XPropertySet> xFormatProps(m_xFormattedPart, UNO_QUERY); + Reference<XPropertySet> xEditProps; + query_interface(static_cast<XWeak*>(m_pEditPart), xEditProps); UniString sLanguage, sCountry; ConvertLanguageToIsoNames(Application::GetAppInternational().GetLanguage(), sLanguage, sCountry); - starlang::Locale aAppLanguage( + Locale aAppLanguage( sLanguage, sCountry, ::rtl::OUString()); @@ -237,7 +250,7 @@ void SAL_CALL OFormattedFieldWrapper::write(const staruno::Reference<stario::XOb } //------------------------------------------------------------------ -void SAL_CALL OFormattedFieldWrapper::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw( stario::IOException, staruno::RuntimeException ) +void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& _rxInStream) throw( IOException, RuntimeException ) { if (m_xAggregate.is()) { // we alread did a decision if we're an EditModel or a FormattedModel @@ -251,7 +264,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const staruno::Reference<stario::XObj // b) it was written by a version using edit headers // as we can distinguish a) from b) only after we have read the edit part, we need to remember the // position - staruno::Reference<stario::XMarkableStream> xInMarkable(_rxInStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xInMarkable(_rxInStream, UNO_QUERY); DBG_ASSERT(xInMarkable.is(), "OFormattedFieldWrapper::read : can only work with markable streams !"); sal_Int32 nBeforeEditPart = xInMarkable->createMark(); @@ -265,10 +278,10 @@ void SAL_CALL OFormattedFieldWrapper::read(const staruno::Reference<stario::XObj xInMarkable->deleteMark(nBeforeEditPart); } - staruno::Reference<stario::XPersistObject> xAggregatePersistence; + Reference<XPersistObject> xAggregatePersistence; query_aggregation(m_xAggregate, xAggregatePersistence); DBG_ASSERT(xAggregatePersistence.is(), "OFormattedFieldWrapper::read : don't know how to handle this : can't read !"); - // oops ... We gave an stario::XPersistObject interface to the caller but now we aren't an stario::XPersistObject ... + // oops ... We gave an XPersistObject interface to the caller but now we aren't an XPersistObject ... if (xAggregatePersistence.is()) xAggregatePersistence->read(_rxInStream); @@ -294,7 +307,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const staruno::Reference<stario::XObj pFormattedReader->read(_rxInStream); // for the next write (if any) : the FormattedModel and the EditModel parts - query_interface(static_cast<staruno::XWeak*>(pFormattedReader), m_xFormattedPart); + query_interface(static_cast<XWeak*>(pFormattedReader), m_xFormattedPart); m_pEditPart = pBasicReader; m_pEditPart->acquire(); @@ -305,12 +318,12 @@ void SAL_CALL OFormattedFieldWrapper::read(const staruno::Reference<stario::XObj // do the aggregation increment(m_refCount); { - query_interface(static_cast<staruno::XWeak*>(pNewAggregate), m_xAggregate); - DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::read : the OEditModel didn't have an staruno::XAggregation interface !"); + query_interface(static_cast<XWeak*>(pNewAggregate), m_xAggregate); + DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::read : the OEditModel didn't have an XAggregation interface !"); } if (m_xAggregate.is()) { // has to be in it's own block because of the temporary variable created by *this - m_xAggregate->setDelegator(static_cast<staruno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } decrement(m_refCount); } @@ -330,15 +343,15 @@ void OFormattedFieldWrapper::ensureAggregate() { // arghhh ... instantiate it directly ... it's dirty, but we really need this aggregate OEditModel* pModel = new OEditModel(m_xServiceFactory); - query_interface(static_cast<staruno::XWeak*>(pModel), xEditModel); + query_interface(static_cast<XWeak*>(pModel), xEditModel); } - m_xAggregate = staruno::Reference<staruno::XAggregation> (xEditModel, staruno::UNO_QUERY); - DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::ensureAggregate : the OEditModel didn't have an staruno::XAggregation interface !"); + m_xAggregate = Reference<XAggregation> (xEditModel, UNO_QUERY); + DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::ensureAggregate : the OEditModel didn't have an XAggregation interface !"); } if (m_xAggregate.is()) { // has to be in it's own block because of the temporary variable created by *this - m_xAggregate->setDelegator(static_cast<staruno::XWeak*>(this)); + m_xAggregate->setDelegator(static_cast<XWeak*>(this)); } decrement(m_refCount); } diff --git a/forms/source/component/FormattedFieldWrapper.hxx b/forms/source/component/FormattedFieldWrapper.hxx index d050990c85fe..99b150fb5f3a 100644 --- a/forms/source/component/FormattedFieldWrapper.hxx +++ b/forms/source/component/FormattedFieldWrapper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FormattedFieldWrapper.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -75,37 +75,37 @@ class OEditModel; //= OFormattedFieldWrapper //================================================================== class OFormattedFieldWrapper - :public stario::XPersistObject + :public ::com::sun::star::io::XPersistObject ,public ::cppu::OWeakAggObject { - staruno::Reference<starlang::XMultiServiceFactory> m_xServiceFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory; protected: - staruno::Reference<staruno::XAggregation> m_xAggregate; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation> m_xAggregate; OEditModel* m_pEditPart; // if we act as formatted this is used to write the EditModel part - staruno::Reference<stario::XPersistObject> m_xFormattedPart; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject> m_xFormattedPart; // if we act as formatted, this is the PersistObject interface of our aggregate, used // to read and write the FormattedModel part - OFormattedFieldWrapper(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory, sal_Bool _bActAsFormatted); + OFormattedFieldWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, sal_Bool _bActAsFormatted); // if _bActAsFormatted is sal_False, the state is undetermined until somebody calls ::read or does // anything which requires a living aggregate virtual ~OFormattedFieldWrapper(); - friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); - friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + friend InterfaceRef SAL_CALL OFormattedFieldWrapper_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); public: // UNO DECLARE_UNO3_AGG_DEFAULTS(OFormattedFieldWrapper, OWeakAggObject); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); - // stario::XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + // ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); protected: /// ensure we're in a defined state, which means a FormattedModel _OR_ an EditModel diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx index 75999c5bf811..6e33514854f9 100644 --- a/forms/source/component/FormsCollection.cxx +++ b/forms/source/component/FormsCollection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FormsCollection.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -80,43 +80,40 @@ namespace frm { //......................................................................... - +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::container; //------------------------------------------------------------------ DBG_NAME(OFormsCollection) //------------------------------------------------------------------ -InterfaceRef SAL_CALL OFormsCollection_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OFormsCollection_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OFormsCollection(_rxFactory)); } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OFormsCollection::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OFormsCollection::getServiceName() throw(RuntimeException) { return FRM_SUN_FORMS_COLLECTION; } //------------------------------------------------------------------------------ -staruno::Sequence< sal_Int8 > SAL_CALL OFormsCollection::getImplementationId( ) throw(staruno::RuntimeException) +Sequence< sal_Int8 > SAL_CALL OFormsCollection::getImplementationId( ) throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> SAL_CALL OFormsCollection::getTypes() throw(staruno::RuntimeException) +Sequence<Type> SAL_CALL OFormsCollection::getTypes() throw(RuntimeException) { - staruno::Sequence<staruno::Type> aBaseTypes = OInterfaceContainer::getTypes(); - staruno::Sequence<staruno::Type> aComponentTypes = FormsCollectionComponentBase::getTypes(); - - staruno::Sequence<staruno::Type> aOwnTypes(1); - aOwnTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XChild>*>(NULL)); - - return concatSequences(aBaseTypes, aComponentTypes, aOwnTypes); + return concatSequences(OInterfaceContainer::getTypes(), FormsCollectionComponentBase::getTypes(), OFormsCollection_BASE::getTypes()); } //------------------------------------------------------------------ -OFormsCollection::OFormsCollection(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OFormsCollection::OFormsCollection(const Reference<XMultiServiceFactory>& _rxFactory) :FormsCollectionComponentBase(m_aMutex) - ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<staruno::Reference<starform::XForm>*>(NULL))) + ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<Reference<XForm>*>(NULL))) { DBG_CTOR(OFormsCollection, NULL); } @@ -133,33 +130,30 @@ OFormsCollection::~OFormsCollection() } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OFormsCollection::queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException) +Any SAL_CALL OFormsCollection::queryAggregation(const Type& _rType) throw(RuntimeException) { - staruno::Any aReturn = ::cppu::queryInterface( - _rType, - static_cast<starcontainer::XChild*>(this), - static_cast<starlang::XServiceInfo*>(this) - ); - + Any aReturn = OFormsCollection_BASE::queryInterface(_rType); if (!aReturn.hasValue()) + { aReturn = OInterfaceContainer::queryInterface(_rType); - if (!aReturn.hasValue()) - aReturn = FormsCollectionComponentBase::queryAggregation(_rType); + if (!aReturn.hasValue()) + aReturn = FormsCollectionComponentBase::queryAggregation(_rType); + } return aReturn; } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OFormsCollection::getImplementationName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OFormsCollection::getImplementationName() throw(RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.form.OFormsCollection"); } //------------------------------------------------------------------------------ -sal_Bool SAL_CALL OFormsCollection::supportsService( const ::rtl::OUString& _rServiceName ) throw(staruno::RuntimeException) +sal_Bool SAL_CALL OFormsCollection::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException) { - staruno::Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); + Sequence<rtl::OUString> aSupported = getSupportedServiceNames(); const rtl::OUString* pSupported = aSupported.getConstArray(); for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) if (pSupported->equals(_rServiceName)) @@ -168,7 +162,7 @@ sal_Bool SAL_CALL OFormsCollection::supportsService( const ::rtl::OUString& _rSe } //------------------------------------------------------------------------------ -StringSequence SAL_CALL OFormsCollection::getSupportedServiceNames() throw(staruno::RuntimeException) +StringSequence SAL_CALL OFormsCollection::getSupportedServiceNames() throw(RuntimeException) { StringSequence aReturn(2); @@ -189,14 +183,14 @@ void OFormsCollection::disposing() //XChild //------------------------------------------------------------------------------ -void OFormsCollection::setParent(const InterfaceRef& Parent) throw( starlang::NoSupportException, staruno::RuntimeException ) +void OFormsCollection::setParent(const InterfaceRef& Parent) throw( NoSupportException, RuntimeException ) { ::osl::MutexGuard aGuard( m_aMutex ); m_xParent = Parent; } //------------------------------------------------------------------------------ -InterfaceRef OFormsCollection::getParent() throw( staruno::RuntimeException ) +InterfaceRef OFormsCollection::getParent() throw( RuntimeException ) { return m_xParent; } diff --git a/forms/source/component/FormsCollection.hxx b/forms/source/component/FormsCollection.hxx index b9708b96b6f5..c1239946a8e1 100644 --- a/forms/source/component/FormsCollection.hxx +++ b/forms/source/component/FormsCollection.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FormsCollection.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -66,6 +66,9 @@ #ifndef _CPPUHELPER_COMPONENT_HXX_ #include <cppuhelper/component.hxx> #endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif #ifndef _COMPHELPER_UNO3_HXX_ #include <comphelper/uno3.hxx> @@ -91,45 +94,46 @@ namespace frm // oder auen einen Context uebergeben bekommen //================================================================== typedef ::cppu::OComponentHelper FormsCollectionComponentBase; +typedef ::cppu::ImplHelper2< ::com::sun::star::container::XChild + ,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE; + // else MSVC kills itself on some statements class OFormsCollection :public FormsCollectionComponentBase ,public OInterfaceContainer - ,public starcontainer::XChild - ,public starlang::XServiceInfo - + ,public OFormsCollection_BASE { - ::osl::Mutex m_aMutex; - OImplementationIdsRef m_aHoldIdHelper; + ::osl::Mutex m_aMutex; + OImplementationIdsRef m_aHoldIdHelper; ::comphelper::InterfaceRef m_xParent; // Parent public: - OFormsCollection(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OFormsCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OFormsCollection(); public: DECLARE_UNO3_AGG_DEFAULTS(OFormsCollection, FormsCollectionComponentBase); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); // XTypeProvider - virtual staruno::Sequence< staruno::Type > SAL_CALL getTypes( ) throw(staruno::RuntimeException); - virtual staruno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(staruno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(staruno::RuntimeException); - virtual StringSequence SAL_CALL getSupportedServiceNames( ) throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); -// starcontainer::XChild - virtual ::comphelper::InterfaceRef SAL_CALL getParent() throw(staruno::RuntimeException); - virtual void SAL_CALL setParent(const ::comphelper::InterfaceRef& Parent) throw(starlang::NoSupportException, staruno::RuntimeException); +// ::com::sun::star::container::XChild + virtual ::comphelper::InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent(const ::comphelper::InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); }; //......................................................................... diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 992bc0b2414c..09800fbd8375 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Grid.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -138,6 +138,18 @@ sal_Int32 findPos(const ::rtl::OUString& aStr, const StringSequence& rList) namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; +using namespace ::com::sun::star::view; const sal_uInt16 ROWHEIGHT = 0x0001; const sal_uInt16 FONTTYPE = 0x0002; @@ -150,35 +162,25 @@ const sal_uInt16 RECORDMARKER = 0x0080; const sal_uInt16 BACKGROUNDCOLOR = 0x0100; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OGridControlModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OGridControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OGridControlModel(_rxFactory)); } //------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OGridControlModel::_getTypes() +Sequence<Type> OGridControlModel::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) - { - staruno::Sequence<staruno::Type> aOwnTypes(5); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starform::XGridColumnFactory>*)NULL); - pOwnTypes[1] = getCppuType((staruno::Reference<starview::XSelectionSupplier>*)NULL); - pOwnTypes[2] = getCppuType((staruno::Reference<starawt::XControlModel>*)NULL); - pOwnTypes[3] = getCppuType((staruno::Reference<starform::XReset>*)NULL); - pOwnTypes[4] = getCppuType((staruno::Reference<starform::XLoadListener>*)NULL); - - aTypes = concatSequences(OControlModel::_getTypes(), OInterfaceContainer::getTypes(), aOwnTypes); - } + aTypes = concatSequences(OControlModel::_getTypes(), OInterfaceContainer::getTypes(), OGridControlModel_BASE::getTypes()); return aTypes; } DBG_NAME(OGridControlModel); //------------------------------------------------------------------ -OGridControlModel::OGridControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OGridControlModel::OGridControlModel(const Reference<XMultiServiceFactory>& _rxFactory) :OControlModel(_rxFactory, ::rtl::OUString()) - ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertySet>*>(NULL))) + ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<Reference<XPropertySet>*>(NULL))) ,m_aSelectListeners(m_aMutex) ,m_aResetListeners(m_aMutex) ,m_aDefaultControl(FRM_CONTROL_GRID) // use the old control name for compytibility reasons @@ -193,7 +195,7 @@ OGridControlModel::OGridControlModel(const staruno::Reference<starlang::XMultiSe { DBG_CTOR(OGridControlModel,NULL); - m_nClassId = starform::FormComponentType::GRIDCONTROL; + m_nClassId = FormComponentType::GRIDCONTROL; } //------------------------------------------------------------------ @@ -211,9 +213,9 @@ OGridControlModel::~OGridControlModel() } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ -StringSequence OGridControlModel::getSupportedServiceNames() throw(staruno::RuntimeException) +StringSequence OGridControlModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); @@ -224,40 +226,33 @@ StringSequence OGridControlModel::getSupportedServiceNames() throw(staruno::Runt } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OGridControlModel::queryAggregation( const staruno::Type& _rType ) throw (staruno::RuntimeException) +Any SAL_CALL OGridControlModel::queryAggregation( const Type& _rType ) throw (RuntimeException) { - staruno::Any aReturn = - ::cppu::queryInterface(_rType, - static_cast<starform::XGridColumnFactory*>(this), - static_cast<starawt::XControlModel*>(this), - static_cast<starview::XSelectionSupplier*>(this), - static_cast<starform::XReset*>(this), - static_cast<starform::XLoadListener*>(this), - static_cast<starlang::XEventListener*>(static_cast<starform::XLoadListener*>(this)) - ); + Any aReturn = OGridControlModel_BASE::queryInterface(_rType); if (!aReturn.hasValue()) + { aReturn = OControlModel::queryAggregation(_rType); - if (!aReturn.hasValue()) - aReturn = OInterfaceContainer::queryInterface(_rType); - + if (!aReturn.hasValue()) + aReturn = OInterfaceContainer::queryInterface(_rType); + } return aReturn; } -// starcontainer::XChild +// XChild //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::setParent(const InterfaceRef& Parent) throw(starlang::NoSupportException, staruno::RuntimeException) +void SAL_CALL OGridControlModel::setParent(const InterfaceRef& Parent) throw(NoSupportException, RuntimeException) { - staruno::Reference<starform::XForm> xForm(m_xParent, staruno::UNO_QUERY); - staruno::Reference<starform::XLoadable> xLoadable(xForm, staruno::UNO_QUERY); + Reference<XForm> xForm(m_xParent, UNO_QUERY); + Reference<XLoadable> xLoadable(xForm, UNO_QUERY); if (xLoadable.is()) xLoadable->removeLoadListener(this); OControlModel::setParent(Parent); - xForm = staruno::Reference<starform::XForm> (m_xParent, staruno::UNO_QUERY); - xLoadable = staruno::Reference<starform::XLoadable> (xForm, staruno::UNO_QUERY); + xForm = Reference<XForm> (m_xParent, UNO_QUERY); + xLoadable = Reference<XLoadable> (xForm, UNO_QUERY); if (xLoadable.is()) xLoadable->addLoadListener(this); } @@ -269,91 +264,90 @@ void OGridControlModel::disposing() OControlModel::disposing(); OInterfaceContainer::disposing(); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); m_aSelectListeners.disposeAndClear(aEvt); m_aResetListeners.disposeAndClear(aEvt); } -// starlang::XEventListener +// XEventListener //------------------------------------------------------------------------------ -void OGridControlModel::disposing(const starlang::EventObject& e) throw( staruno::RuntimeException ) +void OGridControlModel::disposing(const EventObject& e) throw( RuntimeException ) { OControlModel::disposing(e); } -// starview::XSelectionSupplier +// XSelectionSupplier //----------------------------------------------------------------------------- -sal_Bool SAL_CALL OGridControlModel::select(const staruno::Any& rElement) throw(starlang::IllegalArgumentException, staruno::RuntimeException) +sal_Bool SAL_CALL OGridControlModel::select(const Any& rElement) throw(IllegalArgumentException, RuntimeException) { - staruno::Reference<starbeans::XPropertySet> xSel; + Reference<XPropertySet> xSel; if (rElement.hasValue() && !::cppu::extractInterface(xSel, rElement)) { - throw starlang::IllegalArgumentException(); + throw IllegalArgumentException(); } - InterfaceRef xMe = static_cast<staruno::XWeak*>(this); + InterfaceRef xMe = static_cast<XWeak*>(this); if (xSel.is()) { - staruno::Reference<starcontainer::XChild> xAsChild(xSel, staruno::UNO_QUERY); + Reference<XChild> xAsChild(xSel, UNO_QUERY); if (!xAsChild.is() || (xAsChild->getParent() != xMe)) { - throw starlang::IllegalArgumentException(); + throw IllegalArgumentException(); } } if (xSel != m_xSelection) { m_xSelection = xSel; - starlang::EventObject aEvt(xMe); - NOTIFY_LISTENERS(m_aSelectListeners, starview::XSelectionChangeListener, selectionChanged, aEvt); + EventObject aEvt(xMe); + NOTIFY_LISTENERS(m_aSelectListeners, XSelectionChangeListener, selectionChanged, aEvt); return sal_True; } - else - return sal_False; + return sal_False; } //----------------------------------------------------------------------------- -staruno::Any SAL_CALL OGridControlModel::getSelection() throw(staruno::RuntimeException) +Any SAL_CALL OGridControlModel::getSelection() throw(RuntimeException) { - return staruno::makeAny(m_xSelection); + return makeAny(m_xSelection); } //----------------------------------------------------------------------------- -void OGridControlModel::addSelectionChangeListener(const staruno::Reference< starview::XSelectionChangeListener >& _rxListener) throw( staruno::RuntimeException ) +void OGridControlModel::addSelectionChangeListener(const Reference< XSelectionChangeListener >& _rxListener) throw( RuntimeException ) { m_aSelectListeners.addInterface(_rxListener); } //----------------------------------------------------------------------------- -void OGridControlModel::removeSelectionChangeListener(const staruno::Reference< starview::XSelectionChangeListener >& _rxListener) throw( staruno::RuntimeException ) +void OGridControlModel::removeSelectionChangeListener(const Reference< XSelectionChangeListener >& _rxListener) throw( RuntimeException ) { m_aSelectListeners.removeInterface(_rxListener); } -// starform::XGridColumnFactory +// XGridColumnFactory //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySet> SAL_CALL OGridControlModel::createColumn(const ::rtl::OUString& ColumnType) +Reference<XPropertySet> SAL_CALL OGridControlModel::createColumn(const ::rtl::OUString& ColumnType) { - const staruno::Sequence< ::rtl::OUString >& rColumnTypes = frm::getColumnTypes(); + const Sequence< ::rtl::OUString >& rColumnTypes = frm::getColumnTypes(); return createColumn(::internal::findPos(ColumnType, rColumnTypes)); } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySet> OGridControlModel::createColumn(sal_Int32 nTypeId) const +Reference<XPropertySet> OGridControlModel::createColumn(sal_Int32 nTypeId) const { - staruno::Reference<starbeans::XPropertySet> xReturn; + Reference<XPropertySet> xReturn; switch (nTypeId) { - case TYPE_CHECKBOX: xReturn = new CheckBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_COMBOBOX: xReturn = new ComboBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_CURRENCYFIELD: xReturn = new CurrencyFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_DATEFIELD: xReturn = new DateFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_LISTBOX: xReturn = new ListBoxColumn(OControlModel::m_xServiceFactory); break; - case TYPE_NUMERICFIELD: xReturn = new NumericFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_PATTERNFIELD: xReturn = new PatternFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_TEXTFIELD: xReturn = new TextFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_TIMEFIELD: xReturn = new TimeFieldColumn(OControlModel::m_xServiceFactory); break; - case TYPE_FORMATTEDFIELD: xReturn = new FormattedFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_CHECKBOX: xReturn = new CheckBoxColumn(OControlModel::m_xServiceFactory); break; + case TYPE_COMBOBOX: xReturn = new ComboBoxColumn(OControlModel::m_xServiceFactory); break; + case TYPE_CURRENCYFIELD: xReturn = new CurrencyFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_DATEFIELD: xReturn = new DateFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_LISTBOX: xReturn = new ListBoxColumn(OControlModel::m_xServiceFactory); break; + case TYPE_NUMERICFIELD: xReturn = new NumericFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_PATTERNFIELD: xReturn = new PatternFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_TEXTFIELD: xReturn = new TextFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_TIMEFIELD: xReturn = new TimeFieldColumn(OControlModel::m_xServiceFactory); break; + case TYPE_FORMATTEDFIELD: xReturn = new FormattedFieldColumn(OControlModel::m_xServiceFactory); break; default: DBG_ERROR("OGridControlModel::createColumn: Unknown Column"); break; @@ -367,31 +361,31 @@ StringSequence SAL_CALL OGridControlModel::getColumnTypes() return frm::getColumnTypes(); } -// starform::XReset +// XReset //----------------------------------------------------------------------------- void SAL_CALL OGridControlModel::reset() { ::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners); - starlang::EventObject aEvt(static_cast<staruno::XWeak*>(this)); + EventObject aEvt(static_cast<XWeak*>(this)); sal_Bool bContinue = sal_True; while (aIter.hasMoreElements() && bContinue) - bContinue =((starform::XResetListener*)aIter.next())->approveReset(aEvt); + bContinue =((XResetListener*)aIter.next())->approveReset(aEvt); if (bContinue) { _reset(); - NOTIFY_LISTENERS(m_aResetListeners, starform::XResetListener, resetted, aEvt); + NOTIFY_LISTENERS(m_aResetListeners, XResetListener, resetted, aEvt); } } //----------------------------------------------------------------------------- -void SAL_CALL OGridControlModel::addResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) +void SAL_CALL OGridControlModel::addResetListener(const Reference<XResetListener>& _rxListener) { m_aResetListeners.addInterface(_rxListener); } //----------------------------------------------------------------------------- -void SAL_CALL OGridControlModel::removeResetListener(const staruno::Reference<starform::XResetListener>& _rxListener) +void SAL_CALL OGridControlModel::removeResetListener(const Reference<XResetListener>& _rxListener) { m_aResetListeners.removeInterface(_rxListener); } @@ -399,21 +393,21 @@ void SAL_CALL OGridControlModel::removeResetListener(const staruno::Reference<st //----------------------------------------------------------------------------- void OGridControlModel::_reset() { + Reference<XReset> xReset; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) { - staruno::Reference<starform::XReset> xReset; - ::cppu::extractInterface(xReset, getByIndex( nIndex )); + getByIndex( nIndex ) >>= xReset; if (xReset.is()) xReset->reset(); } } -// starbeans::XPropertySet +// XPropertySet //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OGridControlModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OGridControlModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -425,30 +419,30 @@ staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OGridControlModel::getP //------------------------------------------------------------------------------ void OGridControlModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { BEGIN_AGGREGATION_PROPERTY_HELPER(29, m_xAggregateSet) - DECL_PROP1(NAME, ::rtl::OUString, BOUND); + DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); - DECL_PROP1(TAG, ::rtl::OUString, BOUND); + DECL_PROP1(TAG, ::rtl::OUString, BOUND); DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP3(TABSTOP, sal_Bool, BOUND, MAYBEDEFAULT, MAYBEVOID); DECL_PROP2(HASNAVIGATION, sal_Bool, BOUND, MAYBEDEFAULT); DECL_PROP1(ENABLED, sal_Bool, BOUND); DECL_PROP1(BORDER, sal_Int16, BOUND); - DECL_PROP1(DEFAULTCONTROL, ::rtl::OUString, BOUND); + DECL_PROP1(DEFAULTCONTROL, ::rtl::OUString, BOUND); DECL_PROP3(TEXTCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID); DECL_PROP3(BACKGROUNDCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID); - DECL_PROP2(FONT, starawt::FontDescriptor, BOUND, MAYBEDEFAULT); + DECL_PROP2(FONT, FontDescriptor, BOUND, MAYBEDEFAULT); DECL_PROP3(ROWHEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID); - DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_PROP1(FONT_NAME, ::rtl::OUString, MAYBEDEFAULT); - DECL_PROP1(FONT_STYLENAME, ::rtl::OUString, MAYBEDEFAULT); + DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); + DECL_PROP1(FONT_NAME, ::rtl::OUString, MAYBEDEFAULT); + DECL_PROP1(FONT_STYLENAME, ::rtl::OUString, MAYBEDEFAULT); DECL_PROP1(FONT_FAMILY, sal_Int16, MAYBEDEFAULT); DECL_PROP1(FONT_CHARSET, sal_Int16, MAYBEDEFAULT); - DECL_PROP1(FONT_HEIGHT, Float, MAYBEDEFAULT); - DECL_PROP1(FONT_WEIGHT, Float, MAYBEDEFAULT); + DECL_PROP1(FONT_HEIGHT, Float, MAYBEDEFAULT); + DECL_PROP1(FONT_WEIGHT, Float, MAYBEDEFAULT); DECL_PROP1(FONT_SLANT, sal_Int16, MAYBEDEFAULT); DECL_PROP1(FONT_UNDERLINE, sal_Int16, MAYBEDEFAULT); DECL_PROP1(FONT_STRIKEOUT, sal_Int16, MAYBEDEFAULT); @@ -462,7 +456,7 @@ void OGridControlModel::fillProperties( } //------------------------------------------------------------------------------ -void OGridControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const +void OGridControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const { switch (nHandle) { @@ -506,7 +500,7 @@ void OGridControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHa rValue = m_aBackgroundColor; break; case PROPERTY_ID_FONT: - rValue = staruno::makeAny(m_aFont); + rValue = makeAny(m_aFont); break; case PROPERTY_ID_ROWHEIGHT: rValue = m_aRowHeight; @@ -530,7 +524,7 @@ void OGridControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHa rValue <<= (float)m_aFont.Weight; break; case PROPERTY_ID_FONT_SLANT: - rValue = staruno::makeAny(m_aFont.Slant); + rValue = makeAny(m_aFont.Slant); break; case PROPERTY_ID_FONT_UNDERLINE: rValue <<= (sal_Int16)m_aFont.Underline; @@ -544,8 +538,8 @@ void OGridControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHa } //------------------------------------------------------------------------------ -sal_Bool OGridControlModel::convertFastPropertyValue( staruno::Any& rConvertedValue, staruno::Any& rOldValue, - sal_Int32 nHandle, const staruno::Any& rValue )throw( starlang::IllegalArgumentException ) +sal_Bool OGridControlModel::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue, + sal_Int32 nHandle, const Any& rValue )throw( IllegalArgumentException ) { sal_Bool bModified(sal_False); switch (nHandle) @@ -562,9 +556,9 @@ sal_Bool OGridControlModel::convertFastPropertyValue( staruno::Any& rConvertedVa case PROPERTY_ID_CURSORCOLOR: if (!rValue.hasValue() || !m_aCursorColor.hasValue()) { - if (rValue.hasValue() && (staruno::TypeClass_LONG != rValue.getValueType().getTypeClass())) + if (rValue.hasValue() && (TypeClass_LONG != rValue.getValueType().getTypeClass())) { - throw starlang::IllegalArgumentException(); + throw IllegalArgumentException(); } rOldValue = m_aCursorColor; rConvertedValue = rValue; @@ -601,7 +595,7 @@ sal_Bool OGridControlModel::convertFastPropertyValue( staruno::Any& rConvertedVa bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBackgroundColor, ::getCppuType((const sal_Int32*)NULL)); break; case PROPERTY_ID_FONT: - bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, staruno::makeAny(m_aFont), ::getCppuType((const starawt::FontDescriptor*)NULL)); + bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, makeAny(m_aFont), ::getCppuType((const FontDescriptor*)NULL)); break; case PROPERTY_ID_ROWHEIGHT: bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aRowHeight, ::getCppuType((const sal_Int32*)NULL)); @@ -640,7 +634,7 @@ sal_Bool OGridControlModel::convertFastPropertyValue( staruno::Any& rConvertedVa } //------------------------------------------------------------------------------ -void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) +void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) { switch (nHandle) { @@ -748,9 +742,9 @@ void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con //------------------------------------------------------------------------------ IMPL_LINK( OGridControlModel, OnFontChanged, void*, EMPTYARG ) { - staruno::Any aOldVal; + Any aOldVal; aOldVal >>= m_aOldFont; - staruno::Any aNewVal; + Any aNewVal; aNewVal >>= m_aFont; { ::osl::MutexGuard aGuard(m_aMutex); @@ -763,90 +757,90 @@ IMPL_LINK( OGridControlModel, OnFontChanged, void*, EMPTYARG ) //XPropertyState //------------------------------------------------------------------------------ -starbeans::PropertyState OGridControlModel::getPropertyStateByHandle(sal_Int32 nHandle) +PropertyState OGridControlModel::getPropertyStateByHandle(sal_Int32 nHandle) { - starbeans::PropertyState eState(starbeans::PropertyState_DIRECT_VALUE); + PropertyState eState(PropertyState_DIRECT_VALUE); switch (nHandle) { case PROPERTY_ID_HELPURL: if (m_sHelpURL.getLength() == 0) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_DISPLAYSYNCHRON: if (m_bDisplaySynchron) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_ALWAYSSHOWCURSOR: if (!m_bAlwaysShowCursor) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_CURSORCOLOR: if (!m_aCursorColor.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_PRINTABLE: if (m_bPrintable) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_HASNAVIGATION: if (m_bNavigation) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_RECORDMARKER: if (m_bRecordMarker) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_TABSTOP: if (!m_aTabStop.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_TEXTCOLOR: if (!m_aTextColor.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_BACKGROUNDCOLOR: if (!m_aBackgroundColor.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_NAME: if (!m_aFont.Name.len()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_STYLENAME: if (!m_aFont.StyleName.len()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_FAMILY: if (!m_aFont.Family) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_CHARSET: if (!m_aFont.CharSet) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_HEIGHT: if (!m_aFont.Height) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_WEIGHT: if (!m_aFont.Weight) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_SLANT: - if (m_aFont.Slant == starawt::FontSlant_NONE) - eState = starbeans::PropertyState_DEFAULT_VALUE; + if (m_aFont.Slant == FontSlant_NONE) + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_UNDERLINE: if (!m_aFont.Underline) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_FONT_STRIKEOUT: if (!m_aFont.Strikeout) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; case PROPERTY_ID_ROWHEIGHT: if (!m_aRowHeight.hasValue()) - eState = starbeans::PropertyState_DEFAULT_VALUE; + eState = PropertyState_DEFAULT_VALUE; break; default: eState = OControlModel::getPropertyStateByHandle(nHandle); @@ -874,12 +868,12 @@ void OGridControlModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) case PROPERTY_ID_BACKGROUNDCOLOR: case PROPERTY_ID_ROWHEIGHT: case PROPERTY_ID_CURSORCOLOR: - setFastPropertyValue(nHandle, staruno::Any()); + setFastPropertyValue(nHandle, Any()); break; case PROPERTY_ID_HELPURL: case PROPERTY_ID_FONT_NAME: case PROPERTY_ID_FONT_STYLENAME: - setFastPropertyValue(nHandle, staruno::makeAny(::rtl::OUString())); + setFastPropertyValue(nHandle, makeAny(::rtl::OUString())); break; case PROPERTY_ID_FONT_FAMILY: case PROPERTY_ID_FONT_CHARSET: @@ -887,15 +881,15 @@ void OGridControlModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) case PROPERTY_ID_FONT_UNDERLINE: case PROPERTY_ID_FONT_STRIKEOUT: { - staruno::Any aVal; + Any aVal; aVal <<= (sal_Int16)0; setFastPropertyValue(nHandle, aVal); } break; case PROPERTY_ID_FONT_HEIGHT: - setFastPropertyValue(nHandle, staruno::makeAny((float)0)); + setFastPropertyValue(nHandle, makeAny((float)0)); break; case PROPERTY_ID_FONT_WEIGHT: - setFastPropertyValue(nHandle, staruno::makeAny((float)0)); + setFastPropertyValue(nHandle, makeAny((float)0)); break; default: OControlModel::setPropertyToDefaultByHandle(nHandle); @@ -903,7 +897,7 @@ void OGridControlModel::setPropertyToDefaultByHandle(sal_Int32 nHandle) } //------------------------------------------------------------------------------ -staruno::Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) +Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) { switch (nHandle) { @@ -915,87 +909,86 @@ staruno::Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) case PROPERTY_ID_TEXTCOLOR: case PROPERTY_ID_BACKGROUNDCOLOR: case PROPERTY_ID_ROWHEIGHT: - return staruno::Any(); + return Any(); case PROPERTY_ID_FONT_NAME: case PROPERTY_ID_FONT_STYLENAME: - return staruno::makeAny(::rtl::OUString()); + return makeAny(::rtl::OUString()); case PROPERTY_ID_FONT_FAMILY: case PROPERTY_ID_FONT_CHARSET: case PROPERTY_ID_FONT_SLANT: case PROPERTY_ID_FONT_UNDERLINE: case PROPERTY_ID_FONT_STRIKEOUT: - return staruno::makeAny((sal_Int16)0); + return makeAny((sal_Int16)0); case PROPERTY_ID_FONT_HEIGHT: - return staruno::makeAny((float)0); + return makeAny((float)0); case PROPERTY_ID_FONT_WEIGHT: - return staruno::makeAny((float)0); + return makeAny((float)0); default: return OControlModel::getPropertyDefaultByHandle(nHandle); } } -// starform::XLoadListener +// XLoadListener //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::loaded(const starlang::EventObject& rEvent) throw(staruno::RuntimeException) +void SAL_CALL OGridControlModel::loaded(const EventObject& rEvent) throw(RuntimeException) { + Reference<XLoadListener> xListener; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; ++nIndex) { - // staruno::Any aElement(getByIndex( nIndex )); - staruno::Reference<starform::XLoadListener> xListener; - ::cppu::extractInterface(xListener, getByIndex(nIndex)); + getByIndex(nIndex) >>= xListener; if (xListener.is()) xListener->loaded(rEvent); } } //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::unloaded(const starlang::EventObject& rEvent) throw(staruno::RuntimeException) +void SAL_CALL OGridControlModel::unloaded(const EventObject& rEvent) throw(RuntimeException) { + Reference<XLoadListener> xListener; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) { - staruno::Reference<starform::XLoadListener> xListener; - ::cppu::extractInterface(xListener, getByIndex(nIndex)); + getByIndex(nIndex) >>= xListener; if (xListener.is()) xListener->unloaded(rEvent); } } //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::reloading(const starlang::EventObject& rEvent) throw(staruno::RuntimeException) +void SAL_CALL OGridControlModel::reloading(const EventObject& rEvent) throw(RuntimeException) { + Reference<XLoadListener> xListener; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) { - staruno::Reference<starform::XLoadListener> xListener; - ::cppu::extractInterface(xListener, getByIndex(nIndex)); + getByIndex(nIndex) >>= xListener; if (xListener.is()) xListener->reloading(rEvent); } } //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::unloading(const starlang::EventObject& rEvent) throw(staruno::RuntimeException) +void SAL_CALL OGridControlModel::unloading(const EventObject& rEvent) throw(RuntimeException) { + Reference<XLoadListener> xListener; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) { - staruno::Reference<starform::XLoadListener> xListener; - ::cppu::extractInterface(xListener, getByIndex(nIndex)); + getByIndex(nIndex) >>= xListener; if (xListener.is()) xListener->unloading(rEvent); } } //------------------------------------------------------------------------------ -void SAL_CALL OGridControlModel::reloaded(const starlang::EventObject& rEvent) throw(staruno::RuntimeException) +void SAL_CALL OGridControlModel::reloaded(const EventObject& rEvent) throw(RuntimeException) { + Reference<XLoadListener> xListener; sal_Int32 nCount = getCount(); for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++) { - staruno::Reference<starform::XLoadListener> xListener; - ::cppu::extractInterface(xListener, getByIndex(nIndex)); + getByIndex(nIndex) >>= xListener; if (xListener.is()) xListener->reloaded(rEvent); } @@ -1005,7 +998,7 @@ void SAL_CALL OGridControlModel::reloaded(const starlang::EventObject& rEvent) t OGridColumn* OGridControlModel::getColumnImplementation(const InterfaceRef& _rxIFace) const { OGridColumn* pImplementation = NULL; - staruno::Reference<starlang::XUnoTunnel> xUnoTunnel(_rxIFace, staruno::UNO_QUERY); + Reference<XUnoTunnel> xUnoTunnel(_rxIFace, UNO_QUERY); if (xUnoTunnel.is()) pImplementation = reinterpret_cast<OGridColumn*>(xUnoTunnel->getSomething(OGridColumn::getUnoTunnelImplementationId())); @@ -1013,17 +1006,17 @@ OGridColumn* OGridControlModel::getColumnImplementation(const InterfaceRef& _rxI } //------------------------------------------------------------------------------ -void OGridControlModel::insert(sal_Int32 _nIndex, const InterfaceRef& xElement, sal_Bool bEvents) throw( starlang::IllegalArgumentException ) +void OGridControlModel::insert(sal_Int32 _nIndex, const InterfaceRef& xElement, sal_Bool bEvents) throw( IllegalArgumentException ) { OGridColumn* pCol = getColumnImplementation(xElement); if (!pCol) { - throw starlang::IllegalArgumentException(); + throw IllegalArgumentException(); } OInterfaceContainer::insert(_nIndex, xElement, bEvents); } -// stario::XPersistObject +// XPersistObject //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OGridControlModel::getServiceName() { @@ -1031,11 +1024,11 @@ void OGridControlModel::insert(sal_Int32 _nIndex, const InterfaceRef& xElement, } //------------------------------------------------------------------------------ -void OGridControlModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OGridControlModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { OControlModel::write(_rxOutStream); - staruno::Reference<stario::XMarkableStream> xMark(_rxOutStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY); // 1. Version _rxOutStream->writeShort(0x0008); @@ -1074,15 +1067,15 @@ void OGridControlModel::write(const staruno::Reference<stario::XObjectOutputStre // 4. Attribute // Maskierung fuer alle any Typen sal_uInt16 nAnyMask = 0; - if (m_aRowHeight.getValueType().getTypeClass() == staruno::TypeClass_LONG) + if (m_aRowHeight.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= ROWHEIGHT; if (!(m_aFont == getDefaultFont())) // have no !=, only a == nAnyMask |= FONTATTRIBS | FONTSIZE | FONTTYPE | FONTDESCRIPTOR; - if (m_aTabStop.getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN) + if (m_aTabStop.getValueType().getTypeClass() == TypeClass_BOOLEAN) nAnyMask |= TABSTOP; - if (m_aTextColor.getValueType().getTypeClass() == staruno::TypeClass_LONG) + if (m_aTextColor.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= TEXTCOLOR; - if (m_aBackgroundColor.getValueType().getTypeClass() == staruno::TypeClass_LONG) + if (m_aBackgroundColor.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= BACKGROUNDCOLOR; if (!m_bRecordMarker) nAnyMask |= RECORDMARKER; @@ -1104,7 +1097,7 @@ void OGridControlModel::write(const staruno::Reference<stario::XObjectOutputStre _rxOutStream->writeBoolean( m_aFont.Kerning ); _rxOutStream->writeBoolean( m_aFont.WordLineMode ); - // starawt::Size + // Size _rxOutStream->writeLong( m_aFont.Width ); _rxOutStream->writeLong( m_aFont.Height ); _rxOutStream->writeShort( VCLUnoHelper::ConvertFontWidth( m_aFont.CharacterWidth ) ); @@ -1147,11 +1140,11 @@ void OGridControlModel::write(const staruno::Reference<stario::XObjectOutputStre } //------------------------------------------------------------------------------ -void OGridControlModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream) { OControlModel::read(_rxInStream); - staruno::Reference<stario::XMarkableStream> xMark(_rxInStream, staruno::UNO_QUERY); + Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY); // 1. Version sal_Int16 nVersion = _rxInStream->readShort(); @@ -1167,7 +1160,7 @@ void OGridControlModel::read(const staruno::Reference<stario::XObjectInputStream ::rtl::OUString sModelName; _rxInStream >> sModelName; - staruno::Reference<starbeans::XPropertySet> xCol(createColumn(getColumnTypeByModelName(sModelName))); + Reference<XPropertySet> xCol(createColumn(getColumnTypeByModelName(sModelName))); DBG_ASSERT(xCol.is(), "OGridControlModel::read : unknown column type !"); sal_Int32 nObjLen = _rxInStream->readLong(); if (nObjLen) @@ -1195,7 +1188,7 @@ void OGridControlModel::read(const staruno::Reference<stario::XObjectInputStream if (nObjLen) { sal_Int32 nMark = xMark->createMark(); - staruno::Reference<stario::XPersistObject> xObj(m_xEventAttacher, staruno::UNO_QUERY); + Reference<XPersistObject> xObj(m_xEventAttacher, UNO_QUERY); if (xObj.is()) xObj->read(_rxInStream); xMark->jumpToMark(nMark); @@ -1206,9 +1199,9 @@ void OGridControlModel::read(const staruno::Reference<stario::XObjectInputStream // Attachement lesen for (sal_Int32 i = 0; i < nLen; i++) { - InterfaceRef xIfc(m_aItems[i], staruno::UNO_QUERY); - staruno::Reference<starbeans::XPropertySet> xSet(xIfc, staruno::UNO_QUERY); - staruno::Any aHelper; + InterfaceRef xIfc(m_aItems[i], UNO_QUERY); + Reference<XPropertySet> xSet(xIfc, UNO_QUERY); + Any aHelper; aHelper <<= xSet; m_xEventAttacher->attach( i, xIfc, aHelper ); } @@ -1230,7 +1223,7 @@ void OGridControlModel::read(const staruno::Reference<stario::XObjectInputStream { m_aFont.Weight = VCLUnoHelper::ConvertFontWeight( _rxInStream->readShort() ); - m_aFont.Slant = (starawt::FontSlant)_rxInStream->readShort(); + m_aFont.Slant = (FontSlant)_rxInStream->readShort(); m_aFont.Underline = _rxInStream->readShort(); m_aFont.Strikeout = _rxInStream->readShort(); m_aFont.Orientation = ( (double)_rxInStream->readShort() ) / 10; diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index b90477227888..f80019168c08 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Grid.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -84,17 +84,24 @@ #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ #include <comphelper/proparrhlp.hxx> #endif +#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include <cppuhelper/implbase5.hxx> +#endif //......................................................................... namespace frm { //......................................................................... - namespace starview = ::com::sun::star::view; - //================================================================== // OGridControlModel //================================================================== +typedef ::cppu::ImplHelper5< ::com::sun::star::awt::XControlModel, + ::com::sun::star::form::XGridColumnFactory, + ::com::sun::star::form::XLoadListener, + ::com::sun::star::form::XReset, + ::com::sun::star::view::XSelectionSupplier> OGridControlModel_BASE; + class OGridColumn; class OGridControlModel :public OControlModel ,public OInterfaceContainer @@ -102,118 +109,115 @@ class OGridControlModel :public OControlModel // though we don't use aggregation, we're derived from an OPropertySetAggregationHelper, // which expects that we use an OPropertyArrayAggregationHelper, which we ensure // with deriving from OAggregationArrayUsageHelper - ,public starawt::XControlModel - ,public starform::XGridColumnFactory - ,public starform::XLoadListener - ,public starform::XReset - ,public starview::XSelectionSupplier + ,public OGridControlModel_BASE { - ::cppu::OInterfaceContainerHelper - m_aSelectListeners, - m_aResetListeners; + ::cppu::OInterfaceContainerHelper m_aSelectListeners, + m_aResetListeners; - staruno::Reference<starbeans::XPropertySet> m_xSelection; +// [properties] + ::com::sun::star::uno::Any m_aRowHeight; // Zeilenhoehe + ::com::sun::star::uno::Any m_aTabStop; + ::com::sun::star::uno::Any m_aTextColor; + ::com::sun::star::uno::Any m_aBackgroundColor; + ::com::sun::star::uno::Any m_aCursorColor; // transient + ::com::sun::star::awt::FontDescriptor m_aFont; + ::com::sun::star::awt::FontDescriptor m_aOldFont; + ::rtl::OUString m_aDefaultControl; +// [properties] - sal_uInt32 m_nFontEvent; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSelection; + sal_uInt32 m_nFontEvent; // [properties] - ::rtl::OUString m_aDefaultControl; - staruno::Any m_aRowHeight; // Zeilenhoehe - staruno::Any m_aTabStop; - staruno::Any m_aTextColor; - staruno::Any m_aBackgroundColor; - starawt::FontDescriptor m_aFont; - starawt::FontDescriptor m_aOldFont; + ::rtl::OUString m_sHelpURL; // URL sal_Int16 m_nBorder; - sal_Bool m_bEnable : 1; - sal_Bool m_bNavigation : 1; - sal_Bool m_bRecordMarker : 1; - sal_Bool m_bPrintable : 1; + sal_Bool m_bEnable : 1; + sal_Bool m_bNavigation : 1; + sal_Bool m_bRecordMarker : 1; + sal_Bool m_bPrintable : 1; sal_Bool m_bAlwaysShowCursor : 1; // transient - sal_Bool m_bDisplaySynchron : 1; // transient - staruno::Any m_aCursorColor; // transient - ::rtl::OUString m_sHelpURL; // URL + sal_Bool m_bDisplaySynchron : 1; // transient // [properties] protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); void _reset(); public: - OGridControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OGridControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OGridControlModel(); // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OControlModel); - virtual staruno::Any SAL_CALL queryAggregation( const staruno::Type& _rType ) throw (staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); // starcontainer::XChild - virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(starlang::NoSupportException, staruno::RuntimeException); + virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OGridControlModel); - virtual StringSequence SAL_CALL getSupportedServiceNames() throw(staruno::RuntimeException); + virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException); +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); -// starform::XLoadListener - virtual void SAL_CALL loaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL unloaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL unloading(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL reloading(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); - virtual void SAL_CALL reloaded(const starlang::EventObject& aEvent) throw(staruno::RuntimeException); +// ::com::sun::star::form::XLoadListener + virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException); -// starform::XReset +// ::com::sun::star::form::XReset virtual void SAL_CALL reset(); - virtual void SAL_CALL addResetListener(const staruno::Reference<starform::XResetListener>& _rxListener); - virtual void SAL_CALL removeResetListener(const staruno::Reference<starform::XResetListener>& _rxListener); + virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener); + virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener); // ::com::sun::star::view::XSelectionSupplier - virtual sal_Bool SAL_CALL select(const staruno::Any& aElement) throw(starlang::IllegalArgumentException, staruno::RuntimeException); - virtual staruno::Any SAL_CALL getSelection() throw(staruno::RuntimeException); - virtual void SAL_CALL addSelectionChangeListener(const staruno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeSelectionChangeListener(const staruno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(staruno::RuntimeException); + virtual sal_Bool SAL_CALL select(const ::com::sun::star::uno::Any& aElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException); -// starform::XGridColumnFactory - virtual staruno::Reference<starbeans::XPropertySet> SAL_CALL createColumn(const ::rtl::OUString& ColumnType); +// ::com::sun::star::form::XGridColumnFactory + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> SAL_CALL createColumn(const ::rtl::OUString& ColumnType); virtual StringSequence SAL_CALL getColumnTypes(); // stario::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream); -// starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - 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); - -// starbeans::XPropertyState - virtual starbeans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); + +// ::com::sun::star::beans::XPropertyState + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); - virtual staruno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() protected: virtual void insert(sal_Int32 _nIndex, const InterfaceRef& _Object, sal_Bool bEvents) - throw(starlang::IllegalArgumentException); + throw(::com::sun::star::lang::IllegalArgumentException); - staruno::Reference<starbeans::XPropertySet> createColumn(sal_Int32 nTypeId) const; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createColumn(sal_Int32 nTypeId) const; OGridColumn* getColumnImplementation(const InterfaceRef& _rxIFace) const; diff --git a/forms/source/component/GroupBox.cxx b/forms/source/component/GroupBox.cxx index 2b2f452b87fd..300d32bb99fb 100644 --- a/forms/source/component/GroupBox.cxx +++ b/forms/source/component/GroupBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: GroupBox.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -78,22 +78,33 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // OGroupBoxModel //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OGroupBoxModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OGroupBoxModel_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OGroupBoxModel(_rxFactory)); } //------------------------------------------------------------------ -OGroupBoxModel::OGroupBoxModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OGroupBoxModel::OGroupBoxModel(const Reference<starlang::XMultiServiceFactory>& _rxFactory) :OControlModel(_rxFactory, VCL_CONTROLMODEL_GROUPBOX, VCL_CONTROL_GROUPBOX) { - m_nClassId = starform::FormComponentType::GROUPBOX; + m_nClassId = FormComponentType::GROUPBOX; } // XServiceInfo @@ -114,9 +125,9 @@ OGroupBoxModel::~OGroupBoxModel() } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OGroupBoxModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OGroupBoxModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -128,8 +139,8 @@ cppu::IPropertyArrayHelper& OGroupBoxModel::getInfoHelper() //------------------------------------------------------------------------------ void OGroupBoxModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(4) // don't want to have the TabStop property @@ -143,14 +154,14 @@ void OGroupBoxModel::fillProperties( } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OGroupBoxModel::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OGroupBoxModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_GROUPBOX; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OGroupBoxModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OGroupBoxModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { OControlModel::write(_rxOutStream); @@ -160,7 +171,7 @@ void SAL_CALL OGroupBoxModel::write(const staruno::Reference<stario::XObjectOutp } //------------------------------------------------------------------------------ -void SAL_CALL OGroupBoxModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OGroupBoxModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, RuntimeException) { OControlModel::read( _rxInStream ); @@ -183,13 +194,13 @@ void SAL_CALL OGroupBoxModel::read(const staruno::Reference<stario::XObjectInput //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OGroupBoxControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OGroupBoxControl_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OGroupBoxControl(_rxFactory)); } //------------------------------------------------------------------------------ -OGroupBoxControl::OGroupBoxControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OGroupBoxControl::OGroupBoxControl(const Reference<starlang::XMultiServiceFactory>& _rxFactory) :OControl(_rxFactory, VCL_CONTROL_GROUPBOX) { } diff --git a/forms/source/component/GroupBox.hxx b/forms/source/component/GroupBox.hxx index 218151b74136..6399e72fd883 100644 --- a/forms/source/component/GroupBox.hxx +++ b/forms/source/component/GroupBox.hxx @@ -2,9 +2,9 @@ * * $RCSfile: GroupBox.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -78,7 +78,7 @@ class OGroupBoxModel ,public ::comphelper::OAggregationArrayUsageHelper< OGroupBoxModel > { public: - OGroupBoxModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OGroupBoxModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OGroupBoxModel(); // XServiceInfo @@ -86,20 +86,20 @@ public: virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XPropertySetRef - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -110,7 +110,7 @@ public: class OGroupBoxControl : public OControl { public: - OGroupBoxControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OGroupBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(OGroupBoxControl); diff --git a/forms/source/component/Hidden.cxx b/forms/source/component/Hidden.cxx index 38806eba2c14..07955f48757b 100644 --- a/forms/source/component/Hidden.cxx +++ b/forms/source/component/Hidden.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Hidden.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -78,22 +78,33 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OHiddenModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OHiddenModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OHiddenModel(_rxFactory)); } //------------------------------------------------------------------ -OHiddenModel::OHiddenModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OHiddenModel::OHiddenModel(const Reference<XMultiServiceFactory>& _rxFactory) :OControlModel(_rxFactory, ::rtl::OUString()) { - m_nClassId = starform::FormComponentType::HIDDENCONTROL; + m_nClassId = FormComponentType::HIDDENCONTROL; } //------------------------------------------------------------------------------ -void OHiddenModel::getFastPropertyValue(staruno::Any& _rValue, sal_Int32 _nHandle) const +void OHiddenModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { switch (_nHandle) { @@ -104,12 +115,12 @@ void OHiddenModel::getFastPropertyValue(staruno::Any& _rValue, sal_Int32 _nHandl } //------------------------------------------------------------------------------ -void OHiddenModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const staruno::Any& _rValue) throw (com::sun::star::uno::Exception) +void OHiddenModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::uno::Exception) { switch (_nHandle) { case PROPERTY_ID_HIDDEN_VALUE : - DBG_ASSERT(_rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "OHiddenModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OHiddenModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_sHiddenValue; break; default: @@ -119,8 +130,8 @@ void OHiddenModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const st //------------------------------------------------------------------------------ sal_Bool OHiddenModel::convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue) - throw (starlang::IllegalArgumentException) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) { sal_Bool bModified(sal_False); switch (_nHandle) @@ -136,9 +147,9 @@ sal_Bool OHiddenModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OHiddenModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OHiddenModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -150,8 +161,8 @@ cppu::IPropertyArrayHelper& OHiddenModel::getInfoHelper() //------------------------------------------------------------------------------ void OHiddenModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { BEGIN_AGGREGATION_PROPERTY_HELPER(4, m_xAggregateSet) DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); @@ -175,14 +186,14 @@ StringSequence SAL_CALL OHiddenModel::getSupportedServiceNames() throw(::com::su } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OHiddenModel::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL OHiddenModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_HIDDEN; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OHiddenModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OHiddenModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { // Version _rxOutStream->writeShort(0x0002); @@ -194,7 +205,7 @@ void SAL_CALL OHiddenModel::write(const staruno::Reference<stario::XObjectOutput } //------------------------------------------------------------------------------ -void SAL_CALL OHiddenModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OHiddenModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, RuntimeException) { // Version UINT16 nVersion = _rxInStream->readShort(); diff --git a/forms/source/component/Hidden.hxx b/forms/source/component/Hidden.hxx index ba15b779cca6..cf74916f654f 100644 --- a/forms/source/component/Hidden.hxx +++ b/forms/source/component/Hidden.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Hidden.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -80,18 +80,18 @@ class OHiddenModel ::rtl::OUString m_sHiddenValue; public: - OHiddenModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OHiddenModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // OPropertySetHelper - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) - throw (staruno::Exception); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); virtual sal_Bool SAL_CALL convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue ) - throw (starlang::IllegalArgumentException); + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); // XPropertySetRef - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XServiceInfo @@ -99,16 +99,16 @@ public: virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; diff --git a/forms/source/component/ImageButton.cxx b/forms/source/component/ImageButton.cxx index 8923d05f76f5..8dfa668350dc 100644 --- a/forms/source/component/ImageButton.cxx +++ b/forms/source/component/ImageButton.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ImageButton.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:05 $ + * 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 @@ -78,24 +78,35 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== //= OImageButtonModel //================================================================== DBG_NAME(OImageButtonModel) //------------------------------------------------------------------ -InterfaceRef SAL_CALL OImageButtonModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OImageButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OImageButtonModel(_rxFactory)); } //------------------------------------------------------------------ -OImageButtonModel::OImageButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OImageButtonModel::OImageButtonModel(const Reference<XMultiServiceFactory>& _rxFactory) :OImageModel(_rxFactory, VCL_CONTROLMODEL_IMAGEBUTTON, FRM_CONTROL_IMAGEBUTTON) // use the old control name for compytibility reasons { DBG_CTOR(OImageButtonModel, NULL); - m_nClassId = starform::FormComponentType::IMAGEBUTTON; + m_nClassId = FormComponentType::IMAGEBUTTON; } //------------------------------------------------------------------------------ @@ -105,13 +116,13 @@ OImageButtonModel::~OImageButtonModel() } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OImageButtonModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OImageButtonModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OImageButtonModel::getSupportedServiceNames() throw() { @@ -125,12 +136,12 @@ StringSequence OImageButtonModel::getSupportedServiceNames() throw() //------------------------------------------------------------------------------ void OImageButtonModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(8) DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); - DECL_PROP1(BUTTONTYPE, starform::FormButtonType, BOUND); + DECL_PROP1(BUTTONTYPE, FormButtonType, BOUND); DECL_PROP1(TARGET_URL, ::rtl::OUString, BOUND); DECL_PROP1(TARGET_FRAME, ::rtl::OUString, BOUND); DECL_PROP1(NAME, ::rtl::OUString, BOUND); @@ -153,7 +164,7 @@ void OImageButtonModel::fillProperties( } //------------------------------------------------------------------------------ -void OImageButtonModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OImageButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { OControlModel::write(_rxOutStream); @@ -168,7 +179,7 @@ void OImageButtonModel::write(const staruno::Reference<stario::XObjectOutputStre } //------------------------------------------------------------------------------ -void OImageButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OImageButtonModel::read(const Reference<XObjectInputStream>& _rxInStream) { OControlModel::read(_rxInStream); @@ -179,12 +190,12 @@ void OImageButtonModel::read(const staruno::Reference<stario::XObjectInputStream { case 0x0001: { - m_eButtonType = (starform::FormButtonType)_rxInStream->readShort(); + m_eButtonType = (FormButtonType)_rxInStream->readShort(); } break; case 0x0002: { - m_eButtonType = (starform::FormButtonType)_rxInStream->readShort(); + m_eButtonType = (FormButtonType)_rxInStream->readShort(); ::rtl::OUString sTmp; _rxInStream >> sTmp; m_sTargetURL = INetURLObject::RelToAbs( sTmp ); @@ -193,7 +204,7 @@ void OImageButtonModel::read(const staruno::Reference<stario::XObjectInputStream break; case 0x0003: { - m_eButtonType = (starform::FormButtonType)_rxInStream->readShort(); + m_eButtonType = (FormButtonType)_rxInStream->readShort(); ::rtl::OUString sTmp; _rxInStream >> sTmp; m_sTargetURL = INetURLObject::RelToAbs( sTmp ); @@ -204,7 +215,7 @@ void OImageButtonModel::read(const staruno::Reference<stario::XObjectInputStream default : DBG_ERROR("OImageButtonModel::read : unknown version !"); - m_eButtonType = starform::FormButtonType_PUSH; + m_eButtonType = FormButtonType_PUSH; m_sTargetURL = ::rtl::OUString(); m_sTargetFrame = ::rtl::OUString(); break; @@ -215,26 +226,17 @@ void OImageButtonModel::read(const staruno::Reference<stario::XObjectInputStream // OImageButtonControl //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OImageButtonControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OImageButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OImageButtonControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OImageButtonControl::_getTypes() +Sequence<Type> OImageButtonControl::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) - { - // my base class - staruno::Sequence<staruno::Type> aBaseClassTypes = OImageControl::_getTypes(); - - staruno::Sequence<staruno::Type> aOwnTypes(1); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starawt::XMouseListener>*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); - } + aTypes = concatSequences(OImageControl::_getTypes(), OImageButtonControl_BASE::getTypes()); return aTypes; } @@ -250,16 +252,16 @@ StringSequence OImageButtonControl::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -OImageButtonControl::OImageButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OImageButtonControl::OImageButtonControl(const Reference<XMultiServiceFactory>& _rxFactory) :OImageControl(_rxFactory, VCL_CONTROL_IMAGEBUTTON) { increment(m_refCount); { // als MouseListener anmelden - staruno::Reference<starawt::XWindow> xComp; + Reference<XWindow> xComp; query_aggregation( m_xAggregate, xComp); if (xComp.is()) - xComp->addMouseListener((starawt::XMouseListener*)this); + xComp->addMouseListener((XMouseListener*)this); } // Refcount bei 1 fuer angemeldeten Listener sal_Int32 n = decrement(m_refCount); @@ -267,25 +269,21 @@ OImageButtonControl::OImageButtonControl(const staruno::Reference<starlang::XMul // UNO Anbindung //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OImageButtonControl::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OImageButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OImageControl::queryAggregation(_rType); + Any aReturn = OImageControl::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XMouseListener*>(this) - ); + aReturn = OImageButtonControl_BASE::queryInterface(_rType); return aReturn; } //------------------------------------------------------------------------------ -void OImageButtonControl::mousePressed(const starawt::MouseEvent& e) +void OImageButtonControl::mousePressed(const MouseEvent& e) { ////////////////////////////////////////////////////////////////////// // Nur linke Maustaste - if (e.Buttons != starawt::MouseButton::LEFT) + if (e.Buttons != MouseButton::LEFT) return; ::osl::ClearableMutexGuard aGuard( m_aMutex ); diff --git a/forms/source/component/ImageButton.hxx b/forms/source/component/ImageButton.hxx index 37da51efaf6b..b1fdaf8b27fe 100644 --- a/forms/source/component/ImageButton.hxx +++ b/forms/source/component/ImageButton.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ImageButton.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -83,26 +83,26 @@ class OImageButtonModel ,public ::comphelper::OAggregationArrayUsageHelper< OImageButtonModel > { public: - OImageButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OImageButtonModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); ~OImageButtonModel(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OImageButtonModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -// stario::XPersistObject +// ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -110,33 +110,34 @@ public: //================================================================== // OImageButtonControl //================================================================== +typedef ::cppu::ImplHelper1< ::com::sun::star::awt::XMouseListener> OImageButtonControl_BASE; class OImageButtonControl : public OImageControl, - public starawt::XMouseListener + public OImageButtonControl_BASE { protected: // UNO Anbindung - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OImageButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OImageButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OImageButtonControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OImageButtonControl, OImageControl); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException) +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) { OControl::disposing(_rSource); } -// starawt::XMouseListener - virtual void SAL_CALL mousePressed(const starawt::MouseEvent& e); - virtual void SAL_CALL mouseReleased(const starawt::MouseEvent& e) { } - virtual void SAL_CALL mouseEntered(const starawt::MouseEvent& e) { } - virtual void SAL_CALL mouseExited(const starawt::MouseEvent& e) { } +// ::com::sun::star::awt::XMouseListener + virtual void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& e); + virtual void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& e) { } + virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) { } + virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) { } }; //......................................................................... diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index c5876e407bdf..17403ee9b421 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ImageControl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fs $ $Date: 2000-11-17 18:33:00 $ + * 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 @@ -129,29 +129,40 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // OImageControlModel //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OImageControlModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OImageControlModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OImageControlModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OImageControlModel::_getTypes() +Sequence<Type> OImageControlModel::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my base class - staruno::Sequence<staruno::Type> aBaseClassTypes = OBoundControlModel::_getTypes(); + Sequence<Type> aBaseClassTypes = OBoundControlModel::_getTypes(); - staruno::Sequence<staruno::Type> aOwnTypes(1); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starform::XImageProducerSupplier>*)NULL); + Sequence<Type> aOwnTypes(1); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference<XImageProducerSupplier>*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -160,7 +171,7 @@ staruno::Sequence<staruno::Type> OImageControlModel::_getTypes() DBG_NAME(OImageControlModel) //------------------------------------------------------------------ -OImageControlModel::OImageControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OImageControlModel::OImageControlModel(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_CONTROL_IMAGECONTROL, sal_False) // use the old control name for compytibility reasons ,OPropertyChangeListener(m_aMutex) @@ -168,7 +179,7 @@ OImageControlModel::OImageControlModel(const staruno::Reference<starlang::XMulti ,m_bReadOnly(sal_False) { DBG_CTOR(OImageControlModel,NULL); - m_nClassId = starform::FormComponentType::IMAGECONTROL; + m_nClassId = FormComponentType::IMAGECONTROL; m_xImageProducer = m_pImageProducer; @@ -194,7 +205,7 @@ OImageControlModel::~OImageControlModel() DBG_DTOR(OImageControlModel,NULL); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OImageControlModel::getSupportedServiceNames() throw() { @@ -207,14 +218,12 @@ StringSequence OImageControlModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OImageControlModel::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OImageControlModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OBoundControlModel::queryAggregation(_rType); + Any aReturn = OBoundControlModel::queryAggregation(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType - ,static_cast<starform::XImageProducerSupplier*>(this) + ,static_cast<XImageProducerSupplier*>(this) ); return aReturn; @@ -224,9 +233,9 @@ staruno::Any SAL_CALL OImageControlModel::queryAggregation(const staruno::Type& sal_Bool OImageControlModel::_approve(sal_Int32 _nColumnType) { // zulaessing sind die binary Typen, OTHER- und LONGVARCHAR-Felder - if ((_nColumnType == starsdbc::DataType::BINARY) || (_nColumnType == starsdbc::DataType::VARBINARY) - || (_nColumnType == starsdbc::DataType::LONGVARBINARY) || (_nColumnType == starsdbc::DataType::OTHER) - || (_nColumnType == starsdbc::DataType::LONGVARCHAR)) + if ((_nColumnType == DataType::BINARY) || (_nColumnType == DataType::VARBINARY) + || (_nColumnType == DataType::LONGVARBINARY) || (_nColumnType == DataType::OTHER) + || (_nColumnType == DataType::LONGVARCHAR)) return sal_True; return sal_False; @@ -234,18 +243,18 @@ sal_Bool OImageControlModel::_approve(sal_Int32 _nColumnType) //------------------------------------------------------------------------------ -void OImageControlModel::_propertyChanged( const starbeans::PropertyChangeEvent& rEvt ) - throw( staruno::RuntimeException ) +void OImageControlModel::_propertyChanged( const PropertyChangeEvent& rEvt ) + throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aMutex); - // Wenn eine starutil::URL gesetzt worden ist, muss die noch an den ImageProducer + // Wenn eine URL gesetzt worden ist, muss die noch an den ImageProducer // weitergereicht werden. // xInStream erzeugen - staruno::Reference<stario::XActiveDataSink> xSink( + Reference<XActiveDataSink> xSink( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), staruno::UNO_QUERY); + ::rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), UNO_QUERY); if (!xSink.is()) return; @@ -264,11 +273,11 @@ void OImageControlModel::_propertyChanged( const starbeans::PropertyChangeEvent& if (pFileStream->GetBufferSize() < 8192) pFileStream->SetBufferSize(8192); - staruno::Reference<stario::XInputStream> xInput + Reference<XInputStream> xInput (new ::utl::OInputStreamHelper(new SvLockBytes(pFileStream, sal_True), pFileStream->GetBufferSize())); xSink->setInputStream(xInput); - staruno::Reference<stario::XInputStream> xInStream(xSink, staruno::UNO_QUERY); + Reference<XInputStream> xInStream(xSink, UNO_QUERY); if (m_xColumnUpdate.is()) m_xColumnUpdate->updateBinaryStream(xInStream, xInput->available()); else @@ -278,7 +287,7 @@ void OImageControlModel::_propertyChanged( const starbeans::PropertyChangeEvent& } // usually the setBinaryStream should close the input, but just in case .... - try { xInStream->closeInput(); } catch (stario::NotConnectedException& e) { e; } + try { xInStream->closeInput(); } catch (NotConnectedException& e) { e; } } else { @@ -286,7 +295,7 @@ void OImageControlModel::_propertyChanged( const starbeans::PropertyChangeEvent& m_xColumnUpdate->updateNull(); else { - staruno::Reference<stario::XInputStream> xInStream; + Reference<XInputStream> xInStream; GetImageProducer()->setImage( xInStream ); m_xImageProducer->startProduction(); } @@ -295,7 +304,7 @@ void OImageControlModel::_propertyChanged( const starbeans::PropertyChangeEvent& } //------------------------------------------------------------------------------ -void OImageControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const +void OImageControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { switch (nHandle) { @@ -306,12 +315,12 @@ void OImageControlModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nH } //------------------------------------------------------------------------------ -void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const staruno::Any& rValue) +void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) { switch (nHandle) { case PROPERTY_ID_READONLY : - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_BOOLEAN, "OImageControlModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, "OImageControlModel::setFastPropertyValue_NoBroadcast : invalid type !" ); m_bReadOnly = getBOOL(rValue); break; @@ -321,8 +330,8 @@ void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, con } //------------------------------------------------------------------------------ -sal_Bool OImageControlModel::convertFastPropertyValue(staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue) - throw( starlang::IllegalArgumentException ) +sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue) + throw( IllegalArgumentException ) { switch (nHandle) { @@ -335,19 +344,19 @@ sal_Bool OImageControlModel::convertFastPropertyValue(staruno::Any& rConvertedVa } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OImageControlModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OImageControlModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo(createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo(createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OImageControlModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(9) -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_IMAGE_URL, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_IMAGE_URL, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_BOOL_PROP1(READONLY, BOUND); @@ -355,8 +364,8 @@ void OImageControlModel::fillProperties( DECL_PROP1(TAG, ::rtl::OUString, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -374,7 +383,7 @@ void OImageControlModel::fillProperties( } //------------------------------------------------------------------------------ -void OImageControlModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) +void OImageControlModel::write(const Reference<XObjectOutputStream>& _rxOutStream) { // Basisklasse OBoundControlModel::write(_rxOutStream); @@ -388,7 +397,7 @@ void OImageControlModel::write(const staruno::Reference<stario::XObjectOutputStr } //------------------------------------------------------------------------------ -void OImageControlModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) +void OImageControlModel::read(const Reference<XObjectInputStream>& _rxInStream) { OBoundControlModel::read(_rxInStream); @@ -422,7 +431,7 @@ void OImageControlModel::read(const staruno::Reference<stario::XObjectInputStrea } } -// starbeans::XPropertyChangeListener +// XPropertyChangeListener //------------------------------------------------------------------------------ void OImageControlModel::_onValueChanged() { @@ -430,10 +439,10 @@ void OImageControlModel::_onValueChanged() } //------------------------------------------------------------------------------ -staruno::Any OImageControlModel::_getControlValue() const +Any OImageControlModel::_getControlValue() const { // hier macht ein Vergleich keinen Sinn, daher void siehe OBoundControlModel - return staruno::Any(); + return Any(); } // OComponentHelper @@ -442,11 +451,7 @@ void OImageControlModel::disposing() { OBoundControlModel::disposing(); -#if SUPD<583 - XInputStreamRef xInStream; -#else - staruno::Reference<stario::XInputStream> xInStream; -#endif + Reference<XInputStream> xInStream; GetImageProducer()->setImage( xInStream ); m_xImageProducer->startProduction(); } @@ -454,13 +459,9 @@ void OImageControlModel::disposing() //------------------------------------------------------------------------------ void OImageControlModel::_reset() { -#if SUPD<583 - XInputStreamRef xDummy; -#else - staruno::Reference<stario::XInputStream> xDummy; -#endif + Reference<XInputStream> xDummy; GetImageProducer()->setImage(xDummy); - staruno::Reference<starawt::XImageProducer> xProducer = m_xImageProducer; + Reference<XImageProducer> xProducer = m_xImageProducer; { // release our mutex once (it's acquired in the calling method !), as starting the image production may // result in the locking of the solar mutex (unfortunally the default implementation of our aggregate, // VCLXImageControl, does this locking) @@ -474,19 +475,10 @@ void OImageControlModel::_reset() //------------------------------------------------------------------------------ void OImageControlModel::UpdateFromField() { - staruno::Reference<stario::XInputStream> xInStream; + Reference<XInputStream> xInStream; xInStream = m_xColumn->getBinaryStream(); -#if SUPD<583 - //------------------------------------------------------------ - // temporary as long as the ImageProducer is a Smart-UNO-Class - XInputStreamRef xUsrIFace; - convertIFace(xInStream, xUsrIFace); - GetImageProducer()->setImage(xUsrIFace); - //------------------------------------------------------------ -#else GetImageProducer()->setImage(xInStream); -#endif m_xImageProducer->startProduction(); } @@ -496,23 +488,23 @@ void OImageControlModel::UpdateFromField() //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OImageControlControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OImageControlControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OImageControlControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OImageControlControl::_getTypes() +Sequence<Type> OImageControlControl::_getTypes() { - static staruno::Sequence<staruno::Type> aTypes; + static Sequence<Type> aTypes; if (!aTypes.getLength()) { // my base class - staruno::Sequence<staruno::Type> aBaseClassTypes = OBoundControl::_getTypes(); + Sequence<Type> aBaseClassTypes = OBoundControl::_getTypes(); - staruno::Sequence<staruno::Type> aOwnTypes(1); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference<starawt::XMouseListener>*)NULL); + Sequence<Type> aOwnTypes(1); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference<XMouseListener>*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -520,13 +512,13 @@ staruno::Sequence<staruno::Type> OImageControlControl::_getTypes() } //------------------------------------------------------------------------------ -OImageControlControl::OImageControlControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OImageControlControl::OImageControlControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_IMAGECONTROL) { increment(m_refCount); { // als Focus- und MouseListener anmelden - staruno::Reference<starawt::XWindow> xComp; + Reference<XWindow> xComp; query_aggregation( m_xAggregate, xComp); if (xComp.is()) xComp->addMouseListener(this); @@ -537,14 +529,12 @@ OImageControlControl::OImageControlControl(const staruno::Reference<starlang::XM // UNO Anbindung //------------------------------------------------------------------------------ -staruno::Any SAL_CALL OImageControlControl::queryAggregation(const staruno::Type& _rType) throw (staruno::RuntimeException) +Any SAL_CALL OImageControlControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - staruno::Any aReturn; - - aReturn = OBoundControl::queryAggregation(_rType); + Any aReturn = OBoundControl::queryAggregation(_rType); if (!aReturn.hasValue()) aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XMouseListener*>(this) + ,static_cast<XMouseListener*>(this) ); return aReturn; @@ -561,25 +551,25 @@ StringSequence OImageControlControl::getSupportedServiceNames() throw() return aSupported; } -// starawt::XControl +// XControl //------------------------------------------------------------------------------ -void SAL_CALL OImageControlControl::createPeer(const staruno::Reference<starawt::XToolkit>& _rxToolkit, const staruno::Reference<starawt::XWindowPeer>& Parent) throw( staruno::RuntimeException ) +void SAL_CALL OImageControlControl::createPeer(const Reference<XToolkit>& _rxToolkit, const Reference<XWindowPeer>& Parent) throw( RuntimeException ) { OBoundControl::createPeer(_rxToolkit, Parent); if (!m_xControl.is()) return; // ImageConsumer vom Control holen - staruno::Reference<starawt::XWindowPeer> xPeer = m_xControl->getPeer(); - staruno::Reference<starawt::XImageConsumer> xImageConsumer(xPeer, staruno::UNO_QUERY); + Reference<XWindowPeer> xPeer = m_xControl->getPeer(); + Reference<XImageConsumer> xImageConsumer(xPeer, UNO_QUERY); if (!xImageConsumer.is()) return; // ImageConsumer am Imageproducer setzen - staruno::Reference<starform::XImageProducerSupplier> xImageSource(m_xControl->getModel(), staruno::UNO_QUERY); + Reference<XImageProducerSupplier> xImageSource(m_xControl->getModel(), UNO_QUERY); if (!xImageSource.is()) return; - staruno::Reference<starawt::XImageProducer> xImageProducer = xImageSource->getImageProducer(); + Reference<XImageProducer> xImageProducer = xImageSource->getImageProducer(); xImageProducer->addConsumer(xImageConsumer); xImageProducer->startProduction(); @@ -587,11 +577,11 @@ void SAL_CALL OImageControlControl::createPeer(const staruno::Reference<starawt: // MouseListener //------------------------------------------------------------------------------ -void OImageControlControl::mousePressed(const starawt::MouseEvent& e) +void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& e) { ////////////////////////////////////////////////////////////////////// // Nur linke Maustaste - if (e.Buttons != starawt::MouseButton::LEFT) + if (e.Buttons != MouseButton::LEFT) return; ////////////////////////////////////////////////////////////////////// @@ -599,14 +589,14 @@ void OImageControlControl::mousePressed(const starawt::MouseEvent& e) if (e.ClickCount == 2) { - staruno::Reference<starbeans::XPropertySet> xSet(getModel(), staruno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (!xSet.is()) return; // wenn Control nicht gebunden ist, kein Dialog (da die zu schickende URL hinterher sowieso // versanden wuerde) // FS - #64946# - 19.04.99 - staruno::Reference<starbeans::XPropertySet> xBoundField; + Reference<XPropertySet> xBoundField; if (hasProperty(PROPERTY_BOUNDFIELD, xSet)) ::cppu::extractInterface(xBoundField, xSet->getPropertyValue(PROPERTY_BOUNDFIELD)); if (!xBoundField.is()) @@ -624,39 +614,39 @@ void OImageControlControl::mousePressed(const starawt::MouseEvent& e) ::rtl::OUString sTitle = FRM_RES_STRING(RID_STR_IMPORT_GRAPHIC); // build some arguments for the upcoming dialog - staruno::Sequence<staruno::Any> aParams(4); - aParams.getArray()[0] = staruno::makeAny(starbeans::PropertyValue( + Sequence<Any> aParams(4); + aParams.getArray()[0] = makeAny(PropertyValue( ::rtl::OUString::createFromAscii("Title"), -1, - staruno::makeAny(sTitle), starbeans::PropertyState_DIRECT_VALUE + makeAny(sTitle), PropertyState_DIRECT_VALUE )); - aParams.getArray()[1] = staruno::makeAny(starbeans::PropertyValue( + aParams.getArray()[1] = makeAny(PropertyValue( ::rtl::OUString::createFromAscii("PreviewActive"), -1, - staruno::makeAny((sal_Bool)sal_True), starbeans::PropertyState_DIRECT_VALUE + makeAny((sal_Bool)sal_True), PropertyState_DIRECT_VALUE )); - aParams.getArray()[2] = staruno::makeAny(starbeans::PropertyValue( + aParams.getArray()[2] = makeAny(PropertyValue( ::rtl::OUString::createFromAscii("AllowEmptyFileNames"), -1, - staruno::makeAny((sal_Bool)sal_True), starbeans::PropertyState_DIRECT_VALUE + makeAny((sal_Bool)sal_True), PropertyState_DIRECT_VALUE )); - staruno::Reference<starawt::XWindow> xWindow(getPeer(), staruno::UNO_QUERY); - aParams.getArray()[3] = staruno::makeAny(starbeans::PropertyValue( + Reference<XWindow> xWindow(getPeer(), UNO_QUERY); + aParams.getArray()[3] = makeAny(PropertyValue( ::rtl::OUString::createFromAscii("ParentWindow"), -1, - staruno::makeAny(xWindow), starbeans::PropertyState_DIRECT_VALUE + makeAny(xWindow), PropertyState_DIRECT_VALUE )); try { - staruno::Reference<starawt::XDialog> xDialog( + Reference<XDialog> xDialog( m_xServiceFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii("com.sun.star.dialogs.ImportGraphicsDialog"), aParams), - staruno::UNO_QUERY + UNO_QUERY ); - staruno::Reference<starbeans::XPropertySet> xDialogProps(xDialog, staruno::UNO_QUERY); + Reference<XPropertySet> xDialogProps(xDialog, UNO_QUERY); if (xDialog.is() && xDialogProps.is() && xDialog->execute()) { - staruno::Any aSelectedPath = xDialogProps->getPropertyValue(::rtl::OUString::createFromAscii("SelectedPath")); - if (aSelectedPath.getValueType().getTypeClass() == staruno::TypeClass_STRING) + Any aSelectedPath = xDialogProps->getPropertyValue(::rtl::OUString::createFromAscii("SelectedPath")); + if (aSelectedPath.getValueType().getTypeClass() == TypeClass_STRING) { xSet->setPropertyValue(PROPERTY_IMAGE_URL, ::com::sun::star::uno::makeAny(::rtl::OUString())); // reset the url property in case it already has the value we're about to set - in this case @@ -665,7 +655,7 @@ void OImageControlControl::mousePressed(const starawt::MouseEvent& e) } } } - catch(...) + catch(Exception&) { } } diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index 9a3c30cfc5af..5c4889a05745 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ImageControl.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -89,12 +89,12 @@ namespace frm // OImageControlModel //================================================================== class OImageControlModel - :public starform::XImageProducerSupplier + :public ::com::sun::star::form::XImageProducerSupplier ,public ::comphelper::OAggregationArrayUsageHelper<OImageControlModel> ,public OBoundControlModel ,public OPropertyChangeListener { - staruno::Reference<starawt::XImageProducer> m_xImageProducer; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer; ImageProducer* m_pImageProducer; sal_Bool m_bReadOnly; @@ -103,7 +103,7 @@ class OImageControlModel protected: // UNO Anbindung - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); virtual void _onValueChanged(); virtual sal_Bool _approve(sal_Int32 _nColumnType); @@ -111,24 +111,24 @@ protected: inline ImageProducer* GetImageProducer() { return m_pImageProducer; } public: - OImageControlModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OImageControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OImageControlModel(); - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle ) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const staruno::Any& rValue); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue); - virtual sal_Bool SAL_CALL convertFastPropertyValue(staruno::Any& rConvertedValue, staruno::Any& rOldValue, sal_Int32 nHandle, const staruno::Any& rValue ) - throw(starlang::IllegalArgumentException); + virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw(::com::sun::star::lang::IllegalArgumentException); // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OImageControlModel, OBoundControlModel); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// starform::XBoundComponent - virtual staruno::Any _getControlValue() const; +// ::com::sun::star::form::XBoundComponent + virtual ::com::sun::star::uno::Any _getControlValue() const; virtual void _reset(); -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OImageControlModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); @@ -136,24 +136,24 @@ public: virtual void SAL_CALL disposing(); // OPropertyChangeListener - virtual void _propertyChanged( const starbeans::PropertyChangeEvent& ) throw(staruno::RuntimeException); + virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); -// staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); +// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); -// stario::XPersistObject +// ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - virtual void SAL_CALL write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream); + virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); -// starform::XImageProducerSupplier - virtual staruno::Reference<starawt::XImageProducer> SAL_CALL getImageProducer() { return m_xImageProducer; } +// ::com::sun::star::form::XImageProducerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> SAL_CALL getImageProducer() { return m_xImageProducer; } // ::comphelper::OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -161,36 +161,36 @@ public: //================================================================== // OImageControlControl //================================================================== -class OImageControlControl : public starawt::XMouseListener, +class OImageControlControl : public ::com::sun::star::awt::XMouseListener, public OBoundControl { protected: // UNO Anbindung - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OImageControlControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OImageControlControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OImageControlControl, OBoundControl); - virtual staruno::Any SAL_CALL queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// starlang::XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& _rSource) throw(staruno::RuntimeException) +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) { OBoundControl::disposing(_rSource); } -// starlang::XServiceInfo +// ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OImageControlControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// starawt::XMouseListener - virtual void SAL_CALL mousePressed(const starawt::MouseEvent& e); - virtual void SAL_CALL mouseReleased(const starawt::MouseEvent& e) { } - virtual void SAL_CALL mouseEntered(const starawt::MouseEvent& e) { } - virtual void SAL_CALL mouseExited(const starawt::MouseEvent& e) { } +// ::com::sun::star::awt::XMouseListener + virtual void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& e); + virtual void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& e) { } + virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) { } + virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) { } -// starawt::XControl - virtual void SAL_CALL createPeer(const staruno::Reference<starawt::XToolkit>& _rToolkit, const staruno::Reference<starawt::XWindowPeer>& _rParent) throw(staruno::RuntimeException); +// ::com::sun::star::awt::XControl + virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& _rParent) throw(::com::sun::star::uno::RuntimeException); }; //......................................................................... diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 8eb2eea9d7ea..c1bee7e74a0d 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ListBox.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: obo $ $Date: 2000-10-24 13:02:32 $ + * 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 @@ -142,40 +142,41 @@ using namespace dbtools; //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== //= OListBoxModel //================================================================== sal_Int32 OListBoxModel::nSelectHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OListBoxModel_CreateInstance(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) throw (::com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OListBoxModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OListBoxModel(_rxFactory)); } //------------------------------------------------------------------------------ -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> OListBoxModel::_getTypes() +Sequence< Type> OListBoxModel::_getTypes() { - static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aTypes; + static Sequence< Type> aTypes; if (!aTypes.getLength()) - { - // my two base classes - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aBaseClassTypes = OBoundControlModel::_getTypes(); - - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aOwnTypes(2); - ::com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((::com::sun::star::uno::Reference<starsdb::XSQLErrorBroadcaster>*)NULL); - pOwnTypes[1] = getCppuType((::com::sun::star::uno::Reference<starutil::XRefreshable>*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); - } + aTypes = concatSequences(OBoundControlModel::_getTypes(), OListBoxModel_BASE::getTypes()); return aTypes; } DBG_NAME(OListBoxModel); //------------------------------------------------------------------ -OListBoxModel::OListBoxModel(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OListBoxModel::OListBoxModel(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_LISTBOX, FRM_CONTROL_LISTBOX) // use the old control name for compytibility reasons ,m_aRefreshListeners(m_aMutex) @@ -185,8 +186,8 @@ OListBoxModel::OListBoxModel(const ::com::sun::star::uno::Reference<com::sun::st { DBG_CTOR(OListBoxModel,NULL); - m_nClassId = starform::FormComponentType::LISTBOX; - m_eListSourceType = starform::ListSourceType_VALUELIST; + m_nClassId = FormComponentType::LISTBOX; + m_eListSourceType = ListSourceType_VALUELIST; m_aBoundColumn <<= (sal_Int16)1; m_sDataFieldConnectivityProperty = PROPERTY_SELECT_SEQ; if (OListBoxModel::nSelectHandle == -1) @@ -207,7 +208,7 @@ OListBoxModel::~OListBoxModel() // XServiceInfo //------------------------------------------------------------------------------ -StringSequence SAL_CALL OListBoxModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL OListBoxModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 2); @@ -219,16 +220,11 @@ StringSequence SAL_CALL OListBoxModel::getSupportedServiceNames() throw(::com::s } //------------------------------------------------------------------------------ -::com::sun::star::uno::Any SAL_CALL OListBoxModel::queryAggregation(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) +Any SAL_CALL OListBoxModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - ::com::sun::star::uno::Any aReturn; - - aReturn = OBoundControlModel::queryAggregation(_rType); + Any aReturn = OBoundControlModel::queryAggregation(_rType); if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starutil::XRefreshable*>(this) - ,static_cast<starsdb::XSQLErrorBroadcaster*>(this) - ); + aReturn = OListBoxModel_BASE::queryInterface(_rType); return aReturn; } @@ -237,30 +233,30 @@ StringSequence SAL_CALL OListBoxModel::getSupportedServiceNames() throw(::com::s //------------------------------------------------------------------------------ void OListBoxModel::disposing() { - com::sun::star::lang::EventObject aEvt(static_cast< ::com::sun::star::uno::XWeak*>(this)); + EventObject aEvt(static_cast< XWeak*>(this)); m_aRefreshListeners.disposeAndClear(aEvt); OBoundControlModel::disposing(); } // XRefreshable //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::addRefreshListener(const ::com::sun::star::uno::Reference<starutil::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::addRefreshListener(const Reference<XRefreshListener>& _rxListener) throw(RuntimeException) { m_aRefreshListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::removeRefreshListener(const ::com::sun::star::uno::Reference<starutil::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::removeRefreshListener(const Reference<XRefreshListener>& _rxListener) throw(RuntimeException) { m_aRefreshListeners.removeInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::refresh() throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::refresh() throw(RuntimeException) { { ::osl::MutexGuard aGuard(m_aMutex); - if (m_eListSourceType != starform::ListSourceType_VALUELIST) + if (m_eListSourceType != ListSourceType_VALUELIST) { if (m_xField.is()) m_aValueSeq = StringSequence(); @@ -270,12 +266,12 @@ void SAL_CALL OListBoxModel::refresh() throw(::com::sun::star::uno::RuntimeExcep } } - com::sun::star::lang::EventObject aEvt(static_cast< ::com::sun::star::uno::XWeak*>(this)); - NOTIFY_LISTENERS(m_aRefreshListeners, starutil::XRefreshListener, refreshed, aEvt); + EventObject aEvt(static_cast< XWeak*>(this)); + NOTIFY_LISTENERS(m_aRefreshListeners, XRefreshListener, refreshed, aEvt); } //------------------------------------------------------------------------------ -void OListBoxModel::getFastPropertyValue(::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle) const +void OListBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) const { switch (_nHandle) { @@ -305,18 +301,18 @@ void OListBoxModel::getFastPropertyValue(::com::sun::star::uno::Any& _rValue, sa } //------------------------------------------------------------------------------ -void OListBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue) throw (com::sun::star::uno::Exception) +void OListBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::uno::Exception) { switch (_nHandle) { case PROPERTY_ID_BOUNDCOLUMN : - DBG_ASSERT((_rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_SHORT) || (_rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID), + DBG_ASSERT((_rValue.getValueType().getTypeClass() == TypeClass_SHORT) || (_rValue.getValueType().getTypeClass() == TypeClass_VOID), "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); m_aBoundColumn = _rValue; break; case PROPERTY_ID_LISTSOURCETYPE : - DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast<starform::ListSourceType*>(NULL))), + DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast<ListSourceType*>(NULL))), "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_eListSourceType; break; @@ -326,7 +322,7 @@ void OListBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const : "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_aListSourceSeq; - if (m_eListSourceType == starform::ListSourceType_VALUELIST) + if (m_eListSourceType == ListSourceType_VALUELIST) m_aValueSeq = m_aListSourceSeq; else if (m_xCursor.is() && !m_xField.is()) // Listbox bereits mit Datenbank verbunden // Aenderung der Datenquelle -> neu laden @@ -341,7 +337,7 @@ void OListBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const : break; case PROPERTY_ID_DEFAULT_SELECT_SEQ : - DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast< ::com::sun::star::uno::Sequence<sal_Int16>*>(NULL))), + DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast< Sequence<sal_Int16>*>(NULL))), "OListBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_aDefaultSelectSeq; @@ -366,8 +362,8 @@ void OListBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const : //------------------------------------------------------------------------------ sal_Bool OListBoxModel::convertFastPropertyValue( - ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue) - throw (com::sun::star::lang::IllegalArgumentException) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) { sal_Bool bModified(sal_False); switch (_nHandle) @@ -399,9 +395,9 @@ sal_Bool OListBoxModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL OListBoxModel::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL OListBoxModel::getPropertySetInfo() throw(RuntimeException) { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -413,44 +409,44 @@ cppu::IPropertyArrayHelper& OListBoxModel::getInfoHelper() //------------------------------------------------------------------------------ void OListBoxModel::fillProperties( - ::com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rProps, - ::com::sun::star::uno::Sequence< com::sun::star::beans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(14) // die SelectSequence-Property soll transient sein .... - ModifyPropertyAttributes(_rAggregateProps, PROPERTY_SELECT_SEQ, com::sun::star::beans::PropertyAttribute::TRANSIENT, 0); + ModifyPropertyAttributes(_rAggregateProps, PROPERTY_SELECT_SEQ, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP1(TAG, ::rtl::OUString, BOUND); DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP2(BOUNDCOLUMN, sal_Int16, BOUND, MAYBEVOID); - DECL_PROP1(LISTSOURCETYPE, starform::ListSourceType, BOUND); + DECL_PROP1(LISTSOURCETYPE, ListSourceType, BOUND); DECL_PROP1(LISTSOURCE, StringSequence, BOUND); DECL_PROP3(VALUE_SEQ, StringSequence, BOUND, READONLY, TRANSIENT); - DECL_PROP1(DEFAULT_SELECT_SEQ, ::com::sun::star::uno::Sequence<sal_Int16>, BOUND); + DECL_PROP1(DEFAULT_SELECT_SEQ, Sequence<sal_Int16>, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, com::sun::star::beans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, com::sun::star::beans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL OListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException) +::rtl::OUString SAL_CALL OListBoxModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_LISTBOX; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::write(const ::com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, ::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream) + throw(stario::IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); // Dummy-Seq, um Kompatible zu bleiben, wenn SelectSeq nicht mehr gespeichert wird - ::com::sun::star::uno::Sequence<sal_Int16> aDummySeq; + Sequence<sal_Int16> aDummySeq; // Version // Version 0x0002: ListSource wird StringSeq @@ -458,7 +454,7 @@ void SAL_CALL OListBoxModel::write(const ::com::sun::star::uno::Reference<stario // Maskierung fuer any sal_uInt16 nAnyMask = 0; - if (m_aBoundColumn.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID) + if (m_aBoundColumn.getValueType().getTypeClass() != TypeClass_VOID) nAnyMask |= BOUNDCOLUMN; _rxOutStream << nAnyMask; @@ -481,7 +477,7 @@ void SAL_CALL OListBoxModel::write(const ::com::sun::star::uno::Reference<stario } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::read(const ::com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, ::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::read(const Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, RuntimeException) { // Bei manchen Variblen muessen Abhaengigkeiten beruecksichtigt werden. // Deshalb muessen sie explizit ueber setPropertyValue() gesetzt werden. @@ -499,7 +495,7 @@ void SAL_CALL OListBoxModel::read(const ::com::sun::star::uno::Reference<stario: m_aListSourceSeq.realloc(0); m_aBoundColumn <<= (sal_Int16)0; m_aValueSeq.realloc(0); - m_eListSourceType = starform::ListSourceType_VALUELIST; + m_eListSourceType = ListSourceType_VALUELIST; m_aDefaultSelectSeq.realloc(0); defaultCommonProperties(); return; @@ -526,20 +522,20 @@ void SAL_CALL OListBoxModel::read(const ::com::sun::star::uno::Reference<stario: sal_Int16 nListSourceType; _rxInStream >> nListSourceType; - m_eListSourceType = (starform::ListSourceType)nListSourceType; - ::com::sun::star::uno::Any aListSourceSeqAny; + m_eListSourceType = (ListSourceType)nListSourceType; + Any aListSourceSeqAny; aListSourceSeqAny <<= aListSourceSeq; setFastPropertyValue(PROPERTY_ID_LISTSOURCE, aListSourceSeqAny ); // Dummy-Seq, um Kompatible zu bleiben, wenn SelectSeq nicht mehr gespeichert wird - ::com::sun::star::uno::Sequence<sal_Int16> aDummySeq; + Sequence<sal_Int16> aDummySeq; _rxInStream >> aDummySeq; // DefaultSelectSeq - ::com::sun::star::uno::Sequence<sal_Int16> aDefaultSelectSeq; + Sequence<sal_Int16> aDefaultSelectSeq; _rxInStream >> aDefaultSelectSeq; - ::com::sun::star::uno::Any aDefaultSelectSeqAny; + Any aDefaultSelectSeqAny; aDefaultSelectSeqAny <<= aDefaultSelectSeq; setFastPropertyValue(PROPERTY_ID_DEFAULT_SELECT_SEQ, aDefaultSelectSeqAny); @@ -556,10 +552,10 @@ void SAL_CALL OListBoxModel::read(const ::com::sun::star::uno::Reference<stario: // Stringliste mu gelehrt werden, wenn nicht ueber WerteListe gefuellt wird // dieses kann der Fall sein wenn im alive modus gespeichert wird - if (m_eListSourceType != starform::ListSourceType_VALUELIST && m_xAggregateSet.is()) + if (m_eListSourceType != ListSourceType_VALUELIST && m_xAggregateSet.is()) { StringSequence aSequence; - setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, ::com::sun::star::uno::makeAny(aSequence)); + setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, makeAny(aSequence)); } if (nVersion > 3) @@ -574,28 +570,28 @@ void SAL_CALL OListBoxModel::read(const ::com::sun::star::uno::Reference<stario: //------------------------------------------------------------------------------ void OListBoxModel::loadData() { - DBG_ASSERT(m_eListSourceType != starform::ListSourceType_VALUELIST, "fuer Werteliste kein Laden aus der Datenbank") + DBG_ASSERT(m_eListSourceType != ListSourceType_VALUELIST, "fuer Werteliste kein Laden aus der Datenbank") m_nNULLPos = -1; m_bBoundComponent = sal_False; // Connection holen - ::com::sun::star::uno::Reference<starsdbc::XRowSet> xForm(m_xCursor, ::com::sun::star::uno::UNO_QUERY); + Reference<XRowSet> xForm(m_xCursor, UNO_QUERY); if (!xForm.is()) return; - ::com::sun::star::uno::Reference<starsdbc::XConnection> xConnection = getConnection(xForm); + Reference<XConnection> xConnection = getConnection(xForm); if (!xConnection.is()) return; // we need a com::sun::star::sdb::Connection for some of the code below ... - ::com::sun::star::uno::Reference<com::sun::star::lang::XServiceInfo> xServiceInfo(xConnection, ::com::sun::star::uno::UNO_QUERY); + Reference<XServiceInfo> xServiceInfo(xConnection, UNO_QUERY); if (!xServiceInfo.is() || !xServiceInfo->supportsService(SRV_SDB_CONNECTION)) { DBG_ERROR("OListBoxModel::loadData : invalid connection !"); return; } - ::com::sun::star::uno::Reference<starsdbc::XResultSet> xListCursor; + Reference<XResultSet> xListCursor; // Wenn der ListSourceType keine Werteliste ist, // muss die String-Seq zu einem String zusammengefasst werden @@ -608,20 +604,20 @@ void OListBoxModel::loadData() return; sal_Int16 nBoundColumn = 0; - if (m_aBoundColumn.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_SHORT) + if (m_aBoundColumn.getValueType().getTypeClass() == TypeClass_SHORT) m_aBoundColumn >>= nBoundColumn; try { switch (m_eListSourceType) { - case starform::ListSourceType_TABLEFIELDS: + case ListSourceType_TABLEFIELDS: // don't work with a statement here, the fields will be collected below break; - case starform::ListSourceType_TABLE: + case ListSourceType_TABLE: { - ::com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldsByName = getTableFields(xConnection, sListSource); - ::com::sun::star::uno::Reference<starcontainer::XIndexAccess> xFieldsByIndex(xFieldsByName, ::com::sun::star::uno::UNO_QUERY); + Reference<XNameAccess> xFieldsByName = getTableFields(xConnection, sListSource); + Reference<XIndexAccess> xFieldsByIndex(xFieldsByName, UNO_QUERY); // do we have a bound column if yes we have to select it // and the displayed column is the first column othwhise we act as a combobox @@ -633,7 +629,7 @@ void OListBoxModel::loadData() if (xFieldsByIndex->getCount() <= nBoundColumn) break; - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFieldAsSet; + Reference<XPropertySet> xFieldAsSet; xFieldsByIndex->getByIndex(nBoundColumn) >>= xFieldAsSet; xFieldAsSet->getPropertyValue(PROPERTY_NAME) >>= aBoundFieldName; nBoundColumn = 1; @@ -648,32 +644,32 @@ void OListBoxModel::loadData() else { // otherwise look for the alias - ::com::sun::star::uno::Reference<starsdb::XSQLQueryComposerFactory> xFactory(xConnection, ::com::sun::star::uno::UNO_QUERY); + Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY); if (!xFactory.is()) break; - ::com::sun::star::uno::Reference<starsdb::XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); + Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer(); try { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFormAsSet(xForm, ::com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xFormAsSet(xForm, UNO_QUERY); ::rtl::OUString aStatement; xFormAsSet->getPropertyValue(PROPERTY_ACTIVECOMMAND) >>= aStatement; xComposer->setQuery(aStatement); } - catch(...) + catch(Exception&) { disposeComponent(xComposer); break; } // search the field - ::com::sun::star::uno::Reference<starsdbcx::XColumnsSupplier> xSupplyFields(xComposer, ::com::sun::star::uno::UNO_QUERY); + Reference<XColumnsSupplier> xSupplyFields(xComposer, UNO_QUERY); DBG_ASSERT(xSupplyFields.is(), "OListBoxModel::loadData : invalid query composer !"); - ::com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldNames = xSupplyFields->getColumns(); + Reference<XNameAccess> xFieldNames = xSupplyFields->getColumns(); if (xFieldNames->hasByName(m_aControlSource)) { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xComposerFieldAsSet; + Reference<XPropertySet> xComposerFieldAsSet; xFieldNames->getByName(m_aControlSource) >>= xComposerFieldAsSet; if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet)) xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName; @@ -684,7 +680,7 @@ void OListBoxModel::loadData() if (!aFieldName.len()) break; - ::com::sun::star::uno::Reference<starsdbc::XDatabaseMetaData> xMeta = xConnection->getMetaData(); + Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); ::rtl::OUString aQuote = xMeta->getIdentifierQuoteString(); ::rtl::OUString aStatement = ::rtl::OUString::createFromAscii("SELECT "); if (!aBoundFieldName.getLength()) // act like a combobox @@ -699,15 +695,15 @@ void OListBoxModel::loadData() aStatement += ::rtl::OUString::createFromAscii(" FROM "); aStatement += quoteTableName(xMeta, sListSource); - ::com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); + Reference<XStatement> xStmt = xConnection->createStatement(); xListCursor = xStmt->executeQuery(aStatement); } break; - case starform::ListSourceType_QUERY: + case ListSourceType_QUERY: { - ::com::sun::star::uno::Reference<starsdb::XQueriesSupplier> xSupplyQueries(xConnection, ::com::sun::star::uno::UNO_QUERY); - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(sListSource).getValue(), ::com::sun::star::uno::UNO_QUERY); - ::com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>(xStmt, ::com::sun::star::uno::UNO_QUERY)->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); + Reference<XQueriesSupplier> xSupplyQueries(xConnection, UNO_QUERY); + Reference<XPropertySet> xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(sListSource).getValue(), UNO_QUERY); + Reference<XStatement> xStmt = xConnection->createStatement(); + Reference<XPropertySet>(xStmt, UNO_QUERY)->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); ::rtl::OUString sCommand; xQuery->getPropertyValue(PROPERTY_COMMAND) >>= sCommand; @@ -715,30 +711,30 @@ void OListBoxModel::loadData() } break; default: { - ::com::sun::star::uno::Reference<starsdbc::XStatement> xStmt = xConnection->createStatement(); - if (starform::ListSourceType_SQLPASSTHROUGH == m_eListSourceType) + Reference<XStatement> xStmt = xConnection->createStatement(); + if (ListSourceType_SQLPASSTHROUGH == m_eListSourceType) { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xStatementProps(xStmt, ::com::sun::star::uno::UNO_QUERY); - xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::com::sun::star::uno::makeAny(sal_Bool(sal_False))); + Reference<XPropertySet> xStatementProps(xStmt, UNO_QUERY); + xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, makeAny(sal_Bool(sal_False))); } xListCursor = xStmt->executeQuery(sListSource); } } } - catch(starsdbc::SQLException& eSQL) + catch(SQLException& eSQL) { onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); disposeComponent(xListCursor); return; } - catch(::com::sun::star::uno::Exception& eUnknown) + catch(Exception& eUnknown) { eUnknown; disposeComponent(xListCursor); return; } - if (starform::ListSourceType_TABLEFIELDS != m_eListSourceType && !xListCursor.is()) + if (ListSourceType_TABLEFIELDS != m_eListSourceType && !xListCursor.is()) // something went wrong ... return; @@ -751,50 +747,50 @@ void OListBoxModel::loadData() { switch (m_eListSourceType) { - case starform::ListSourceType_SQL: - case starform::ListSourceType_SQLPASSTHROUGH: - case starform::ListSourceType_TABLE: - case starform::ListSourceType_QUERY: + case ListSourceType_SQL: + case ListSourceType_SQLPASSTHROUGH: + case ListSourceType_TABLE: + case ListSourceType_QUERY: { // Feld der 1. Column des ResultSets holen - ::com::sun::star::uno::Reference<starsdbcx::XColumnsSupplier> xSupplyCols(xListCursor, ::com::sun::star::uno::UNO_QUERY); + Reference<XColumnsSupplier> xSupplyCols(xListCursor, UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "OListBoxModel::loadData : cursor supports the row set service but is no column supplier ??!"); - ::com::sun::star::uno::Reference<starcontainer::XIndexAccess> xColumns; + Reference<XIndexAccess> xColumns; if (xSupplyCols.is()) { - xColumns = ::com::sun::star::uno::Reference<starcontainer::XIndexAccess>(xSupplyCols->getColumns(), ::com::sun::star::uno::UNO_QUERY); + xColumns = Reference<XIndexAccess>(xSupplyCols->getColumns(), UNO_QUERY); DBG_ASSERT(xColumns.is(), "OListBoxModel::loadData : no columns supplied by the row set !"); } - ::com::sun::star::uno::Reference<starsdb::XColumn> xDataField; + Reference<XColumn> xDataField; if (xColumns.is()) - xDataField = ::com::sun::star::uno::Reference<starsdb::XColumn>(*(InterfaceRef*)xColumns->getByIndex(0).getValue(), ::com::sun::star::uno::UNO_QUERY); + xDataField = Reference<XColumn>(*(InterfaceRef*)xColumns->getByIndex(0).getValue(), UNO_QUERY); if (!xDataField.is()) { disposeComponent(xListCursor); return; } - starutil::Date aNullDate(DBTypeConversion::STANDARD_DB_DATE); + ::com::sun::star::util::Date aNullDate(DBTypeConversion::STANDARD_DB_DATE); sal_Int32 nFormatKey = 0; - sal_Int32 nFieldType = starsdbc::DataType::OTHER; - sal_Int16 nKeyType = starutil::NumberFormat::UNDEFINED; + sal_Int32 nFieldType = DataType::OTHER; + sal_Int16 nKeyType = NumberFormat::UNDEFINED; try { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xFieldAsSet(xDataField, ::com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xFieldAsSet(xDataField, UNO_QUERY); xFieldAsSet->getPropertyValue(PROPERTY_FIELDTYPE) >>= nFieldType; xFieldAsSet->getPropertyValue(PROPERTY_FORMATKEY) >>= nFormatKey; } - catch(...) + catch(Exception&) { } - ::com::sun::star::uno::Reference<starutil::XNumberFormatter> xFormatter; - ::com::sun::star::uno::Reference<starutil::XNumberFormatsSupplier> xSupplier = getNumberFormats(xConnection, sal_False, m_xServiceFactory); + Reference<XNumberFormatter> xFormatter; + Reference<XNumberFormatsSupplier> xSupplier = getNumberFormats(xConnection, sal_False, m_xServiceFactory); if (xSupplier.is()) { - xFormatter = ::com::sun::star::uno::Reference<starutil::XNumberFormatter>( + xFormatter = Reference<XNumberFormatter>( m_xServiceFactory->createInstance(FRM_NUMBER_FORMATTER), - ::com::sun::star::uno::UNO_QUERY + UNO_QUERY ); if (xFormatter.is()) { @@ -806,10 +802,10 @@ void OListBoxModel::loadData() } // Feld der BoundColumn des ResultSets holen - ::com::sun::star::uno::Reference<starsdb::XColumn> xBoundField; + Reference<XColumn> xBoundField; if ((nBoundColumn > 0) && m_xColumn.is()) // don't look for a bound column if we're not connected to a field - xBoundField = ::com::sun::star::uno::Reference<starsdb::XColumn>(*(InterfaceRef*)xColumns->getByIndex(nBoundColumn).getValue(), ::com::sun::star::uno::UNO_QUERY); + xBoundField = Reference<XColumn>(*(InterfaceRef*)xColumns->getByIndex(nBoundColumn).getValue(), UNO_QUERY); m_bBoundComponent = xBoundField.is(); // Ist die LB an ein Feld gebunden und sind Leereintrge zulaessig @@ -840,9 +836,9 @@ void OListBoxModel::loadData() } break; - case starform::ListSourceType_TABLEFIELDS: + case ListSourceType_TABLEFIELDS: { - ::com::sun::star::uno::Reference<starcontainer::XNameAccess> xFieldNames = getTableFields(xConnection, sListSource); + Reference<XNameAccess> xFieldNames = getTableFields(xConnection, sListSource); if (xFieldNames.is()) { StringSequence seqNames = xFieldNames->getElementNames(); @@ -856,13 +852,13 @@ void OListBoxModel::loadData() break; } } - catch(starsdbc::SQLException& eSQL) + catch(SQLException& eSQL) { onError(eSQL, FRM_RES_STRING(RID_BASELISTBOX_ERROR_FILLLIST)); disposeComponent(xListCursor); return; } - catch(::com::sun::star::uno::Exception& eUnknown) + catch(Exception& eUnknown) { eUnknown; disposeComponent(xListCursor); @@ -870,7 +866,7 @@ void OListBoxModel::loadData() } - // Value-::com::sun::star::uno::Sequence erzeugen + // Value-Sequence erzeugen // NULL eintrag hinzufuegen if (bUseNULL && m_nNULLPos == -1) { @@ -886,13 +882,13 @@ void OListBoxModel::loadData() for (i = 0; i < aValueList.size(); ++i) pustrValues[i] = aValueList[i]; - // String-::com::sun::star::uno::Sequence fuer ListBox erzeugen + // String-Sequence fuer ListBox erzeugen StringSequence aStringSeq(aStringList.size()); ::rtl::OUString* pustrStrings = aStringSeq.getArray(); for (i = 0; i < aStringList.size(); ++i) pustrStrings[i] = aStringList[i]; - setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, ::com::sun::star::uno::makeAny(aStringSeq)); + setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, makeAny(aStringSeq)); // Statement + Cursor zerstoeren @@ -900,15 +896,15 @@ void OListBoxModel::loadData() } //------------------------------------------------------------------------------ -void OListBoxModel::_loaded(const com::sun::star::lang::EventObject& rEvent) +void OListBoxModel::_loaded(const EventObject& rEvent) { // an Felder gebundene Listboxen haben keine Multiselektion if (m_xField.is()) { - setFastPropertyValue(PROPERTY_ID_MULTISELECTION, ::com::sun::star::uno::makeAny(sal_Bool(sal_False))); + setFastPropertyValue(PROPERTY_ID_MULTISELECTION, makeAny(sal_Bool(sal_False))); } - if (m_eListSourceType != starform::ListSourceType_VALUELIST) + if (m_eListSourceType != ListSourceType_VALUELIST) { if (m_xField.is()) m_aValueSeq = StringSequence(); @@ -921,14 +917,14 @@ void OListBoxModel::_loaded(const com::sun::star::lang::EventObject& rEvent) //------------------------------------------------------------------------------ void OListBoxModel::_unloaded() { - if (m_eListSourceType != starform::ListSourceType_VALUELIST) + if (m_eListSourceType != ListSourceType_VALUELIST) { m_aValueSeq = StringSequence(); m_nNULLPos = -1; m_bBoundComponent = sal_False; StringSequence aSequence; - setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, ::com::sun::star::uno::makeAny(aSequence)); + setFastPropertyValue(PROPERTY_ID_STRINGITEMLIST, makeAny(aSequence)); } } @@ -937,13 +933,13 @@ StringSequence OListBoxModel::GetCurValueSeq() const { StringSequence aCurValues; - // Aus den selektierten Indizes Werte-::com::sun::star::uno::Sequence aufbauen + // Aus den selektierten Indizes Werte-Sequence aufbauen DBG_ASSERT(m_xAggregateFastSet.is(), "OListBoxModel::GetCurValueSeq : invalid aggregate !"); if (!m_xAggregateFastSet.is()) return aCurValues; - ::com::sun::star::uno::Any aTmp = m_xAggregateFastSet->getFastPropertyValue(OListBoxModel::nSelectHandle); + Any aTmp = m_xAggregateFastSet->getFastPropertyValue(OListBoxModel::nSelectHandle); - ::com::sun::star::uno::Sequence<sal_Int16> aSelectSeq = *(::com::sun::star::uno::Sequence<sal_Int16>*)aTmp.getValue(); + Sequence<sal_Int16> aSelectSeq = *(Sequence<sal_Int16>*)aTmp.getValue(); const sal_Int16 *pSels = aSelectSeq.getConstArray(); sal_uInt32 nSelCount = aSelectSeq.getLength(); @@ -994,7 +990,7 @@ StringSequence OListBoxModel::GetCurValueSeq() const sal_Bool OListBoxModel::_commit() { // derzeitige Selectionsliste - ::com::sun::star::uno::Any aNewValue; + Any aNewValue; StringSequence aCurValueSeq = GetCurValueSeq(); if (aCurValueSeq.getLength()) aNewValue <<= aCurValueSeq.getConstArray()[0]; @@ -1011,7 +1007,7 @@ sal_Bool OListBoxModel::_commit() aNewValue >>= sNewValue; m_xColumnUpdate->updateString(sNewValue); } - catch(...) + catch(Exception&) { return sal_False; } @@ -1029,7 +1025,7 @@ void OListBoxModel::_onValueChanged() if (!m_xAggregateFastSet.is() || !m_xAggregateSet.is()) return; - ::com::sun::star::uno::Sequence<sal_Int16> aSelSeq; + Sequence<sal_Int16> aSelSeq; // Bei NULL-Eintraegen Selektion aufheben! ::rtl::OUString sValue = m_xColumn->getString(); @@ -1055,7 +1051,7 @@ void OListBoxModel::_onValueChanged() aSelSeq = findValue(aStringSeq, sValue, m_bBoundComponent); } } - ::com::sun::star::uno::Any aSelectAny; + Any aSelectAny; aSelectAny <<= aSelSeq; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with @@ -1074,18 +1070,18 @@ void OListBoxModel::_reset( void ) if (!m_xAggregateFastSet.is() || !m_xAggregateSet.is()) return; - ::com::sun::star::uno::Any aValue; + Any aValue; if (m_aDefaultSelectSeq.getLength()) aValue <<= m_aDefaultSelectSeq; else if (m_nNULLPos != -1) // gebundene Listbox { - ::com::sun::star::uno::Sequence<sal_Int16> aSeq(1); + Sequence<sal_Int16> aSeq(1); aSeq.getArray()[0] = m_nNULLPos; aValue <<= aSeq; } else { - ::com::sun::star::uno::Sequence<sal_Int16> aSeq; + Sequence<sal_Int16> aSeq; aValue <<= aSeq; } { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties @@ -1098,28 +1094,28 @@ void OListBoxModel::_reset( void ) } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::addSQLErrorListener(const ::com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::addSQLErrorListener(const Reference<XSQLErrorListener>& _rxListener) throw(RuntimeException) { m_aErrorListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxModel::removeSQLErrorListener(const ::com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxModel::removeSQLErrorListener(const Reference<XSQLErrorListener>& _rxListener) throw(RuntimeException) { m_aErrorListeners.removeInterface(_rxListener); } //------------------------------------------------------------------------------ -void OListBoxModel::onError(starsdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription) +void OListBoxModel::onError(SQLException& _rException, const ::rtl::OUString& _rContextDescription) { - starsdb::SQLContext aError = prependContextInfo(_rException, static_cast< ::com::sun::star::uno::XWeak*>(this), _rContextDescription); + SQLContext aError = prependContextInfo(_rException, static_cast< XWeak*>(this), _rContextDescription); if (m_aErrorListeners.getLength()) { - starsdb::SQLErrorEvent aEvent(static_cast< ::com::sun::star::uno::XWeak*>(this), ::com::sun::star::uno::makeAny(aError)); + SQLErrorEvent aEvent(static_cast< XWeak*>(this), makeAny(aError)); ::cppu::OInterfaceIteratorHelper aIter(m_aErrorListeners); while (aIter.hasMoreElements()) - static_cast<starsdb::XSQLErrorListener*>(aIter.next())->errorOccured(aEvent); + static_cast<XSQLErrorListener*>(aIter.next())->errorOccured(aEvent); } } @@ -1128,39 +1124,24 @@ void OListBoxModel::onError(starsdbc::SQLException& _rException, const ::rtl::OU //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OListBoxControl_CreateInstance(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) throw (::com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OListBoxControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new OListBoxControl(_rxFactory)); } //------------------------------------------------------------------------------ -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> OListBoxControl::_getTypes() +Sequence< Type> OListBoxControl::_getTypes() { - static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aTypes; + static Sequence< Type> aTypes; if (!aTypes.getLength()) - { - // my two base classes - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aBaseClassTypes = OBoundControl::_getTypes(); - - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> aOwnTypes(2); - ::com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = ::getCppuType((::com::sun::star::uno::Reference<starawt::XFocusListener>*)NULL); - pOwnTypes[1] = ::getCppuType((::com::sun::star::uno::Reference<starform::XChangeBroadcaster>*)NULL); - - aTypes = concatSequences(aBaseClassTypes, aOwnTypes); - } + aTypes = concatSequences(OBoundControl::_getTypes(), OListBoxControl_BASE::getTypes()); return aTypes; } //------------------------------------------------------------------ -::com::sun::star::uno::Any SAL_CALL OListBoxControl::queryAggregation(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) +Any SAL_CALL OListBoxControl::queryAggregation(const Type& _rType) throw (RuntimeException) { - ::com::sun::star::uno::Any aReturn; - - aReturn = ::cppu::queryInterface(_rType - ,static_cast<starawt::XFocusListener*>(this) - ,static_cast<starform::XChangeBroadcaster*>(this) - ); + Any aReturn = OListBoxControl_BASE::queryInterface(_rType); if (!aReturn.hasValue()) aReturn = OBoundControl::queryAggregation(_rType); @@ -1169,7 +1150,7 @@ InterfaceRef SAL_CALL OListBoxControl_CreateInstance(const ::com::sun::star::uno DBG_NAME(OListBoxControl); //------------------------------------------------------------------------------ -OListBoxControl::OListBoxControl(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& _rxFactory) +OListBoxControl::OListBoxControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_LISTBOX) ,m_aChangeListeners(m_aMutex) { @@ -1178,12 +1159,12 @@ OListBoxControl::OListBoxControl(const ::com::sun::star::uno::Reference<com::sun increment(m_refCount); { // als FocusListener anmelden - ::com::sun::star::uno::Reference<starawt::XWindow> xComp; + Reference<XWindow> xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->addFocusListener(this); // als ItemListener anmelden - ::com::sun::star::uno::Reference<starawt::XListBox> xListbox; + Reference<XListBox> xListbox; if (query_aggregation(m_xAggregate, xListbox)) xListbox->addItemListener(this); } @@ -1207,7 +1188,7 @@ OListBoxControl::~OListBoxControl() } //------------------------------------------------------------------------------ -StringSequence SAL_CALL OListBoxControl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL OListBoxControl::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControl::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); @@ -1220,12 +1201,12 @@ StringSequence SAL_CALL OListBoxControl::getSupportedServiceNames() throw(::com: // XFocusListener //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::focusGained(const starawt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::focusGained(const FocusEvent& _rEvent) throw(RuntimeException) { ::osl::ClearableMutexGuard aGuard(m_aMutex); if (m_aChangeListeners.getLength()) // only if there are listeners { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), ::com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (xSet.is()) { // memorize the current selection for posting the change event @@ -1235,20 +1216,20 @@ void SAL_CALL OListBoxControl::focusGained(const starawt::FocusEvent& _rEvent) t } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::focusLost(const starawt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::focusLost(const FocusEvent& _rEvent) throw(RuntimeException) { m_aCurrentSelection.clear(); } // XItemListener //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::itemStateChanged(const starawt::ItemEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::itemStateChanged(const ItemEvent& _rEvent) throw(RuntimeException) { // call the changelistener delayed ::osl::ClearableMutexGuard aGuard(m_aMutex); if (m_aChangeTimer.IsActive()) { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), ::com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); m_aCurrentSelection = xSet->getPropertyValue(PROPERTY_SELECT_SEQ); m_aChangeTimer.Stop(); @@ -1258,15 +1239,15 @@ void SAL_CALL OListBoxControl::itemStateChanged(const starawt::ItemEvent& _rEven { if (m_aChangeListeners.getLength() && m_aCurrentSelection.hasValue()) { - ::com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), ::com::sun::star::uno::UNO_QUERY); + Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if (xSet.is()) { // Has the selection been changed? sal_Bool bModified(sal_False); - ::com::sun::star::uno::Any aValue = xSet->getPropertyValue(PROPERTY_SELECT_SEQ); + Any aValue = xSet->getPropertyValue(PROPERTY_SELECT_SEQ); - ::com::sun::star::uno::Sequence<sal_Int16>& rSelection = *(::com::sun::star::uno::Sequence<sal_Int16> *)aValue.getValue(); - ::com::sun::star::uno::Sequence<sal_Int16>& rOldSelection = *(::com::sun::star::uno::Sequence<sal_Int16> *)m_aCurrentSelection.getValue(); + Sequence<sal_Int16>& rSelection = *(Sequence<sal_Int16> *)aValue.getValue(); + Sequence<sal_Int16>& rOldSelection = *(Sequence<sal_Int16> *)m_aCurrentSelection.getValue(); sal_Int32 nLen = rSelection.getLength(); if (nLen != rOldSelection.getLength()) bModified = sal_True; @@ -1293,20 +1274,20 @@ void SAL_CALL OListBoxControl::itemStateChanged(const starawt::ItemEvent& _rEven // XEventListener //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::disposing(const com::sun::star::lang::EventObject& _rSource) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::disposing(const EventObject& _rSource) throw (RuntimeException) { OBoundControl::disposing(_rSource); } // XChangeBroadcaster //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::addChangeListener(const ::com::sun::star::uno::Reference<starform::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::addChangeListener(const Reference<XChangeListener>& _rxListener) throw(RuntimeException) { m_aChangeListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OListBoxControl::removeChangeListener(const ::com::sun::star::uno::Reference<starform::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL OListBoxControl::removeChangeListener(const Reference<XChangeListener>& _rxListener) throw(RuntimeException) { m_aChangeListeners.removeInterface(_rxListener); } @@ -1318,7 +1299,7 @@ void OListBoxControl::disposing() if (m_aChangeTimer.IsActive()) m_aChangeTimer.Stop(); - com::sun::star::lang::EventObject aEvt(static_cast< ::com::sun::star::uno::XWeak*>(this)); + EventObject aEvt(static_cast< XWeak*>(this)); m_aChangeListeners.disposeAndClear(aEvt); OBoundControl::disposing(); @@ -1327,8 +1308,8 @@ void OListBoxControl::disposing() //------------------------------------------------------------------------------ IMPL_LINK(OListBoxControl, OnTimeout, void*, EMPTYTAG) { - com::sun::star::lang::EventObject aEvt(static_cast< ::com::sun::star::uno::XWeak*>(this)); - NOTIFY_LISTENERS(m_aChangeListeners, starform::XChangeListener, changed, aEvt); + EventObject aEvt(static_cast< XWeak*>(this)); + NOTIFY_LISTENERS(m_aChangeListeners, XChangeListener, changed, aEvt); return 1; } diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 5b8d7ab28e9f..5ebe00e374d8 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ListBox.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2000-10-24 10:29:44 $ + * 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 @@ -78,13 +78,31 @@ #include <vcl/timer.hxx> #endif +#ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_ #include <com/sun/star/util/XRefreshable.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include <com/sun/star/util/XNumberFormatter.hpp> +#endif +#ifndef _COM_SUN_STAR_SDB_XSQLERRORBROADCASTER_HPP_ #include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_LISTSOURCETYPE_HPP_ #include <com/sun/star/form/ListSourceType.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XITEMLISTENER_HPP_ #include <com/sun/star/awt/XItemListener.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_XFOCUSLISTENER_HPP_ #include <com/sun/star/awt/XFocusListener.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ #include <com/sun/star/form/XChangeBroadcaster.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + //......................................................................... namespace frm @@ -95,19 +113,20 @@ const ::rtl::OUString LISTBOX_EMPTY_VALUE = ::rtl::OUString::createFromAscii("$$ //================================================================== //= OListBoxModel //================================================================== -class OListBoxModel - :public OBoundControlModel - ,public starsdb::XSQLErrorBroadcaster - ,public starutil::XRefreshable - ,public ::comphelper::OAggregationArrayUsageHelper< OListBoxModel > +typedef ::cppu::ImplHelper2< ::com::sun::star::sdb::XSQLErrorBroadcaster, + ::com::sun::star::util::XRefreshable> OListBoxModel_BASE; + +class OListBoxModel : public OBoundControlModel + ,public OListBoxModel_BASE + ,public ::comphelper::OAggregationArrayUsageHelper< OListBoxModel > { - ::com::sun::star::uno::Any m_aSaveValue; + ::com::sun::star::uno::Any m_aSaveValue; // <properties> - starform::ListSourceType m_eListSourceType; // type der list source + ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source ::com::sun::star::uno::Any m_aBoundColumn; - StringSequence m_aListSourceSeq; // - StringSequence m_aValueSeq; // alle Werte, readonly + StringSequence m_aListSourceSeq; // + StringSequence m_aValueSeq; // alle Werte, readonly ::com::sun::star::uno::Sequence<sal_Int16> m_aDefaultSelectSeq; // DefaultSelected // </properties> @@ -130,7 +149,7 @@ protected: virtual void _onValueChanged(); public: - OListBoxModel(const ::com::sun::star::uno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OListBoxModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OListBoxModel(); // XServiceInfo @@ -150,63 +169,64 @@ public: throw (::com::sun::star::uno::Exception); virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) - throw (starlang::IllegalArgumentException); + throw (::com::sun::star::lang::IllegalArgumentException); // XLoadListener - virtual void _loaded(const starlang::EventObject& rEvent); + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); virtual void _unloaded(); // XBoundComponent virtual sal_Bool _commit(); // XPropertySet - virtual ::com::sun::star::uno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const ::com::sun::star::uno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, ::com::sun::star::uno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const ::com::sun::star::uno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, ::com::sun::star::uno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // XReset virtual void _reset(); // XRefreshable virtual void SAL_CALL refresh() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference<starutil::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference<starutil::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRefreshListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // XSQLErrorBroadcaster - virtual void SAL_CALL addSQLErrorListener(const ::com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeSQLErrorListener(const ::com::sun::star::uno::Reference<starsdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - ::com::sun::star::uno::Sequence< starbeans::Property >& /* [out] */ _rProps, - ::com::sun::star::uno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() protected: void loadData(); - void onError(starsdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription); + void onError(::com::sun::star::sdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription); }; //================================================================== //= OListBoxControl //================================================================== +typedef ::cppu::ImplHelper3< ::com::sun::star::awt::XFocusListener, + ::com::sun::star::awt::XItemListener, + ::com::sun::star::form::XChangeBroadcaster > OListBoxControl_BASE; class OListBoxControl :public OBoundControl - ,public starawt::XFocusListener - ,public starawt::XItemListener - ,public starform::XChangeBroadcaster + ,public OListBoxControl_BASE { ::cppu::OInterfaceContainerHelper m_aChangeListeners; - ::com::sun::star::uno::Any m_aCurrentSelection; + ::com::sun::star::uno::Any m_aCurrentSelection; Timer m_aChangeTimer; protected: @@ -214,7 +234,7 @@ protected: virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OListBoxControl(const ::com::sun::star::uno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OListBoxControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OListBoxControl(); // UNO Anbindung @@ -226,18 +246,18 @@ public: virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XChangeBroadcaster - virtual void SAL_CALL addChangeListener(const ::com::sun::star::uno::Reference<starform::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeChangeListener(const ::com::sun::star::uno::Reference<starform::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); // XFocusListener - virtual void SAL_CALL focusGained(const starawt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL focusLost(const starawt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); // XItemListener - virtual void SAL_CALL itemStateChanged(const starawt::ItemEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemStateChanged(const ::com::sun::star::awt::ItemEvent& _rEvent) throw(::com::sun::star::uno::RuntimeException); // XEventListener - virtual void SAL_CALL disposing(const starlang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw (::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx index 25d3eb19f75e..4d1a07957b47 100644 --- a/forms/source/component/Numeric.cxx +++ b/forms/source/component/Numeric.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Numeric.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $ + * 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 @@ -71,13 +71,24 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // ONumericControl //================================================================== //------------------------------------------------------------------ -ONumericControl::ONumericControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ONumericControl::ONumericControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_NUMERICFIELD) { } @@ -95,13 +106,13 @@ StringSequence ONumericControl::getSupportedServiceNames() throw() //------------------------------------------------------------------ -InterfaceRef SAL_CALL ONumericControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL ONumericControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new ONumericControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> ONumericControl::_getTypes() +Sequence<Type> ONumericControl::_getTypes() { return OBoundControl::_getTypes(); } @@ -111,23 +122,23 @@ staruno::Sequence<staruno::Type> ONumericControl::_getTypes() //================================================================== sal_Int32 ONumericModel::nValueHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL ONumericModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL ONumericModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new ONumericModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> ONumericModel::_getTypes() +Sequence<Type> ONumericModel::_getTypes() { return OEditBaseModel::_getTypes(); } //------------------------------------------------------------------ -ONumericModel::ONumericModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ONumericModel::ONumericModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_NUMERICFIELD, FRM_CONTROL_NUMERICFIELD) // use the old control name for compytibility reasons { - m_nClassId = starform::FormComponentType::NUMERICFIELD; + m_nClassId = FormComponentType::NUMERICFIELD; m_sDataFieldConnectivityProperty = PROPERTY_VALUE; if (ONumericModel::nValueHandle == -1) ONumericModel::nValueHandle = getOriginalHandle(PROPERTY_ID_VALUE); @@ -138,7 +149,7 @@ ONumericModel::~ONumericModel() { } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence ONumericModel::getSupportedServiceNames() throw() { @@ -152,20 +163,20 @@ StringSequence ONumericModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL ONumericModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL ONumericModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void ONumericModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(10) // Value auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_VALUE, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_VALUE, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP3(DEFAULT_VALUE, double, BOUND, MAYBEDEFAULT, MAYBEVOID); @@ -174,8 +185,8 @@ void ONumericModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet,READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet,READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -192,11 +203,11 @@ void ONumericModel::fillProperties( return FRM_COMPONENT_NUMERICFIELD; // old (non-sun) name for compatibility ! } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ sal_Bool ONumericModel::_commit() { - staruno::Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( ONumericModel::nValueHandle ); + Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( ONumericModel::nValueHandle ); if (!compare(aNewValue, m_aSaveValue)) { if (!aNewValue.hasValue()) @@ -207,7 +218,7 @@ sal_Bool ONumericModel::_commit() { m_xColumnUpdate->updateDouble(getDouble(aNewValue)); } - catch(...) + catch(Exception&) { return sal_False; } @@ -233,12 +244,12 @@ void ONumericModel::_onValueChanged() } } -// starform::XReset +// XReset //------------------------------------------------------------------------------ void ONumericModel::_reset() { - staruno::Any aValue; - if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_DOUBLE) + Any aValue; + if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE) aValue = m_aDefault; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties diff --git a/forms/source/component/Numeric.hxx b/forms/source/component/Numeric.hxx index 2bf26e89767a..eb3822535dc5 100644 --- a/forms/source/component/Numeric.hxx +++ b/forms/source/component/Numeric.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Numeric.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -78,29 +78,29 @@ class ONumericModel :public OEditBaseModel ,public ::comphelper::OAggregationArrayUsageHelper< ONumericModel > { - staruno::Any m_aSaveValue; + ::com::sun::star::uno::Any m_aSaveValue; static sal_Int32 nValueHandle; protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - ONumericModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ONumericModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~ONumericModel(); // starform::XBoundComponent virtual sal_Bool _commit(); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(ONumericModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); - // staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - // stario::XPersistObject + // ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); // starform::XReset @@ -108,8 +108,8 @@ public: // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -120,12 +120,12 @@ public: class ONumericControl: public OBoundControl { protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - ONumericControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ONumericControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(ONumericControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); }; diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx index cec218fe4dec..cbdca7e266a4 100644 --- a/forms/source/component/Pattern.cxx +++ b/forms/source/component/Pattern.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Pattern.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $ + * 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 @@ -71,24 +71,35 @@ namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== // OPatternControl //================================================================== //------------------------------------------------------------------ -OPatternControl::OPatternControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OPatternControl::OPatternControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_PATTERNFIELD) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OPatternControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OPatternControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OPatternControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OPatternControl::_getTypes() +Sequence<Type> OPatternControl::_getTypes() { return OBoundControl::_getTypes(); } @@ -110,23 +121,23 @@ StringSequence OPatternControl::getSupportedServiceNames() throw() sal_Int32 OPatternModel::nTextHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OPatternModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OPatternModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OPatternModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OPatternModel::_getTypes() +Sequence<Type> OPatternModel::_getTypes() { return OEditBaseModel::_getTypes(); } //------------------------------------------------------------------ -OPatternModel::OPatternModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OPatternModel::OPatternModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_PATTERNFIELD, FRM_CONTROL_PATTERNFIELD) // use the old control name for compytibility reasons { - m_nClassId = starform::FormComponentType::PATTERNFIELD; + m_nClassId = FormComponentType::PATTERNFIELD; m_sDataFieldConnectivityProperty = PROPERTY_TEXT; if (OPatternModel::nTextHandle == -1) OPatternModel::nTextHandle = getOriginalHandle(PROPERTY_ID_TEXT); @@ -137,7 +148,7 @@ OPatternModel::~OPatternModel() { } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence SAL_CALL OPatternModel::getSupportedServiceNames() throw() { @@ -152,20 +163,20 @@ StringSequence SAL_CALL OPatternModel::getSupportedServiceNames() throw() //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OPatternModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OPatternModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OPatternModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(12) // Text auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TEXT, PropertyAttribute::TRANSIENT, 0); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP2(DEFAULT_TEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT); @@ -174,9 +185,9 @@ void OPatternModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); DECL_PROP2(FILTERPROPOSAL, sal_Bool, BOUND, MAYBEDEFAULT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -193,7 +204,7 @@ void OPatternModel::fillProperties( return FRM_COMPONENT_PATTERNFIELD; // old (non-sun) name for compatibility ! } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ sal_Bool OPatternModel::_commit() { @@ -208,7 +219,7 @@ sal_Bool OPatternModel::_commit() { m_xColumnUpdate->updateString(aNewValue); } - catch(...) + catch(Exception&) { return sal_False; } @@ -218,7 +229,7 @@ sal_Bool OPatternModel::_commit() return sal_True; } -// starbeans::XPropertyChangeListener +// XPropertyChangeListener //------------------------------------------------------------------------------ void OPatternModel::_onValueChanged() { @@ -228,11 +239,11 @@ void OPatternModel::_onValueChanged() // our own mutex locked // FS - 72451 - 31.01.00 MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OPatternModel::nTextHandle, staruno::makeAny(m_aSaveValue)); + m_xAggregateFastSet->setFastPropertyValue(OPatternModel::nTextHandle, makeAny(m_aSaveValue)); } } -// starform::XReset +// XReset //------------------------------------------------------------------------------ void OPatternModel::_reset( void ) { @@ -241,7 +252,7 @@ void OPatternModel::_reset( void ) // our own mutex locked // FS - 72451 - 31.01.00 MutexRelease aRelease(m_aMutex); - m_xAggregateFastSet->setFastPropertyValue(OPatternModel::nTextHandle, staruno::makeAny(m_aDefaultText)); + m_xAggregateFastSet->setFastPropertyValue(OPatternModel::nTextHandle, makeAny(m_aDefaultText)); } } diff --git a/forms/source/component/Pattern.hxx b/forms/source/component/Pattern.hxx index 59729f7c9d2f..2d06ffa402ab 100644 --- a/forms/source/component/Pattern.hxx +++ b/forms/source/component/Pattern.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Pattern.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -84,24 +84,24 @@ class OPatternModel protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OPatternModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OPatternModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OPatternModel(); // starform::XBoundComponent virtual sal_Bool _commit(); - // staruno::Reference<starbeans::XPropertySet> - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + // ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OPatternModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); - // stario::XPersistObject + // ::com::sun::star::io::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); // starform::XReset @@ -109,8 +109,8 @@ public: // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -121,12 +121,12 @@ public: class OPatternControl: public OBoundControl { protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OPatternControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OPatternControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OPatternControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); }; diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx index b8542a0fe8f0..f37026b42c17 100644 --- a/forms/source/component/RadioButton.cxx +++ b/forms/source/component/RadioButton.cxx @@ -2,9 +2,9 @@ * * $RCSfile: RadioButton.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $ + * 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 @@ -82,16 +82,27 @@ //......................................................................... namespace frm { +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +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::util; //================================================================== //------------------------------------------------------------------------------ -InterfaceRef SAL_CALL ORadioButtonControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL ORadioButtonControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new ORadioButtonControl(_rxFactory)); } //------------------------------------------------------------------------------ -StringSequence SAL_CALL ORadioButtonControl::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL ORadioButtonControl::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControl::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 1); @@ -103,25 +114,25 @@ StringSequence SAL_CALL ORadioButtonControl::getSupportedServiceNames() throw(:: //------------------------------------------------------------------ -ORadioButtonControl::ORadioButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ORadioButtonControl::ORadioButtonControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_RADIOBUTTON) { } //================================================================== -InterfaceRef SAL_CALL ORadioButtonModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL ORadioButtonModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException) { return *(new ORadioButtonModel(_rxFactory)); } //------------------------------------------------------------------ -ORadioButtonModel::ORadioButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +ORadioButtonModel::ORadioButtonModel(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControlModel(_rxFactory, VCL_CONTROLMODEL_RADIOBUTTON, FRM_CONTROL_RADIOBUTTON, sal_False) // use the old control name for compytibility reasons ,OPropertyChangeListener(m_aMutex) ,m_bInReset(sal_False) { - m_nClassId = starform::FormComponentType::RADIOBUTTON; + m_nClassId = FormComponentType::RADIOBUTTON; m_nDefaultChecked = RB_NOCHECK; m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX; m_sDataFieldConnectivityProperty = PROPERTY_STATE; @@ -138,7 +149,7 @@ ORadioButtonModel::ORadioButtonModel(const staruno::Reference<starlang::XMultiSe // XServiceInfo //------------------------------------------------------------------------------ -StringSequence SAL_CALL ORadioButtonModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) +StringSequence SAL_CALL ORadioButtonModel::getSupportedServiceNames() throw(RuntimeException) { StringSequence aSupported = OBoundControlModel::getSupportedServiceNames(); aSupported.realloc(aSupported.getLength() + 2); @@ -150,7 +161,7 @@ StringSequence SAL_CALL ORadioButtonModel::getSupportedServiceNames() throw(::co } //------------------------------------------------------------------------------ -void ORadioButtonModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const +void ORadioButtonModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { switch (nHandle) { @@ -162,21 +173,21 @@ void ORadioButtonModel::getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHa } //------------------------------------------------------------------------------ -void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const staruno::Any& rValue) +void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue) { // mein Name ::rtl::OUString sMyName(m_aName); // meine Siblings durchiterieren - staruno::Reference<starcontainer::XIndexAccess> xIndexAccess(getParent(), staruno::UNO_QUERY); + Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY); if (xIndexAccess.is()) { - staruno::Reference<starbeans::XPropertySet> xMyProps; - query_interface(static_cast<staruno::XWeak*>(this), xMyProps); + Reference<XPropertySet> xMyProps; + query_interface(static_cast<XWeak*>(this), xMyProps); ::rtl::OUString sCurrentName; for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i) { - staruno::Reference<starbeans::XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), staruno::UNO_QUERY); + Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY); if (!xSiblingProperties.is()) continue; if (xMyProps == xSiblingProperties) @@ -187,7 +198,7 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons continue; sal_Int16 nType; xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType; - if (nType != starform::FormComponentType::RADIOBUTTON) + if (nType != FormComponentType::RADIOBUTTON) continue; // das 'zur selben Gruppe gehoeren' wird am Namen festgemacht @@ -199,17 +210,17 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons } //------------------------------------------------------------------------------ -void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const staruno::Any& rValue) throw (::com::sun::star::uno::Exception) +void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception) { switch (nHandle) { case PROPERTY_ID_REFVALUE : - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_STRING, "ORadioButtonModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "ORadioButtonModel::setFastPropertyValue_NoBroadcast : invalid type !" ); rValue >>= m_sReferenceValue; break; case PROPERTY_ID_DEFAULTCHECKED : - DBG_ASSERT(rValue.getValueType().getTypeClass() == staruno::TypeClass_SHORT, "ORadioButtonModel::setFastPropertyValue_NoBroadcast : invalid type !" ); + DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_SHORT, "ORadioButtonModel::setFastPropertyValue_NoBroadcast : invalid type !" ); rValue >>= (sal_Int16)m_nDefaultChecked; _reset(); break; @@ -235,17 +246,17 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons if (nHandle == PROPERTY_ID_NAME) { // ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann - staruno::Reference<starcontainer::XIndexAccess> xIndexAccess(getParent(), staruno::UNO_QUERY); + Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY); if (xIndexAccess.is()) { ::rtl::OUString sName; ::rtl::OUString sControlSource; - staruno::Reference<starbeans::XPropertySet> xMyProps; - query_interface(static_cast<staruno::XWeak*>(this), xMyProps); + Reference<XPropertySet> xMyProps; + query_interface(static_cast<XWeak*>(this), xMyProps); for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i) { - staruno::Reference<starbeans::XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), staruno::UNO_QUERY); + Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY); if (!xSiblingProperties.is()) continue; @@ -255,7 +266,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons sal_Int16 nType; xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType; - if (nType != starform::FormComponentType::RADIOBUTTON) + if (nType != FormComponentType::RADIOBUTTON) // nur Radio-Buttons continue; @@ -277,7 +288,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons if (1 == nValue) { // bei allen Radios der selben Gruppe das 'default checked' ruecksetzen, denn wie schon der highlander wusste : // es kann nur einen geben. - staruno::Any aZero; + Any aZero; nValue = 0; aZero <<= nValue; SetSiblingPropsTo(PROPERTY_DEFAULTCHECKED, aZero); @@ -287,8 +298,8 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons //------------------------------------------------------------------------------ sal_Bool ORadioButtonModel::convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue) - throw (starlang::IllegalArgumentException) + Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) + throw (IllegalArgumentException) { sal_Bool bModified(sal_False); switch (_nHandle) @@ -307,9 +318,9 @@ sal_Bool ORadioButtonModel::convertFastPropertyValue( } //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL ORadioButtonModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference<XPropertySetInfo> SAL_CALL ORadioButtonModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } @@ -321,12 +332,12 @@ cppu::IPropertyArrayHelper& ORadioButtonModel::getInfoHelper() //------------------------------------------------------------------------------ void ORadioButtonModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(11) // the "State" property is transient, so change this - // ModifyPropertyAttributes(_rAggregateProps, PROPERTY_STATE, starbeans::PropertyAttribute::TRANSIENT, 0); + // ModifyPropertyAttributes(_rAggregateProps, PROPERTY_STATE, PropertyAttribute::TRANSIENT, 0); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(REFVALUE, ::rtl::OUString, BOUND); @@ -336,21 +347,21 @@ void ORadioButtonModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } //------------------------------------------------------------------------------ -::rtl::OUString SAL_CALL ORadioButtonModel::getServiceName() throw(staruno::RuntimeException) +::rtl::OUString SAL_CALL ORadioButtonModel::getServiceName() throw(RuntimeException) { return FRM_COMPONENT_RADIOBUTTON; // old (non-sun) name for compatibility ! } //------------------------------------------------------------------------------ -void SAL_CALL ORadioButtonModel::write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL ORadioButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream) + throw(IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); @@ -367,7 +378,7 @@ void SAL_CALL ORadioButtonModel::write(const staruno::Reference<stario::XObjectO } //------------------------------------------------------------------------------ -void SAL_CALL ORadioButtonModel::read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL ORadioButtonModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException) { OBoundControlModel::read(_rxInStream); ::osl::MutexGuard aGuard(m_aMutex); @@ -403,7 +414,7 @@ void SAL_CALL ORadioButtonModel::read(const staruno::Reference<stario::XObjectIn } //------------------------------------------------------------------------------ -void ORadioButtonModel::_propertyChanged(const starbeans::PropertyChangeEvent& _rEvent) throw(staruno::RuntimeException) +void ORadioButtonModel::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(RuntimeException) { if (_rEvent.PropertyName.equals(PROPERTY_STATE)) { @@ -411,7 +422,7 @@ void ORadioButtonModel::_propertyChanged(const starbeans::PropertyChangeEvent& _ { // wenn sich mein Status auf 'checked' geaendert hat, muss ich alle meine Siblings, die in der selben Gruppe // sind wie ich, entsprechend zuruecksetzen - staruno::Any aZero; + Any aZero; aZero <<= (sal_Int16)0; SetSiblingPropsTo(PROPERTY_STATE, aZero); @@ -420,7 +431,7 @@ void ORadioButtonModel::_propertyChanged(const starbeans::PropertyChangeEvent& _ // as we aren't commitable we have to take care of the field we are bound to ourself if (m_xField.is() && !m_bInReset) { - m_xField->setPropertyValue(PROPERTY_VALUE, staruno::makeAny(m_sReferenceValue)); + m_xField->setPropertyValue(PROPERTY_VALUE, makeAny(m_sReferenceValue)); } } } @@ -429,7 +440,7 @@ void ORadioButtonModel::_propertyChanged(const starbeans::PropertyChangeEvent& _ //------------------------------------------------------------------------------ void ORadioButtonModel::_onValueChanged() { - staruno::Any aValue; + Any aValue; aValue <<= (sal_Int16)((m_xColumn->getString() == m_sReferenceValue) ? RB_CHECK : RB_NOCHECK); m_bInReset = sal_True; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties @@ -443,13 +454,13 @@ void ORadioButtonModel::_onValueChanged() } //------------------------------------------------------------------------------ -staruno::Any ORadioButtonModel::_getControlValue() const +Any ORadioButtonModel::_getControlValue() const { return m_xAggregateSet->getPropertyValue(PROPERTY_STATE); } //------------------------------------------------------------------------------ -sal_Int16 ORadioButtonModel::getState( const staruno::Any& rValue ) +sal_Int16 ORadioButtonModel::getState( const Any& rValue ) { //::rtl::OUString aStrValue = DBTypeConversion::toString( rValue ); return RB_NOCHECK; @@ -458,7 +469,7 @@ sal_Int16 ORadioButtonModel::getState( const staruno::Any& rValue ) //------------------------------------------------------------------------------ void ORadioButtonModel::_reset( void ) { - staruno::Any aValue; + Any aValue; aValue <<= (sal_Int16)m_nDefaultChecked; { // release our mutex once (it's acquired in the calling method !), as setting aggregate properties // may cause any uno controls belonging to us to lock the solar mutex, which is potentially dangerous with @@ -486,9 +497,9 @@ sal_Bool ORadioButtonModel::_commit() sal_Int16 nValue; m_xAggregateSet->getPropertyValue(PROPERTY_STATE) >>= nValue; if (nValue == 1) - m_xField->setPropertyValue(PROPERTY_VALUE, staruno::makeAny(m_sReferenceValue)); + m_xField->setPropertyValue(PROPERTY_VALUE, makeAny(m_sReferenceValue)); } - catch(...) + catch(Exception&) { DBG_ERROR("ORadioButtonModel::_commit : could not commit !"); } @@ -497,7 +508,7 @@ sal_Bool ORadioButtonModel::_commit() } //----------------------------------------------------------------------------- -void ORadioButtonModel::reset(void) throw (::com::sun::star::uno::RuntimeException) +void ORadioButtonModel::reset(void) throw (RuntimeException) { m_bInReset = sal_True; OBoundControlModel::reset(); diff --git a/forms/source/component/RadioButton.hxx b/forms/source/component/RadioButton.hxx index bd05715174b6..a5b57c86a195 100644 --- a/forms/source/component/RadioButton.hxx +++ b/forms/source/component/RadioButton.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RadioButton.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -89,47 +89,47 @@ class ORadioButtonModel :public OBoundControlModel sal_Bool m_bInReset : 1; protected: - sal_Int16 getState(const staruno::Any& rValue); + sal_Int16 getState(const ::com::sun::star::uno::Any& rValue); virtual void _onValueChanged(); - virtual staruno::Any _getControlValue() const; + virtual ::com::sun::star::uno::Any _getControlValue() const; public: - ORadioButtonModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ORadioButtonModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(ORadioButtonModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // OPropertySetHelper - virtual void SAL_CALL getFastPropertyValue(staruno::Any& rValue, sal_Int32 nHandle) const; - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const staruno::Any& rValue ) - throw (staruno::Exception); + virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); virtual sal_Bool SAL_CALL convertFastPropertyValue( - staruno::Any& _rConvertedValue, staruno::Any& _rOldValue, sal_Int32 _nHandle, const staruno::Any& _rValue ) - throw (starlang::IllegalArgumentException); + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); // XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // XPersistObject - virtual ::rtl::OUString SAL_CALL getServiceName() throw(staruno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - write(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream) throw(stario::IOException, staruno::RuntimeException); + write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL - read(const staruno::Reference<stario::XObjectInputStream>& _rxInStream) throw(stario::IOException, staruno::RuntimeException); + read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); // OPropertyChangeListener - virtual void _propertyChanged(const starbeans::PropertyChangeEvent& evt) throw(staruno::RuntimeException); + virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); // XReset - virtual void SAL_CALL reset() throw(staruno::RuntimeException); + virtual void SAL_CALL reset() throw(::com::sun::star::uno::RuntimeException); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() @@ -138,7 +138,7 @@ protected: virtual sal_Bool _commit(); protected: - void SetSiblingPropsTo(const ::rtl::OUString& rPropName, const staruno::Any& rValue); + void SetSiblingPropsTo(const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rValue); }; //================================================================== @@ -147,7 +147,7 @@ protected: class ORadioButtonControl: public OBoundControl { public: - ORadioButtonControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + ORadioButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // XServiceInfo IMPLEMENTATION_NAME(ORadioButtonControl); diff --git a/forms/source/component/Time.cxx b/forms/source/component/Time.cxx index 53c2461f60f3..201c55ed4980 100644 --- a/forms/source/component/Time.cxx +++ b/forms/source/component/Time.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Time.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -86,24 +86,34 @@ using namespace dbtools; namespace frm { //......................................................................... +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; //================================================================== //= OTimeControl //================================================================== //------------------------------------------------------------------ -OTimeControl::OTimeControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OTimeControl::OTimeControl(const Reference<XMultiServiceFactory>& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_TIMEFIELD) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OTimeControl_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OTimeControl_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OTimeControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OTimeControl::_getTypes() +Sequence<Type> OTimeControl::_getTypes() { return OBoundControl::_getTypes(); } @@ -125,12 +135,12 @@ StringSequence SAL_CALL OTimeControl::getSupportedServiceNames() throw() sal_Int32 OTimeModel::nTimeHandle = -1; //------------------------------------------------------------------ -InterfaceRef SAL_CALL OTimeModel_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +InterfaceRef SAL_CALL OTimeModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) { return *(new OTimeModel(_rxFactory)); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence SAL_CALL OTimeModel::getSupportedServiceNames() throw() { @@ -144,17 +154,17 @@ StringSequence SAL_CALL OTimeModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -staruno::Sequence<staruno::Type> OTimeModel::_getTypes() +Sequence<Type> OTimeModel::_getTypes() { return OBoundControlModel::_getTypes(); } //------------------------------------------------------------------ -OTimeModel::OTimeModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) +OTimeModel::OTimeModel(const Reference<XMultiServiceFactory>& _rxFactory) :OEditBaseModel(_rxFactory, VCL_CONTROLMODEL_TIMEFIELD, FRM_CONTROL_TIMEFIELD ) // use the old control name for compytibility reasons { - m_nClassId = starform::FormComponentType::TIMEFIELD; + m_nClassId = FormComponentType::TIMEFIELD; m_sDataFieldConnectivityProperty = PROPERTY_TIME; if (OTimeModel::nTimeHandle == -1) OTimeModel::nTimeHandle = getOriginalHandle(PROPERTY_ID_TIME); @@ -166,22 +176,22 @@ OTimeModel::OTimeModel(const staruno::Reference<starlang::XMultiServiceFactory>& return FRM_COMPONENT_TIMEFIELD; // old (non-sun) name for compatibility ! } -// starbeans::XPropertySet +// XPropertySet //------------------------------------------------------------------------------ -staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL OTimeModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference<XPropertySetInfo> SAL_CALL OTimeModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference<starbeans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) ); return xInfo; } //------------------------------------------------------------------------------ void OTimeModel::fillProperties( - staruno::Sequence< starbeans::Property >& _rProps, - staruno::Sequence< starbeans::Property >& _rAggregateProps ) const + Sequence< Property >& _rProps, + Sequence< Property >& _rAggregateProps ) const { FRM_BEGIN_PROP_HELPER(10) // starutil::Time auf transient setzen -// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TIME, starbeans::PropertyAttribute::TRANSIENT, 0); +// ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TIME, PropertyAttribute::TRANSIENT, 0); DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); @@ -190,8 +200,8 @@ void OTimeModel::fillProperties( DECL_PROP1(TABINDEX, sal_Int16, BOUND); DECL_PROP1(CONTROLSOURCE, ::rtl::OUString, BOUND); DECL_PROP1(HELPTEXT, ::rtl::OUString, BOUND); - DECL_IFACE_PROP2(BOUNDFIELD, starbeans::XPropertySet, READONLY, TRANSIENT); - DECL_IFACE_PROP2(CONTROLLABEL, starbeans::XPropertySet, BOUND, MAYBEVOID); + DECL_IFACE_PROP2(BOUNDFIELD, XPropertySet, READONLY, TRANSIENT); + DECL_IFACE_PROP2(CONTROLLABEL, XPropertySet, BOUND, MAYBEVOID); DECL_PROP2(CONTROLSOURCEPROPERTY, rtl::OUString, READONLY, TRANSIENT); FRM_END_PROP_HELPER(); } @@ -202,9 +212,9 @@ void OTimeModel::fillProperties( return *const_cast<OTimeModel*>(this)->getArrayHelper(); } -// starform::XLoadListener +// XLoadListener //------------------------------------------------------------------------------ -void OTimeModel::_loaded(const starlang::EventObject& rEvent) +void OTimeModel::_loaded(const EventObject& rEvent) { OBoundControlModel::_loaded(rEvent); if (m_xField.is()) @@ -214,19 +224,19 @@ void OTimeModel::_loaded(const starlang::EventObject& rEvent) { sal_Int32 nFieldType; m_xField->getPropertyValue(PROPERTY_FIELDTYPE) >>= nFieldType; - m_bDateTimeField = (nFieldType == starsdbc::DataType::TIMESTAMP); + m_bDateTimeField = (nFieldType == DataType::TIMESTAMP); } - catch(...) + catch(Exception&) { } } } -// starform::XBoundComponent +// XBoundComponent //------------------------------------------------------------------------------ sal_Bool OTimeModel::_commit() { - staruno::Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OTimeModel::nTimeHandle ); + Any aNewValue = m_xAggregateFastSet->getFastPropertyValue( OTimeModel::nTimeHandle ); if (!compare(aNewValue, m_aSaveValue)) { if (!aNewValue.hasValue()) @@ -255,7 +265,7 @@ sal_Bool OTimeModel::_commit() m_xColumnUpdate->updateTimestamp(aDateTime); } } - catch(...) + catch(Exception&) { return sal_False; } @@ -287,8 +297,8 @@ void OTimeModel::_onValueChanged() //------------------------------------------------------------------------------ void OTimeModel::_reset() { - staruno::Any aValue; - if (m_aDefault.getValueType().getTypeClass() == staruno::TypeClass_LONG) + Any aValue; + if (m_aDefault.getValueType().getTypeClass() == TypeClass_LONG) aValue = m_aDefault; else { // aktuelles Datum einstellen diff --git a/forms/source/component/Time.hxx b/forms/source/component/Time.hxx index d819d93cb433..0393f8bc3f0e 100644 --- a/forms/source/component/Time.hxx +++ b/forms/source/component/Time.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Time.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-10-19 11:52:16 $ + * 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 @@ -78,16 +78,16 @@ class OTimeModel :public OEditBaseModel ,public ::comphelper::OAggregationArrayUsageHelper< OTimeModel > { - staruno::Any m_aSaveValue; + ::com::sun::star::uno::Any m_aSaveValue; sal_Bool m_bDateTimeField; static sal_Int32 nTimeHandle; protected: virtual void _onValueChanged(); - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OTimeModel(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OTimeModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); // starform::XBoundComponent virtual sal_Bool _commit(); @@ -95,24 +95,24 @@ public: // stario::XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName(); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OTimeModel); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); - // starbeans::XPropertySet - virtual staruno::Reference<starbeans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(staruno::RuntimeException); + // ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // starform::XReset virtual void _reset( void ); // starform::XLoadListener - virtual void _loaded(const starlang::EventObject& rEvent); + virtual void _loaded(const ::com::sun::star::lang::EventObject& rEvent); // OAggregationArrayUsageHelper virtual void fillProperties( - staruno::Sequence< starbeans::Property >& /* [out] */ _rProps, - staruno::Sequence< starbeans::Property >& /* [out] */ _rAggregateProps + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps ) const; IMPLEMENT_INFO_SERVICE() }; @@ -123,13 +123,13 @@ public: class OTimeControl: public OBoundControl { protected: - virtual staruno::Sequence<staruno::Type> _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OTimeControl(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory); + OTimeControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); DECLARE_UNO3_AGG_DEFAULTS(OTimeControl, OBoundControl); - // starlang::XServiceInfo + // ::com::sun::star::lang::XServiceInfo IMPLEMENTATION_NAME(OTimeControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); }; |