diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-10-07 01:43:11 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-11-19 13:47:34 +0100 |
commit | a3604b24962ffdb02dee78a13db9eb9d977de376 (patch) | |
tree | cceef6daa5c186c06d8748f11472206b194eaa7e /chart2 | |
parent | dde6b8047384ffad5bcf8dad24aa5fb814217334 (diff) |
use AbstractShapeFactory in more places
Change-Id: I1c34f6e56579c4a43e4ba28a81799c3f67d679cb
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/diagram/VDiagram.cxx | 12 | ||||
-rw-r--r-- | chart2/source/view/inc/AbstractShapeFactory.hxx | 5 | ||||
-rw-r--r-- | chart2/source/view/inc/DummyShapeFactory.hxx | 5 | ||||
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 4 | ||||
-rw-r--r-- | chart2/source/view/main/DataPointSymbolSupplier.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/main/DummyShapeFactory.cxx | 8 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 12 |
7 files changed, 40 insertions, 15 deletions
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index 643146c84579..a07d26297887 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -170,11 +170,10 @@ void VDiagram::createShapes_2d() //add back wall { - m_xWall2D = uno::Reference< drawing::XShape >( - m_xShapeFactory->createInstance( - "com.sun.star.drawing.RectangleShape" ), uno::UNO_QUERY ); + AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory); + m_xWall2D = pShapeFactory->createRectangle( + xGroupForWall ); - xGroupForWall->add(m_xWall2D); uno::Reference< beans::XPropertySet > xProp( m_xWall2D, uno::UNO_QUERY ); if( xProp.is()) { @@ -477,10 +476,7 @@ void VDiagram::createShapes_3d() //create shape m_xOuterGroupShape = uno::Reference< drawing::XShape >( - m_xShapeFactory->createInstance( - "com.sun.star.drawing.Shape3DSceneObject" ), uno::UNO_QUERY ); - AbstractShapeFactory::setShapeName( m_xOuterGroupShape, "PlotAreaExcludingAxes" ); - m_xTarget->add(m_xOuterGroupShape); + m_pShapeFactory->createGroup3D( m_xTarget, "PlotAreaExcludingAxes" ), uno::UNO_QUERY); uno::Reference< drawing::XShapes > xOuterGroup_Shapes = uno::Reference<drawing::XShapes>( m_xOuterGroupShape, uno::UNO_QUERY ); diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx index fc25226ddf9a..03780eb3a9e4 100644 --- a/chart2/source/view/inc/AbstractShapeFactory.hxx +++ b/chart2/source/view/inc/AbstractShapeFactory.hxx @@ -204,6 +204,11 @@ public: , const tNameSequence& rPropNames , const tAnySequence& rPropValues ) = 0; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createRectangle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget ) = 0; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ) = 0; diff --git a/chart2/source/view/inc/DummyShapeFactory.hxx b/chart2/source/view/inc/DummyShapeFactory.hxx index fab81324f50d..0cc7b908f528 100644 --- a/chart2/source/view/inc/DummyShapeFactory.hxx +++ b/chart2/source/view/inc/DummyShapeFactory.hxx @@ -160,6 +160,11 @@ public: , const tNameSequence& rPropNames , const tAnySequence& rPropValues ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createRectangle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ); diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index d73367f1a071..fc4368356ad5 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -175,6 +175,10 @@ public: , const tNameSequence& rPropNames , const tAnySequence& rPropValues ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createRectangle( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getOrCreateChartRootShape( const ::com::sun::star::uno::Reference< diff --git a/chart2/source/view/main/DataPointSymbolSupplier.cxx b/chart2/source/view/main/DataPointSymbolSupplier.cxx index af87754a82a1..96190d14b1b5 100644 --- a/chart2/source/view/main/DataPointSymbolSupplier.cxx +++ b/chart2/source/view/main/DataPointSymbolSupplier.cxx @@ -30,15 +30,10 @@ uno::Reference< drawing::XShapes > DataPointSymbolSupplier::create2DSymbolList( , const uno::Reference< drawing::XShapes >& xTarget , const drawing::Direction3D& rSize ) { - uno::Reference< drawing::XShape > xGroup( - xShapeFactory->createInstance( - "com.sun.star.drawing.GroupShape" ), uno::UNO_QUERY ); - if(xTarget.is()) - xTarget->add(xGroup); + AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(xShapeFactory); uno::Reference< drawing::XShapes > xGroupShapes = - uno::Reference<drawing::XShapes>( xGroup, uno::UNO_QUERY ); + pShapeFactory->createGroup2D( xTarget ); - AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(xShapeFactory); drawing::Position3D aPos(0,0,0); for(sal_Int32 nS=0;nS<AbstractShapeFactory::getSymbolCount();nS++) { diff --git a/chart2/source/view/main/DummyShapeFactory.cxx b/chart2/source/view/main/DummyShapeFactory.cxx index 187e8fe69bc8..eb855356cafd 100644 --- a/chart2/source/view/main/DummyShapeFactory.cxx +++ b/chart2/source/view/main/DummyShapeFactory.cxx @@ -252,6 +252,14 @@ uno::Reference< drawing::XShape > DummyShapeFactory::createRectangle( } uno::Reference< drawing::XShape > + DummyShapeFactory::createRectangle( + const uno::Reference< + drawing::XShapes >& ) +{ + return new DummyXShape(); +} + +uno::Reference< drawing::XShape > DummyShapeFactory::createText( const uno::Reference< drawing::XShapes >& , const OUString& , const tNameSequence& diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 69cc0c1ce51d..5deac27ad5a9 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2061,6 +2061,18 @@ uno::Reference< drawing::XShape > ShapeFactory::createRectangle( } uno::Reference< drawing::XShape > + ShapeFactory::createRectangle( + const uno::Reference< + drawing::XShapes >& xTarget ) +{ + uno::Reference< drawing::XShape > xShape( m_xShapeFactory->createInstance( + "com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY ); + xTarget->add( xShape ); + + return xShape; +} + +uno::Reference< drawing::XShape > ShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget , const OUString& rText , const tNameSequence& rPropNames |