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 .
20 #undef SC_DLLIMPLEMENTATION
22 #include "inscldlg.hxx"
23 #include "scresid.hxx"
24 #include "miscdlgs.hrc"
26 static sal_uInt8 nInsItemChecked
=0;
28 ScInsertCellDlg::ScInsertCellDlg( vcl::Window
* pParent
,bool bDisallowCellMove
) :
29 ModalDialog ( pParent
, "InsertCellsDialog", "modules/scalc/ui/insertcells.ui")
31 get(m_pBtnCellsDown
, "down");
32 get(m_pBtnCellsRight
, "right");
33 get(m_pBtnInsRow
, "rows");
34 get(m_pBtnInsCol
, "cols");
36 if (bDisallowCellMove
)
38 m_pBtnCellsDown
->Disable();
39 m_pBtnCellsRight
->Disable();
40 m_pBtnInsRow
->Check();
42 switch(nInsItemChecked
)
44 case 2: m_pBtnInsRow
->Check();break;
45 case 3: m_pBtnInsCol
->Check();break;
46 default:m_pBtnInsRow
->Check();break;
51 switch(nInsItemChecked
)
53 case 0: m_pBtnCellsDown
->Check();break;
54 case 1: m_pBtnCellsRight
->Check();break;
55 case 2: m_pBtnInsRow
->Check();break;
56 case 3: m_pBtnInsCol
->Check();break;
61 ScInsertCellDlg::~ScInsertCellDlg()
66 void ScInsertCellDlg::dispose()
68 m_pBtnCellsDown
.clear();
69 m_pBtnCellsRight
.clear();
72 ModalDialog::dispose();
75 InsCellCmd
ScInsertCellDlg::GetInsCellCmd() const
77 InsCellCmd nReturn
= INS_NONE
;
79 if ( m_pBtnCellsDown
->IsChecked() )
82 nReturn
= INS_CELLSDOWN
;
84 else if ( m_pBtnCellsRight
->IsChecked())
87 nReturn
= INS_CELLSRIGHT
;
89 else if ( m_pBtnInsRow
->IsChecked() )
92 nReturn
= INS_INSROWS_BEFORE
;
94 else if ( m_pBtnInsCol
->IsChecked() )
97 nReturn
= INS_INSCOLS_BEFORE
;
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */