xref: /aoo4110/main/dbaccess/source/ui/dlg/dlgattr.cxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_dbaccess.hxx"
26 
27 
28 #ifndef DBAUI_SBATTRDLG_HXX
29 #include "dlgattr.hxx"
30 #endif
31 
32 #ifndef _SFXTABDLG_HXX //autogen
33 #include <sfx2/tabdlg.hxx>
34 #endif
35 
36 #ifndef _SVX_NUMINF_HXX //autogen
37 #include <svx/numinf.hxx>
38 #endif
39 
40 //CHINA001 #ifndef _SVX_CHARDLG_HXX //autogen
41 //CHINA001 #include <svx/chardlg.hxx>
42 //CHINA001 #endif
43 
44 //CHINA001 #ifndef _SVX_NUMFMT_HXX //autogen
45 //CHINA001 #include <svx/numfmt.hxx>
46 //CHINA001 #endif
47 #ifndef _SVX_NUMINF_HXX
48 #include <svx/numinf.hxx>
49 #endif
50 
51 //CHINA001 #ifndef _SVX_ALIGN_HXX //autogen
52 //CHINA001 #include <svx/align.hxx>
53 //CHINA001 #endif
54 
55 #ifndef _SVX_DIALOGS_HRC
56 #include <svx/dialogs.hrc>
57 #endif
58 #ifndef _DBU_DLG_HRC_
59 #include "dbu_dlg.hrc"
60 #endif
61 #ifndef _SFXITEMSET_HXX
62 #include <svl/itemset.hxx>
63 #endif
64 #define _ZFORLIST_DECLARE_TABLE
65 #ifndef _ZFORLIST_HXX
66 #include <svl/zforlist.hxx>
67 #endif
68 #include <svx/svxids.hrc> //CHINA001
69 #include <svx/flagsdef.hxx>	//CHINA001
70 #ifndef _SFXINTITEM_HXX //CHINA001
71 #include <svl/intitem.hxx> //CHINA001
72 #endif //CHINA001
73 #ifndef _DBAUI_MODULE_DBU_HXX_
74 #include "moduledbu.hxx"
75 #endif
76 using namespace dbaui;
77 
DBG_NAME(SbaSbAttrDlg)78 DBG_NAME(SbaSbAttrDlg)
79 //==================================================================
80 SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, sal_uInt16 nFlags, sal_Bool bRow)
81 			 : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs )
82 			 ,aTitle(ModuleRes(ST_ROW))
83 {
84     DBG_CTOR(SbaSbAttrDlg,NULL);
85 
86     pNumberInfoItem = new SvxNumberInfoItem( pFormatter, 0 );
87 
88 	if (bRow)
89 		SetText(aTitle);
90 	if( nFlags & TP_ATTR_CHAR )
91     {
92 //        AddTabPage( RID_SVXPAGE_CHAR_STD,String(ModuleRes(TP_ATTR_CHAR)),SvxCharStdPage::Create,            0 );
93         DBG_ERROR( "found flag TP_ATTR_CHAR" );
94     }
95 	if( nFlags & TP_ATTR_NUMBER )
96 		AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)) ); //CHINA001 AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)),SvxNumberFormatTabPage::Create,	0 );
97 	if( nFlags & TP_ATTR_ALIGN )
98 		AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)) );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)),SvxAlignmentTabPage::Create,	0 );
99 	FreeResource();
100 }
101 
102 // -----------------------------------------------------------------------
~SbaSbAttrDlg()103 SbaSbAttrDlg::~SbaSbAttrDlg()
104 {
105 	delete pNumberInfoItem;
106 
107     DBG_DTOR(SbaSbAttrDlg,NULL);
108 }
109 
110 // -----------------------------------------------------------------------
PageCreated(sal_uInt16 nPageId,SfxTabPage & rTabPage)111 void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
112 {
113 	SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
114 	switch ( nPageId )
115 	{
116 		case RID_SVXPAGE_NUMBERFORMAT:
117 		{
118 			//CHINA001 ((SvxNumberFormatTabPage&)rTabPage).
119 				//CHINA001 SetNumberFormatList( *pNumberInfoItem );
120 			aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
121 			rTabPage.PageCreated(aSet);
122 		}
123 		break;
124 
125 		case RID_SVXPAGE_CHAR_STD:
126 		{
127 			//	((SvxCharStdPage&)rTabPage).SetFontList(SBA_MOD_EXT()->FontListItem());
128 		}
129 		break;
130 
131 		case RID_SVXPAGE_ALIGNMENT:
132 		{
133 			//CHINA001 ((SvxAlignmentTabPage&)rTabPage).SetFlags(WBA_NO_ORIENTATION|WBA_NO_LINEBREAK|WBA_NO_GRIDLINES|WBA_NO_VERTICAL|WBA_NO_LEFTINDENT);
134 //           aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, WBA_NO_ORIENTATION|WBA_NO_LINEBREAK|WBA_NO_GRIDLINES|WBA_NO_VERTICAL|WBA_NO_LEFTINDENT));
135 //           rTabPage.PageCreated(aSet);
136 		}
137 		break;
138 
139 		default:
140 		break;
141 	}
142 }
143 
144 
145