1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
22 #include "ShapeContextHandler.hxx"
23 #include "ShapeDrawingFragmentHandler.hxx"
24 #include "LockedCanvasContext.hxx"
25 #include "WpsContext.hxx"
26 #include "WpgContext.hxx"
27 #include "services.hxx"
28 #include "oox/vml/vmldrawingfragment.hxx"
29 #include "oox/vml/vmlshape.hxx"
30 #include "oox/drawingml/themefragmenthandler.hxx"
31 #include <cppuhelper/supportsservice.hxx>
34 namespace oox
{ namespace shape
{
36 using namespace ::com::sun::star
;
38 using namespace drawingml
;
40 OUString SAL_CALL
ShapeContextHandler_getImplementationName()
42 return OUString( "com.sun.star.comp.oox.ShapeContextHandler" );
45 uno::Sequence
< OUString
> SAL_CALL
46 ShapeContextHandler_getSupportedServiceNames()
48 uno::Sequence
< OUString
> s(1);
49 s
[0] = "com.sun.star.xml.sax.FastShapeContextHandler";
53 uno::Reference
< uno::XInterface
> SAL_CALL
54 ShapeContextHandler_createInstance( const uno::Reference
< uno::XComponentContext
> & context
)
55 throw (uno::Exception
)
57 return static_cast< ::cppu::OWeakObject
* >( new ShapeContextHandler(context
) );
60 ShapeContextHandler::ShapeContextHandler
61 (uno::Reference
< uno::XComponentContext
> const & context
) :
62 mnStartToken(0), m_xContext(context
)
66 mxFilterBase
.set( new ShapeFilterBase(context
) );
68 catch( uno::Exception
& )
73 ShapeContextHandler::~ShapeContextHandler()
77 uno::Reference
<xml::sax::XFastContextHandler
> ShapeContextHandler::getLockedCanvasContext(sal_Int32 nElement
)
79 if (!mxLockedCanvasContext
.is())
81 FragmentHandler2Ref
rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
82 ShapePtr pMasterShape
;
84 switch (nElement
& 0xffff)
86 case XML_lockedCanvas
:
87 mxLockedCanvasContext
.set(new LockedCanvasContext(*rFragmentHandler
));
94 return mxLockedCanvasContext
;
98 * This method creates new ChartGraphicDataContext Object.
100 uno::Reference
<xml::sax::XFastContextHandler
> ShapeContextHandler::getChartShapeContext(sal_Int32 nElement
)
102 if (!mxChartShapeContext
.is())
104 switch (nElement
& 0xffff)
108 std::unique_ptr
<ContextHandler2Helper
> pFragmentHandler(
109 new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
110 mpShape
.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
111 mxChartShapeContext
.set(new ChartGraphicDataContext(*pFragmentHandler
, mpShape
, true));
119 return mxChartShapeContext
;
122 uno::Reference
<xml::sax::XFastContextHandler
> ShapeContextHandler::getWpsContext(sal_Int32 nStartElement
, sal_Int32 nElement
)
124 if (!mxWpsContext
.is())
126 FragmentHandler2Ref
rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
127 ShapePtr pMasterShape
;
129 uno::Reference
<drawing::XShape
> xShape
;
130 // No element happens in case of pretty-printed XML, bodyPr is the case when we are called again after <wps:txbx>.
131 if (!nElement
|| nElement
== WPS_TOKEN(bodyPr
))
132 // Assume that this is just a continuation of the previous shape.
133 xShape
= mxSavedShape
;
135 switch (getBaseToken(nStartElement
))
138 mxWpsContext
.set(new WpsContext(*rFragmentHandler
, xShape
));
148 uno::Reference
<xml::sax::XFastContextHandler
> ShapeContextHandler::getWpgContext(sal_Int32 nElement
)
150 if (!mxWpgContext
.is())
152 FragmentHandler2Ref
rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
153 ShapePtr pMasterShape
;
155 switch (getBaseToken(nElement
))
158 mxWpgContext
.set(new WpgContext(*rFragmentHandler
));
168 uno::Reference
<xml::sax::XFastContextHandler
>
169 ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element
)
171 if (! mxGraphicShapeContext
.is())
173 std::shared_ptr
<ContextHandler2Helper
> pFragmentHandler
174 (new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
175 ShapePtr pMasterShape
;
177 switch (Element
& 0xffff)
180 mpShape
.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
181 mxGraphicShapeContext
.set
182 (new GraphicalObjectFrameContext(*pFragmentHandler
, pMasterShape
, mpShape
, true));
185 mpShape
.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
186 mxGraphicShapeContext
.set
187 (new GraphicShapeContext(*pFragmentHandler
, pMasterShape
, mpShape
));
194 return mxGraphicShapeContext
;
197 uno::Reference
<xml::sax::XFastContextHandler
>
198 ShapeContextHandler::getDrawingShapeContext()
200 if (!mxDrawingFragmentHandler
.is())
202 mpDrawing
.reset( new oox::vml::Drawing( *mxFilterBase
, mxDrawPage
, oox::vml::VMLDRAWING_WORD
) );
203 mxDrawingFragmentHandler
.set
204 (dynamic_cast<ContextHandler
*>
205 (new oox::vml::DrawingFragment
206 ( *mxFilterBase
, msRelationFragmentPath
, *mpDrawing
)));
210 // Reset the handler if fragment path has changed
211 OUString sHandlerFragmentPath
= dynamic_cast<ContextHandler
&>(*mxDrawingFragmentHandler
.get()).getFragmentPath();
212 if ( !msRelationFragmentPath
.equals(sHandlerFragmentPath
) )
214 mxDrawingFragmentHandler
.clear();
215 mxDrawingFragmentHandler
.set
216 (dynamic_cast<ContextHandler
*>
217 (new oox::vml::DrawingFragment
218 ( *mxFilterBase
, msRelationFragmentPath
, *mpDrawing
)));
221 return mxDrawingFragmentHandler
;
224 uno::Reference
<xml::sax::XFastContextHandler
>
225 ShapeContextHandler::getDiagramShapeContext()
227 if (!mxDiagramShapeContext
.is())
229 std::shared_ptr
<ContextHandler2Helper
> pFragmentHandler(new ShapeFragmentHandler(*mxFilterBase
, msRelationFragmentPath
));
230 mpShape
.reset(new Shape());
231 mxDiagramShapeContext
.set(new DiagramGraphicDataContext(*pFragmentHandler
, mpShape
));
234 return mxDiagramShapeContext
;
237 uno::Reference
<xml::sax::XFastContextHandler
>
238 ShapeContextHandler::getContextHandler(sal_Int32 nElement
)
240 uno::Reference
<xml::sax::XFastContextHandler
> xResult
;
242 switch (getNamespace( mnStartToken
))
246 xResult
.set(getDrawingShapeContext());
248 case NMSP_dmlDiagram
:
249 xResult
.set(getDiagramShapeContext());
251 case NMSP_dmlLockedCanvas
:
252 xResult
.set(getLockedCanvasContext(mnStartToken
));
255 xResult
.set(getChartShapeContext(mnStartToken
));
258 xResult
.set(getWpsContext(mnStartToken
, nElement
));
261 xResult
.set(getWpgContext(mnStartToken
));
264 xResult
.set(getGraphicShapeContext(mnStartToken
));
271 // ::com::sun::star::xml::sax::XFastContextHandler:
272 void SAL_CALL
ShapeContextHandler::startFastElement
273 (::sal_Int32 Element
,
274 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
275 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
277 static const OUString sInputStream
280 uno::Sequence
<beans::PropertyValue
> aSeq(1);
281 aSeq
[0].Name
= sInputStream
;
282 aSeq
[0].Value
<<= mxInputStream
;
283 mxFilterBase
->filter(aSeq
);
285 mpThemePtr
.reset(new Theme());
287 if (Element
== DGM_TOKEN(relIds
) || Element
== LC_TOKEN(lockedCanvas
) || Element
== C_TOKEN(chart
) ||
288 Element
== WPS_TOKEN(wsp
) || Element
== WPG_TOKEN(wgp
) || Element
== OOX_TOKEN(dmlPicture
, pic
))
290 // Parse the theme relation, if available; the diagram won't have colors without it.
291 if (!msRelationFragmentPath
.isEmpty())
293 // Get Target for Type = "officeDocument" from _rels/.rels file
294 // aOfficeDocumentFragmentPath is pointing to "word/document.xml" for docx & to "ppt/presentation.xml" for pptx
295 FragmentHandlerRef
rFragmentHandlerRef(new ShapeFragmentHandler(*mxFilterBase
, "/"));
296 OUString aOfficeDocumentFragmentPath
= rFragmentHandlerRef
->getFragmentPathFromFirstTypeFromOfficeDoc( "officeDocument" );
298 // Get the theme DO NOT use msRelationFragmentPath for getting theme as for a document there is a single theme in document.xml.rels
299 // and the same is used by header and footer as well.
300 FragmentHandlerRef
rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase
, aOfficeDocumentFragmentPath
));
301 OUString aThemeFragmentPath
= rFragmentHandler
->getFragmentPathFromFirstTypeFromOfficeDoc( "theme" );
303 if(!aThemeFragmentPath
.isEmpty())
305 uno::Reference
<xml::sax::XFastSAXSerializable
> xDoc(mxFilterBase
->importFragment(aThemeFragmentPath
), uno::UNO_QUERY_THROW
);
306 mxFilterBase
->importFragment(new ThemeFragmentHandler(*mxFilterBase
, aThemeFragmentPath
, *mpThemePtr
), xDoc
);
307 ShapeFilterBase
* pShapeFilterBase(dynamic_cast<ShapeFilterBase
*>(mxFilterBase
.get()));
308 if (pShapeFilterBase
)
309 pShapeFilterBase
->setCurrentTheme(mpThemePtr
);
313 createFastChildContext(Element
, Attribs
);
316 // Entering VML block (startFastElement() is called for the outermost tag),
317 // handle possible recursion.
318 if ( getContextHandler() == getDrawingShapeContext() )
319 mpDrawing
->getShapes().pushMark();
321 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
323 if (xContextHandler
.is())
324 xContextHandler
->startFastElement(Element
, Attribs
);
327 void SAL_CALL
ShapeContextHandler::startUnknownElement
328 (const OUString
& Namespace
, const OUString
& Name
,
329 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
330 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
332 if ( getContextHandler() == getDrawingShapeContext() )
333 mpDrawing
->getShapes().pushMark();
335 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
337 if (xContextHandler
.is())
338 xContextHandler
->startUnknownElement(Namespace
, Name
, Attribs
);
341 void SAL_CALL
ShapeContextHandler::endFastElement(::sal_Int32 Element
)
342 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
344 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
346 if (xContextHandler
.is())
347 xContextHandler
->endFastElement(Element
);
348 // In case a textbox is sent, and later we get additional properties for
349 // the textbox, then the wps context is not cleared, so do that here.
350 if (Element
== (NMSP_wps
| XML_wsp
))
352 uno::Reference
<lang::XServiceInfo
> xServiceInfo(mxSavedShape
, uno::UNO_QUERY
);
353 bool bTextFrame
= xServiceInfo
.is() && xServiceInfo
->supportsService("com.sun.star.text.TextFrame");
354 bool bTextBox
= false;
357 uno::Reference
<beans::XPropertySet
> xPropertySet(mxSavedShape
, uno::UNO_QUERY
);
358 if (xPropertySet
.is())
359 xPropertySet
->getPropertyValue("TextBox") >>= bTextBox
;
361 if (bTextFrame
|| bTextBox
)
362 mxWpsContext
.clear();
363 mxSavedShape
.clear();
367 void SAL_CALL
ShapeContextHandler::endUnknownElement
368 (const OUString
& Namespace
,
369 const OUString
& Name
)
370 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
372 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
374 if (xContextHandler
.is())
375 xContextHandler
->endUnknownElement(Namespace
, Name
);
378 uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
379 ShapeContextHandler::createFastChildContext
380 (::sal_Int32 Element
,
381 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
382 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
384 uno::Reference
< xml::sax::XFastContextHandler
> xResult
;
385 uno::Reference
< xml::sax::XFastContextHandler
> xContextHandler(getContextHandler(Element
));
387 if (xContextHandler
.is())
388 xResult
.set(xContextHandler
->createFastChildContext
394 uno::Reference
< xml::sax::XFastContextHandler
> SAL_CALL
395 ShapeContextHandler::createUnknownChildContext
396 (const OUString
& Namespace
,
397 const OUString
& Name
,
398 const uno::Reference
< xml::sax::XFastAttributeList
> & Attribs
)
399 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
401 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
403 if (xContextHandler
.is())
404 return xContextHandler
->createUnknownChildContext
405 (Namespace
, Name
, Attribs
);
407 return uno::Reference
< xml::sax::XFastContextHandler
>();
410 void SAL_CALL
ShapeContextHandler::characters(const OUString
& aChars
)
411 throw (uno::RuntimeException
, xml::sax::SAXException
, std::exception
)
413 uno::Reference
<XFastContextHandler
> xContextHandler(getContextHandler());
415 if (xContextHandler
.is())
416 xContextHandler
->characters(aChars
);
419 // ::com::sun::star::xml::sax::XFastShapeContextHandler:
420 uno::Reference
< drawing::XShape
> SAL_CALL
421 ShapeContextHandler::getShape() throw (uno::RuntimeException
, std::exception
)
423 uno::Reference
< drawing::XShape
> xResult
;
424 uno::Reference
< drawing::XShapes
> xShapes( mxDrawPage
, uno::UNO_QUERY
);
426 if (mxFilterBase
.is() && xShapes
.is())
428 if ( getContextHandler() == getDrawingShapeContext() )
430 mpDrawing
->finalizeFragmentImport();
431 if( std::shared_ptr
< vml::ShapeBase
> pShape
= mpDrawing
->getShapes().takeLastShape() )
432 xResult
= pShape
->convertAndInsert( xShapes
);
433 // Only now remove the recursion mark, because getShape() is called in writerfilter
434 // after endFastElement().
435 mpDrawing
->getShapes().popMark();
437 else if (mxDiagramShapeContext
.is())
439 basegfx::B2DHomMatrix aMatrix
;
440 if (mpShape
->getExtDrawings().size() == 0)
442 mpShape
->addShape( *mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, mpShape
->getFillProperties() );
443 xResult
= mpShape
->getXShape();
447 // Prerendered diagram output is available, then use that, and throw away the original result.
448 for (std::vector
<OUString
>::const_iterator aIt
= mpShape
->getExtDrawings().begin(); aIt
!= mpShape
->getExtDrawings().end(); ++aIt
)
450 DiagramGraphicDataContext
* pDiagramGraphicDataContext
= dynamic_cast<DiagramGraphicDataContext
*>(mxDiagramShapeContext
.get());
451 if (!pDiagramGraphicDataContext
)
453 OUString
aFragmentPath(pDiagramGraphicDataContext
->getFragmentPathFromRelId(*aIt
));
454 oox::drawingml::ShapePtr
pShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) );
455 pShapePtr
->setDiagramType();
456 mxFilterBase
->importFragment(new ShapeDrawingFragmentHandler(*mxFilterBase
, aFragmentPath
, pShapePtr
));
458 uno::Sequence
<beans::PropertyValue
> aValue(mpShape
->getDiagramDoms());
459 uno::Sequence
< uno::Any
> diagramDrawing(2);
460 // drawingValue[0] => dom, drawingValue[1] => Sequence of associated relationships
462 sal_Int32 length
= aValue
.getLength();
463 aValue
.realloc(length
+1);
465 diagramDrawing
[0] = uno::makeAny( mxFilterBase
->importFragment( aFragmentPath
) );
466 diagramDrawing
[1] = uno::makeAny( pShapePtr
->resolveRelationshipsOfTypeFromOfficeDoc(
467 *mxFilterBase
, aFragmentPath
, "image" ) );
469 beans::PropertyValue
* pValue
= aValue
.getArray();
470 pValue
[length
].Name
= "OOXDrawing";
471 pValue
[length
].Value
= uno::makeAny( diagramDrawing
);
473 pShapePtr
->setDiagramDoms( aValue
);
475 pShapePtr
->addShape( *mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, pShapePtr
->getFillProperties() );
476 xResult
= pShapePtr
->getXShape();
478 mpShape
.reset((Shape
*)0);
480 mxDiagramShapeContext
.clear();
482 else if (mxLockedCanvasContext
.is())
484 ShapePtr pShape
= dynamic_cast<LockedCanvasContext
&>(*mxLockedCanvasContext
.get()).getShape();
487 basegfx::B2DHomMatrix aMatrix
;
488 pShape
->addShape(*mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, pShape
->getFillProperties());
489 xResult
= pShape
->getXShape();
490 mxLockedCanvasContext
.clear();
493 //NMSP_dmlChart == getNamespace( mnStartToken ) check is introduced to make sure that
494 //mnStartToken is set as NMSP_dmlChart in setStartToken.
495 //Only in case it is set then only the below block of code for ChartShapeContext should be executed.
496 else if (mxChartShapeContext
.is() && (NMSP_dmlChart
== getNamespace( mnStartToken
)))
498 ChartGraphicDataContext
* pChartGraphicDataContext
= dynamic_cast<ChartGraphicDataContext
*>(mxChartShapeContext
.get());
499 if (pChartGraphicDataContext
)
501 basegfx::B2DHomMatrix aMatrix
;
502 oox::drawingml::ShapePtr
xShapePtr( pChartGraphicDataContext
->getShape());
503 // See SwXTextDocument::createInstance(), ODF import uses the same hack.
504 xShapePtr
->setServiceName("com.sun.star.drawing.temporaryForXMLImportOLE2Shape");
505 xShapePtr
->addShape( *mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, xShapePtr
->getFillProperties() );
506 xResult
= xShapePtr
->getXShape();
508 mxChartShapeContext
.clear();
510 else if (mxWpsContext
.is())
512 ShapePtr pShape
= dynamic_cast<WpsContext
&>(*mxWpsContext
.get()).getShape();
515 basegfx::B2DHomMatrix aMatrix
;
516 pShape
->setPosition(maPosition
);
517 pShape
->addShape(*mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, pShape
->getFillProperties());
518 xResult
= pShape
->getXShape();
519 mxSavedShape
= xResult
;
520 mxWpsContext
.clear();
523 else if (mxWpgContext
.is())
525 ShapePtr pShape
= dynamic_cast<WpgContext
&>(*mxWpgContext
.get()).getShape();
528 basegfx::B2DHomMatrix aMatrix
;
529 pShape
->setPosition(maPosition
);
530 pShape
->addShape(*mxFilterBase
, mpThemePtr
.get(), xShapes
, aMatrix
, pShape
->getFillProperties());
531 xResult
= pShape
->getXShape();
532 mxWpgContext
.clear();
535 else if (mpShape
.get() != NULL
)
537 basegfx::B2DHomMatrix aTransformation
;
538 mpShape
->addShape(*mxFilterBase
, mpThemePtr
.get(), xShapes
, aTransformation
, mpShape
->getFillProperties() );
539 xResult
.set(mpShape
->getXShape());
540 mxGraphicShapeContext
.clear( );
547 css::uno::Reference
< css::drawing::XDrawPage
> SAL_CALL
548 ShapeContextHandler::getDrawPage() throw (css::uno::RuntimeException
, std::exception
)
553 void SAL_CALL
ShapeContextHandler::setDrawPage
554 (const css::uno::Reference
< css::drawing::XDrawPage
> & the_value
)
555 throw (css::uno::RuntimeException
, std::exception
)
557 mxDrawPage
= the_value
;
560 css::uno::Reference
< css::frame::XModel
> SAL_CALL
561 ShapeContextHandler::getModel() throw (css::uno::RuntimeException
, std::exception
)
563 if( !mxFilterBase
.is() )
564 throw uno::RuntimeException();
565 return mxFilterBase
->getModel();
568 void SAL_CALL
ShapeContextHandler::setModel
569 (const css::uno::Reference
< css::frame::XModel
> & the_value
)
570 throw (css::uno::RuntimeException
, std::exception
)
572 if( !mxFilterBase
.is() )
573 throw uno::RuntimeException();
574 uno::Reference
<lang::XComponent
> xComp(the_value
, uno::UNO_QUERY_THROW
);
575 mxFilterBase
->setTargetDocument(xComp
);
578 uno::Reference
< io::XInputStream
> SAL_CALL
579 ShapeContextHandler::getInputStream() throw (uno::RuntimeException
, std::exception
)
581 return mxInputStream
;
584 void SAL_CALL
ShapeContextHandler::setInputStream
585 (const uno::Reference
< io::XInputStream
> & the_value
)
586 throw (uno::RuntimeException
, std::exception
)
588 mxInputStream
= the_value
;
591 OUString SAL_CALL
ShapeContextHandler::getRelationFragmentPath()
592 throw (uno::RuntimeException
, std::exception
)
594 return msRelationFragmentPath
;
597 void SAL_CALL
ShapeContextHandler::setRelationFragmentPath(const OUString
& the_value
)
598 throw (uno::RuntimeException
, std::exception
)
600 msRelationFragmentPath
= the_value
;
603 ::sal_Int32 SAL_CALL
ShapeContextHandler::getStartToken() throw (::com::sun::star::uno::RuntimeException
, std::exception
)
608 void SAL_CALL
ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken
) throw (::com::sun::star::uno::RuntimeException
, std::exception
)
610 mnStartToken
= _starttoken
;
613 awt::Point SAL_CALL
ShapeContextHandler::getPosition() throw (uno::RuntimeException
, std::exception
)
618 void SAL_CALL
ShapeContextHandler::setPosition(const awt::Point
& rPosition
) throw (uno::RuntimeException
, std::exception
)
620 maPosition
= rPosition
;
623 void SAL_CALL
ShapeContextHandler::setDocumentProperties(const uno::Reference
<document::XDocumentProperties
>& xDocProps
)
624 throw (css::uno::RuntimeException
, std::exception
)
626 mxDocumentProperties
= xDocProps
;
627 mxFilterBase
->checkDocumentProperties(mxDocumentProperties
);
630 uno::Reference
<document::XDocumentProperties
> SAL_CALL
ShapeContextHandler::getDocumentProperties()
631 throw (css::uno::RuntimeException
, std::exception
)
633 return mxDocumentProperties
;
636 OUString
ShapeContextHandler::getImplementationName()
637 throw (css::uno::RuntimeException
, std::exception
)
639 return ShapeContextHandler_getImplementationName();
642 uno::Sequence
< OUString
> ShapeContextHandler::getSupportedServiceNames()
643 throw (css::uno::RuntimeException
, std::exception
)
645 return ShapeContextHandler_getSupportedServiceNames();
648 sal_Bool SAL_CALL
ShapeContextHandler::supportsService(const OUString
& ServiceName
)
649 throw (css::uno::RuntimeException
, std::exception
)
651 return cppu::supportsService(this, ServiceName
);
656 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */