Use o3tl::convert in Math
[LibreOffice.git] / reportdesign / source / ui / report / dlgedfac.cxx
blobceb2d6402ee52d1084d0f679aeb6aeca7e3ab493
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
22 #include <RptDef.hxx>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <osl/diagnose.h>
26 namespace rptui
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) );
43 IMPL_STATIC_LINK(
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")
55 ,OBJ_RD_FIXEDTEXT);
56 break;
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);
61 break;
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);
66 break;
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);
73 pNewObj = pObj;
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)) );
80 break;
81 case OBJ_CUSTOMSHAPE:
82 pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE);
83 break;
84 case OBJ_RD_SUBREPORT:
85 pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_RD_SUBREPORT);
86 break;
87 case OBJ_OLE2:
88 pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", OBJ_OLE2);
89 break;
90 default:
91 OSL_FAIL("Unknown object id");
92 break;
95 return pNewObj;
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */