sync master with lastest vba changes
[ooovba.git] / sc / source / ui / miscdlgs / textdlgs.cxx
blobff4ac7464b369c2542e1f5de90995b8f396eded4
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: textdlgs.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_sc.hxx"
34 #undef SC_DLLIMPLEMENTATION
36 // ohne precompiled Headers uebersetzen !!!
40 // INCLUDE ---------------------------------------------------------------
42 #include <svx/svxids.hrc>
44 //CHINA001 #include <svx/chardlg.hxx>
45 #include <svx/flstitem.hxx>
46 //CHINA001 #include <svx/paragrph.hxx>
47 //CHINA001 #include <svx/tabstpge.hxx>
48 #include <sfx2/objsh.hxx>
49 #include <svtools/cjkoptions.hxx>
51 #include "textdlgs.hxx"
52 #include "scresid.hxx"
53 #include "sc.hrc"
54 #include <svx/svxids.hrc> //add CHINA001
55 #include <svtools/intitem.hxx> //add CHINA001
56 #include <svx/flagsdef.hxx> //CHINA001
57 // -----------------------------------------------------------------------
59 ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
60 const SfxObjectShell* pDocShell ) :
61 SfxTabDialog ( pParent, ScResId( RID_SCDLG_CHAR ), pAttr ),
62 rOutAttrs ( *pAttr ),
63 rDocShell ( *pDocShell )
65 FreeResource();
67 AddTabPage( RID_SVXPAGE_CHAR_NAME ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, 0);
68 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, 0);
69 AddTabPage( RID_SVXPAGE_CHAR_POSITION ); //CHINA001 AddTabPage( RID_SVXPAGE_CHAR_POSITION, SvxCharPositionPage::Create, 0);
72 // -----------------------------------------------------------------------
74 void __EXPORT ScCharDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
76 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); //CHINA001
77 switch( nId )
79 case RID_SVXPAGE_CHAR_NAME:
81 SvxFontListItem aItem(*( (const SvxFontListItem*)
82 ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
84 //CHINA001 ( (SvxCharNamePage&) rPage ).SetFontList( aItem );
85 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
86 rPage.PageCreated(aSet);
88 break;
90 case RID_SVXPAGE_CHAR_EFFECTS:
91 //CHINA001 ( (SvxCharEffectsPage&) rPage ).DisableControls(
92 //CHINA001 DISABLE_CASEMAP);
93 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); //CHINA001
94 rPage.PageCreated(aSet);
95 break;
97 default:
98 break;
102 // -----------------------------------------------------------------------
104 ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
105 SfxTabDialog ( pParent, ScResId( RID_SCDLG_PARAGRAPH ), pAttr ),
106 rOutAttrs ( *pAttr )
108 FreeResource();
110 SvtCJKOptions aCJKOptions;
112 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH, SvxStdParagraphTabPage::Create, 0);
113 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );//CHINA001 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH, SvxParaAlignTabPage::Create, 0);
114 //AddTabPage( RID_SVXPAGE_EXT_PARAGRAPH, SvxExtParagraphTabPage::Create, 0);
115 if ( aCJKOptions.IsAsianTypographyEnabled() )
116 AddTabPage( RID_SVXPAGE_PARA_ASIAN);//CHINA001 AddTabPage( RID_SVXPAGE_PARA_ASIAN, SvxAsianTabPage::Create,0);
117 else
118 RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
119 AddTabPage( RID_SVXPAGE_TABULATOR );//CHINA001 AddTabPage( RID_SVXPAGE_TABULATOR, SvxTabulatorTabPage::Create, 0);
122 // -----------------------------------------------------------------------
124 void __EXPORT ScParagraphDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
126 switch( nId )
128 case RID_SVXPAGE_TABULATOR:
130 //CHINA001 ( (SvxTabulatorTabPage&) rPage ).
131 //CHINA001 DisableControls( TABTYPE_ALL &~TABTYPE_LEFT |
132 //CHINA001 TABFILL_ALL &~TABFILL_NONE );
133 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));//add CHINA001
134 aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
135 (TABFILL_ALL &~TABFILL_NONE) ));
136 rPage.PageCreated(aSet);//add CHINA001
138 break;