Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <sfx2/dispatch.hxx>
30 : : #include <svl/intitem.hxx>
31 : : #include <svl/eitem.hxx>
32 : : #include "dialmgr.hxx"
33 : : #include "splitcelldlg.hxx"
34 : : #include "cuires.hrc"
35 : : #include "splitcelldlg.hrc"
36 : :
37 : 0 : SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
38 [ # # ]: 0 : : SvxStandardDialog(pParent, CUI_RES(RID_SVX_SPLITCELLDLG))
39 [ # # ]: 0 : , maCountFL(this, CUI_RES(FL_COUNT))
40 [ # # ]: 0 : , maCountLbl(this, CUI_RES(FT_COUNT))
41 [ # # ]: 0 : , maCountEdit(this, CUI_RES(ED_COUNT))
42 [ # # ]: 0 : , maDirFL(this, CUI_RES(FL_DIR))
43 [ # # ]: 0 : , maHorzBox(this, CUI_RES(RB_HORZ))
44 [ # # ]: 0 : , maVertBox(this, CUI_RES(RB_VERT))
45 [ # # ]: 0 : , maPropCB(this, CUI_RES(CB_PROP))
46 [ # # ]: 0 : , maOKBtn(this, CUI_RES(BT_OK))
47 [ # # ]: 0 : , maCancelBtn(this, CUI_RES(BT_CANCEL))
48 [ # # ]: 0 : , maHelpBtn( this, CUI_RES( BT_HELP ) )
49 : : , mnMaxVertical( nMaxVertical )
50 [ # # ][ # # ]: 0 : , mnMaxHorizontal( nMaxHorizontal )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
51 : : {
52 [ # # ]: 0 : FreeResource();
53 [ # # ]: 0 : maHorzBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
54 [ # # ]: 0 : maPropCB.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
55 [ # # ]: 0 : maVertBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
56 : :
57 [ # # ]: 0 : if( mnMaxVertical < 2 )
58 [ # # ]: 0 : maVertBox.Enable(sal_False);
59 : :
60 : : //exchange the meaning of horizontal and vertical for vertical text
61 [ # # ]: 0 : if(bIsTableVertical)
62 : : {
63 [ # # ][ # # ]: 0 : Image aTmpImg(maHorzBox.GetModeRadioImage());
64 [ # # ]: 0 : String sTmp(maHorzBox.GetText());
65 [ # # ][ # # ]: 0 : maHorzBox.SetText(maVertBox.GetText());
[ # # ]
66 [ # # ][ # # ]: 0 : maHorzBox.SetModeRadioImage(maVertBox.GetModeRadioImage());
67 [ # # ]: 0 : maVertBox.SetText(sTmp);
68 [ # # ][ # # ]: 0 : maVertBox.SetModeRadioImage(aTmpImg);
[ # # ]
69 : : }
70 : 0 : }
71 : :
72 [ # # ][ # # ]: 0 : SvxSplitTableDlg::~SvxSplitTableDlg()
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
73 : : {
74 [ # # ]: 0 : }
75 : :
76 : 0 : IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton )
77 : : {
78 : 0 : const bool bIsVert = pButton == &maVertBox ;
79 [ # # ]: 0 : long nMax = bIsVert ? mnMaxVertical : mnMaxHorizontal;
80 : 0 : maPropCB.Enable(!bIsVert);
81 : 0 : maCountEdit.SetMax( nMax );
82 : 0 : return 0;
83 : : }
84 : :
85 : 0 : bool SvxSplitTableDlg::IsHorizontal() const
86 : : {
87 : 0 : return maHorzBox.IsChecked();
88 : : }
89 : :
90 : 0 : bool SvxSplitTableDlg::IsProportional() const
91 : : {
92 [ # # ][ # # ]: 0 : return maPropCB.IsChecked() && maHorzBox.IsChecked();
93 : : }
94 : :
95 : 0 : long SvxSplitTableDlg::GetCount() const
96 : : {
97 : 0 : return sal::static_int_cast<long>( maCountEdit.GetValue() );
98 : : }
99 : :
100 : 0 : short SvxSplitTableDlg::Execute()
101 : : {
102 : 0 : return SvxStandardDialog::Execute();
103 : : }
104 : :
105 : 0 : void SvxSplitTableDlg::Apply()
106 : : {
107 : 0 : }
108 : :
109 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|