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