Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / miscdlgs / inscldlg.cxx
blob0d522c80224ff6d1fa4142041240d3cab4f0441f
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 .
21 #undef SC_DLLIMPLEMENTATION
25 //------------------------------------------------------------------
27 #include "inscldlg.hxx"
28 #include "scresid.hxx"
29 #include "miscdlgs.hrc"
32 static sal_uInt8 nInsItemChecked=0;
34 //==================================================================
36 ScInsertCellDlg::ScInsertCellDlg( Window* pParent,sal_Bool bDisallowCellMove) :
37 ModalDialog ( pParent, "InsertCellsDialog", "modules/scalc/ui/insertcells.ui")
39 get(m_pBtnCellsDown, "down");
40 get(m_pBtnCellsRight, "right");
41 get(m_pBtnInsRow, "rows");
42 get(m_pBtnInsCol, "cols");
44 if (bDisallowCellMove)
46 m_pBtnCellsDown->Disable();
47 m_pBtnCellsRight->Disable();
48 m_pBtnInsRow->Check();
50 switch(nInsItemChecked)
52 case 2: m_pBtnInsRow->Check();break;
53 case 3: m_pBtnInsCol->Check();break;
54 default:m_pBtnInsRow->Check();break;
57 else
59 switch(nInsItemChecked)
61 case 0: m_pBtnCellsDown->Check();break;
62 case 1: m_pBtnCellsRight->Check();break;
63 case 2: m_pBtnInsRow->Check();break;
64 case 3: m_pBtnInsCol->Check();break;
69 //------------------------------------------------------------------------
71 InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
73 InsCellCmd nReturn = INS_NONE;
75 if ( m_pBtnCellsDown->IsChecked() )
77 nInsItemChecked=0;
78 nReturn = INS_CELLSDOWN;
80 else if ( m_pBtnCellsRight->IsChecked())
82 nInsItemChecked=1;
83 nReturn = INS_CELLSRIGHT;
85 else if ( m_pBtnInsRow->IsChecked() )
87 nInsItemChecked=2;
88 nReturn = INS_INSROWS;
90 else if ( m_pBtnInsCol->IsChecked() )
92 nInsItemChecked=3;
93 nReturn = INS_INSCOLS;
96 return nReturn;
99 ScInsertCellDlg::~ScInsertCellDlg()
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */