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 .
20 #undef SC_DLLIMPLEMENTATION
22 #include <namecrea.hxx>
24 ScNameCreateDlg::ScNameCreateDlg(weld::Window
* pParent
, CreateNameFlags nFlags
)
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"))
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
));
37 ScNameCreateDlg::~ScNameCreateDlg() {}
39 CreateNameFlags
ScNameCreateDlg::GetFlags() const
41 CreateNameFlags nResult
= CreateNameFlags::NONE
;
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
;
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */