summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-04 13:49:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-04 17:26:03 +0200
commit9738002eca0f7cba337ae856cb5bce8ba93ee293 (patch)
treebb942212ba1aa12e714710542261e12e795f5449 /filter
parentaf5059d19a37c6f2dffd756c579e92d30f65bc8b (diff)
fdo#46808, Adapt drawing::ShapeCollection UNO service to new style
No client code is using the XComponent interface, so drop it. Change-Id: Id8f6da1248da641dcc0a3cb6d0a70e3bf29e5c99
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index 37ab1d68efd0..7d541272bbed 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -42,11 +42,13 @@
#include <com/sun/star/drawing/PointSequence.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
#include <com/sun/star/drawing/FlagSequence.hpp>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
#include <com/sun/star/drawing/TextAdjust.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/style/HorizontalAlignment.hpp>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -448,21 +450,14 @@ void CGMImpressOutAct::EndGroup()
uno::Any aAny( maXDrawPage->queryInterface( ::getCppuType(((const uno::Reference< drawing::XShapeGrouper >*)0) )));
if( aAny >>= aXShapeGrouper )
{
- uno::Reference< drawing::XShapes > aXShapes;
- uno::Reference< drawing::XShape > aXShapeCollection( maXServiceManagerSC->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.ShapeCollection" )) ), uno::UNO_QUERY );
- if ( aXShapeCollection.is() )
+ uno::Reference< drawing::XShapes > aXShapes(
+ drawing::ShapeCollection::create(comphelper::ComponentContext(maXServiceManagerSC).getUNOContext()) );
+ for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
{
- aXShapes = uno::Reference< drawing::XShapes >( aXShapeCollection, uno::UNO_QUERY );
- if( aXShapes.is() )
+ uno::Reference< drawing::XShape > aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
+ if (aXShape.is() )
{
- for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
- {
- uno::Reference< drawing::XShape > aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
- if (aXShape.is() )
- {
- aXShapes->add( aXShape );
- }
- }
+ aXShapes->add( aXShape );
}
}
uno::Reference< drawing::XShapeGroup > aXShapeGroup = aXShapeGrouper->group( aXShapes );