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 );
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
)) );
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()));
84 case RID_SVXPAGE_NUMBERFORMAT
:
86 aSet
.Put (SvxNumberInfoItem( pNumberInfoItem
->GetNumberFormatter(), (const sal_uInt16
)SID_ATTR_NUMBERFORMAT_INFO
));
87 rTabPage
.PageCreated(aSet
);
91 case RID_SVXPAGE_CHAR_STD
:
96 case RID_SVXPAGE_ALIGNMENT
:
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */