summaryrefslogtreecommitdiffstats
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
parentSome clean up of previous commit (diff)
downloadcore-9738002eca0f7cba337ae856cb5bce8ba93ee293.tar.gz
core-9738002eca0f7cba337ae856cb5bce8ba93ee293.zip
fdo#46808, Adapt drawing::ShapeCollection UNO service to new style
No client code is using the XComponent interface, so drop it. Change-Id: Id8f6da1248da641dcc0a3cb6d0a70e3bf29e5c99
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx3
-rw-r--r--extensions/source/dbpilots/optiongrouplayouter.cxx9
-rw-r--r--extensions/source/dbpilots/optiongrouplayouter.hxx8
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx21
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/drawing/ShapeCollection.idl13
-rw-r--r--offapi/type_reference/types.rdbbin7655424 -> 7655424 bytes
-rw-r--r--sw/source/ui/vba/vbaselection.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbashaperange.cxx4
9 files changed, 24 insertions, 40 deletions
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 4d15d553de7c..00d7dabb52e5 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -33,6 +33,7 @@
#include <vcl/msgbox.hxx>
#include "optiongrouplayouter.hxx"
#include "dbpilots.hrc"
+#include <comphelper/componentcontext.hxx>
#define GBW_STATE_OPTIONLIST 0
#define GBW_STATE_DEFAULTOPTION 1
@@ -168,7 +169,7 @@ namespace dbp
{
try
{
- OOptionGroupLayouter aLayouter(getServiceFactory());
+ OOptionGroupLayouter aLayouter(comphelper::ComponentContext(getServiceFactory()).getUNOContext());
aLayouter.doLayout(getContext(), getSettings());
}
catch(const Exception&)
diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx
index 99b68ad46f25..f5b73a8a8457 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/drawing/XShapeGrouper.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
@@ -62,8 +63,8 @@ namespace dbp
//= OOptionGroupLayouter
//=====================================================================
//---------------------------------------------------------------------
- OOptionGroupLayouter::OOptionGroupLayouter(const Reference< XMultiServiceFactory >& _rxORB)
- :m_xORB(_rxORB)
+ OOptionGroupLayouter::OOptionGroupLayouter(const Reference< XComponentContext >& _rxContext)
+ :mxContext(_rxContext)
{
}
@@ -103,9 +104,7 @@ namespace dbp
implAnchorShape(Reference< XPropertySet >(_rContext.xObjectShape, UNO_QUERY));
// shape collection (for grouping the shapes)
- Reference< XShapes > xButtonCollection(m_xORB->createInstance(
- ::rtl::OUString("com.sun.star.drawing.ShapeCollection")),
- UNO_QUERY);
+ Reference< XShapes > xButtonCollection( ShapeCollection::create(mxContext), UNO_QUERY_THROW );
// first member : the shape of the control
xButtonCollection->add(_rContext.xObjectShape.get());
diff --git a/extensions/source/dbpilots/optiongrouplayouter.hxx b/extensions/source/dbpilots/optiongrouplayouter.hxx
index 08d36efe8fa2..0a0c8707a888 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.hxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.hxx
@@ -22,7 +22,7 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include "dbptypes.hxx"
@@ -39,12 +39,12 @@ namespace dbp
//=====================================================================
class OOptionGroupLayouter
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext;
public:
OOptionGroupLayouter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
);
public:
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 );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0a9714528a0f..291699a24c33 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -103,6 +103,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\
OOXMLDocumentPropertiesImporter \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\
+ ShapeCollection \
SlideRenderer \
SlideSorter \
))
@@ -669,7 +670,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/drawing
RotationDescriptor \
ShadowProperties \
Shape \
- ShapeCollection \
Shapes \
Text \
TextProperties \
diff --git a/offapi/com/sun/star/drawing/ShapeCollection.idl b/offapi/com/sun/star/drawing/ShapeCollection.idl
index 7c80d9308458..b126177458dd 100644
--- a/offapi/com/sun/star/drawing/ShapeCollection.idl
+++ b/offapi/com/sun/star/drawing/ShapeCollection.idl
@@ -20,7 +20,6 @@
#define __com_sun_star_drawing_ShapeCollection_idl__
#include <com/sun/star/drawing/Shapes.idl>
-#include <com/sun/star/lang/XComponent.idl>
module com { module sun { module star { module drawing {
@@ -32,17 +31,7 @@ module com { module sun { module star { module drawing {
This service is used by the view f.e. to return a collection of
<type>Shape</type> that are selected at the ui.
*/
-published service ShapeCollection
-{
- /** gives access to the shapes
- */
- interface com::sun::star::drawing::XShapes;
-
- /** allows controlling or observing the lifetime of this collection
- */
- interface com::sun::star::lang::XComponent;
-
-};
+published service ShapeCollection : com::sun::star::drawing::XShapes;
}; }; }; };
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index d36fc05331eb..e6e15796737f 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index df31e1457eb8..641668166bfd 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -60,6 +60,7 @@
#include "vbaheaderfooter.hxx"
#include "vbaheaderfooterhelper.hxx"
#include <vbahelper/vbashaperange.hxx>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include "vbarows.hxx"
@@ -868,8 +869,7 @@ SwVbaSelection::ShapeRange( ) throw (uno::RuntimeException)
if ( !xShapes.is() )
{
uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
- uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
- xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW );
+ xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
xShapes->add( xShape );
}
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index fb2ca53022bd..87168bbcead7 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -16,6 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <com/sun/star/drawing/ShapeCollection.hpp>
#include <com/sun/star/drawing/XShapeGrouper.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include<com/sun/star/view/XSelectionSupplier.hpp>
@@ -73,8 +74,7 @@ ScVbaShapeRange::getShapes() throw (uno::RuntimeException)
{
if ( !m_xShapes.is() )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
- m_xShapes.set( xMSF->createInstance( rtl::OUString("com.sun.star.drawing.ShapeCollection") ), uno::UNO_QUERY_THROW );
+ m_xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
sal_Int32 nLen = m_xIndexAccess->getCount();
for ( sal_Int32 index = 0; index < nLen; ++index )
m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) );