00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "unohelper.hxx"
00030 #include <com/sun/star/beans/XPropertySet.hpp>
00031
00032 using ::com::sun::star::uno::UNO_QUERY;
00033
00034 namespace scsolver { namespace unohelper {
00035
00036
00037 uno::Any getPropertyValue( const Reference< uno::XInterface >& obj, const rtl::OUString& sPropName )
00038 {
00039 Reference< beans::XPropertySet > xPS( obj, UNO_QUERY );
00040 OSL_ASSERT( xPS != NULL );
00041 return xPS->getPropertyValue( sPropName );
00042 }
00043
00044 void getPropertyValue( const Reference< XInterface >& obj, const rtl::OUString& sPropName, sal_Int16& t )
00045 {
00046 uno::Any aValue = getPropertyValue( obj, sPropName );
00047 aValue >>= t;
00048 }
00049
00050 void setPropertyValue( const Reference< uno::XInterface >& obj, const rtl::OUString& sPropName,
00051 const sal_Int32 n )
00052 {
00053 uno::Any aVal;
00054 aVal <<= n;
00055 setPropertyValue( obj, sPropName, aVal );
00056 }
00057
00058 void setPropertyValue( const Reference< uno::XInterface >& obj, const rtl::OUString& sPropName,
00059 const uno::Any& aVal )
00060 {
00061 Reference< beans::XPropertySet > xPS( obj, UNO_QUERY );
00062 OSL_ASSERT( xPS != NULL );
00063 xPS->setPropertyValue( sPropName, aVal );
00064 }
00065
00066
00067 }}
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084