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
, "modules/scalc/ui/deletecells.ui", "DeleteCellsDialog")
28 , m_xBtnCellsUp(m_xBuilder
->weld_radio_button("up"))
29 , m_xBtnCellsLeft(m_xBuilder
->weld_radio_button("left"))
30 , m_xBtnDelRows(m_xBuilder
->weld_radio_button("rows"))
31 , m_xBtnDelCols(m_xBuilder
->weld_radio_button("cols"))
33 if (bDisallowCellMove
)
35 m_xBtnCellsUp
->set_sensitive(false);
36 m_xBtnCellsLeft
->set_sensitive(false);
38 switch (nDelItemChecked
)
41 m_xBtnDelRows
->set_active(true);
44 m_xBtnDelCols
->set_active(true);
47 m_xBtnDelRows
->set_active(true);
53 switch (nDelItemChecked
)
56 m_xBtnCellsUp
->set_active(true);
59 m_xBtnCellsLeft
->set_active(true);
62 m_xBtnDelRows
->set_active(true);
65 m_xBtnDelCols
->set_active(true);
71 ScDeleteCellDlg::~ScDeleteCellDlg() {}
73 DelCellCmd
ScDeleteCellDlg::GetDelCellCmd() const
75 DelCellCmd nReturn
= DelCellCmd::NONE
;
77 if (m_xBtnCellsUp
->get_active())
80 nReturn
= DelCellCmd::CellsUp
;
82 else if (m_xBtnCellsLeft
->get_active())
85 nReturn
= DelCellCmd::CellsLeft
;
87 else if (m_xBtnDelRows
->get_active())
90 nReturn
= DelCellCmd::Rows
;
92 else if (m_xBtnDelCols
->get_active())
95 nReturn
= DelCellCmd::Cols
;
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */