merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / dlg / dlgpage.cxx
blobb49d06d32d0fa401fc778cff15b6e0348b44df73
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgpage.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #ifdef SD_DLLIMPLEMENTATION
35 #undef SD_DLLIMPLEMENTATION
36 #endif
38 #include <svtools/intitem.hxx>
39 #ifndef _SVX_DIALOGS_HRC
40 #include <svx/dialogs.hrc>
41 #endif
42 #include <svx/tabarea.hxx>
43 #include <svx/drawitem.hxx>
45 #ifndef _SD_SDRESID_HXX
46 #include "sdresid.hxx"
47 #endif
48 #include "dlgpage.hxx"
50 #include "DrawDocShell.hxx"
51 #include <svtools/aeitem.hxx>
52 #include <svx/flagsdef.hxx>
53 #include <svx/svxenum.hxx>
55 /*************************************************************************
57 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
59 \************************************************************************/
61 SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, BOOL bAreaPage ) :
62 SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
63 mrOutAttrs ( *pAttr ),
64 mpDocShell ( pDocSh )
66 SvxColorTableItem aColorTableItem(*( (const SvxColorTableItem*)
67 ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
68 SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
69 ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
70 SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
71 ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
72 SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
73 ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
75 mpColorTab = aColorTableItem.GetColorTable();
76 mpGradientList = aGradientListItem.GetGradientList();
77 mpHatchingList = aHatchListItem.GetHatchList();
78 mpBitmapList = aBitmapListItem.GetBitmapList();
80 FreeResource();
82 AddTabPage( RID_SVXPAGE_PAGE);
83 AddTabPage( RID_SVXPAGE_AREA);
85 if(!bAreaPage) // I have to add the page before I remove it !
86 RemoveTabPage( RID_SVXPAGE_AREA );
90 /*************************************************************************
92 |* Seite wird erzeugt
94 \************************************************************************/
96 void SdPageDlg::PageCreated(USHORT nId, SfxTabPage& rPage)
98 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
99 switch(nId)
101 case RID_SVXPAGE_PAGE:
102 aSet.Put (SfxAllEnumItem((const USHORT)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
103 aSet.Put (SfxAllEnumItem((const USHORT)SID_PAPER_START, PAPER_A0));
104 aSet.Put (SfxAllEnumItem((const USHORT)SID_PAPER_END, PAPER_E));
105 rPage.PageCreated(aSet);
106 break;
107 case RID_SVXPAGE_AREA:
108 aSet.Put (SvxColorTableItem(mpColorTab,SID_COLOR_TABLE));
109 aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
110 aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
111 aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
112 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
113 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
114 aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
115 rPage.PageCreated(aSet);
116 break;