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>
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <osl/diagnose.h>
27 using namespace ::com::sun::star
;
30 DlgEdFactory::DlgEdFactory()
32 SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
36 DlgEdFactory::~DlgEdFactory() COVERITY_NOEXCEPT_FALSE
38 SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory
, MakeObject
) );
43 DlgEdFactory
, MakeObject
, SdrObjCreatorParams
, aParams
, rtl::Reference
<SdrObject
> )
45 rtl::Reference
<SdrObject
> pNewObj
;
47 if ( aParams
.nInventor
== SdrInventor::ReportDesign
)
49 switch( aParams
.nObjIdentifier
)
51 case SdrObjKind::ReportDesignFixedText
:
52 pNewObj
= new OUnoObject(aParams
.rSdrModel
53 ,u
"com.sun.star.form.component.FixedText"_ustr
54 ,SdrObjKind::ReportDesignFixedText
);
56 case SdrObjKind::ReportDesignImageControl
:
57 pNewObj
= new OUnoObject(aParams
.rSdrModel
58 ,u
"com.sun.star.form.component.DatabaseImageControl"_ustr
59 ,SdrObjKind::ReportDesignImageControl
);
61 case SdrObjKind::ReportDesignFormattedField
:
62 pNewObj
= new OUnoObject(aParams
.rSdrModel
63 ,u
"com.sun.star.form.component.FormattedField"_ustr
64 ,SdrObjKind::ReportDesignFormattedField
);
66 case SdrObjKind::ReportDesignVerticalFixedLine
:
67 case SdrObjKind::ReportDesignHorizontalFixedLine
:
69 rtl::Reference
<OUnoObject
> pObj
= new OUnoObject(aParams
.rSdrModel
70 ,u
"com.sun.star.awt.UnoControlFixedLineModel"_ustr
71 ,aParams
.nObjIdentifier
);
73 if ( aParams
.nObjIdentifier
== SdrObjKind::ReportDesignHorizontalFixedLine
)
75 uno::Reference
<beans::XPropertySet
> xProp
= pObj
->getAwtComponent();
76 xProp
->setPropertyValue( PROPERTY_ORIENTATION
, uno::Any(sal_Int32(0)) );
80 case SdrObjKind::CustomShape
:
81 pNewObj
= new OCustomShape(aParams
.rSdrModel
);
83 case SdrObjKind::ReportDesignSubReport
:
84 pNewObj
= new OOle2Obj(aParams
.rSdrModel
, SdrObjKind::ReportDesignSubReport
);
86 case SdrObjKind::OLE2
:
87 pNewObj
= new OOle2Obj(aParams
.rSdrModel
, SdrObjKind::OLE2
);
90 OSL_FAIL("Unknown object id");
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */