sc: factor out some more code
[LibreOffice.git] / sw / source / ui / vba / vbadialogs.cxx
blob60adb7885fffbba8aafad1c3dff18d05a9bce237
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <ooo/vba/word/XDialog.hpp>
20 #include "vbadialogs.hxx"
21 #include "vbadialog.hxx"
22 #include <unotxdoc.hxx>
24 using namespace ::ooo::vba;
25 using namespace ::com::sun::star;
27 SwVbaDialogs::SwVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent,
28 const css::uno::Reference< css::uno::XComponentContext > &xContext,
29 const rtl::Reference< SwXTextDocument >& xModel )
30 : SwVbaDialogs_BASE( xParent, xContext ), m_xModel(xModel) {}
32 uno::Any
33 SwVbaDialogs::Item( const uno::Any &aItem )
35 sal_Int32 nIndex = 0;
36 aItem >>= nIndex;
37 uno::Reference< word::XDialog > aDialog( new SwVbaDialog( uno::Reference< XHelperInterface >( Application(),uno::UNO_QUERY_THROW ), mxContext, m_xModel, nIndex ) );
38 return uno::Any( aDialog );
41 OUString
42 SwVbaDialogs::getServiceImplName()
44 return u"SwVbaDialogs"_ustr;
47 uno::Sequence< OUString >
48 SwVbaDialogs::getServiceNames()
50 static uno::Sequence< OUString > const aServiceNames
52 u"ooo.vba.word.Dialogs"_ustr
54 return aServiceNames;
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */