summaryrefslogtreecommitdiff
path: root/oox/source/shape
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-18 11:48:16 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-18 11:48:16 +0000
commitdc9227cea64250b544f81c2fe960e9aba7513566 (patch)
treed6983dd301de8fcdc033e07140582380b52734ee /oox/source/shape
parentf3f7fa31c6de8dacb418f813b5a5b716fd421f3a (diff)
CWS-TOOLING: integrate CWS hb14
2009-01-23 10:08:45 +0100 os r266775 : #i90699# import text columns at start correctly 2009-01-21 16:36:51 +0100 hbrinkm r266686 : #i92625# new attribute StartToken 2009-01-21 16:29:07 +0100 hbrinkm r266684 : #i92625# XFastShapeContextHandler: new attribute StartToken 2009-01-21 16:26:19 +0100 hbrinkm r266683 : #i92625# compile error in debug code 2009-01-21 16:22:27 +0100 hbrinkm r266682 : #i92625# OOXMLFastContextHandlerShape::setToken 2009-01-21 16:18:17 +0100 hbrinkm r266680 : #i92625# OOXMLDocumentImpl::getSubStream: forward mxShapes to substream document 2009-01-05 12:34:38 +0100 hbrinkm r265864 : CWS-TOOLING: rebase CWS hb14 to trunk@265758 (milestone: DEV300:m38)
Diffstat (limited to 'oox/source/shape')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx67
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx6
2 files changed, 49 insertions, 24 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 3d8f2a9e596f..c2d98650776b 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -39,7 +39,7 @@ using namespace drawingml;
ShapeContextHandler::ShapeContextHandler
(uno::Reference< uno::XComponentContext > const & context) :
-m_xContext(context)
+mnStartToken(0), m_xContext(context)
{
try
{
@@ -57,16 +57,29 @@ ShapeContextHandler::~ShapeContextHandler()
}
uno::Reference<xml::sax::XFastContextHandler>
-ShapeContextHandler::getGraphicShapeContext()
+ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
{
if (! mxGraphicShapeContext.is())
{
FragmentHandlerRef rFragmentHandler
(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
ShapePtr pMasterShape;
- mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
- mxGraphicShapeContext.set
- (new GraphicShapeContext(*rFragmentHandler, pMasterShape, mpShape));
+
+ switch (Element & 0xffff)
+ {
+ case XML_graphic:
+ mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
+ mxGraphicShapeContext.set
+ (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape));
+ break;
+ case XML_pic:
+ mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
+ mxGraphicShapeContext.set
+ (new GraphicShapeContext(*rFragmentHandler, pMasterShape, mpShape));
+ break;
+ default:
+ break;
+ }
}
return mxGraphicShapeContext;
@@ -79,9 +92,9 @@ ShapeContextHandler::getDrawingShapeContext()
{
mpDrawing.reset( new oox::vml::Drawing() );
mxDrawingFragmentHandler.set
- (dynamic_cast<ContextHandler *>
- (new oox::vml::DrawingFragmentHandler
- ( *mxFilterBase, msRelationFragmentPath, mpDrawing->getShapes(), mpDrawing->getShapeTypes() )));
+ (dynamic_cast<ContextHandler *>
+ (new oox::vml::DrawingFragmentHandler
+ ( *mxFilterBase, msRelationFragmentPath, mpDrawing->getShapes(), mpDrawing->getShapeTypes() )));
}
return mxDrawingFragmentHandler;
@@ -91,10 +104,16 @@ uno::Reference<xml::sax::XFastContextHandler>
ShapeContextHandler::getContextHandler()
{
uno::Reference<xml::sax::XFastContextHandler> xResult;
- if (mxDrawingFragmentHandler.is())
- xResult.set(mxDrawingFragmentHandler);
- else if (mxGraphicShapeContext.is())
- xResult.set(mxGraphicShapeContext);
+
+ switch (mnStartToken & NMSP_MASK)
+ {
+ case NMSP_VML:
+ xResult.set(getDrawingShapeContext());
+ break;
+ default:
+ xResult.set(getGraphicShapeContext(mnStartToken));
+ break;
+ }
return xResult;
}
@@ -159,17 +178,7 @@ ShapeContextHandler::createFastChildContext
throw (uno::RuntimeException, xml::sax::SAXException)
{
uno::Reference< xml::sax::XFastContextHandler > xResult;
- uno::Reference< xml::sax::XFastContextHandler > xContextHandler;
-
- switch (Element & NMSP_MASK)
- {
- case NMSP_VML:
- xContextHandler.set(getDrawingShapeContext());
- break;
- default:
- xContextHandler.set(getGraphicShapeContext());
- break;
- }
+ uno::Reference< xml::sax::XFastContextHandler > xContextHandler(getContextHandler());
if (xContextHandler.is())
xResult.set(xContextHandler->createFastChildContext
@@ -287,6 +296,18 @@ void SAL_CALL ShapeContextHandler::setRelationFragmentPath
msRelationFragmentPath = the_value;
}
+::sal_Int32 SAL_CALL ShapeContextHandler::getStartToken() throw (::com::sun::star::uno::RuntimeException)
+{
+ return mnStartToken;
+}
+
+void SAL_CALL ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException)
+{
+ mnStartToken = _starttoken;
+
+
+}
+
::rtl::OUString ShapeContextHandler::getImplementationName()
throw (css::uno::RuntimeException)
{
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index 148414d7db3d..171640838502 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -161,11 +161,15 @@ public:
(const ::rtl::OUString & the_value)
throw (css::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getStartToken() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException);
private:
ShapeContextHandler(ShapeContextHandler &); // not defined
void operator =(ShapeContextHandler &); // not defined
+ ::sal_uInt32 mnStartToken;
+
css::uno::Reference< css::uno::XComponentContext > m_xContext;
drawingml::ShapePtr mpShape;
vml::DrawingPtr mpDrawing;
@@ -181,7 +185,7 @@ private:
css::uno::Reference<css::io::XInputStream> mxInputStream;
::rtl::OUString msRelationFragmentPath;
- css::uno::Reference<XFastContextHandler> getGraphicShapeContext();
+ css::uno::Reference<XFastContextHandler> getGraphicShapeContext(::sal_Int32 Element);
css::uno::Reference<XFastContextHandler> getDrawingShapeContext();
css::uno::Reference<XFastContextHandler> getContextHandler();
};