Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / source / ui / dlg / dlgattr.cxx
blob9179a5a724d14adaccee716e10e153aa9889d2fd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
31 #include "dlgattr.hxx"
33 #include <sfx2/tabdlg.hxx>
35 #include <svx/numinf.hxx>
37 #include <svx/dialogs.hrc>
38 #include "dbu_dlg.hrc"
39 #include <svl/itemset.hxx>
40 #include <svl/zforlist.hxx>
41 #include <svx/svxids.hrc>
42 #include <svx/flagsdef.hxx>
43 #include <svl/intitem.hxx>
44 #include "moduledbu.hxx"
45 using namespace dbaui;
47 DBG_NAME(SbaSbAttrDlg)
48 //==================================================================
49 SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, sal_uInt16 nFlags, sal_Bool bRow)
50 : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs )
51 ,aTitle(ModuleRes(ST_ROW))
53 DBG_CTOR(SbaSbAttrDlg,NULL);
55 pNumberInfoItem = new SvxNumberInfoItem( pFormatter, 0 );
57 if (bRow)
58 SetText(aTitle);
59 if( nFlags & TP_ATTR_CHAR )
61 OSL_FAIL( "found flag TP_ATTR_CHAR" );
63 if( nFlags & TP_ATTR_NUMBER )
64 AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)) );
65 if( nFlags & TP_ATTR_ALIGN )
66 AddTabPage( RID_SVXPAGE_ALIGNMENT,String(ModuleRes(TP_ATTR_ALIGN)) );
67 FreeResource();
70 // -----------------------------------------------------------------------
71 SbaSbAttrDlg::~SbaSbAttrDlg()
73 delete pNumberInfoItem;
75 DBG_DTOR(SbaSbAttrDlg,NULL);
78 // -----------------------------------------------------------------------
79 void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
81 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
82 switch ( nPageId )
84 case RID_SVXPAGE_NUMBERFORMAT:
86 aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
87 rTabPage.PageCreated(aSet);
89 break;
91 case RID_SVXPAGE_CHAR_STD:
94 break;
96 case RID_SVXPAGE_ALIGNMENT:
99 break;
101 default:
102 break;
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */