xref: /aoo4110/main/sc/source/ui/miscdlgs/textdlgs.cxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 #undef SC_DLLIMPLEMENTATION
28 
29 //		ohne precompiled Headers uebersetzen !!!
30 
31 
32 
33 // INCLUDE ---------------------------------------------------------------
34 
35 #include <svx/svxids.hrc>
36 
37 //CHINA001 #include <svx/chardlg.hxx>
38 #include <editeng/flstitem.hxx>
39 //CHINA001 #include <svx/paragrph.hxx>
40 //CHINA001 #include <svx/tabstpge.hxx>
41 #include <sfx2/objsh.hxx>
42 #include <svl/cjkoptions.hxx>
43 
44 #include "textdlgs.hxx"
45 #include "scresid.hxx"
46 #include "sc.hrc"
47 #include <svx/svxids.hrc> //add CHINA001
48 #include <svl/intitem.hxx> //add CHINA001
49 #include <svx/flagsdef.hxx> //CHINA001
50 // -----------------------------------------------------------------------
51 
ScCharDlg(Window * pParent,const SfxItemSet * pAttr,const SfxObjectShell * pDocShell)52 ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
53 					const SfxObjectShell* pDocShell ) :
54 		SfxTabDialog		( pParent, ScResId( RID_SCDLG_CHAR ), pAttr ),
55 		rOutAttrs			( *pAttr ),
56 		rDocShell			( *pDocShell )
57 {
58 	FreeResource();
59 
60 	AddTabPage( RID_SVXPAGE_CHAR_NAME ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0);
61 	AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0);
62 	AddTabPage( RID_SVXPAGE_CHAR_POSITION ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0);
63 }
64 
65 // -----------------------------------------------------------------------
66 
PageCreated(sal_uInt16 nId,SfxTabPage & rPage)67 void __EXPORT ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
68 {
69 	SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
70 	switch( nId )
71 	{
72 		case RID_SVXPAGE_CHAR_NAME:
73 		{
74 			SvxFontListItem aItem(*( (const SvxFontListItem*)
75 				( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
76 
77 			//CHINA001 ( (SvxCharNamePage&) rPage ).SetFontList( aItem );
78 			aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
79 			rPage.PageCreated(aSet);
80 		}
81 		break;
82 
83 		case RID_SVXPAGE_CHAR_EFFECTS:
84 			//CHINA001 ( (SvxCharEffectsPage&) rPage ).DisableControls(
85 							//CHINA001 DISABLE_CASEMAP);
86 			aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); //CHINA001
87 			rPage.PageCreated(aSet);
88 			break;
89 
90 		default:
91 		break;
92 	}
93 }
94 
95 // -----------------------------------------------------------------------
96 
ScParagraphDlg(Window * pParent,const SfxItemSet * pAttr)97 ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
98 		SfxTabDialog		( pParent, ScResId( RID_SCDLG_PARAGRAPH ), pAttr ),
99 		rOutAttrs			( *pAttr )
100 {
101 	FreeResource();
102 
103 	SvtCJKOptions aCJKOptions;
104 
105 	AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0);
106 	AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0);
107 	//AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0);
108 	if ( aCJKOptions.IsAsianTypographyEnabled() )
109 		AddTabPage( RID_SVXPAGE_PARA_ASIAN);//CHINA001 AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create,0);
110 	else
111 		RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
112 	AddTabPage( RID_SVXPAGE_TABULATOR );//CHINA001 AddTabPage( RID_SVXPAGE_TABULATOR, SvxTabulatorTabPage::Create, 0);
113 }
114 
115 // -----------------------------------------------------------------------
116 
PageCreated(sal_uInt16 nId,SfxTabPage & rPage)117 void __EXPORT ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
118 {
119 	switch( nId )
120 	{
121 		case RID_SVXPAGE_TABULATOR:
122 			{
123 			//CHINA001 ( (SvxTabulatorTabPage&) rPage ).
124 			//CHINA001 		DisableControls( TABTYPE_ALL &~TABTYPE_LEFT |
125 			//CHINA001 						 TABFILL_ALL &~TABFILL_NONE );
126 			SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));//add CHINA001
127 			aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
128 								(TABFILL_ALL &~TABFILL_NONE) ));
129 			rPage.PageCreated(aSet);//add CHINA001
130 			}
131 		break;
132 	}
133 }
134 
135 
136 
137