summaryrefslogtreecommitdiff
path: root/oox/source/shape/ShapeContextHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/shape/ShapeContextHandler.cxx')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx37
1 files changed, 36 insertions, 1 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 9c8da2d0549d..5c1f990a5ab9 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -21,6 +21,7 @@
#include "ShapeContextHandler.hxx"
#include "ShapeDrawingFragmentHandler.hxx"
+#include "LockedCanvasContext.hxx"
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/drawingml/themefragmenthandler.hxx"
@@ -69,6 +70,26 @@ ShapeContextHandler::~ShapeContextHandler()
{
}
+uno::Reference<xml::sax::XFastContextHandler> ShapeContextHandler::getLockedCanvasContext(sal_Int32 nElement)
+{
+ if (!mxLockedCanvasContext.is())
+ {
+ FragmentHandlerRef rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
+ ShapePtr pMasterShape;
+
+ switch (nElement & 0xffff)
+ {
+ case XML_lockedCanvas:
+ mxLockedCanvasContext.set(new LockedCanvasContext(*rFragmentHandler));
+ break;
+ default:
+ break;
+ }
+ }
+
+ return mxLockedCanvasContext;
+}
+
uno::Reference<xml::sax::XFastContextHandler>
ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
{
@@ -140,6 +161,9 @@ ShapeContextHandler::getContextHandler()
case NMSP_dmlDiagram:
xResult.set(getDiagramShapeContext());
break;
+ case NMSP_dmlLockedCanvas:
+ xResult.set(getLockedCanvasContext(mnStartToken));
+ break;
default:
xResult.set(getGraphicShapeContext(mnStartToken));
break;
@@ -164,7 +188,7 @@ void SAL_CALL ShapeContextHandler::startFastElement
mpThemePtr.reset(new Theme());
- if (Element == DGM_TOKEN(relIds))
+ if (Element == DGM_TOKEN(relIds) || Element == LC_TOKEN(lockedCanvas))
{
// Parse the theme relation, if available; the diagram won't have colors without it.
if (!msRelationFragmentPath.isEmpty())
@@ -309,6 +333,17 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
}
mxDiagramShapeContext.clear();
}
+ else if (mxLockedCanvasContext.is())
+ {
+ ShapePtr pShape = dynamic_cast<LockedCanvasContext*>(mxLockedCanvasContext.get())->getShape();
+ if (pShape)
+ {
+ basegfx::B2DHomMatrix aMatrix;
+ pShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes, aMatrix, pShape->getFillProperties());
+ xResult = pShape->getXShape();
+ mxLockedCanvasContext.clear();
+ }
+ }
else if (mpShape.get() != NULL)
{
basegfx::B2DHomMatrix aTransformation;