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 :
21 : #undef SC_DLLIMPLEMENTATION
22 :
23 :
24 :
25 : //------------------------------------------------------------------
26 :
27 : #include "delcldlg.hxx"
28 : #include "scresid.hxx"
29 : #include "miscdlgs.hrc"
30 :
31 :
32 : static sal_uInt8 nDelItemChecked=0;
33 :
34 : //==================================================================
35 :
36 0 : ScDeleteCellDlg::ScDeleteCellDlg(Window* pParent, bool bDisallowCellMove)
37 0 : : ModalDialog(pParent, "DeleteCellsDialog", "modules/scalc/ui/deletecells.ui")
38 : {
39 0 : get(m_pBtnCellsUp, "up");
40 0 : get(m_pBtnCellsLeft, "left");
41 0 : get(m_pBtnDelRows, "rows");
42 0 : get(m_pBtnDelCols, "cols");
43 :
44 0 : if (bDisallowCellMove)
45 : {
46 0 : m_pBtnCellsUp->Disable();
47 0 : m_pBtnCellsLeft->Disable();
48 :
49 0 : switch(nDelItemChecked)
50 : {
51 0 : case 2: m_pBtnDelRows->Check();break;
52 0 : case 3: m_pBtnDelCols->Check();break;
53 0 : default:m_pBtnDelRows->Check();break;
54 : }
55 : }
56 : else
57 : {
58 0 : switch(nDelItemChecked)
59 : {
60 0 : case 0: m_pBtnCellsUp->Check();break;
61 0 : case 1: m_pBtnCellsLeft->Check();break;
62 0 : case 2: m_pBtnDelRows->Check();break;
63 0 : case 3: m_pBtnDelCols->Check();break;
64 : }
65 : }
66 0 : }
67 :
68 : //------------------------------------------------------------------------
69 :
70 0 : DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
71 : {
72 0 : DelCellCmd nReturn = DEL_NONE;
73 :
74 0 : if ( m_pBtnCellsUp->IsChecked() )
75 : {
76 0 : nDelItemChecked=0;
77 0 : nReturn = DEL_CELLSUP;
78 : }
79 0 : else if ( m_pBtnCellsLeft->IsChecked() )
80 : {
81 0 : nDelItemChecked=1;
82 0 : nReturn = DEL_CELLSLEFT;
83 : }
84 0 : else if ( m_pBtnDelRows->IsChecked() )
85 : {
86 0 : nDelItemChecked=2;
87 0 : nReturn = DEL_DELROWS;
88 : }
89 0 : else if ( m_pBtnDelCols->IsChecked() )
90 : {
91 0 : nDelItemChecked=3;
92 0 : nReturn = DEL_DELCOLS;
93 : }
94 :
95 0 : return nReturn;
96 0 : }
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|