Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / miscdlgs / delcldlg.cxx
bloba618d802909f4fd83d99b79d1f6e0d79b2e8ca69
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"
23 #include "scresid.hxx"
24 #include "miscdlgs.hrc"
26 static sal_uInt8 nDelItemChecked=0;
28 ScDeleteCellDlg::ScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove)
29 : ModalDialog(pParent, "DeleteCellsDialog", "modules/scalc/ui/deletecells.ui")
31 get(m_pBtnCellsUp, "up");
32 get(m_pBtnCellsLeft, "left");
33 get(m_pBtnDelRows, "rows");
34 get(m_pBtnDelCols, "cols");
36 if (bDisallowCellMove)
38 m_pBtnCellsUp->Disable();
39 m_pBtnCellsLeft->Disable();
41 switch(nDelItemChecked)
43 case 2: m_pBtnDelRows->Check();break;
44 case 3: m_pBtnDelCols->Check();break;
45 default:m_pBtnDelRows->Check();break;
48 else
50 switch(nDelItemChecked)
52 case 0: m_pBtnCellsUp->Check();break;
53 case 1: m_pBtnCellsLeft->Check();break;
54 case 2: m_pBtnDelRows->Check();break;
55 case 3: m_pBtnDelCols->Check();break;
60 ScDeleteCellDlg::~ScDeleteCellDlg()
62 disposeOnce();
65 void ScDeleteCellDlg::dispose()
67 m_pBtnCellsUp.clear();
68 m_pBtnCellsLeft.clear();
69 m_pBtnDelRows.clear();
70 m_pBtnDelCols.clear();
71 ModalDialog::dispose();
75 DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
77 DelCellCmd nReturn = DEL_NONE;
79 if ( m_pBtnCellsUp->IsChecked() )
81 nDelItemChecked=0;
82 nReturn = DEL_CELLSUP;
84 else if ( m_pBtnCellsLeft->IsChecked() )
86 nDelItemChecked=1;
87 nReturn = DEL_CELLSLEFT;
89 else if ( m_pBtnDelRows->IsChecked() )
91 nDelItemChecked=2;
92 nReturn = DEL_DELROWS;
94 else if ( m_pBtnDelCols->IsChecked() )
96 nDelItemChecked=3;
97 nReturn = DEL_DELCOLS;
100 return nReturn;
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */