tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / miscdlgs / namecrea.cxx
blob269da6efb1cfeaa2fdecf4150ea158b19a41b2d1
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 .
20 #undef SC_DLLIMPLEMENTATION
22 #include <namecrea.hxx>
24 ScNameCreateDlg::ScNameCreateDlg(weld::Window* pParent, CreateNameFlags nFlags)
25 : GenericDialogController(pParent, u"modules/scalc/ui/createnamesdialog.ui"_ustr,
26 u"CreateNamesDialog"_ustr)
27 , m_xTopBox(m_xBuilder->weld_check_button(u"top"_ustr))
28 , m_xLeftBox(m_xBuilder->weld_check_button(u"left"_ustr))
29 , m_xBottomBox(m_xBuilder->weld_check_button(u"bottom"_ustr))
30 , m_xRightBox(m_xBuilder->weld_check_button(u"right"_ustr))
32 m_xTopBox->set_active(bool(nFlags & CreateNameFlags::Top));
33 m_xLeftBox->set_active(bool(nFlags & CreateNameFlags::Left));
34 m_xBottomBox->set_active(bool(nFlags & CreateNameFlags::Bottom));
35 m_xRightBox->set_active(bool(nFlags & CreateNameFlags::Right));
38 ScNameCreateDlg::~ScNameCreateDlg() {}
40 CreateNameFlags ScNameCreateDlg::GetFlags() const
42 CreateNameFlags nResult = CreateNameFlags::NONE;
44 if (m_xTopBox->get_active())
45 nResult |= CreateNameFlags::Top;
46 if (m_xLeftBox->get_active())
47 nResult |= CreateNameFlags::Left;
48 if (m_xBottomBox->get_active())
49 nResult |= CreateNameFlags::Bottom;
50 if (m_xRightBox->get_active())
51 nResult |= CreateNameFlags::Right;
53 return nResult;
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */