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 <delcldlg.hxx>
24 static sal_uInt8 nDelItemChecked
= 0;
26 ScDeleteCellDlg::ScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
)
27 : GenericDialogController(pParent
, u
"modules/scalc/ui/deletecells.ui"_ustr
,
28 u
"DeleteCellsDialog"_ustr
)
29 , m_xBtnCellsUp(m_xBuilder
->weld_radio_button(u
"up"_ustr
))
30 , m_xBtnCellsLeft(m_xBuilder
->weld_radio_button(u
"left"_ustr
))
31 , m_xBtnDelRows(m_xBuilder
->weld_radio_button(u
"rows"_ustr
))
32 , m_xBtnDelCols(m_xBuilder
->weld_radio_button(u
"cols"_ustr
))
34 if (bDisallowCellMove
)
36 m_xBtnCellsUp
->set_sensitive(false);
37 m_xBtnCellsLeft
->set_sensitive(false);
39 switch (nDelItemChecked
)
42 m_xBtnDelRows
->set_active(true);
45 m_xBtnDelCols
->set_active(true);
48 m_xBtnDelRows
->set_active(true);
54 switch (nDelItemChecked
)
57 m_xBtnCellsUp
->set_active(true);
60 m_xBtnCellsLeft
->set_active(true);
63 m_xBtnDelRows
->set_active(true);
66 m_xBtnDelCols
->set_active(true);
72 ScDeleteCellDlg::~ScDeleteCellDlg() {}
74 DelCellCmd
ScDeleteCellDlg::GetDelCellCmd() const
76 DelCellCmd nReturn
= DelCellCmd::NONE
;
78 if (m_xBtnCellsUp
->get_active())
81 nReturn
= DelCellCmd::CellsUp
;
83 else if (m_xBtnCellsLeft
->get_active())
86 nReturn
= DelCellCmd::CellsLeft
;
88 else if (m_xBtnDelRows
->get_active())
91 nReturn
= DelCellCmd::Rows
;
93 else if (m_xBtnDelCols
->get_active())
96 nReturn
= DelCellCmd::Cols
;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */