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 "vbadialog.hxx"
20 #include <ooo/vba/word/WdWordDialog.hpp>
21 #include <unotxdoc.hxx>
23 using namespace ::ooo::vba
;
24 using namespace ::com::sun::star
;
28 struct WordDialogTable
36 const WordDialogTable aWordDialogTable
[] =
38 { word::WdWordDialog::wdDialogFileNew
, ".uno:NewDoc" },
39 { word::WdWordDialog::wdDialogFileOpen
, ".uno:Open" },
40 { word::WdWordDialog::wdDialogFilePrint
, ".uno:Print" },
41 { word::WdWordDialog::wdDialogFileSaveAs
, ".uno:SaveAs" },
45 SwVbaDialog::SwVbaDialog( const css::uno::Reference
< ov::XHelperInterface
>& xParent
,
46 const css::uno::Reference
< css::uno::XComponentContext
> & xContext
,
47 const rtl::Reference
< SwXTextDocument
>& xModel
,
49 : SwVbaDialog_BASE( xParent
, xContext
, nIndex
), m_xModel(xModel
) {}
51 css::uno::Reference
< css::frame::XModel
> SwVbaDialog::getModel() const
53 return static_cast<SfxBaseModel
*>(m_xModel
.get());
57 SwVbaDialog::mapIndexToName( sal_Int32 nIndex
)
59 for (const WordDialogTable
& rTable
: aWordDialogTable
)
61 if( nIndex
== rTable
.wdDialog
)
63 return OUString::createFromAscii( rTable
.ooDialog
);
70 SwVbaDialog::getServiceImplName()
72 return u
"SwVbaDialog"_ustr
;
75 uno::Sequence
< OUString
>
76 SwVbaDialog::getServiceNames()
78 static uno::Sequence
< OUString
> const aServiceNames
80 u
"ooo.vba.word.Dialog"_ustr
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */