xref: /aoo41x/main/sw/source/ui/vba/vbasection.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #include "vbasection.hxx"
28 #include <vbahelper/vbahelper.hxx>
29 #include <tools/diagnose_ex.h>
30 #include "vbapagesetup.hxx"
31 
32 using namespace ::ooo::vba;
33 using namespace ::com::sun::star;
34 
35 SwVbaSection::SwVbaSection( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xProps ) throw ( uno::RuntimeException ) :
36     SwVbaSection_BASE( rParent, rContext ), mxModel( xModel ), mxPageProps( xProps )
37 {
38 }
39 
40 SwVbaSection::~SwVbaSection()
41 {
42 }
43 
44 ::sal_Bool SAL_CALL SwVbaSection::getProtectedForForms() throw (uno::RuntimeException)
45 {
46     return sal_False;
47 }
48 
49 void SAL_CALL SwVbaSection::setProtectedForForms( ::sal_Bool /*_protectedforforms*/ ) throw (uno::RuntimeException)
50 {
51 }
52 
53 uno::Any SAL_CALL SwVbaSection::Headers(  ) throw (uno::RuntimeException)
54 {
55     return uno::Any();
56 }
57 
58 uno::Any SAL_CALL SwVbaSection::Footers(  ) throw (uno::RuntimeException)
59 {
60     return uno::Any();
61 }
62 
63 uno::Any SAL_CALL
64 SwVbaSection::PageSetup( ) throw (uno::RuntimeException)
65 {
66     return uno::makeAny( uno::Reference< word::XPageSetup >( new SwVbaPageSetup( this, mxContext, mxModel, mxPageProps ) ) );
67 }
68 
69 rtl::OUString&
70 SwVbaSection::getServiceImplName()
71 {
72 	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaSection") );
73 	return sImplName;
74 }
75 
76 uno::Sequence< rtl::OUString >
77 SwVbaSection::getServiceNames()
78 {
79 	static uno::Sequence< rtl::OUString > aServiceNames;
80 	if ( aServiceNames.getLength() == 0 )
81 	{
82 		aServiceNames.realloc( 1 );
83 		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Section" ) );
84 	}
85 	return aServiceNames;
86 }
87 
88