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 .
21 #undef SC_DLLIMPLEMENTATION
25 //------------------------------------------------------------------
27 #include "delcldlg.hxx"
28 #include "scresid.hxx"
29 #include "miscdlgs.hrc"
32 static sal_uInt8 nDelItemChecked
=0;
34 //==================================================================
36 ScDeleteCellDlg::ScDeleteCellDlg(Window
* pParent
, bool bDisallowCellMove
)
37 : ModalDialog(pParent
, "DeleteCellsDialog", "modules/scalc/ui/deletecells.ui")
39 get(m_pBtnCellsUp
, "up");
40 get(m_pBtnCellsLeft
, "left");
41 get(m_pBtnDelRows
, "rows");
42 get(m_pBtnDelCols
, "cols");
44 if (bDisallowCellMove
)
46 m_pBtnCellsUp
->Disable();
47 m_pBtnCellsLeft
->Disable();
49 switch(nDelItemChecked
)
51 case 2: m_pBtnDelRows
->Check();break;
52 case 3: m_pBtnDelCols
->Check();break;
53 default:m_pBtnDelRows
->Check();break;
58 switch(nDelItemChecked
)
60 case 0: m_pBtnCellsUp
->Check();break;
61 case 1: m_pBtnCellsLeft
->Check();break;
62 case 2: m_pBtnDelRows
->Check();break;
63 case 3: m_pBtnDelCols
->Check();break;
68 //------------------------------------------------------------------------
70 DelCellCmd
ScDeleteCellDlg::GetDelCellCmd() const
72 DelCellCmd nReturn
= DEL_NONE
;
74 if ( m_pBtnCellsUp
->IsChecked() )
77 nReturn
= DEL_CELLSUP
;
79 else if ( m_pBtnCellsLeft
->IsChecked() )
82 nReturn
= DEL_CELLSLEFT
;
84 else if ( m_pBtnDelRows
->IsChecked() )
87 nReturn
= DEL_DELROWS
;
89 else if ( m_pBtnDelCols
->IsChecked() )
92 nReturn
= DEL_DELCOLS
;
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */