Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <sal/macros.h>
30 : : #include <svx/fmdmod.hxx>
31 : : #include "fmservs.hxx"
32 : : #include <fmobj.hxx>
33 : : #include <svx/unoshape.hxx>
34 : : #include <comphelper/processfactory.hxx>
35 : : #include <svx/fmglob.hxx>
36 : :
37 : : using namespace ::svxform;
38 : :
39 : : //-----------------------------------------------------------------------------
40 : 90480 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const ::rtl::OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
41 : : {
42 : 90480 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet;
43 [ + + ]: 90480 : if ( ServiceSpecifier.indexOf( "com.sun.star.form.component." ) == 0 )
44 : : {
45 [ + - ][ + - ]: 520 : xRet = ::comphelper::getProcessServiceFactory()->createInstance(ServiceSpecifier);
[ + - ][ + - ]
46 : : }
47 [ + + ]: 89960 : else if ( ServiceSpecifier == "com.sun.star.drawing.ControlShape" )
48 : : {
49 [ + - ][ + - ]: 534 : SdrObject* pObj = new FmFormObj();
50 [ + - ][ + - ]: 534 : xRet = static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new SvxShapeControl(pObj)));
51 : : }
52 [ + + ]: 90480 : if (!xRet.is())
53 [ + + ][ + - ]: 89426 : xRet = SvxUnoDrawMSFactory::createInstance(ServiceSpecifier);
54 : 90480 : return xRet;
55 : : }
56 : :
57 : : //-----------------------------------------------------------------------------
58 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstanceWithArguments(const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
59 : : {
60 : 0 : return SvxUnoDrawMSFactory::createInstanceWithArguments(ServiceSpecifier, Arguments );
61 : : }
62 : :
63 : : //-----------------------------------------------------------------------------
64 : 129 : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL SvxFmMSFactory::getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException )
65 : : {
66 : : static const ::rtl::OUString aSvxComponentServiceNameList[] =
67 : : {
68 : : FM_SUN_COMPONENT_TEXTFIELD,
69 : : FM_SUN_COMPONENT_FORM,
70 : : FM_SUN_COMPONENT_LISTBOX,
71 : : FM_SUN_COMPONENT_COMBOBOX,
72 : : FM_SUN_COMPONENT_RADIOBUTTON,
73 : : FM_SUN_COMPONENT_GROUPBOX,
74 : : FM_SUN_COMPONENT_FIXEDTEXT,
75 : : FM_SUN_COMPONENT_COMMANDBUTTON,
76 : : FM_SUN_COMPONENT_CHECKBOX,
77 : : FM_SUN_COMPONENT_GRIDCONTROL,
78 : : FM_SUN_COMPONENT_IMAGEBUTTON,
79 : : FM_SUN_COMPONENT_FILECONTROL,
80 : : FM_SUN_COMPONENT_TIMEFIELD,
81 : : FM_SUN_COMPONENT_DATEFIELD,
82 : : FM_SUN_COMPONENT_NUMERICFIELD,
83 : : FM_SUN_COMPONENT_CURRENCYFIELD,
84 : : FM_SUN_COMPONENT_PATTERNFIELD,
85 : : FM_SUN_COMPONENT_HIDDENCONTROL,
86 : : FM_SUN_COMPONENT_IMAGECONTROL
87 [ + + ][ + - ]: 549 : };
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ # #
# # # # ]
[ + + ]
88 : :
89 : : static const sal_uInt16 nSvxComponentServiceNameListCount = sizeof(aSvxComponentServiceNameList) / sizeof ( aSvxComponentServiceNameList[0] );
90 : :
91 [ + - ]: 129 : ::com::sun::star::uno::Sequence< ::rtl::OUString > aSeq( nSvxComponentServiceNameListCount );
92 [ + - ]: 129 : ::rtl::OUString* pStrings = aSeq.getArray();
93 [ + + ]: 2580 : for( sal_uInt16 nIdx = 0; nIdx < nSvxComponentServiceNameListCount; nIdx++ )
94 : 2451 : pStrings[nIdx] = aSvxComponentServiceNameList[nIdx];
95 : :
96 [ + - ]: 129 : ::com::sun::star::uno::Sequence< ::rtl::OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() );
97 [ + - ][ + - ]: 129 : return concatServiceNames( aParentSeq, aSeq );
98 : : }
99 : :
100 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|