LibreOffice Module sw (master) 1
vbasection.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#include "vbasection.hxx"
20#include <utility>
22#include "vbapagesetup.hxx"
23#include "vbaheadersfooters.hxx"
24
25using namespace ::ooo::vba;
26using namespace ::com::sun::star;
27
28SwVbaSection::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 ))
30{
31}
32
34{
35}
36
38{
39 return false;
40}
41
42void SAL_CALL SwVbaSection::setProtectedForForms( sal_Bool /*_protectedforforms*/ )
43{
44}
45
46uno::Any SAL_CALL SwVbaSection::Headers( const uno::Any& index )
47{
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 );
52}
53
54uno::Any SAL_CALL SwVbaSection::Footers( const uno::Any& index )
55{
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 );
60}
61
62uno::Any SAL_CALL
64{
65 return uno::Any( uno::Reference< word::XPageSetup >( new SwVbaPageSetup( this, mxContext, mxModel, mxPageProps ) ) );
66}
67
68OUString
70{
71 return "SwVbaSection";
72}
73
74uno::Sequence< OUString >
76{
77 static uno::Sequence< OUString > const aServiceNames
78 {
79 "ooo.vba.word.Section"
80 };
81 return aServiceNames;
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::frame::XModel2 > mxModel
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual sal_Bool SAL_CALL getProtectedForForms() override
Definition: vbasection.cxx:37
css::uno::Reference< css::beans::XPropertySet > mxPageProps
Definition: vbasection.hxx:31
css::uno::Reference< css::frame::XModel > mxModel
Definition: vbasection.hxx:30
virtual void SAL_CALL setProtectedForForms(sal_Bool _protectedforforms) override
Definition: vbasection.cxx:42
SwVbaSection(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::frame::XModel > xModel, css::uno::Reference< css::beans::XPropertySet > xProps)
Definition: vbasection.cxx:28
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbasection.cxx:75
virtual css::uno::Any SAL_CALL PageSetup() override
Definition: vbasection.cxx:63
virtual css::uno::Any SAL_CALL Headers(const css::uno::Any &index) override
Definition: vbasection.cxx:46
virtual OUString getServiceImplName() override
Definition: vbasection.cxx:69
virtual css::uno::Any SAL_CALL Footers(const css::uno::Any &index) override
Definition: vbasection.cxx:54
virtual ~SwVbaSection() override
Definition: vbasection.cxx:33
Sequence< OUString > aServiceNames
index
Reference< XModel > xModel
unsigned char sal_Bool