Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #undef SC_DLLIMPLEMENTATION
21 :
22 : #include "delcldlg.hxx"
23 : #include "scresid.hxx"
24 : #include "miscdlgs.hrc"
25 :
26 : static sal_uInt8 nDelItemChecked=0;
27 :
28 0 : ScDeleteCellDlg::ScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove)
29 0 : : ModalDialog(pParent, "DeleteCellsDialog", "modules/scalc/ui/deletecells.ui")
30 : {
31 0 : get(m_pBtnCellsUp, "up");
32 0 : get(m_pBtnCellsLeft, "left");
33 0 : get(m_pBtnDelRows, "rows");
34 0 : get(m_pBtnDelCols, "cols");
35 :
36 0 : if (bDisallowCellMove)
37 : {
38 0 : m_pBtnCellsUp->Disable();
39 0 : m_pBtnCellsLeft->Disable();
40 :
41 0 : switch(nDelItemChecked)
42 : {
43 0 : case 2: m_pBtnDelRows->Check();break;
44 0 : case 3: m_pBtnDelCols->Check();break;
45 0 : default:m_pBtnDelRows->Check();break;
46 : }
47 : }
48 : else
49 : {
50 0 : switch(nDelItemChecked)
51 : {
52 0 : case 0: m_pBtnCellsUp->Check();break;
53 0 : case 1: m_pBtnCellsLeft->Check();break;
54 0 : case 2: m_pBtnDelRows->Check();break;
55 0 : case 3: m_pBtnDelCols->Check();break;
56 : }
57 : }
58 0 : }
59 :
60 0 : DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
61 : {
62 0 : DelCellCmd nReturn = DEL_NONE;
63 :
64 0 : if ( m_pBtnCellsUp->IsChecked() )
65 : {
66 0 : nDelItemChecked=0;
67 0 : nReturn = DEL_CELLSUP;
68 : }
69 0 : else if ( m_pBtnCellsLeft->IsChecked() )
70 : {
71 0 : nDelItemChecked=1;
72 0 : nReturn = DEL_CELLSLEFT;
73 : }
74 0 : else if ( m_pBtnDelRows->IsChecked() )
75 : {
76 0 : nDelItemChecked=2;
77 0 : nReturn = DEL_DELROWS;
78 : }
79 0 : else if ( m_pBtnDelCols->IsChecked() )
80 : {
81 0 : nDelItemChecked=3;
82 0 : nReturn = DEL_DELCOLS;
83 : }
84 :
85 0 : return nReturn;
86 0 : }
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|