1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23 #include "vbasection.hxx"
24 #include <vbahelper/vbahelper.hxx>
25 #include <tools/diagnose_ex.h>
26 #include "vbapagesetup.hxx"
27
28 using namespace ::ooo::vba;
29 using namespace ::com::sun::star;
30
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)31 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 ) :
32 SwVbaSection_BASE( rParent, rContext ), mxModel( xModel ), mxPageProps( xProps )
33 {
34 }
35
~SwVbaSection()36 SwVbaSection::~SwVbaSection()
37 {
38 }
39
getProtectedForForms()40 ::sal_Bool SAL_CALL SwVbaSection::getProtectedForForms() throw (uno::RuntimeException)
41 {
42 return sal_False;
43 }
44
setProtectedForForms(::sal_Bool)45 void SAL_CALL SwVbaSection::setProtectedForForms( ::sal_Bool /*_protectedforforms*/ ) throw (uno::RuntimeException)
46 {
47 }
48
Headers()49 uno::Any SAL_CALL SwVbaSection::Headers( ) throw (uno::RuntimeException)
50 {
51 return uno::Any();
52 }
53
Footers()54 uno::Any SAL_CALL SwVbaSection::Footers( ) throw (uno::RuntimeException)
55 {
56 return uno::Any();
57 }
58
59 uno::Any SAL_CALL
PageSetup()60 SwVbaSection::PageSetup( ) throw (uno::RuntimeException)
61 {
62 return uno::makeAny( uno::Reference< word::XPageSetup >( new SwVbaPageSetup( this, mxContext, mxModel, mxPageProps ) ) );
63 }
64
65 rtl::OUString&
getServiceImplName()66 SwVbaSection::getServiceImplName()
67 {
68 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaSection") );
69 return sImplName;
70 }
71
72 uno::Sequence< rtl::OUString >
getServiceNames()73 SwVbaSection::getServiceNames()
74 {
75 static uno::Sequence< rtl::OUString > aServiceNames;
76 if ( aServiceNames.getLength() == 0 )
77 {
78 aServiceNames.realloc( 1 );
79 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Section" ) );
80 }
81 return aServiceNames;
82 }
83
84