merge the formfield patch from ooo-build
[ooovba.git] / svx / source / unodraw / unodtabl.cxx
blobb23dc0e6b3c98130589a73031241c241b2f65993
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unodtabl.cxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <com/sun/star/drawing/LineDash.hpp>
34 #include <svtools/itempool.hxx>
35 #include <svtools/itemset.hxx>
37 #include <vector>
38 #include "UnoNameItemTable.hxx"
39 #include <svx/xlndsit.hxx>
40 #include <svx/unomid.hxx>
42 #include <svx/xdash.hxx>
43 #include <svx/svdmodel.hxx>
44 #include "unofill.hxx"
46 using namespace ::com::sun::star;
47 using namespace ::rtl;
48 using namespace ::cppu;
50 class SvxUnoDashTable : public SvxUnoNameItemTable
52 public:
53 SvxUnoDashTable( SdrModel* pModel ) throw();
54 virtual ~SvxUnoDashTable() throw();
56 virtual NameOrIndex* createItem() const throw();
58 // XServiceInfo
59 virtual OUString SAL_CALL getImplementationName( ) throw( uno::RuntimeException );
60 virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw( uno::RuntimeException);
62 // XElementAccess
63 virtual uno::Type SAL_CALL getElementType( ) throw( uno::RuntimeException);
66 SvxUnoDashTable::SvxUnoDashTable( SdrModel* pModel ) throw()
67 : SvxUnoNameItemTable( pModel, XATTR_LINEDASH, MID_LINEDASH )
71 SvxUnoDashTable::~SvxUnoDashTable() throw()
75 OUString SAL_CALL SvxUnoDashTable::getImplementationName() throw( uno::RuntimeException )
77 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoDashTable") );
80 uno::Sequence< OUString > SAL_CALL SvxUnoDashTable::getSupportedServiceNames( )
81 throw( uno::RuntimeException )
83 uno::Sequence< OUString > aSNS( 1 );
84 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable" ));
85 return aSNS;
88 NameOrIndex* SvxUnoDashTable::createItem() const throw()
90 XLineDashItem* pNewItem = new XLineDashItem();
91 pNewItem->SetWhich( XATTR_LINEDASH ); // set which id for pooling
92 return pNewItem;
95 // XElementAccess
96 uno::Type SAL_CALL SvxUnoDashTable::getElementType( )
97 throw( uno::RuntimeException )
99 return ::getCppuType((const struct drawing::LineDash*)0);
103 * Create a gradienttable
105 uno::Reference< uno::XInterface > SAL_CALL SvxUnoDashTable_createInstance( SdrModel* pModel )
107 return *new SvxUnoDashTable(pModel);