calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / sc / source / ui / miscdlgs / delcldlg.cxx
blob71ce6b99edd2e4349927a7a3a05681684e1aa1a9
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 <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)
40 case 2:
41 m_xBtnDelRows->set_active(true);
42 break;
43 case 3:
44 m_xBtnDelCols->set_active(true);
45 break;
46 default:
47 m_xBtnDelRows->set_active(true);
48 break;
51 else
53 switch (nDelItemChecked)
55 case 0:
56 m_xBtnCellsUp->set_active(true);
57 break;
58 case 1:
59 m_xBtnCellsLeft->set_active(true);
60 break;
61 case 2:
62 m_xBtnDelRows->set_active(true);
63 break;
64 case 3:
65 m_xBtnDelCols->set_active(true);
66 break;
71 ScDeleteCellDlg::~ScDeleteCellDlg() {}
73 DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
75 DelCellCmd nReturn = DelCellCmd::NONE;
77 if (m_xBtnCellsUp->get_active())
79 nDelItemChecked = 0;
80 nReturn = DelCellCmd::CellsUp;
82 else if (m_xBtnCellsLeft->get_active())
84 nDelItemChecked = 1;
85 nReturn = DelCellCmd::CellsLeft;
87 else if (m_xBtnDelRows->get_active())
89 nDelItemChecked = 2;
90 nReturn = DelCellCmd::Rows;
92 else if (m_xBtnDelCols->get_active())
94 nDelItemChecked = 3;
95 nReturn = DelCellCmd::Cols;
98 return nReturn;
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */