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