From 0c8a7ec5f5a113d37632206af8605ff8a18792db Mon Sep 17 00:00:00 2001 From: Sven Jacobi Date: Fri, 4 May 2001 14:09:29 +0000 Subject: #85379# added method to set PropertyValues at XPropertySets --- svx/source/msfilter/msdffimp.cxx | 42 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index ef68ecd36c91..ede5479a03f9 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: msdffimp.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: sj $ $Date: 2001-05-02 10:23:16 $ + * last change: $Author: sj $ $Date: 2001-05-04 15:09:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -5063,3 +5063,41 @@ SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const return pRet; } +sal_Bool SvxMSDffManager::SetPropValue( + const ::com::sun::star::uno::Any& rAny, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, + const String& rPropName, + sal_Bool bTestPropertyAvailability ) +{ + sal_Bool bRetValue = sal_True; + if ( bTestPropertyAvailability ) + { + bRetValue = sal_False; + try + { + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > + aXPropSetInfo( rXPropSet->getPropertySetInfo() ); + if ( aXPropSetInfo.is() ) + bRetValue = aXPropSetInfo->hasPropertyByName( rPropName ); + } + catch( ::com::sun::star::uno::Exception& ) + { + bRetValue = sal_False; + } + } + if ( bRetValue ) + { + try + { + rXPropSet->setPropertyValue( rPropName, rAny ); + bRetValue = sal_True; + } + catch( ::com::sun::star::uno::Exception& ) + { + bRetValue = sal_False; + } + } + return bRetValue; +} + + -- cgit v1.2.3