xref: /trunk/main/reportdesign/source/ui/dlg/dlgpage.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 #include "precompiled_reportdesign.hxx"
28 
29 
30 #include <svx/dialogs.hrc>
31 #include <svx/tabarea.hxx>
32 #include <svx/flagsdef.hxx>
33 #include <svx/svxdlg.hxx>
34 #include <editeng/svxenum.hxx>
35 #include "dlgpage.hxx"
36 #include "ModuleHelper.hxx"
37 #include "RptResId.hrc"
38 #include <svl/intitem.hxx> //add CHINA001
39 #include <svl/cjkoptions.hxx>
40 #include <svl/aeitem.hxx>
41 
42 namespace rptui
43 {
44 /*************************************************************************
45 |*
46 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
47 |*
48 \************************************************************************/
49 
50 ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,sal_uInt16 _nPageId) :
51 SfxTabDialog ( pParent, ModuleRes( _nPageId ), pAttr ),
52         rOutAttrs           ( *pAttr )
53 {
54     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
55     DBG_ASSERT(pFact, "Dialogdiet fail!");
56     switch( _nPageId )
57     {
58         case RID_PAGEDIALOG_BACKGROUND:
59             AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1)));
60             break;
61         case RID_PAGEDIALOG_PAGE:
62             //AddTabPage( RID_SVXPAGE_PAGE,String(ModuleRes(1)));
63    //         AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1)));
64             AddTabPage(RID_SVXPAGE_PAGE, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 );
65             AddTabPage(RID_SVXPAGE_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
66             break;
67         case RID_PAGEDIALOG_CHAR:
68             AddTabPage(RID_PAGE_CHAR, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
69             AddTabPage(RID_PAGE_EFFECTS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
70             AddTabPage(RID_PAGE_POSITION, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 );
71             AddTabPage(RID_PAGE_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), 0 );
72             AddTabPage(RID_PAGE_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
73             AddTabPage(RID_PAGE_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
74 
75             break;
76         case RID_PAGEDIALOG_LINE:
77             AddTabPage( RID_SVXPAGE_LINE,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), 0 );
78             //AddTabPage( RID_SVXPAGE_LINE_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE_DEF ), 0 );
79             //AddTabPage( RID_SVXPAGE_LINEEND_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINEEND_DEF ), 0 );
80             break;
81         default:
82             OSL_ENSURE(0,"Unknown page id");
83     }
84 
85     SvtCJKOptions aCJKOptions;
86     if ( !aCJKOptions.IsDoubleLinesEnabled() )
87         RemoveTabPage(RID_PAGE_TWOLN);
88 
89     FreeResource();
90 }
91 // =============================================================================
92 } // namespace rptui
93 // =============================================================================
94