INTEGRATION: CWS dba204b (1.2.68); FILE MERGED

2006/07/06 14:52:28 fs 1.2.68.1: #i65159# describePropertyLine now returning a LineDescriptor, instead of taking an out parameter / some less warnings
This commit is contained in:
Rüdiger Timm 2006-07-26 06:58:12 +00:00
parent 4621cce13a
commit a4c1c6bf5e
4 changed files with 34 additions and 30 deletions

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: eventhandler.hxx,v $ * $RCSfile: eventhandler.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: vg $ $Date: 2006-03-14 11:22:22 $ * last change: $Author: rt $ $Date: 2006-07-26 07:55:38 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -155,7 +155,7 @@ namespace pcr
SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException); SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, ::com::sun::star::inspection::LineDescriptor& /* [out] */ _rDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isComposable( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isComposable( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::inspection::InteractiveSelectionResult virtual ::com::sun::star::inspection::InteractiveSelectionResult
SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: genericpropertyhandler.cxx,v $ * $RCSfile: genericpropertyhandler.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: vg $ $Date: 2006-03-14 11:25:05 $ * last change: $Author: rt $ $Date: 2006-07-26 07:57:48 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -314,7 +314,7 @@ namespace pcr
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void SAL_CALL UrlClickHandler::disposing( const EventObject& Source ) throw (RuntimeException) void SAL_CALL UrlClickHandler::disposing( const EventObject& /*Source*/ ) throw (RuntimeException)
{ {
// not interested in // not interested in
} }
@ -491,7 +491,7 @@ namespace pcr
impl_getEnumConverter( pos->second.Type )->getValueFromDescription( sControlValue, aPropertyValue ); impl_getEnumConverter( pos->second.Type )->getValueFromDescription( sControlValue, aPropertyValue );
} }
else else
aPropertyValue = PropertyHandlerHelper::convertToPropertyValue( m_aContext.getUNOContext(), m_xTypeConverter, pos->second, _rControlValue ); aPropertyValue = PropertyHandlerHelper::convertToPropertyValue( m_xTypeConverter, pos->second, _rControlValue );
return aPropertyValue; return aPropertyValue;
} }
@ -516,7 +516,7 @@ namespace pcr
aControlValue <<= impl_getEnumConverter( pos->second.Type )->getDescriptionForValue( _rPropertyValue ); aControlValue <<= impl_getEnumConverter( pos->second.Type )->getDescriptionForValue( _rPropertyValue );
} }
else else
aControlValue = PropertyHandlerHelper::convertToControlValue( m_aContext.getUNOContext(), m_xTypeConverter, pos->second, _rPropertyValue, _rControlValueType ); aControlValue = PropertyHandlerHelper::convertToControlValue( m_xTypeConverter, _rPropertyValue, _rControlValueType );
return aControlValue; return aControlValue;
} }
@ -667,8 +667,8 @@ namespace pcr
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::describePropertyLine( const ::rtl::OUString& _rPropertyName, LineDescriptor SAL_CALL GenericPropertyHandler::describePropertyLine( const ::rtl::OUString& _rPropertyName,
LineDescriptor& /* [out] */ _out_rDescriptor, const Reference< XPropertyControlFactory >& _rxControlFactory ) const Reference< XPropertyControlFactory >& _rxControlFactory )
throw (UnknownPropertyException, NullPointerException, RuntimeException) throw (UnknownPropertyException, NullPointerException, RuntimeException)
{ {
if ( !_rxControlFactory.is() ) if ( !_rxControlFactory.is() )
@ -681,11 +681,12 @@ namespace pcr
if ( pos == m_aProperties.end() ) if ( pos == m_aProperties.end() )
throw UnknownPropertyException(); throw UnknownPropertyException();
_out_rDescriptor.DisplayName = _rPropertyName; LineDescriptor aDescriptor;
aDescriptor.DisplayName = _rPropertyName;
switch ( pos->second.Type.getTypeClass() ) switch ( pos->second.Type.getTypeClass() )
{ {
case TypeClass_ENUM: case TypeClass_ENUM:
_out_rDescriptor.Control = PropertyHandlerHelper::createListBoxControl( _rxControlFactory, aDescriptor.Control = PropertyHandlerHelper::createListBoxControl( _rxControlFactory,
impl_getEnumConverter( pos->second.Type )->getDescriptions(), impl_getEnumConverter( pos->second.Type )->getDescriptions(),
PropertyHandlerHelper::requiresReadOnlyControl( pos->second.Attributes ) ); PropertyHandlerHelper::requiresReadOnlyControl( pos->second.Attributes ) );
break; break;
@ -695,43 +696,46 @@ namespace pcr
bool bIsURLProperty = ( _rPropertyName.getLength() >= 3 ) && _rPropertyName.matchAsciiL( "URL", 3, _rPropertyName.getLength() - 3 ); bool bIsURLProperty = ( _rPropertyName.getLength() >= 3 ) && _rPropertyName.matchAsciiL( "URL", 3, _rPropertyName.getLength() - 3 );
if ( bIsURLProperty ) if ( bIsURLProperty )
{ {
_out_rDescriptor.Control = _rxControlFactory->createPropertyControl( aDescriptor.Control = _rxControlFactory->createPropertyControl(
PropertyControlType::HyperlinkField, PropertyHandlerHelper::requiresReadOnlyControl( pos->second.Attributes ) ); PropertyControlType::HyperlinkField, PropertyHandlerHelper::requiresReadOnlyControl( pos->second.Attributes ) );
Reference< XHyperlinkControl > xControl( _out_rDescriptor.Control, UNO_QUERY_THROW ); Reference< XHyperlinkControl > xControl( aDescriptor.Control, UNO_QUERY_THROW );
Reference< XActionListener > xEnsureDelete( new UrlClickHandler( m_aContext, xControl ) ); Reference< XActionListener > xEnsureDelete( new UrlClickHandler( m_aContext, xControl ) );
} }
} }
break; break;
default:
break;
} }
// fallback // fallback
if ( !_out_rDescriptor.Control.is() ) if ( !aDescriptor.Control.is() )
PropertyHandlerHelper::describePropertyLine( m_aContext.getUNOContext(), pos->second, _out_rDescriptor, _rxControlFactory ); PropertyHandlerHelper::describePropertyLine( pos->second, aDescriptor, _rxControlFactory );
_out_rDescriptor.Category = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "General" ) ); aDescriptor.Category = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "General" ) );
return aDescriptor;
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
::sal_Bool SAL_CALL GenericPropertyHandler::isComposable( const ::rtl::OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException) ::sal_Bool SAL_CALL GenericPropertyHandler::isComposable( const ::rtl::OUString& /*_rPropertyName*/ ) throw (UnknownPropertyException, RuntimeException)
{ {
return sal_False; return sal_False;
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
InteractiveSelectionResult SAL_CALL GenericPropertyHandler::onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, Any& _rData, const Reference< XObjectInspectorUI >& _rxInspectorUI ) throw (UnknownPropertyException, NullPointerException, RuntimeException) InteractiveSelectionResult SAL_CALL GenericPropertyHandler::onInteractivePropertySelection( const ::rtl::OUString& /*_rPropertyName*/, sal_Bool /*_bPrimary*/, Any& /*_rData*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/ ) throw (UnknownPropertyException, NullPointerException, RuntimeException)
{ {
DBG_ERROR( "GenericPropertyHandler::onInteractivePropertySelection: I'm too dumb to know anything about property browse buttons!" ); DBG_ERROR( "GenericPropertyHandler::onInteractivePropertySelection: I'm too dumb to know anything about property browse buttons!" );
return InteractiveSelectionResult_Cancelled; return InteractiveSelectionResult_Cancelled;
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::actuatingPropertyChanged( const ::rtl::OUString& _rActuatingPropertyName, const Any& _rNewValue, const Any& _rOldValue, const Reference< XObjectInspectorUI >& _rxInspectorUI, sal_Bool _bFirstTimeInit ) throw (NullPointerException, RuntimeException) void SAL_CALL GenericPropertyHandler::actuatingPropertyChanged( const ::rtl::OUString& /*_rActuatingPropertyName*/, const Any& /*_rNewValue*/, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/, sal_Bool /*_bFirstTimeInit*/ ) throw (NullPointerException, RuntimeException)
{ {
DBG_ERROR( "GenericPropertyHandler::actuatingPropertyChanged: no no no, I did not register for any actuating properties!" ); DBG_ERROR( "GenericPropertyHandler::actuatingPropertyChanged: no no no, I did not register for any actuating properties!" );
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
sal_Bool SAL_CALL GenericPropertyHandler::suspend( sal_Bool _bSuspend ) throw (RuntimeException) sal_Bool SAL_CALL GenericPropertyHandler::suspend( sal_Bool /*_bSuspend*/ ) throw (RuntimeException)
{ {
return sal_True; return sal_True;
} }

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: genericpropertyhandler.hxx,v $ * $RCSfile: genericpropertyhandler.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: vg $ $Date: 2006-03-14 11:25:17 $ * last change: $Author: rt $ $Date: 2006-07-26 07:57:59 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -148,7 +148,7 @@ namespace pcr
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException); SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, ::com::sun::star::inspection::LineDescriptor& /* [out] */ _rDescriptor, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isComposable( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isComposable( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::inspection::InteractiveSelectionResult virtual ::com::sun::star::inspection::InteractiveSelectionResult
SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: handlerhelper.cxx,v $ * $RCSfile: handlerhelper.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: vg $ $Date: 2006-03-14 11:25:27 $ * last change: $Author: rt $ $Date: 2006-07-26 07:58:12 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -109,7 +109,7 @@ namespace pcr
//= PropertyHandlerHelper //= PropertyHandlerHelper
//==================================================================== //====================================================================
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void PropertyHandlerHelper::describePropertyLine( const Reference< XComponentContext >& _rxContext, const Property& _rProperty, void PropertyHandlerHelper::describePropertyLine( const Property& _rProperty,
LineDescriptor& /* [out] */ _out_rDescriptor, const Reference< XPropertyControlFactory >& _rxControlFactory ) LineDescriptor& /* [out] */ _out_rDescriptor, const Reference< XPropertyControlFactory >& _rxControlFactory )
{ {
// display the pure property name - no L10N // display the pure property name - no L10N
@ -237,7 +237,7 @@ namespace pcr
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
Any PropertyHandlerHelper::convertToPropertyValue( const Reference< XComponentContext >& _rxContext, const Reference< XTypeConverter >& _rxTypeConverter, Any PropertyHandlerHelper::convertToPropertyValue( const Reference< XTypeConverter >& _rxTypeConverter,
const Property& _rProperty, const Any& _rControlValue ) const Property& _rProperty, const Any& _rControlValue )
{ {
Any aPropertyValue( _rControlValue ); Any aPropertyValue( _rControlValue );
@ -274,8 +274,8 @@ namespace pcr
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
Any PropertyHandlerHelper::convertToControlValue( const Reference< XComponentContext >& _rxContext, const Reference< XTypeConverter >& _rxTypeConverter, Any PropertyHandlerHelper::convertToControlValue( const Reference< XTypeConverter >& _rxTypeConverter,
const Property& _rProperty, const Any& _rPropertyValue, const Type& _rControlValueType ) const Any& _rPropertyValue, const Type& _rControlValueType )
{ {
Any aControlValue( _rPropertyValue ); Any aControlValue( _rPropertyValue );
if ( !aControlValue.hasValue() ) if ( !aControlValue.hasValue() )