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 .
19 #include <dlgedfac.hxx>
20 #include <strings.hxx>
21 #include <RptObject.hxx>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <osl/diagnose.h>
28 using namespace ::com::sun::star
;
31 DlgEdFactory::DlgEdFactory()
33 SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
37 DlgEdFactory::~DlgEdFactory() COVERITY_NOEXCEPT_FALSE
39 SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
44 DlgEdFactory
, MakeObject
, SdrObjCreatorParams
, aParams
, SdrObject
* )
46 SdrObject
* pNewObj
= nullptr;
48 if ( aParams
.nInventor
== SdrInventor::ReportDesign
)
50 switch( aParams
.nObjIdentifier
)
52 case OBJ_RD_FIXEDTEXT
:
53 pNewObj
= new OUnoObject(aParams
.rSdrModel
, SERVICE_FIXEDTEXT
54 ,OUString("com.sun.star.form.component.FixedText")
57 case OBJ_RD_IMAGECONTROL
:
58 pNewObj
= new OUnoObject(aParams
.rSdrModel
, SERVICE_IMAGECONTROL
59 ,OUString("com.sun.star.form.component.DatabaseImageControl")
60 ,OBJ_RD_IMAGECONTROL
);
62 case OBJ_RD_FORMATTEDFIELD
:
63 pNewObj
= new OUnoObject(aParams
.rSdrModel
, SERVICE_FORMATTEDFIELD
64 ,OUString("com.sun.star.form.component.FormattedField")
65 ,OBJ_RD_FORMATTEDFIELD
);
67 case OBJ_RD_VFIXEDLINE
:
68 case OBJ_RD_HFIXEDLINE
:
70 OUnoObject
* pObj
= new OUnoObject(aParams
.rSdrModel
, SERVICE_FIXEDLINE
71 ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
72 ,aParams
.nObjIdentifier
);
74 if ( aParams
.nObjIdentifier
== OBJ_RD_HFIXEDLINE
)
76 uno::Reference
<beans::XPropertySet
> xProp
= pObj
->getAwtComponent();
77 xProp
->setPropertyValue( PROPERTY_ORIENTATION
, uno::makeAny(sal_Int32(0)) );
82 pNewObj
= new OCustomShape(aParams
.rSdrModel
, SERVICE_SHAPE
);
84 case OBJ_RD_SUBREPORT
:
85 pNewObj
= new OOle2Obj(aParams
.rSdrModel
, SERVICE_REPORTDEFINITION
, OBJ_RD_SUBREPORT
);
88 pNewObj
= new OOle2Obj(aParams
.rSdrModel
, "com.sun.star.chart2.ChartDocument", OBJ_OLE2
);
91 OSL_FAIL("Unknown object id");
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */