xref: /aoo42x/main/cui/source/dialogs/insrc.cxx (revision 2ee96f1c)
1*2ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2ee96f1cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2ee96f1cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2ee96f1cSAndrew Rist  * distributed with this work for additional information
6*2ee96f1cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2ee96f1cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2ee96f1cSAndrew Rist  * "License"); you may not use this file except in compliance
9*2ee96f1cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2ee96f1cSAndrew Rist  *
11*2ee96f1cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2ee96f1cSAndrew Rist  *
13*2ee96f1cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2ee96f1cSAndrew Rist  * software distributed under the License is distributed on an
15*2ee96f1cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2ee96f1cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2ee96f1cSAndrew Rist  * specific language governing permissions and limitations
18*2ee96f1cSAndrew Rist  * under the License.
19*2ee96f1cSAndrew Rist  *
20*2ee96f1cSAndrew Rist  *************************************************************/
21*2ee96f1cSAndrew Rist 
22*2ee96f1cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <dialmgr.hxx>
28cdf0e10cSrcweir #include <svx/svxdlg.hxx>
29cdf0e10cSrcweir #include <cuires.hrc>
30cdf0e10cSrcweir #include "insrc.hxx"
31cdf0e10cSrcweir #include "insrc.hrc"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir bool SvxInsRowColDlg::isInsertBefore() const
34cdf0e10cSrcweir {
35cdf0e10cSrcweir     return !aAfterBtn.IsChecked();
36cdf0e10cSrcweir }
37cdf0e10cSrcweir 
38cdf0e10cSrcweir sal_uInt16 SvxInsRowColDlg::getInsertCount() const
39cdf0e10cSrcweir {
40cdf0e10cSrcweir     return static_cast< sal_uInt16 >( aCountEdit.GetValue() );
41cdf0e10cSrcweir }
42cdf0e10cSrcweir 
43cdf0e10cSrcweir SvxInsRowColDlg::SvxInsRowColDlg(Window* pParent, bool bCol, const rtl::OString& sHelpId )
44cdf0e10cSrcweir 	: ModalDialog( pParent, CUI_RES(DLG_INS_ROW_COL) ),
45cdf0e10cSrcweir 	aCount( this, CUI_RES( FT_COUNT ) ),
46cdf0e10cSrcweir 	aCountEdit( this, CUI_RES( ED_COUNT ) ),
47cdf0e10cSrcweir     aInsFL( this, CUI_RES( FL_INS ) ),
48cdf0e10cSrcweir 	aBeforeBtn( this, CUI_RES( CB_POS_BEFORE ) ),
49cdf0e10cSrcweir 	aAfterBtn( this, CUI_RES( CB_POS_AFTER ) ),
50cdf0e10cSrcweir     aPosFL( this, CUI_RES( FL_POS ) ),
51cdf0e10cSrcweir 	aRow(CUI_RES(STR_ROW)),
52cdf0e10cSrcweir 	aCol(CUI_RES(STR_COL)),
53cdf0e10cSrcweir 	aOKBtn( this, CUI_RES( BT_OK ) ),
54cdf0e10cSrcweir 	aCancelBtn( this, CUI_RES( BT_CANCEL ) ),
55cdf0e10cSrcweir 	aHelpBtn( this, CUI_RES( BT_HELP ) ),
56cdf0e10cSrcweir 	bColumn( bCol )
57cdf0e10cSrcweir {
58cdf0e10cSrcweir 	FreeResource();
59cdf0e10cSrcweir 	String aTmp( GetText() );
60cdf0e10cSrcweir 	if( bColumn )
61cdf0e10cSrcweir 	{
62cdf0e10cSrcweir 		aTmp += aCol;
63cdf0e10cSrcweir 	}
64cdf0e10cSrcweir 	else
65cdf0e10cSrcweir 	{
66cdf0e10cSrcweir 		aTmp += aRow;
67cdf0e10cSrcweir 	}
68cdf0e10cSrcweir 	SetText( aTmp );
69cdf0e10cSrcweir 	SetHelpId( sHelpId );
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir short SvxInsRowColDlg::Execute(void)
73cdf0e10cSrcweir {
74cdf0e10cSrcweir 	return ModalDialog::Execute();
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79