xref: /aoo41x/main/sc/source/ui/miscdlgs/textdlgs.cxx (revision cdf0e10c)
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 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sc.hxx"
30 
31 #undef SC_DLLIMPLEMENTATION
32 
33 //		ohne precompiled Headers uebersetzen !!!
34 
35 
36 
37 // INCLUDE ---------------------------------------------------------------
38 
39 #include <svx/svxids.hrc>
40 
41 //CHINA001 #include <svx/chardlg.hxx>
42 #include <editeng/flstitem.hxx>
43 //CHINA001 #include <svx/paragrph.hxx>
44 //CHINA001 #include <svx/tabstpge.hxx>
45 #include <sfx2/objsh.hxx>
46 #include <svl/cjkoptions.hxx>
47 
48 #include "textdlgs.hxx"
49 #include "scresid.hxx"
50 #include "sc.hrc"
51 #include <svx/svxids.hrc> //add CHINA001
52 #include <svl/intitem.hxx> //add CHINA001
53 #include <svx/flagsdef.hxx> //CHINA001
54 // -----------------------------------------------------------------------
55 
56 ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
57 					const SfxObjectShell* pDocShell ) :
58 		SfxTabDialog		( pParent, ScResId( RID_SCDLG_CHAR ), pAttr ),
59 		rOutAttrs			( *pAttr ),
60 		rDocShell			( *pDocShell )
61 {
62 	FreeResource();
63 
64 	AddTabPage( RID_SVXPAGE_CHAR_NAME ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0);
65 	AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0);
66 	AddTabPage( RID_SVXPAGE_CHAR_POSITION ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0);
67 }
68 
69 // -----------------------------------------------------------------------
70 
71 void __EXPORT ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
72 {
73 	SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
74 	switch( nId )
75 	{
76 		case RID_SVXPAGE_CHAR_NAME:
77 		{
78 			SvxFontListItem aItem(*( (const SvxFontListItem*)
79 				( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
80 
81 			//CHINA001 ( (SvxCharNamePage&) rPage ).SetFontList( aItem );
82 			aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
83 			rPage.PageCreated(aSet);
84 		}
85 		break;
86 
87 		case RID_SVXPAGE_CHAR_EFFECTS:
88 			//CHINA001 ( (SvxCharEffectsPage&) rPage ).DisableControls(
89 							//CHINA001 DISABLE_CASEMAP);
90 			aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); //CHINA001
91 			rPage.PageCreated(aSet);
92 			break;
93 
94 		default:
95 		break;
96 	}
97 }
98 
99 // -----------------------------------------------------------------------
100 
101 ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
102 		SfxTabDialog		( pParent, ScResId( RID_SCDLG_PARAGRAPH ), pAttr ),
103 		rOutAttrs			( *pAttr )
104 {
105 	FreeResource();
106 
107 	SvtCJKOptions aCJKOptions;
108 
109 	AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0);
110 	AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0);
111 	//AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0);
112 	if ( aCJKOptions.IsAsianTypographyEnabled() )
113 		AddTabPage( RID_SVXPAGE_PARA_ASIAN);//CHINA001 AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create,0);
114 	else
115 		RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
116 	AddTabPage( RID_SVXPAGE_TABULATOR );//CHINA001 AddTabPage( RID_SVXPAGE_TABULATOR, SvxTabulatorTabPage::Create, 0);
117 }
118 
119 // -----------------------------------------------------------------------
120 
121 void __EXPORT ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
122 {
123 	switch( nId )
124 	{
125 		case RID_SVXPAGE_TABULATOR:
126 			{
127 			//CHINA001 ( (SvxTabulatorTabPage&) rPage ).
128 			//CHINA001 		DisableControls( TABTYPE_ALL &~TABTYPE_LEFT |
129 			//CHINA001 						 TABFILL_ALL &~TABFILL_NONE );
130 			SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));//add CHINA001
131 			aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
132 								(TABFILL_ALL &~TABFILL_NONE) ));
133 			rPage.PageCreated(aSet);//add CHINA001
134 			}
135 		break;
136 	}
137 }
138 
139 
140 
141