bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / source / ui / report / dlgedfac.cxx
blobb9b4a02f0d5fd6c2b40bf836d62f56a5b200ef25
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 "uistrings.hrc"
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;
35 DlgEdFactory::DlgEdFactory()
37 SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
42 DlgEdFactory::~DlgEdFactory()
44 SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
49 IMPL_STATIC_LINK(
50 DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
52 if ( pObjFactory->nInventor == ReportInventor )
54 switch( pObjFactory->nIdentifier )
56 case OBJ_DLG_FIXEDTEXT:
57 pObjFactory->pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
58 ,OUString("com.sun.star.form.component.FixedText")
59 ,OBJ_DLG_FIXEDTEXT);
60 break;
61 case OBJ_DLG_IMAGECONTROL:
62 pObjFactory->pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
63 ,OUString("com.sun.star.form.component.DatabaseImageControl")
64 ,OBJ_DLG_IMAGECONTROL);
65 break;
66 case OBJ_DLG_FORMATTEDFIELD:
67 pObjFactory->pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
68 ,OUString("com.sun.star.form.component.FormattedField")
69 ,OBJ_DLG_FORMATTEDFIELD);
70 break;
71 case OBJ_DLG_VFIXEDLINE:
72 case OBJ_DLG_HFIXEDLINE:
74 OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
75 ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
76 ,pObjFactory->nIdentifier);
77 pObjFactory->pNewObj = pObj;
78 if ( pObjFactory->nIdentifier == OBJ_DLG_HFIXEDLINE )
80 uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
81 xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
84 break;
85 case OBJ_CUSTOMSHAPE:
86 pObjFactory->pNewObj = new OCustomShape(SERVICE_SHAPE);
87 break;
88 case OBJ_DLG_SUBREPORT:
89 pObjFactory->pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
90 break;
91 case OBJ_OLE2:
92 pObjFactory->pNewObj = new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
93 break;
94 default:
95 OSL_FAIL("Unknown object id");
96 break;
100 return 0;
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */