13#include <com/sun/star/drawing/XShape.hpp>
14#include <com/sun/star/lang/XComponent.hpp>
15#include <com/sun/star/lang/XMultiServiceFactory.hpp>
16#include <com/sun/star/beans/PropertyVetoException.hpp>
18#include <com/sun/star/uno/Reference.hxx>
24uno::Reference<drawing::XShape>
26 const sal_Int32 nX,
const sal_Int32 nY,
const sal_Int32 nWidth,
27 const sal_Int32 nHeight)
29 return createShape(r_xComponent,
u"Ellipse", nX, nY, nWidth, nHeight);
32uno::Reference<drawing::XShape>
34 const sal_Int32 nX,
const sal_Int32 nY,
const sal_Int32 nWidth,
35 const sal_Int32 nHeight)
37 return createShape(r_xComponent,
u"Line", nX, nY, nWidth, nHeight);
40uno::Reference<drawing::XShape>
42 const sal_Int32 nX,
const sal_Int32 nY,
43 const sal_Int32 nWidth,
const sal_Int32 nHeight)
45 return createShape(r_xComponent,
u"Rectangle", nX, nY, nWidth, nHeight);
49createShape(
const uno::Reference<lang::XComponent>& r_xComponent, std::u16string_view r_aKind,
50 const sal_Int32 nX,
const sal_Int32 nY,
const sal_Int32 nWidth,
const sal_Int32 nHeight)
52 uno::Reference<lang::XMultiServiceFactory> xMSF(r_xComponent, uno::UNO_QUERY_THROW);
53 uno::Reference<drawing::XShape> xShape(
54 xMSF->createInstance(OUString::Concat(
"com.sun.star.drawing.") + r_aKind +
"Shape"),
55 uno::UNO_QUERY_THROW);
59 xShape->setPosition(awt::Point(nX, nY));
60 xShape->setSize(awt::Size(nWidth, nHeight));
62 catch (
const beans::PropertyVetoException&)
uno::Reference< drawing::XShape > OOO_DLLPUBLIC_TEST createLine(const uno::Reference< lang::XComponent > &r_xComponent, const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight)
uno::Reference< drawing::XShape > OOO_DLLPUBLIC_TEST createShape(const uno::Reference< lang::XComponent > &r_xComponent, std::u16string_view r_aKind, const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight)
uno::Reference< drawing::XShape > OOO_DLLPUBLIC_TEST createEllipse(const uno::Reference< lang::XComponent > &r_xComponent, const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight)
uno::Reference< drawing::XShape > OOO_DLLPUBLIC_TEST createRectangle(const uno::Reference< lang::XComponent > &r_xComponent, const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight)
#define OOO_DLLPUBLIC_TEST