From 0b1a461ca52124d962ea9fdd3d0f9f3eb90b4852 Mon Sep 17 00:00:00 2001 From: Björn Milcke Date: Fri, 17 Oct 2003 13:50:29 +0000 Subject: PropertyMapper::setMultiProperties: take a property set rahter than a shape as param --- chart2/source/view/inc/PropertyMapper.hxx | 6 +++--- chart2/source/view/main/PropertyMapper.cxx | 10 ++++++---- chart2/source/view/main/ShapeFactory.cxx | 14 +++++++------- chart2/source/view/main/VLegend.cxx | 10 ++++++---- chart2/source/view/main/VLegendSymbolFactory.cxx | 9 +++++---- chart2/source/view/main/VTitle.cxx | 6 +++--- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/chart2/source/view/inc/PropertyMapper.hxx b/chart2/source/view/inc/PropertyMapper.hxx index a878d57e482d..910353d70e72 100644 --- a/chart2/source/view/inc/PropertyMapper.hxx +++ b/chart2/source/view/inc/PropertyMapper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PropertyMapper.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bm $ $Date: 2003-10-09 16:46:44 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -130,7 +130,7 @@ public: const tNameSequence& rNames , const tAnySequence& rValues , const ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XShape >& xTarget ); + ::com::sun::star::beans::XPropertySet >& xTarget ); static const tMakePropertyNameMap& getPropertyNameMapForCharacterProperties(); static const tMakePropertyNameMap& getPropertyNameMapForParagraphProperties(); diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 404b523a9128..f372f811edd9 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PropertyMapper.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bm $ $Date: 2003-10-09 16:46:45 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -367,11 +367,12 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesPro return m_aShapePropertyMapForFilledSeriesProperties; } -//static +// static void PropertyMapper::setMultiProperties( const tNameSequence& rNames , const tAnySequence& rValues - , const uno::Reference< drawing::XShape >& xTarget ) + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xTarget ) { try { @@ -382,6 +383,7 @@ void PropertyMapper::setMultiProperties( } else { + OSL_ENSURE( false, "Object does not support XMultiPropertySet" ); //@todo: if no multipropertyset is available try the unperformant normal XPropertySet } } diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 7a3e777591c0..508e297fcaa2 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ShapeFactory.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bm $ $Date: 2003-10-07 17:18:46 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1873,14 +1873,14 @@ uno::Reference< drawing::XShape > if( xTextRange.is() ) xTextRange->setString( rText ); - //set properties - PropertyMapper::setMultiProperties( rPropNames, rPropValues, xShape ); - - //set position matrix - //the matrix needs to be set at the end behind autogrow and such position influencing properties uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); if( xProp.is() ) { + //set properties + PropertyMapper::setMultiProperties( rPropNames, rPropValues, xProp ); + + //set position matrix + //the matrix needs to be set at the end behind autogrow and such position influencing properties try { xProp->setPropertyValue( C2U( "Transformation" ), rATransformation ); diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 42ca62a9a17e..0228d2fe9480 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VLegend.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: bm $ $Date: 2003-10-17 12:39:01 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -323,7 +323,8 @@ void lcl_getLegendEntries( // set character properties ::chart::PropertyMapper::setMultiProperties( - rProperties.first, rProperties.second, xEntry ); + rProperties.first, rProperties.second, + uno::Reference< beans::XPropertySet >( xEntry,uno::UNO_QUERY ) ); // adapt min-/max-extent awt::Size aEntrySize( xEntry->getSize() ); @@ -577,7 +578,8 @@ void VLegend::createShapes( // apply legend properties PropertyMapper::setMultiProperties( - aLineFillProperties.first, aLineFillProperties.second, xBorder ); + aLineFillProperties.first, aLineFillProperties.second, + uno::Reference< beans::XPropertySet >( xBorder, uno::UNO_QUERY )); } // create entries diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx index 7ec5685032f0..9d83070d89a2 100644 --- a/chart2/source/view/main/VLegendSymbolFactory.cxx +++ b/chart2/source/view/main/VLegendSymbolFactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VLegendSymbolFactory.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bm $ $Date: 2003-10-10 11:41:28 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,7 +85,8 @@ void lcl_setPropetiesToShape( static ::chart::tPropertyNameMap aFilledNameMap( ::chart::PropertyMapper::getPropertyNameMapForFilledSeriesProperties()); static ::chart::tPropertyNameMap aLineNameMap( ::chart::PropertyMapper::getPropertyNameMapForLineSeriesProperties()); - if( xProp.is() && xShape.is() ) + uno::Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY ); + if( xProp.is() && xShapeProp.is() ) { ::chart::tPropertyNameValueMap aValueMap; if( bFilledSeries ) @@ -96,7 +97,7 @@ void lcl_setPropetiesToShape( ::chart::tNameSequence aPropNames; ::chart::tAnySequence aPropValues; ::chart::PropertyMapper::getMultiPropertyListsFromValueMap( aPropNames, aPropValues, aValueMap ); - ::chart::PropertyMapper::setMultiProperties( aPropNames, aPropValues, xShape ); + ::chart::PropertyMapper::setMultiProperties( aPropNames, aPropValues, xShapeProp ); } } diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx index c02669b587a4..7e6a4d28954c 100644 --- a/chart2/source/view/main/VTitle.cxx +++ b/chart2/source/view/main/VTitle.cxx @@ -2,9 +2,9 @@ * * $RCSfile: VTitle.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bm $ $Date: 2003-10-14 15:35:16 $ + * last change: $Author: bm $ $Date: 2003-10-17 14:50:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -231,7 +231,7 @@ void VTitle::createShapes( const awt::Point& rPos ) tNameSequence aPropNames; tAnySequence aPropValues; PropertyMapper::getMultiPropertyListsFromValueMap( aPropNames, aPropValues, aValueMap ); - PropertyMapper::setMultiProperties( aPropNames, aPropValues, xShape ); + PropertyMapper::setMultiProperties( aPropNames, aPropValues, xShapeProp ); } sal_Bool bStackCharacters(sal_False); -- cgit