Update ooo320-m1
[ooovba.git] / dbaccess / source / ui / dlg / dlgattr.cxx
blobb1d7f41bb5c2de4e5eb5a2341f042f9680df97a0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgattr.cxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
35 #ifndef DBAUI_SBATTRDLG_HXX
36 #include "dlgattr.hxx"
37 #endif
39 #ifndef _SFXTABDLG_HXX //autogen
40 #include <sfx2/tabdlg.hxx>
41 #endif
43 #ifndef _SVX_NUMINF_HXX //autogen
44 #include <svx/numinf.hxx>
45 #endif
47 //CHINA001 #ifndef _SVX_CHARDLG_HXX //autogen
48 //CHINA001 #include <svx/chardlg.hxx>
49 //CHINA001 #endif
51 //CHINA001 #ifndef _SVX_NUMFMT_HXX //autogen
52 //CHINA001 #include <svx/numfmt.hxx>
53 //CHINA001 #endif
54 #ifndef _SVX_NUMINF_HXX
55 #include <svx/numinf.hxx>
56 #endif
58 //CHINA001 #ifndef _SVX_ALIGN_HXX //autogen
59 //CHINA001 #include <svx/align.hxx>
60 //CHINA001 #endif
62 #ifndef _SVX_DIALOGS_HRC
63 #include <svx/dialogs.hrc>
64 #endif
65 #ifndef _DBU_DLG_HRC_
66 #include "dbu_dlg.hrc"
67 #endif
68 #ifndef _SFXITEMSET_HXX
69 #include <svtools/itemset.hxx>
70 #endif
71 #define _ZFORLIST_DECLARE_TABLE
72 #ifndef _ZFORLIST_HXX
73 #include <svtools/zforlist.hxx>
74 #endif
75 #include <svx/svxids.hrc> //CHINA001
76 #include <svx/flagsdef.hxx> //CHINA001
77 #ifndef _SFXINTITEM_HXX //CHINA001
78 #include <svtools/intitem.hxx> //CHINA001
79 #endif //CHINA001
80 #ifndef _DBAUI_MODULE_DBU_HXX_
81 #include "moduledbu.hxx"
82 #endif
83 using namespace dbaui;
85 DBG_NAME(SbaSbAttrDlg)
86 //==================================================================
87 SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, USHORT nFlags, BOOL bRow)
88 : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs )
89 ,aTitle(ModuleRes(ST_ROW))
91 DBG_CTOR(SbaSbAttrDlg,NULL);
93 pNumberInfoItem = new SvxNumberInfoItem( pFormatter, 0 );
95 if (bRow)
96 SetText(aTitle);
97 if( nFlags & TP_ATTR_CHAR )
99 // AddTabPage( RID_SVXPAGE_CHAR_STD,String(ModuleRes(TP_ATTR_CHAR)),SvxCharStdPage::Create, 0 );
100 DBG_ERROR( "found flag TP_ATTR_CHAR" );
102 if( nFlags & TP_ATTR_NUMBER )
103 AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)) ); //CHINA001 AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)),SvxNumberFormatTabPage::Create, 0 );
104 if( nFlags & TP_ATTR_ALIGN )
105 AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)) );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)),SvxAlignmentTabPage::Create, 0 );
106 FreeResource();
109 // -----------------------------------------------------------------------
110 SbaSbAttrDlg::~SbaSbAttrDlg()
112 delete pNumberInfoItem;
114 DBG_DTOR(SbaSbAttrDlg,NULL);
117 // -----------------------------------------------------------------------
118 void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
120 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
121 switch ( nPageId )
123 case RID_SVXPAGE_NUMBERFORMAT:
125 //CHINA001 ((SvxNumberFormatTabPage&)rTabPage).
126 //CHINA001 SetNumberFormatList( *pNumberInfoItem );
127 aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const USHORT)SID_ATTR_NUMBERFORMAT_INFO));
128 rTabPage.PageCreated(aSet);
130 break;
132 case RID_SVXPAGE_CHAR_STD:
134 // ((SvxCharStdPage&)rTabPage).SetFontList(SBA_MOD_EXT()->FontListItem());
136 break;
138 case RID_SVXPAGE_ALIGNMENT:
140 //CHINA001 ((SvxAlignmentTabPage&)rTabPage).SetFlags(WBA_NO_ORIENTATION|WBA_NO_LINEBREAK|WBA_NO_GRIDLINES|WBA_NO_VERTICAL|WBA_NO_LEFTINDENT);
141 // aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, WBA_NO_ORIENTATION|WBA_NO_LINEBREAK|WBA_NO_GRIDLINES|WBA_NO_VERTICAL|WBA_NO_LEFTINDENT));
142 // rTabPage.PageCreated(aSet);
144 break;
146 default:
147 break;