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 "vbasection.hxx"
21 #include <vbahelper/vbahelper.hxx>
22 #include "vbapagesetup.hxx"
23 #include "vbaheadersfooters.hxx"
25 using namespace ::ooo::vba
;
26 using namespace ::com::sun::star
;
28 SwVbaSection::SwVbaSection( const uno::Reference
< ooo::vba::XHelperInterface
>& rParent
, const uno::Reference
< uno::XComponentContext
>& rContext
, uno::Reference
< frame::XModel
> xModel
, uno::Reference
< beans::XPropertySet
> xProps
) :
29 SwVbaSection_BASE( rParent
, rContext
), mxModel(std::move( xModel
)), mxPageProps(std::move( xProps
))
33 SwVbaSection::~SwVbaSection()
37 sal_Bool SAL_CALL
SwVbaSection::getProtectedForForms()
42 void SAL_CALL
SwVbaSection::setProtectedForForms( sal_Bool
/*_protectedforforms*/ )
46 uno::Any SAL_CALL
SwVbaSection::Headers( const uno::Any
& index
)
48 uno::Reference
< XCollection
> xCol( new SwVbaHeadersFooters( this, mxContext
, mxModel
, mxPageProps
, true ) );
49 if ( index
.hasValue() )
50 return xCol
->Item( index
, uno::Any() );
51 return uno::Any( xCol
);
54 uno::Any SAL_CALL
SwVbaSection::Footers( const uno::Any
& index
)
56 uno::Reference
< XCollection
> xCol( new SwVbaHeadersFooters( this, mxContext
, mxModel
, mxPageProps
, false ) );
57 if ( index
.hasValue() )
58 return xCol
->Item( index
, uno::Any() );
59 return uno::Any( xCol
);
63 SwVbaSection::PageSetup( )
65 return uno::Any( uno::Reference
< word::XPageSetup
>( new SwVbaPageSetup( this, mxContext
, mxModel
, mxPageProps
) ) );
69 SwVbaSection::getServiceImplName()
71 return "SwVbaSection";
74 uno::Sequence
< OUString
>
75 SwVbaSection::getServiceNames()
77 static uno::Sequence
< OUString
> const aServiceNames
79 "ooo.vba.word.Section"
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */