LibreOffice Module sc (master)  1
namecrea.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 
20 #undef SC_DLLIMPLEMENTATION
21 
22 #include <namecrea.hxx>
23 
25  : GenericDialogController(pParent, "modules/scalc/ui/createnamesdialog.ui", "CreateNamesDialog")
26  , m_xTopBox(m_xBuilder->weld_check_button("top"))
27  , m_xLeftBox(m_xBuilder->weld_check_button("left"))
28  , m_xBottomBox(m_xBuilder->weld_check_button("bottom"))
29  , m_xRightBox(m_xBuilder->weld_check_button("right"))
30 {
31  m_xTopBox->set_active(bool(nFlags & CreateNameFlags::Top));
32  m_xLeftBox->set_active(bool(nFlags & CreateNameFlags::Left));
33  m_xBottomBox->set_active(bool(nFlags & CreateNameFlags::Bottom));
34  m_xRightBox->set_active(bool(nFlags & CreateNameFlags::Right));
35 }
36 
38 
40 {
42 
43  if (m_xTopBox->get_active())
44  nResult |= CreateNameFlags::Top;
45  if (m_xLeftBox->get_active())
46  nResult |= CreateNameFlags::Left;
47  if (m_xBottomBox->get_active())
48  nResult |= CreateNameFlags::Bottom;
49  if (m_xRightBox->get_active())
50  nResult |= CreateNameFlags::Right;
51 
52  return nResult;
53 }
54 
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::CheckButton > m_xLeftBox
Definition: namecrea.hxx:28
std::unique_ptr< weld::CheckButton > m_xRightBox
Definition: namecrea.hxx:30
CreateNameFlags
Definition: scui_def.hxx:50
ScNameCreateDlg(weld::Window *pParent, CreateNameFlags nFlags)
Definition: namecrea.cxx:24
std::unique_ptr< weld::CheckButton > m_xBottomBox
Definition: namecrea.hxx:29
virtual ~ScNameCreateDlg() override
Definition: namecrea.cxx:37
CreateNameFlags GetFlags() const
Definition: namecrea.cxx:39
std::unique_ptr< weld::CheckButton > m_xTopBox
Definition: namecrea.hxx:27