summaryrefslogtreecommitdiff
path: root/oox/source/shape
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-12-01 17:41:04 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-12-01 17:41:04 +0000
commit25df57fb136eb88253e7b9abc680adab85497dba (patch)
tree8ba67f4e32903a1f4dffb3361fa875b00f076ecd /oox/source/shape
parent2be6a1367647d57da39bac601b5bca7d4d85312a (diff)
parent60be2a0e7659ad752551d8fce0d72e04b28e7888 (diff)
chartshapes: merge with DEV300 m55
Diffstat (limited to 'oox/source/shape')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx38
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx11
-rw-r--r--oox/source/shape/ShapeFilterBase.cxx4
-rw-r--r--oox/source/shape/ShapeFilterBase.hxx6
4 files changed, 29 insertions, 30 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 6d1da1e74da3..80caad025630 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -29,7 +29,9 @@
************************************************************************/
#include "ShapeContextHandler.hxx"
-#include "oox/vml/drawingfragmenthandler.hxx"
+#include "oox/vml/vmldrawingfragment.hxx"
+#include "oox/vml/vmlshape.hxx"
+#include "oox/vml/vmlshapecontainer.hxx"
namespace oox { namespace shape {
@@ -90,11 +92,11 @@ ShapeContextHandler::getDrawingShapeContext()
{
if (!mxDrawingFragmentHandler.is())
{
- mpDrawing.reset( new oox::vml::Drawing() );
+ mpDrawing.reset( new oox::vml::Drawing( *mxFilterBase, mxDrawPage, oox::vml::VMLDRAWING_WORD ) );
mxDrawingFragmentHandler.set
- (dynamic_cast<ContextHandler *>
- (new oox::vml::DrawingFragmentHandler
- ( *mxFilterBase, msRelationFragmentPath, mpDrawing->getShapes(), mpDrawing->getShapeTypes() )));
+ (dynamic_cast<ContextHandler *>
+ (new oox::vml::DrawingFragment
+ ( *mxFilterBase, msRelationFragmentPath, *mpDrawing )));
}
return mxDrawingFragmentHandler;
@@ -217,21 +219,19 @@ uno::Reference< drawing::XShape > SAL_CALL
ShapeContextHandler::getShape() throw (uno::RuntimeException)
{
uno::Reference< drawing::XShape > xResult;
+ uno::Reference< drawing::XShapes > xShapes( mxDrawPage, uno::UNO_QUERY );
- if (mxFilterBase.is() && mxShapes.is())
+ if (mxFilterBase.is() && xShapes.is())
{
if (mpDrawing.get() != NULL)
{
- std::vector< oox::vml::ShapePtr >& rShapes = mpDrawing->getShapes();
- if ( rShapes.size() )
- {
- rShapes[ 0 ]->addShape( *mxFilterBase, *mpDrawing, mxShapes, NULL );
- xResult.set(rShapes[ 0 ]->getXShape());
- }
+ mpDrawing->finalizeFragmentImport();
+ if( const ::oox::vml::ShapeBase* pShape = mpDrawing->getShapes().getFirstShape() )
+ xResult = pShape->convertAndInsert( xShapes );
}
else if (mpShape.get() != NULL)
{
- mpShape->addShape(*mxFilterBase, mpThemePtr.get(), mxShapes);
+ mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes);
xResult.set(mpShape->getXShape());
}
}
@@ -239,17 +239,17 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
return xResult;
}
-css::uno::Reference< css::drawing::XShapes > SAL_CALL
-ShapeContextHandler::getShapes() throw (css::uno::RuntimeException)
+css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
+ShapeContextHandler::getDrawPage() throw (css::uno::RuntimeException)
{
- return mxShapes;
+ return mxDrawPage;
}
-void SAL_CALL ShapeContextHandler::setShapes
-(const css::uno::Reference< css::drawing::XShapes > & the_value)
+void SAL_CALL ShapeContextHandler::setDrawPage
+(const css::uno::Reference< css::drawing::XDrawPage > & the_value)
throw (css::uno::RuntimeException)
{
- mxShapes = the_value;
+ mxDrawPage = the_value;
}
css::uno::Reference< css::frame::XModel > SAL_CALL
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index 171640838502..47b2cf1951de 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -40,7 +40,6 @@
#include "oox/drawingml/theme.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "oox/vml/drawingfragmenthandler.hxx"
#include "ShapeFilterBase.hxx"
namespace css = ::com::sun::star;
@@ -134,11 +133,11 @@ public:
virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getShape()
throw (css::uno::RuntimeException);
- virtual css::uno::Reference< css::drawing::XShapes > SAL_CALL getShapes()
+ virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage()
throw (css::uno::RuntimeException);
- virtual void SAL_CALL setShapes
- (const css::uno::Reference< css::drawing::XShapes > & the_value)
+ virtual void SAL_CALL setDrawPage
+ (const css::uno::Reference< css::drawing::XDrawPage > & the_value)
throw (css::uno::RuntimeException);
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel()
@@ -172,7 +171,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
drawingml::ShapePtr mpShape;
- vml::DrawingPtr mpDrawing;
+ ::boost::shared_ptr< vml::Drawing > mpDrawing;
typedef boost::shared_ptr<drawingml::GraphicShapeContext>
GraphicShapeContextPtr;
@@ -181,7 +180,7 @@ private:
core::XmlFilterRef mxFilterBase;
drawingml::ThemePtr mpThemePtr;
- css::uno::Reference<css::drawing::XShapes> mxShapes;
+ css::uno::Reference<css::drawing::XDrawPage> mxDrawPage;
css::uno::Reference<css::io::XInputStream> mxInputStream;
::rtl::OUString msRelationFragmentPath;
diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx
index c43eaddf363d..0933af28ffd5 100644
--- a/oox/source/shape/ShapeFilterBase.cxx
+++ b/oox/source/shape/ShapeFilterBase.cxx
@@ -58,9 +58,9 @@ sal_Int32 ShapeFilterBase::getSchemeClr(sal_Int32 /*nColorSchemeToken*/ ) const
return 0;
}
-const vml::DrawingPtr ShapeFilterBase::getDrawings()
+::oox::vml::Drawing* ShapeFilterBase::getVmlDrawing()
{
- return vml::DrawingPtr();
+ return 0;
}
const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles()
diff --git a/oox/source/shape/ShapeFilterBase.hxx b/oox/source/shape/ShapeFilterBase.hxx
index 0657aea11c2e..d90904ed22cc 100644
--- a/oox/source/shape/ShapeFilterBase.hxx
+++ b/oox/source/shape/ShapeFilterBase.hxx
@@ -33,7 +33,7 @@
#include <boost/shared_ptr.hpp>
#include <rtl/ref.hxx>
-#include "oox/vml/drawing.hxx"
+#include "oox/vml/vmldrawing.hxx"
#include "oox/drawingml/table/tablestylelist.hxx"
#include "oox/core/xmlfilterbase.hxx"
@@ -58,8 +58,8 @@ public:
/** Has to be implemented by each filter to resolve scheme colors. */
virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const;
- /** Has to be implemented by each filter to return drawings collection. */
- virtual const ::oox::vml::DrawingPtr getDrawings();
+ /** Has to be implemented by each filter to return the collection of VML shapes. */
+ virtual ::oox::vml::Drawing* getVmlDrawing();
/** Has to be implemented by each filter to return TableStyles. */
virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles();