bump product version to 6.3.0.0.beta1
[LibreOffice.git] / reportdesign / source / ui / report / dlgedfac.cxx
blob22af5dfb1f33def9de5da104fa4173b72f228910
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/container/XNameContainer.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/awt/ScrollBarOrientation.hpp>
28 #include <svx/svdoole2.hxx>
29 namespace rptui
31 using namespace ::com::sun::star;
34 DlgEdFactory::DlgEdFactory()
36 SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
40 DlgEdFactory::~DlgEdFactory() COVERITY_NOEXCEPT_FALSE
42 SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
46 IMPL_STATIC_LINK(
47 DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
49 SdrObject* pNewObj = nullptr;
51 if ( aParams.nInventor == SdrInventor::ReportDesign )
53 switch( aParams.nObjIdentifier )
55 case OBJ_DLG_FIXEDTEXT:
56 pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT
57 ,OUString("com.sun.star.form.component.FixedText")
58 ,OBJ_DLG_FIXEDTEXT);
59 break;
60 case OBJ_DLG_IMAGECONTROL:
61 pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL
62 ,OUString("com.sun.star.form.component.DatabaseImageControl")
63 ,OBJ_DLG_IMAGECONTROL);
64 break;
65 case OBJ_DLG_FORMATTEDFIELD:
66 pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD
67 ,OUString("com.sun.star.form.component.FormattedField")
68 ,OBJ_DLG_FORMATTEDFIELD);
69 break;
70 case OBJ_DLG_VFIXEDLINE:
71 case OBJ_DLG_HFIXEDLINE:
73 OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE
74 ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
75 ,aParams.nObjIdentifier);
76 pNewObj = pObj;
77 if ( aParams.nObjIdentifier == OBJ_DLG_HFIXEDLINE )
79 uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
80 xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
83 break;
84 case OBJ_CUSTOMSHAPE:
85 pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE);
86 break;
87 case OBJ_DLG_SUBREPORT:
88 pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_DLG_SUBREPORT);
89 break;
90 case OBJ_OLE2:
91 pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", OBJ_OLE2);
92 break;
93 default:
94 OSL_FAIL("Unknown object id");
95 break;
98 return pNewObj;
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */