From 81c8196ae8bcd805d73ec2683bf64248b668dbbd Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Thu, 23 Nov 2000 07:48:15 +0000 Subject: namespace changes --- forms/source/component/Button.cxx | 101 +- forms/source/component/Button.hxx | 55 +- forms/source/component/CheckBox.cxx | 71 +- forms/source/component/CheckBox.hxx | 40 +- forms/source/component/Columns.cxx | 174 ++-- forms/source/component/Columns.hxx | 100 +- forms/source/component/ComboBox.cxx | 237 ++--- forms/source/component/ComboBox.hxx | 93 +- forms/source/component/Currency.cxx | 65 +- forms/source/component/Currency.hxx | 28 +- forms/source/component/DatabaseForm.cxx | 1121 +++++++++++----------- forms/source/component/DatabaseForm.hxx | 380 ++++---- forms/source/component/Date.cxx | 64 +- forms/source/component/Date.hxx | 28 +- forms/source/component/Edit.cxx | 203 ++-- forms/source/component/Edit.hxx | 79 +- forms/source/component/EditBase.cxx | 79 +- forms/source/component/EditBase.hxx | 50 +- forms/source/component/EventThread.cxx | 46 +- forms/source/component/EventThread.hxx | 31 +- forms/source/component/File.cxx | 83 +- forms/source/component/File.hxx | 44 +- forms/source/component/FixedText.cxx | 41 +- forms/source/component/FixedText.hxx | 20 +- forms/source/component/FormComponent.cxx | 470 +++++---- forms/source/component/FormattedField.cxx | 370 ++++--- forms/source/component/FormattedField.hxx | 87 +- forms/source/component/FormattedFieldWrapper.cxx | 101 +- forms/source/component/FormattedFieldWrapper.hxx | 28 +- forms/source/component/FormsCollection.cxx | 56 +- forms/source/component/FormsCollection.hxx | 40 +- forms/source/component/Grid.cxx | 345 ++++--- forms/source/component/Grid.hxx | 140 +-- forms/source/component/GroupBox.cxx | 41 +- forms/source/component/GroupBox.hxx | 20 +- forms/source/component/Hidden.cxx | 47 +- forms/source/component/Hidden.hxx | 28 +- forms/source/component/ImageButton.cxx | 82 +- forms/source/component/ImageButton.hxx | 47 +- forms/source/component/ImageControl.cxx | 204 ++-- forms/source/component/ImageControl.hxx | 76 +- forms/source/component/ListBox.cxx | 353 ++++--- forms/source/component/ListBox.hxx | 90 +- forms/source/component/Numeric.cxx | 57 +- forms/source/component/Numeric.hxx | 28 +- forms/source/component/Pattern.cxx | 57 +- forms/source/component/Pattern.hxx | 26 +- forms/source/component/RadioButton.cxx | 107 ++- forms/source/component/RadioButton.hxx | 40 +- forms/source/component/Time.cxx | 64 +- forms/source/component/Time.hxx | 28 +- 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& _rxFactory) +InterfaceRef SAL_CALL OButtonModel_CreateInstance(const Reference& _rxFactory) { return *(new OButtonModel(_rxFactory)); } //------------------------------------------------------------------ -OButtonModel::OButtonModel(const staruno::Reference& _rxFactory) +OButtonModel::OButtonModel(const Reference& _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 SAL_CALL OButtonModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference SAL_CALL OButtonModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference 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(this)->getArrayHelper(); } -// starlang::XServiceInfo +// XServiceInfo //------------------------------------------------------------------------------ StringSequence OButtonModel::getSupportedServiceNames() throw() { @@ -152,7 +163,7 @@ StringSequence OButtonModel::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -void OButtonModel::write(const staruno::Reference& _rxOutStream) +void OButtonModel::write(const Reference& _rxOutStream) { OImageModel::write(_rxOutStream); @@ -166,7 +177,7 @@ void OButtonModel::write(const staruno::Reference& } //------------------------------------------------------------------------------ -void OButtonModel::read(const staruno::Reference& _rxInStream) +void OButtonModel::read(const Reference& _rxInStream) { OImageModel::read(_rxInStream); @@ -175,7 +186,7 @@ void OButtonModel::read(const staruno::Reference& _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& _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& _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& _r // OButtonControl //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL OButtonControl_CreateInstance(const staruno::Reference& _rxFactory) +InterfaceRef SAL_CALL OButtonControl_CreateInstance(const Reference& _rxFactory) { return *(new OButtonControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence OButtonControl::_getTypes() +Sequence OButtonControl::_getTypes() { - static staruno::Sequence aTypes; + static Sequence aTypes; if (!aTypes.getLength()) { // my base class - staruno::Sequence aBaseClassTypes = OImageControl::_getTypes(); + Sequence aBaseClassTypes = OImageControl::_getTypes(); - staruno::Sequence aOwnTypes(2); - staruno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((staruno::Reference*)NULL); - pOwnTypes[1] = getCppuType((staruno::Reference*)NULL); + Sequence aOwnTypes(2); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference*)NULL); + pOwnTypes[1] = getCppuType((Reference*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -243,14 +254,14 @@ StringSequence OButtonControl::getSupportedServiceNames() throw() } //------------------------------------------------------------------------------ -OButtonControl::OButtonControl(const staruno::Reference& _rxFactory) +OButtonControl::OButtonControl(const Reference& _rxFactory) :OImageControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON) ,nClickEvent(0) { increment(m_refCount); { // als ActionListener anmelden - staruno::Reference xButton; + Reference 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(this) - ,static_cast(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 xSet(getModel(), staruno::UNO_QUERY); + Reference 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(this), m_aActionCommand); + ActionEvent aEvt(static_cast(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 xButton; + Reference 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 xButton; + Reference xButton; query_aggregation( m_xAggregate, xButton); if (xButton.is()) xButton->setActionCommand(_rCommand); } //------------------------------------------------------------------------------ -void SAL_CALL OButtonControl::addActionListener(const staruno::Reference& _rxListener) throw( staruno::RuntimeException ) +void SAL_CALL OButtonControl::addActionListener(const Reference& _rxListener) throw( RuntimeException ) { m_aActionListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OButtonControl::removeActionListener(const staruno::Reference& _rxListener) throw( staruno::RuntimeException ) +void SAL_CALL OButtonControl::removeActionListener(const Reference& _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 { public: - OButtonModel(const staruno::Reference& _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 - virtual staruno::Reference 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& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference& _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 _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OButtonControl(const staruno::Reference& _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& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeActionListener(const staruno::Reference& _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& _rxFactory) +OCheckBoxControl::OCheckBoxControl(const Reference& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_CHECKBOX) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const staruno::Reference& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OCheckBoxControl_CreateInstance(const Reference& _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& _rxFactory) throw (staruno::RuntimeException) +InterfaceRef SAL_CALL OCheckBoxModel_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) { return *(new OCheckBoxModel(_rxFactory)); } //------------------------------------------------------------------ -OCheckBoxModel::OCheckBoxModel(const staruno::Reference& _rxFactory) +OCheckBoxModel::OCheckBoxModel(const Reference& _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>= 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 SAL_CALL OCheckBoxModel::getPropertySetInfo() throw(staruno::RuntimeException) +Reference SAL_CALL OCheckBoxModel::getPropertySetInfo() throw(RuntimeException) { - staruno::Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference 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& _rxOutStream) - throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OCheckBoxModel::write(const Reference& _rxOutStream) + throw(stario::IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); @@ -290,7 +301,7 @@ void SAL_CALL OCheckBoxModel::write(const staruno::Reference& _rxInStream) throw(stario::IOException, staruno::RuntimeException) +void SAL_CALL OCheckBoxModel::read(const Reference& _rxInStream) throw(stario::IOException, RuntimeException) { OBoundControlModel::read(_rxInStream); osl::MutexGuard aGuard(m_aMutex); @@ -327,7 +338,7 @@ void SAL_CALL OCheckBoxModel::read(const staruno::ReferencegetBoolean()) 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& _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 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& _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& _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& _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& _rxFactory) +InterfaceRef SAL_CALL OGridColumn_CreateInstance(const Reference& _rxFactory) { return *(new OGridColumn(_rxFactory)); } //------------------------------------------------------------------ -const staruno::Sequence& OGridColumn::getUnoTunnelImplementationId() +const Sequence& 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& OGridColumn::getUnoTunnelImplementationId() } //------------------------------------------------------------------ -sal_Int64 SAL_CALL OGridColumn::getSomething( const staruno::Sequence& _rIdentifier) throw(staruno::RuntimeException) +sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence& _rIdentifier) throw(RuntimeException) { sal_Int64 nReturn(0); @@ -228,7 +233,7 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const staruno::Sequence& } else { - staruno::Reference xAggregateTunnel(m_xAggregate, staruno::UNO_QUERY); + Reference 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& } //------------------------------------------------------------------ -staruno::Sequence SAL_CALL OGridColumn::getImplementationId() throw(staruno::RuntimeException) +Sequence SAL_CALL OGridColumn::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ -staruno::Sequence SAL_CALL OGridColumn::getTypes() throw(staruno::RuntimeException) +Sequence SAL_CALL OGridColumn::getTypes() throw(RuntimeException) { - staruno::Sequence aOwnTypes(5); - aOwnTypes.getArray()[0] = ::getCppuType((staruno::Reference*)NULL); - aOwnTypes.getArray()[1] = ::getCppuType((staruno::Reference*)NULL); - aOwnTypes.getArray()[2] = ::getCppuType((staruno::Reference*)NULL); - aOwnTypes.getArray()[3] = ::getCppuType((staruno::Reference*)NULL); - aOwnTypes.getArray()[4] = ::getCppuType((staruno::Reference*)NULL); - - staruno::Reference xProv; + Reference 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(this), - static_cast(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& _rxFactory, const ::rtl::OUString& _sModelName) - :OComponentHelper(m_aMutex) - ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) +OGridColumn::OGridColumn(const Reference& _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 (_rxFactory->createInstance(m_aModelName), staruno::UNO_QUERY); + m_xAggregate = Reference (_rxFactory->createInstance(m_aModelName), UNO_QUERY); setAggregation(m_xAggregate); } @@ -320,7 +312,7 @@ OGridColumn::OGridColumn(const staruno::Reference xEvtLstner; + Reference 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 xComp; + Reference xComp; if (query_aggregation(m_xAggregate, xComp)) xComp->dispose(); @@ -368,7 +360,7 @@ void OGridColumn::disposing() } //------------------------------------------------------------------------------ -void OGridColumn::clearAggregateProperties(staruno::Sequence& seqProps, sal_Bool bAllowDropDown) +void OGridColumn::clearAggregateProperties(Sequence& seqProps, sal_Bool bAllowDropDown) { RemoveProperty(seqProps, PROPERTY_ALIGN); RemoveProperty(seqProps, PROPERTY_AUTOCOMPLETE); @@ -405,10 +397,10 @@ void OGridColumn::clearAggregateProperties(staruno::Sequence& aDescriptor) +void OGridColumn::setOwnProperties(Sequence& 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& aDesc DECL_PROP1(COLUMNSERVICENAME, ::rtl::OUString, READONLY); } -// staruno::Reference +// Reference //------------------------------------------------------------------------------ -staruno::Reference SAL_CALL OGridColumn::getPropertySetInfo() throw(staruno::RuntimeException) +Reference SAL_CALL OGridColumn::getPropertySetInfo() throw(RuntimeException) { DBG_ERROR("OGridColumn::getPropertySetInfo() : Dummy Called"); - return staruno::Reference (); + return Reference (); } //------------------------------------------------------------------------------ @@ -430,13 +422,13 @@ staruno::Reference SAL_CALL OGridColumn::getPropert { DBG_ERROR("OGridColumn::getInfoHelper() : Dummy Called"); - staruno::Sequence aDescriptor, aAggProperties; + Sequence 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& _rxOutStream) +void SAL_CALL OGridColumn::write(const Reference& _rxOutStream) { // 1. Schreiben des UnoControls - staruno::Reference xMark(_rxOutStream, staruno::UNO_QUERY); + Reference xMark(_rxOutStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); sal_Int32 nLen = 0; _rxOutStream->writeLong(nLen); - staruno::Reference xPersist; + Reference xPersist; if (query_aggregation(m_xAggregate, xPersist)) xPersist->write(_rxOutStream); @@ -588,10 +580,10 @@ void SAL_CALL OGridColumn::write(const staruno::ReferencewriteShort(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& _rxInStream) +void SAL_CALL OGridColumn::read(const Reference& _rxInStream) { // 1. Lesen des UnoControls sal_Int32 nLen = _rxInStream->readLong(); if (nLen) { - staruno::Reference xMark(_rxInStream, staruno::UNO_QUERY); + Reference xMark(_rxInStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); - staruno::Reference xPersist; + Reference 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 #endif +#ifndef _CPPUHELPER_COMPBASE2_HXX_ +#include +#endif +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include +#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 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& _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& getUnoTunnelImplementationId(); + static const ::com::sun::star::uno::Sequence& getUnoTunnelImplementationId(); // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const staruno::Sequence& _rIdentifier) throw(staruno::RuntimeException); + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence& _rIdentifier) throw(::com::sun::star::uno::RuntimeException); // XTypeProvider - virtual staruno::Sequence SAL_CALL getImplementationId() throw(staruno::RuntimeException); - virtual staruno::Sequence SAL_CALL getTypes() throw(staruno::RuntimeException); + virtual ::com::sun::star::uno::Sequence 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& _rxOutStream); - virtual void SAL_CALL read(const staruno::Reference& _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 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& seqProps, sal_Bool bAllowDropDown); - static void setOwnProperties(staruno::Sequence& 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& _rxFactory);\ + ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);\ \ - virtual staruno::Reference 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& _rxFactory) \ +ClassName::ClassName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory) \ :OGridColumn(_rxFactory, Model){} \ -staruno::Reference 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 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& _rxFactory) throw (com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OComboBoxModel_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) { return (*new OComboBoxModel(_rxFactory)); } //------------------------------------------------------------------------------ -com::sun::star::uno::Sequence OComboBoxModel::_getTypes() +Sequence OComboBoxModel::_getTypes() { - static com::sun::star::uno::Sequence aTypes; + static Sequence aTypes; if (!aTypes.getLength()) { // my two base classes - com::sun::star::uno::Sequence aBaseClassTypes = OBoundControlModel::_getTypes(); + Sequence aBaseClassTypes = OBoundControlModel::_getTypes(); - com::sun::star::uno::Sequence aOwnTypes(1); - com::sun::star::uno::Type* pOwnTypes = aOwnTypes.getArray(); - pOwnTypes[0] = getCppuType((com::sun::star::uno::Reference*)NULL); + Sequence aOwnTypes(1); + Type* pOwnTypes = aOwnTypes.getArray(); + pOwnTypes[0] = getCppuType((Reference*)NULL); aTypes = concatSequences(aBaseClassTypes, aOwnTypes); } @@ -167,7 +178,7 @@ com::sun::star::uno::Sequence 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(this) + ,static_cast(this) ); return aReturn; } //------------------------------------------------------------------ -OComboBoxModel::OComboBoxModel(const com::sun::star::uno::Reference& _rxFactory) +OComboBoxModel::OComboBoxModel(const Reference& _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(NULL))), + DBG_ASSERT(_rValue.getValueType().equals(::getCppuType(reinterpret_cast(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 SAL_CALL OComboBoxModel::getPropertySetInfo() throw(com::sun::star::uno::RuntimeException) +Reference SAL_CALL OComboBoxModel::getPropertySetInfo() throw(RuntimeException) { - com::sun::star::uno::Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference 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& _rxOutStream) - throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::write(const Reference& _rxOutStream) + throw(stario::IOException, RuntimeException) { OBoundControlModel::write(_rxOutStream); @@ -374,7 +385,7 @@ void SAL_CALL OComboBoxModel::write(const com::sun::star::uno::Reference& _rxInStream) throw(stario::IOException, com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::read(const Reference& _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> 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::ReferencesetPropertyValue(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 xForm(m_xCursor, com::sun::star::uno::UNO_QUERY); + Reference xForm(m_xCursor, UNO_QUERY); if (!xForm.is()) return; - com::sun::star::uno::Reference xConnection = getConnection(xForm); + Reference 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 xServiceInfo(xConnection, com::sun::star::uno::UNO_QUERY); + Reference xServiceInfo(xConnection, UNO_QUERY); if (!xServiceInfo.is() || !xServiceInfo->supportsService(SRV_SDB_CONNECTION)) { DBG_ERROR("OComboBoxModel::loadData : invalid connection !"); return; } - com::sun::star::uno::Reference xListCursor; + Reference 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 xFieldsByName = getTableFields(xConnection, m_aListSource); - com::sun::star::uno::Reference xFieldsByIndex(xFieldsByName, com::sun::star::uno::UNO_QUERY); + Reference xFieldsByName = getTableFields(xConnection, m_aListSource); + Reference 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 xFactory(xConnection, com::sun::star::uno::UNO_QUERY); + Reference xFactory(xConnection, UNO_QUERY); if (!xFactory.is()) break; - com::sun::star::uno::Reference xComposer = xFactory->createQueryComposer(); + Reference xComposer = xFactory->createQueryComposer(); try { - com::sun::star::uno::Reference xFormAsSet(xForm, com::sun::star::uno::UNO_QUERY); + Reference 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 xSupplyFields(xComposer, com::sun::star::uno::UNO_QUERY); + Reference xSupplyFields(xComposer, UNO_QUERY); DBG_ASSERT(xSupplyFields.is(), "OComboBoxModel::loadData : invalid query composer !"); - com::sun::star::uno::Reference xFieldNames = xSupplyFields->getColumns(); + Reference xFieldNames = xSupplyFields->getColumns(); if (xFieldNames->hasByName(m_aControlSource)) { - com::sun::star::uno::Reference xComposerFieldAsSet(*(com::sun::star::uno::Reference*)xFieldNames->getByName(m_aControlSource).getValue()); + Reference xComposerFieldAsSet(*(Reference*)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 xMeta = xConnection->getMetaData(); + Reference 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 xStmt = xConnection->createStatement(); + Reference xStmt = xConnection->createStatement(); xListCursor = xStmt->executeQuery(aStatement); } break; - case starform::ListSourceType_QUERY: + case ListSourceType_QUERY: { - com::sun::star::uno::Reference xSupplyQueries(xConnection, com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(m_aListSource).getValue(), com::sun::star::uno::UNO_QUERY); - com::sun::star::uno::Reference xStmt = xConnection->createStatement(); - com::sun::star::uno::Reference(xStmt, com::sun::star::uno::UNO_QUERY)->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, xQuery->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)); + Reference xSupplyQueries(xConnection, UNO_QUERY); + Reference xQuery(*(InterfaceRef*)xSupplyQueries->getQueries()->getByName(m_aListSource).getValue(), UNO_QUERY); + Reference xStmt = xConnection->createStatement(); + Reference(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 xStmt = xConnection->createStatement(); - if (starform::ListSourceType_SQLPASSTHROUGH == m_eListSourceType) + Reference xStmt = xConnection->createStatement(); + if (ListSourceType_SQLPASSTHROUGH == m_eListSourceType) { - com::sun::star::uno::Reference xStatementProps(xStmt, com::sun::star::uno::UNO_QUERY); - xStatementProps->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, com::sun::star::uno::makeAny(sal_Bool(sal_False))); + Reference 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 xSupplyCols(xListCursor, com::sun::star::uno::UNO_QUERY); + Reference 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 xColumns; + Reference xColumns; if (xSupplyCols.is()) { - xColumns = com::sun::star::uno::Reference(xSupplyCols->getColumns(), com::sun::star::uno::UNO_QUERY); + xColumns = Reference(xSupplyCols->getColumns(), UNO_QUERY); DBG_ASSERT(xColumns.is(), "OComboBoxModel::loadData : no columns supplied by the row set !"); } - com::sun::star::uno::Reference xDataField; + Reference xDataField; if (xColumns.is()) - xDataField = com::sun::star::uno::Reference(*(InterfaceRef*)xColumns->getByIndex(0).getValue(), com::sun::star::uno::UNO_QUERY); + xDataField = Reference(*(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 xFieldNames = getTableFields(xConnection, m_aListSource); + Reference 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; isetPropertyValue(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 xRowSet(rEvent.Source, com::sun::star::uno::UNO_QUERY); + Reference xRowSet(rEvent.Source, UNO_QUERY); DBG_ASSERT(xRowSet.is(), "OComboBoxModel::_loaded : invalid event source !"); - com::sun::star::uno::Reference xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); + Reference xSupplier = getNumberFormats(getConnection(xRowSet), sal_False, m_xServiceFactory); if (xSupplier.is()) { - m_xFormatter = com::sun::star::uno::Reference( - m_xServiceFactory->createInstance(FRM_NUMBER_FORMATTER), com::sun::star::uno::UNO_QUERY + m_xFormatter = Reference( + 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(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& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::addSQLErrorListener(const Reference& _rxListener) throw(RuntimeException) { m_aErrorListeners.addInterface(_rxListener); } //------------------------------------------------------------------------------ -void SAL_CALL OComboBoxModel::removeSQLErrorListener(const com::sun::star::uno::Reference& _rxListener) throw(com::sun::star::uno::RuntimeException) +void SAL_CALL OComboBoxModel::removeSQLErrorListener(const Reference& _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(this), _rContextDescription); + SQLContext aError = prependContextInfo(_rException, static_cast(this), _rContextDescription); if (m_aErrorListeners.getLength()) { - starsdb::SQLErrorEvent aEvent(static_cast(this), com::sun::star::uno::makeAny(aError)); + SQLErrorEvent aEvent(static_cast(this), makeAny(aError)); ::cppu::OInterfaceIteratorHelper aIter(m_aErrorListeners); while (aIter.hasMoreElements()) - static_cast(aIter.next())->errorOccured(aEvent); + static_cast(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& _rxFactory) throw (com::sun::star::uno::RuntimeException) +InterfaceRef SAL_CALL OComboBoxControl_CreateInstance(const Reference& _rxFactory) throw (RuntimeException) { return *(new OComboBoxControl(_rxFactory)); } //------------------------------------------------------------------------------ -OComboBoxControl::OComboBoxControl(const com::sun::star::uno::Reference& _rxFactory) +OComboBoxControl::OComboBoxControl(const Reference& _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 #endif +#ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_SDB_XSQLERRORBROADCASTER_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_FORM_LISTSOURCETYPE_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_AWT_XITEMLISTENER_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_AWT_XFOCUSLISTENER_HPP_ #include +#endif +#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ #include +#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 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 _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OComboBoxModel(const staruno::Reference& _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 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& _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& _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& _rxListener) throw(staruno::RuntimeException); - virtual void SAL_CALL removeSQLErrorListener(const staruno::Reference& _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& _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& _rxFactory) +OCurrencyControl::OCurrencyControl(const Reference& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_CURRENCYFIELD) { } //------------------------------------------------------------------ -InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const staruno::Reference& _rxFactory) +InterfaceRef SAL_CALL OCurrencyControl_CreateInstance(const Reference& _rxFactory) { return *(new OCurrencyControl(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence OCurrencyControl::_getTypes() +Sequence 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& _rxFactory) +InterfaceRef SAL_CALL OCurrencyModel_CreateInstance(const Reference& _rxFactory) { return *(new OCurrencyModel(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence OCurrencyModel::_getTypes() +Sequence OCurrencyModel::_getTypes() { return OEditBaseModel::_getTypes(); } //------------------------------------------------------------------ -OCurrencyModel::OCurrencyModel(const staruno::Reference& _rxFactory) +OCurrencyModel::OCurrencyModel(const Reference& _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::ReferencesetPropertyValue(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 SAL_CALL OCurrencyModel::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference SAL_CALL OCurrencyModel::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference 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 _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OCurrencyModel(const staruno::Reference& _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 - virtual staruno::Reference 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 _getTypes(); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: - OCurrencyControl(const staruno::Reference& _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 { - staruno::Any m_aValue; + Any m_aValue; ::osl::Mutex m_aMutex; ::cppu::OBroadcastHelper m_aBroadcastHelper; OImplementationIdsRef m_aHoldIdHelper; - staruno::Reference m_xPseudoAggregate; - staruno::Reference m_xValueDestination; - sal_Int32 m_nIndex; + Reference m_xPseudoAggregate; + Reference m_xValueDestination; + sal_Int32 m_nIndex; virtual ~OParameterWrapper(); public: - OParameterWrapper(const staruno::Reference& _rxColumn, const staruno::Reference& _rxAllParameters, sal_Int32 _nIndex); + OParameterWrapper(const Reference& _rxColumn, const Reference& _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_CALL getImplementationId() throw(staruno::RuntimeException); - virtual staruno::Sequence SAL_CALL getTypes() throw(staruno::RuntimeException); + virtual Any SAL_CALL queryInterface(const Type& _rType) throw (RuntimeException); + virtual Sequence SAL_CALL getImplementationId() throw(RuntimeException); + virtual Sequence SAL_CALL getTypes() throw(RuntimeException); - // starbeans::XPropertySet - virtual staruno::Reference SAL_CALL getPropertySetInfo() throw( staruno::RuntimeException ); + // XPropertySet + virtual Reference 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& _rxColumn, const staruno::Reference& _rxAllParameters, sal_Int32 _nIndex) +OParameterWrapper::OParameterWrapper(const Reference& _rxColumn, const Reference& _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*>(NULL)); + Sequence< Type > aWeakTypes(1); + aWeakTypes.getArray()[0] = ::getCppuType(static_cast*>(NULL)); - staruno::Sequence< staruno::Type > aPropertyTypes(3); - aPropertyTypes.getArray()[0] = ::getCppuType(static_cast*>(NULL)); - aPropertyTypes.getArray()[1] = ::getCppuType(static_cast*>(NULL)); - aPropertyTypes.getArray()[2] = ::getCppuType(static_cast*>(NULL)); + Sequence< Type > aPropertyTypes(3); + aPropertyTypes.getArray()[0] = ::getCppuType(static_cast*>(NULL)); + aPropertyTypes.getArray()[1] = ::getCppuType(static_cast*>(NULL)); + aPropertyTypes.getArray()[2] = ::getCppuType(static_cast*>(NULL)); return concatSequences(aWeakTypes, aPropertyTypes); } //------------------------------------------------------------------------------ -staruno::Sequence SAL_CALL OParameterWrapper::getImplementationId() throw(staruno::RuntimeException) +Sequence SAL_CALL OParameterWrapper::getImplementationId() throw(RuntimeException) { - staruno::Reference xMyTpes; - query_interface(static_cast(this), xMyTpes); + Reference xMyTpes; + query_interface(static_cast(this), xMyTpes); return OImplementationIds::getImplementationId(xMyTpes); } //------------------------------------------------------------------------------ ::rtl::OUString OParameterWrapper::getPseudoAggregatePropertyName(sal_Int32 _nHandle) const { - staruno::Reference xInfo = const_cast(this)->getPropertySetInfo(); - staruno::Sequence aProperties = xInfo->getProperties(); - const starbeans::Property* pProperties = aProperties.getConstArray(); + Reference xInfo = const_cast(this)->getPropertySetInfo(); + Sequence aProperties = xInfo->getProperties(); + const Property* pProperties = aProperties.getConstArray(); for (sal_Int32 i=0; iHandle == _nHandle) @@ -445,16 +450,16 @@ staruno::Sequence SAL_CALL OParameterWrapper::getImplementationId() th } //------------------------------------------------------------------------------ -staruno::Reference OParameterWrapper::getPropertySetInfo() throw( staruno::RuntimeException ) +Reference OParameterWrapper::getPropertySetInfo() throw( RuntimeException ) { - staruno::Reference xInfo( createPropertySetInfo( getInfoHelper() ) ); + Reference 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 OParametersImplBase; +typedef ::cppu::WeakImplHelper2 OParametersImplBase; class OParametersImpl : public OParametersImplBase { public: - typedef ::std::vector > Parameters; + typedef ::std::vector > 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 SAL_CALL createEnumeration() throw( staruno::RuntimeException ); + virtual Reference 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*>(NULL)); + return ::getCppuType(static_cast*>(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 OParametersImpl::createEnumeration() throw( staruno::RuntimeException ) +Reference OParametersImpl::createEnumeration() throw( RuntimeException ) { - return new OEnumerationByIndex(reinterpret_cast(this)); + return new OEnumerationByIndex(reinterpret_cast(this)); } //================================================================== @@ -611,8 +616,8 @@ DECLARE_STL_USTRINGACCESS_MAP(sal_Int32, MapUString2INT32); struct OParameterInfoImpl { sal_Int32 nCount; // Number of Parameters - staruno::Reference xComposer; - staruno::Reference xParamsAsNames; + Reference xComposer; + Reference 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& _rControl, + const EventObject* _pEvt, + const Reference& _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& _rControl, + const EventObject *_pEvt, + const Reference& _rControl, sal_Bool _bSubmit) { if (_bSubmit) - ((ODatabaseForm *)pCompImpl)->submit_impl(_rControl, *reinterpret_cast(_pEvt), true); + ((ODatabaseForm *)pCompImpl)->submit_impl(_rControl, *reinterpret_cast(_pEvt), true); else ((ODatabaseForm *)pCompImpl)->reset_impl(true); } @@ -675,112 +680,69 @@ void OFormSubmitResetThread::processEvent( //================================================================== //------------------------------------------------------------------ -InterfaceRef SAL_CALL ODatabaseForm_CreateInstance(const staruno::Reference& _rxFactory) +InterfaceRef SAL_CALL ODatabaseForm_CreateInstance(const Reference& _rxFactory) { return *(new ODatabaseForm(_rxFactory)); } //------------------------------------------------------------------------------ -staruno::Sequence SAL_CALL ODatabaseForm::getImplementationId() throw(staruno::RuntimeException) +Sequence SAL_CALL ODatabaseForm::getImplementationId() throw(RuntimeException) { return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ -staruno::Sequence SAL_CALL ODatabaseForm::getTypes() throw(staruno::RuntimeException) +Sequence SAL_CALL ODatabaseForm::getTypes() throw(RuntimeException) { // ask the aggregate - staruno::Sequence aAggregateTypes; - staruno::Reference xAggregateTypes; + Sequence aAggregateTypes; + Reference xAggregateTypes; if (query_aggregation(m_xAggregate, xAggregateTypes)) aAggregateTypes = xAggregateTypes->getTypes(); - staruno::Sequence aOwnTypes(23); - aOwnTypes.getArray()[0] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[1] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[2] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[3] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[4] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[5] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[6] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[7] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[8] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[9] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[10] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[11] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[12] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[13] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[14] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[15] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[16] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[17] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[18] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[19] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[20] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[21] = ::getCppuType(static_cast*>(NULL)); - aOwnTypes.getArray()[22] = ::getCppuType(static_cast*>(NULL)); - - return concatSequences(aAggregateTypes, aOwnTypes, OFormComponents::getTypes()); + Sequence 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(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this) - ); - if (!aReturn.hasValue()) - aReturn = ::cppu::queryInterface(_rType, - static_cast(this), - static_cast(this), - static_cast(static_cast(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(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(this), - static_cast(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& _rxFactory) +ODatabaseForm::ODatabaseForm(const Reference& _rxFactory) :OFormComponents(_rxFactory) ,OPropertySetAggregationHelper(OComponentHelper::rBHelper) ,OPropertyChangeListener(m_aMutex) @@ -793,12 +755,12 @@ ODatabaseForm::ODatabaseForm(const staruno::Reference(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), staruno::UNO_QUERY); - // m_xAggregate = staruno::Reference(m_xServiceFactory->createInstance(rtl::OUString::createFromAscii("com.sun.star.sdb.dbaccess.ORowSet")), staruno::UNO_QUERY); + m_xAggregate = Reference(m_xServiceFactory->createInstance(SRV_SDB_ROWSET), UNO_QUERY); + // m_xAggregate = Reference(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 (m_xAggregate,staruno::UNO_QUERY); + m_xAggregateAsRowSet = Reference (m_xAggregate,UNO_QUERY); setAggregation(m_xAggregate); } if (m_xAggregate.is()) { - m_xAggregate->setDelegator(static_cast(this)); + m_xAggregate->setDelegator(static_cast(this)); } // listen for the properties, important for Parameters @@ -853,7 +815,7 @@ ODatabaseForm::~ODatabaseForm() //============================================================================== // html tools //------------------------------------------------------------------------ -::rtl::OUString ODatabaseForm::GetDataURLEncoded(const staruno::Reference& SubmitButton, const starawt::MouseEvent& MouseEvt) +::rtl::OUString ODatabaseForm::GetDataURLEncoded(const Reference& 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& SubmitButton, const starawt::MouseEvent& MouseEvt) +::rtl::OUString ODatabaseForm::GetDataTextEncoded(const Reference& 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 ODatabaseForm::GetDataMultiPartEncoded(const staruno::Reference& SubmitButton, const starawt::MouseEvent& MouseEvt, ::rtl::OUString& rContentType) +Sequence ODatabaseForm::GetDataMultiPartEncoded(const Reference& SubmitButton, const MouseEvent& MouseEvt, ::rtl::OUString& rContentType) { // Parent erzeugen @@ -995,12 +957,12 @@ staruno::Sequence ODatabaseForm::GetDataMultiPartEncoded(const staruno sal_Int32 nLen = aMemStream.Seek(STREAM_SEEK_TO_END); rContentType = UniString(aParent.GetContentType()); - return staruno::Sequence((sal_Int8*)pData, nLen); + return Sequence((sal_Int8*)pData, nLen); } //------------------------------------------------------------------------ -void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const staruno::Reference& xComponentSet, const ::rtl::OUString& rNamePrefix, - const staruno::Reference& rxSubmitButton, const starawt::MouseEvent& MouseEvt) +void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Reference& xComponentSet, const ::rtl::OUString& rNamePrefix, + const Reference& 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 xSubmitButtonComponent(rxSubmitButton->getModel(), staruno::UNO_QUERY); + Reference xSubmitButtonComponent(rxSubmitButton->getModel(), UNO_QUERY); if (xSubmitButtonComponent == xComponentSet && hasProperty(PROPERTY_LABEL, xComponentSet)) { // =