xref: /aoo42x/main/sw/source/ui/shells/drwtxtex.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sw.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
34*cdf0e10cSrcweir #include <i18npool/mslangid.hxx>
35*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
36*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
37*cdf0e10cSrcweir #include <sfx2/request.hxx>
38*cdf0e10cSrcweir #include <tools/shl.hxx>
39*cdf0e10cSrcweir #include <svx/svdview.hxx>
40*cdf0e10cSrcweir #include <editeng/spltitem.hxx>
41*cdf0e10cSrcweir #include <editeng/orphitem.hxx>
42*cdf0e10cSrcweir #include <editeng/brkitem.hxx>
43*cdf0e10cSrcweir #include <editeng/widwitem.hxx>
44*cdf0e10cSrcweir #include <editeng/kernitem.hxx>
45*cdf0e10cSrcweir #include <editeng/escpitem.hxx>
46*cdf0e10cSrcweir #include <editeng/lspcitem.hxx>
47*cdf0e10cSrcweir #include <editeng/adjitem.hxx>
48*cdf0e10cSrcweir #include <editeng/crsditem.hxx>
49*cdf0e10cSrcweir #include <editeng/shdditem.hxx>
50*cdf0e10cSrcweir #include <editeng/hyznitem.hxx>
51*cdf0e10cSrcweir #include <editeng/udlnitem.hxx>
52*cdf0e10cSrcweir #include <editeng/fontitem.hxx>
53*cdf0e10cSrcweir #include <editeng/fhgtitem.hxx>
54*cdf0e10cSrcweir #include <editeng/colritem.hxx>
55*cdf0e10cSrcweir #include <editeng/wghtitem.hxx>
56*cdf0e10cSrcweir #include <editeng/cntritem.hxx>
57*cdf0e10cSrcweir #include <editeng/postitem.hxx>
58*cdf0e10cSrcweir #include <editeng/frmdiritem.hxx>
59*cdf0e10cSrcweir #include <svx/svdoutl.hxx>
60*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
61*cdf0e10cSrcweir #include <svl/whiter.hxx>
62*cdf0e10cSrcweir #include <svl/cjkoptions.hxx>
63*cdf0e10cSrcweir #include <svl/ctloptions.hxx>
64*cdf0e10cSrcweir #include <svtools/langtab.hxx>
65*cdf0e10cSrcweir #include <svl/languageoptions.hxx>
66*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
67*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
68*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
69*cdf0e10cSrcweir #include <sfx2/request.hxx>
70*cdf0e10cSrcweir #include <editeng/flditem.hxx>
71*cdf0e10cSrcweir #include <editeng/editstat.hxx>
72*cdf0e10cSrcweir #include <svx/hlnkitem.hxx>
73*cdf0e10cSrcweir #include <svx/htmlmode.hxx>
74*cdf0e10cSrcweir #include <svl/languageoptions.hxx>
75*cdf0e10cSrcweir #include <svl/slstitm.hxx>
76*cdf0e10cSrcweir #include <editeng/langitem.hxx>
77*cdf0e10cSrcweir #include <svtools/langtab.hxx>
78*cdf0e10cSrcweir #include <editeng/unolingu.hxx>
79*cdf0e10cSrcweir #include <editeng/scripttypeitem.hxx>
80*cdf0e10cSrcweir #include <editeng/writingmodeitem.hxx>
81*cdf0e10cSrcweir #include <editeng/eeitem.hxx>
82*cdf0e10cSrcweir #include <editeng/editeng.hxx>
83*cdf0e10cSrcweir #include <editeng/editdata.hxx>
84*cdf0e10cSrcweir #include <editeng/outliner.hxx>
85*cdf0e10cSrcweir #include <vcl/window.hxx>
86*cdf0e10cSrcweir #include <editeng/editview.hxx>
87*cdf0e10cSrcweir #include <vcl/outdev.hxx>
88*cdf0e10cSrcweir #include <editeng/hyznitem.hxx>
89*cdf0e10cSrcweir #include <editeng/kernitem.hxx>
90*cdf0e10cSrcweir #include <editeng/langitem.hxx>
91*cdf0e10cSrcweir #include <editeng/lspcitem.hxx>
92*cdf0e10cSrcweir #include <editeng/orphitem.hxx>
93*cdf0e10cSrcweir #include <editeng/outliner.hxx>
94*cdf0e10cSrcweir #include <editeng/postitem.hxx>
95*cdf0e10cSrcweir #include <editeng/scripttypeitem.hxx>
96*cdf0e10cSrcweir #include <editeng/shdditem.hxx>
97*cdf0e10cSrcweir #include <editeng/spltitem.hxx>
98*cdf0e10cSrcweir #include <svx/svdoutl.hxx>
99*cdf0e10cSrcweir #include <svx/svdview.hxx>
100*cdf0e10cSrcweir #include <editeng/udlnitem.hxx>
101*cdf0e10cSrcweir #include <editeng/unolingu.hxx>
102*cdf0e10cSrcweir #include <editeng/wghtitem.hxx>
103*cdf0e10cSrcweir #include <editeng/widwitem.hxx>
104*cdf0e10cSrcweir #include <editeng/writingmodeitem.hxx>
105*cdf0e10cSrcweir #include <tools/shl.hxx>
106*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
107*cdf0e10cSrcweir #include <vcl/outdev.hxx>
108*cdf0e10cSrcweir #include <vcl/window.hxx>
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir #include <cmdid.h>
111*cdf0e10cSrcweir #include <doc.hxx>
112*cdf0e10cSrcweir #include <docstat.hxx>
113*cdf0e10cSrcweir #include <drwtxtsh.hxx>
114*cdf0e10cSrcweir #include <edtwin.hxx>
115*cdf0e10cSrcweir #include <globals.hrc>
116*cdf0e10cSrcweir #include <hintids.hxx>
117*cdf0e10cSrcweir #include <initui.hxx>               // fuer SpellPointer
118*cdf0e10cSrcweir #include <langhelper.hxx>
119*cdf0e10cSrcweir #include <pardlg.hxx>
120*cdf0e10cSrcweir #include <shells.hrc>
121*cdf0e10cSrcweir #include <string.h>
122*cdf0e10cSrcweir #include <swdtflvr.hxx>
123*cdf0e10cSrcweir #include <swmodule.hxx>
124*cdf0e10cSrcweir #include <swwait.hxx>
125*cdf0e10cSrcweir #include <uitool.hxx>
126*cdf0e10cSrcweir #include <viewopt.hxx>
127*cdf0e10cSrcweir #include <wrtsh.hxx>
128*cdf0e10cSrcweir #include <wview.hxx>
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir #include "swabstdlg.hxx"
131*cdf0e10cSrcweir #include "chrdlg.hrc"
132*cdf0e10cSrcweir #include "misc.hrc"
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir #include <langhelper.hxx>
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir using namespace ::com::sun::star;
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir /*--------------------------------------------------------------------
140*cdf0e10cSrcweir 	Beschreibung:
141*cdf0e10cSrcweir  --------------------------------------------------------------------*/
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir void SwDrawTextShell::Execute( SfxRequest &rReq )
144*cdf0e10cSrcweir {
145*cdf0e10cSrcweir 	SwWrtShell &rSh = GetShell();
146*cdf0e10cSrcweir     	OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
147*cdf0e10cSrcweir     	SfxItemSet aEditAttr(pOLV->GetAttribs());
148*cdf0e10cSrcweir 	SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir 	sal_uInt16 nSlot = rReq.GetSlot();
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 	sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
153*cdf0e10cSrcweir 	const SfxItemSet *pNewAttrs = rReq.GetArgs();
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir 	bool bRestoreSelection = false;
156*cdf0e10cSrcweir 	ESelection aOldSelection;
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	sal_uInt16 nEEWhich = 0;
159*cdf0e10cSrcweir 	switch (nSlot)
160*cdf0e10cSrcweir 	{
161*cdf0e10cSrcweir 		case SID_LANGUAGE_STATUS:
162*cdf0e10cSrcweir         {
163*cdf0e10cSrcweir 			aOldSelection = pOLV->GetSelection();
164*cdf0e10cSrcweir 			if (!pOLV->GetEditView().HasSelection())
165*cdf0e10cSrcweir 			{
166*cdf0e10cSrcweir 				bRestoreSelection	= true;
167*cdf0e10cSrcweir 				pOLV->GetEditView().SelectCurrentWord();
168*cdf0e10cSrcweir 			}
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 			bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,GetView(),rSh);
171*cdf0e10cSrcweir 			break;
172*cdf0e10cSrcweir         }
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir         case SID_THES:
175*cdf0e10cSrcweir         {
176*cdf0e10cSrcweir             String aReplaceText;
177*cdf0e10cSrcweir             SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
178*cdf0e10cSrcweir             if (pItem2)
179*cdf0e10cSrcweir                 aReplaceText = pItem2->GetValue();
180*cdf0e10cSrcweir             if (aReplaceText.Len() > 0)
181*cdf0e10cSrcweir                 ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
182*cdf0e10cSrcweir             break;
183*cdf0e10cSrcweir         }
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir         case SID_ATTR_CHAR_FONT:
186*cdf0e10cSrcweir         case SID_ATTR_CHAR_FONTHEIGHT:
187*cdf0e10cSrcweir         case SID_ATTR_CHAR_WEIGHT:
188*cdf0e10cSrcweir         case SID_ATTR_CHAR_POSTURE:
189*cdf0e10cSrcweir         {
190*cdf0e10cSrcweir             SfxItemPool* pPool2 = aEditAttr.GetPool()->GetSecondaryPool();
191*cdf0e10cSrcweir             if( !pPool2 )
192*cdf0e10cSrcweir                 pPool2 = aEditAttr.GetPool();
193*cdf0e10cSrcweir             SvxScriptSetItem aSetItem( nSlot, *pPool2 );
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir             // #i78017 establish the same behaviour as in Writer
196*cdf0e10cSrcweir             sal_uInt16 nScriptTypes = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX;
197*cdf0e10cSrcweir             if (nSlot == SID_ATTR_CHAR_FONT)
198*cdf0e10cSrcweir                 nScriptTypes = pOLV->GetSelectedScriptType();
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir             aSetItem.PutItemForScriptType( nScriptTypes, pNewAttrs->Get( nWhich ) );
201*cdf0e10cSrcweir             aNewAttr.Put( aSetItem.GetItemSet() );
202*cdf0e10cSrcweir         }
203*cdf0e10cSrcweir         break;
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir         case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 		case SID_ATTR_CHAR_UNDERLINE:
208*cdf0e10cSrcweir 		{
209*cdf0e10cSrcweir 		 	FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
210*cdf0e10cSrcweir 			aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
211*cdf0e10cSrcweir 		}
212*cdf0e10cSrcweir 		break;
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 		case SID_ATTR_CHAR_OVERLINE:
215*cdf0e10cSrcweir 		{
216*cdf0e10cSrcweir 		 	FontUnderline eFO = ((const SvxOverlineItem&)aEditAttr.Get(EE_CHAR_OVERLINE)).GetLineStyle();
217*cdf0e10cSrcweir 			aNewAttr.Put(SvxOverlineItem(eFO == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_OVERLINE));
218*cdf0e10cSrcweir 		}
219*cdf0e10cSrcweir 		break;
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir         case SID_ATTR_CHAR_CONTOUR:     nEEWhich = EE_CHAR_OUTLINE; break;
222*cdf0e10cSrcweir         case SID_ATTR_CHAR_SHADOWED:    nEEWhich = EE_CHAR_SHADOW; break;
223*cdf0e10cSrcweir         case SID_ATTR_CHAR_STRIKEOUT:   nEEWhich = EE_CHAR_STRIKEOUT; break;
224*cdf0e10cSrcweir         case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
225*cdf0e10cSrcweir         case SID_ATTR_CHAR_RELIEF      : nEEWhich = EE_CHAR_RELIEF;  break;
226*cdf0e10cSrcweir         case SID_ATTR_CHAR_LANGUAGE    : nEEWhich = EE_CHAR_LANGUAGE;break;
227*cdf0e10cSrcweir         case SID_ATTR_CHAR_KERNING     : nEEWhich = EE_CHAR_KERNING; break;
228*cdf0e10cSrcweir         case SID_ATTR_CHAR_SCALEWIDTH:   nEEWhich = EE_CHAR_FONTWIDTH; break;
229*cdf0e10cSrcweir         case SID_ATTR_CHAR_AUTOKERN  :   nEEWhich = EE_CHAR_PAIRKERNING; break;
230*cdf0e10cSrcweir         case SID_ATTR_CHAR_ESCAPEMENT:   nEEWhich = EE_CHAR_ESCAPEMENT; break;
231*cdf0e10cSrcweir         case SID_ATTR_PARA_ADJUST_LEFT:
232*cdf0e10cSrcweir 			aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_LEFT, EE_PARA_JUST));
233*cdf0e10cSrcweir         break;
234*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_CENTER:
235*cdf0e10cSrcweir 			aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST));
236*cdf0e10cSrcweir         break;
237*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_RIGHT:
238*cdf0e10cSrcweir 			aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_RIGHT, EE_PARA_JUST));
239*cdf0e10cSrcweir         break;
240*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_BLOCK:
241*cdf0e10cSrcweir 			aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST));
242*cdf0e10cSrcweir         break;
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_10:
245*cdf0e10cSrcweir 		{
246*cdf0e10cSrcweir 			SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL);
247*cdf0e10cSrcweir 			aItem.SetPropLineSpace(100);
248*cdf0e10cSrcweir 			aNewAttr.Put(aItem);
249*cdf0e10cSrcweir 		}
250*cdf0e10cSrcweir 		break;
251*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_15:
252*cdf0e10cSrcweir 		{
253*cdf0e10cSrcweir 			SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL);
254*cdf0e10cSrcweir 			aItem.SetPropLineSpace(150);
255*cdf0e10cSrcweir 			aNewAttr.Put(aItem);
256*cdf0e10cSrcweir 		}
257*cdf0e10cSrcweir 		break;
258*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_20:
259*cdf0e10cSrcweir 		{
260*cdf0e10cSrcweir 			SvxLineSpacingItem aItem(SVX_LINESPACE_TWO_LINES, EE_PARA_SBL);
261*cdf0e10cSrcweir 			aItem.SetPropLineSpace(200);
262*cdf0e10cSrcweir 			aNewAttr.Put(aItem);
263*cdf0e10cSrcweir 		}
264*cdf0e10cSrcweir 		break;
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 		case FN_SET_SUPER_SCRIPT:
267*cdf0e10cSrcweir 		{
268*cdf0e10cSrcweir 			SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
269*cdf0e10cSrcweir 			SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
270*cdf0e10cSrcweir 							aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 			if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
273*cdf0e10cSrcweir 				aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
274*cdf0e10cSrcweir 			else
275*cdf0e10cSrcweir 				aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
276*cdf0e10cSrcweir 			aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
277*cdf0e10cSrcweir 		}
278*cdf0e10cSrcweir 		break;
279*cdf0e10cSrcweir 		case FN_SET_SUB_SCRIPT:
280*cdf0e10cSrcweir 		{
281*cdf0e10cSrcweir 			SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
282*cdf0e10cSrcweir 			SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
283*cdf0e10cSrcweir 							aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir 			if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
286*cdf0e10cSrcweir 				aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
287*cdf0e10cSrcweir 			else
288*cdf0e10cSrcweir 				aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
289*cdf0e10cSrcweir 			aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
290*cdf0e10cSrcweir 		}
291*cdf0e10cSrcweir 		break;
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 		case SID_CHAR_DLG:
294*cdf0e10cSrcweir 		case SID_CHAR_DLG_FOR_PARAGRAPH:
295*cdf0e10cSrcweir 		{
296*cdf0e10cSrcweir 			const SfxItemSet* pArgs = rReq.GetArgs();
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir 			if( !pArgs )
299*cdf0e10cSrcweir 			{
300*cdf0e10cSrcweir 				aOldSelection = pOLV->GetSelection();
301*cdf0e10cSrcweir 				if (nSlot == SID_CHAR_DLG_FOR_PARAGRAPH)
302*cdf0e10cSrcweir 				{
303*cdf0e10cSrcweir 					// select current paragraph (and restore selection later on...)
304*cdf0e10cSrcweir 					EditView & rEditView = pOLV->GetEditView();
305*cdf0e10cSrcweir 					SwLangHelper::SelectPara( rEditView, rEditView.GetSelection() );
306*cdf0e10cSrcweir 					bRestoreSelection = true;
307*cdf0e10cSrcweir 				}
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir 				SwView* pView = &GetView();
310*cdf0e10cSrcweir 				FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
311*cdf0e10cSrcweir                 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
312*cdf0e10cSrcweir 				SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 				// util::Language gibts an der EditEngine nicht! Daher nicht im Set.
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 				aDlgAttr.Put( aEditAttr );
317*cdf0e10cSrcweir                 aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
320*cdf0e10cSrcweir                 DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir                 SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR,0, sal_True );
323*cdf0e10cSrcweir                 DBG_ASSERT(pDlg, "Dialogdiet fail!");
324*cdf0e10cSrcweir 				sal_uInt16 nRet = pDlg->Execute();
325*cdf0e10cSrcweir 				if(RET_OK == nRet )
326*cdf0e10cSrcweir                 {
327*cdf0e10cSrcweir                     rReq.Done( *( pDlg->GetOutputItemSet() ) );
328*cdf0e10cSrcweir                     aNewAttr.Put(*pDlg->GetOutputItemSet());
329*cdf0e10cSrcweir                 }
330*cdf0e10cSrcweir 				delete( pDlg );
331*cdf0e10cSrcweir 				if(RET_OK != nRet)
332*cdf0e10cSrcweir 					return ;
333*cdf0e10cSrcweir 			}
334*cdf0e10cSrcweir 			else
335*cdf0e10cSrcweir 				aNewAttr.Put(*pArgs);
336*cdf0e10cSrcweir 		}
337*cdf0e10cSrcweir 		break;
338*cdf0e10cSrcweir 		case FN_FORMAT_FOOTNOTE_DLG:
339*cdf0e10cSrcweir 		{
340*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
341*cdf0e10cSrcweir             DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
344*cdf0e10cSrcweir             DBG_ASSERT(pDlg, "Dialogdiet fail!");
345*cdf0e10cSrcweir 			pDlg->Execute();
346*cdf0e10cSrcweir 			delete pDlg;
347*cdf0e10cSrcweir 			break;
348*cdf0e10cSrcweir 		}
349*cdf0e10cSrcweir 		case FN_NUMBERING_OUTLINE_DLG:
350*cdf0e10cSrcweir 		{
351*cdf0e10cSrcweir 			SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
352*cdf0e10cSrcweir 			SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
353*cdf0e10cSrcweir             DBG_ASSERT(pFact, "Dialogdiet fail!");
354*cdf0e10cSrcweir             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
355*cdf0e10cSrcweir 														GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
356*cdf0e10cSrcweir             DBG_ASSERT(pDlg, "Dialogdiet fail!");
357*cdf0e10cSrcweir 			pDlg->Execute();
358*cdf0e10cSrcweir 			delete pDlg;
359*cdf0e10cSrcweir 			rReq.Done();
360*cdf0e10cSrcweir 		}
361*cdf0e10cSrcweir 		break;
362*cdf0e10cSrcweir 		case SID_OPEN_XML_FILTERSETTINGS:
363*cdf0e10cSrcweir 		{
364*cdf0e10cSrcweir 			try
365*cdf0e10cSrcweir 			{
366*cdf0e10cSrcweir 				uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
367*cdf0e10cSrcweir 				if( xDialog.is() )
368*cdf0e10cSrcweir 				{
369*cdf0e10cSrcweir 					xDialog->execute();
370*cdf0e10cSrcweir 				}
371*cdf0e10cSrcweir 			}
372*cdf0e10cSrcweir 			catch( uno::Exception& )
373*cdf0e10cSrcweir 			{
374*cdf0e10cSrcweir 			}
375*cdf0e10cSrcweir 			rReq.Ignore ();
376*cdf0e10cSrcweir 		}
377*cdf0e10cSrcweir 		break;
378*cdf0e10cSrcweir 		case FN_WORDCOUNT_DIALOG:
379*cdf0e10cSrcweir 		{
380*cdf0e10cSrcweir 			SwDocStat aCurr;
381*cdf0e10cSrcweir 			SwDocStat aDocStat( rSh.getIDocumentStatistics()->GetDocStat() );
382*cdf0e10cSrcweir 			{
383*cdf0e10cSrcweir 				SwWait aWait( *GetView().GetDocShell(), sal_True );
384*cdf0e10cSrcweir 				rSh.StartAction();
385*cdf0e10cSrcweir 				rSh.CountWords( aCurr );
386*cdf0e10cSrcweir 				rSh.UpdateDocStat( aDocStat );
387*cdf0e10cSrcweir 				rSh.EndAction();
388*cdf0e10cSrcweir 			}
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir 			SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
391*cdf0e10cSrcweir 			DBG_ASSERT(pFact, "Dialogdiet fail!");
392*cdf0e10cSrcweir 			AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
393*cdf0e10cSrcweir 			pDialog->SetValues(aCurr, aDocStat );
394*cdf0e10cSrcweir 			pDialog->Execute();
395*cdf0e10cSrcweir 			delete pDialog;
396*cdf0e10cSrcweir 		}
397*cdf0e10cSrcweir 		break;
398*cdf0e10cSrcweir 		case SID_PARA_DLG:
399*cdf0e10cSrcweir 		{
400*cdf0e10cSrcweir 			const SfxItemSet* pArgs = rReq.GetArgs();
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 			if (!pArgs)
403*cdf0e10cSrcweir 			{
404*cdf0e10cSrcweir 				SwView* pView = &GetView();
405*cdf0e10cSrcweir 				FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
406*cdf0e10cSrcweir                 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
407*cdf0e10cSrcweir 				SfxItemSet aDlgAttr(GetPool(),
408*cdf0e10cSrcweir 									EE_ITEMS_START, EE_ITEMS_END,
409*cdf0e10cSrcweir 									SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
410*cdf0e10cSrcweir 									SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
411*cdf0e10cSrcweir 									SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
412*cdf0e10cSrcweir 									SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
413*cdf0e10cSrcweir 									0);
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir 				aDlgAttr.Put(aEditAttr);
416*cdf0e10cSrcweir 
417*cdf0e10cSrcweir 				// Die Werte sind erst einmal uebernommen worden, um den Dialog anzuzeigen.
418*cdf0e10cSrcweir 				// Muss natuerlich noch geaendert werden
419*cdf0e10cSrcweir 				// aDlgAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) );
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir                 aDlgAttr.Put( SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE) );
422*cdf0e10cSrcweir                 aDlgAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
423*cdf0e10cSrcweir                 aDlgAttr.Put( SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT ) );
424*cdf0e10cSrcweir                 aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
425*cdf0e10cSrcweir                 aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
428*cdf0e10cSrcweir                 DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir                 SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
431*cdf0e10cSrcweir                 DBG_ASSERT(pDlg, "Dialogdiet fail!");
432*cdf0e10cSrcweir 				sal_uInt16 nRet = pDlg->Execute();
433*cdf0e10cSrcweir 				if(RET_OK == nRet)
434*cdf0e10cSrcweir                 {
435*cdf0e10cSrcweir                     rReq.Done( *( pDlg->GetOutputItemSet() ) );
436*cdf0e10cSrcweir                     aNewAttr.Put(*pDlg->GetOutputItemSet());
437*cdf0e10cSrcweir                 }
438*cdf0e10cSrcweir 				delete( pDlg );
439*cdf0e10cSrcweir 				if(RET_OK != nRet)
440*cdf0e10cSrcweir 					return;
441*cdf0e10cSrcweir 			}
442*cdf0e10cSrcweir 			else
443*cdf0e10cSrcweir 				aNewAttr.Put(*pArgs);
444*cdf0e10cSrcweir 		}
445*cdf0e10cSrcweir 		break;
446*cdf0e10cSrcweir 		case SID_AUTOSPELL_CHECK:
447*cdf0e10cSrcweir 		{
448*cdf0e10cSrcweir //!! JP 16.03.2001: why??			pSdrView = rSh.GetDrawView();
449*cdf0e10cSrcweir //!! JP 16.03.2001: why??			pOutliner = pSdrView->GetTextEditOutliner();
450*cdf0e10cSrcweir             SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
451*cdf0e10cSrcweir             sal_uInt32 nCtrl = pOutliner->GetControlWord();
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir 			sal_Bool bSet = ((const SfxBoolItem&)rReq.GetArgs()->Get(
454*cdf0e10cSrcweir 													nSlot)).GetValue();
455*cdf0e10cSrcweir             if(bSet)
456*cdf0e10cSrcweir                 nCtrl |= EE_CNTRL_ONLINESPELLING|EE_CNTRL_ALLOWBIGOBJS;
457*cdf0e10cSrcweir             else
458*cdf0e10cSrcweir                 nCtrl &= ~EE_CNTRL_ONLINESPELLING;
459*cdf0e10cSrcweir 			pOutliner->SetControlWord(nCtrl);
460*cdf0e10cSrcweir 
461*cdf0e10cSrcweir             rView.ExecuteSlot(rReq);
462*cdf0e10cSrcweir 		}
463*cdf0e10cSrcweir 		break;
464*cdf0e10cSrcweir 		case SID_HYPERLINK_SETLINK:
465*cdf0e10cSrcweir 		{
466*cdf0e10cSrcweir 			const SfxPoolItem* pItem = 0;
467*cdf0e10cSrcweir 			if(pNewAttrs)
468*cdf0e10cSrcweir 				pNewAttrs->GetItemState(nSlot, sal_False, &pItem);
469*cdf0e10cSrcweir 
470*cdf0e10cSrcweir 			if(pItem)
471*cdf0e10cSrcweir 			{
472*cdf0e10cSrcweir 				const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
473*cdf0e10cSrcweir 				SvxURLField aFld(rHLinkItem.GetURL(), rHLinkItem.GetName(), SVXURLFORMAT_APPDEFAULT);
474*cdf0e10cSrcweir 				aFld.SetTargetFrame(rHLinkItem.GetTargetFrame());
475*cdf0e10cSrcweir 
476*cdf0e10cSrcweir 				const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir 				if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
479*cdf0e10cSrcweir 				{
480*cdf0e10cSrcweir 					// Feld selektieren, so dass es beim Insert geloescht wird
481*cdf0e10cSrcweir 					ESelection aSel = pOLV->GetSelection();
482*cdf0e10cSrcweir 					aSel.nEndPos++;
483*cdf0e10cSrcweir 					pOLV->SetSelection(aSel);
484*cdf0e10cSrcweir 				}
485*cdf0e10cSrcweir                 pOLV->InsertField(SvxFieldItem(aFld, EE_FEATURE_FIELD));
486*cdf0e10cSrcweir 			}
487*cdf0e10cSrcweir 		}
488*cdf0e10cSrcweir 		break;
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir 		case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
491*cdf0e10cSrcweir     	case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
492*cdf0e10cSrcweir 			// Shellwechsel!
493*cdf0e10cSrcweir 			{
494*cdf0e10cSrcweir 				SdrObject* pTmpObj = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
495*cdf0e10cSrcweir 				SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
496*cdf0e10cSrcweir 				SdrView* pTmpView = pSdrView;
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir                 pSdrView->SdrEndTextEdit(sal_True);
499*cdf0e10cSrcweir 
500*cdf0e10cSrcweir 				SfxItemSet aAttr( *aNewAttr.GetPool(),
501*cdf0e10cSrcweir 							SDRATTR_TEXTDIRECTION,
502*cdf0e10cSrcweir 							SDRATTR_TEXTDIRECTION );
503*cdf0e10cSrcweir 
504*cdf0e10cSrcweir 				aAttr.Put( SvxWritingModeItem(
505*cdf0e10cSrcweir 					nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
506*cdf0e10cSrcweir                         text::WritingMode_LR_TB
507*cdf0e10cSrcweir                         : text::WritingMode_TB_RL, SDRATTR_TEXTDIRECTION ) );
508*cdf0e10cSrcweir 				pTmpView->SetAttributes( aAttr );
509*cdf0e10cSrcweir 
510*cdf0e10cSrcweir 				rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin(), sal_False);
511*cdf0e10cSrcweir 				rSh.GetView().AttrChangedNotify( &rSh );
512*cdf0e10cSrcweir 			}
513*cdf0e10cSrcweir 			return;
514*cdf0e10cSrcweir 
515*cdf0e10cSrcweir         case SID_ATTR_PARA_LEFT_TO_RIGHT:
516*cdf0e10cSrcweir         case SID_ATTR_PARA_RIGHT_TO_LEFT:
517*cdf0e10cSrcweir         {
518*cdf0e10cSrcweir             SdrObject* pTmpObj = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
519*cdf0e10cSrcweir             SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
520*cdf0e10cSrcweir             SdrView* pTmpView = pSdrView;
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir             pSdrView->SdrEndTextEdit(sal_True);
523*cdf0e10cSrcweir             sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir             const SfxPoolItem* pPoolItem;
526*cdf0e10cSrcweir             if( pNewAttrs && SFX_ITEM_SET == pNewAttrs->GetItemState( nSlot, sal_True, &pPoolItem ) )
527*cdf0e10cSrcweir             {
528*cdf0e10cSrcweir                 if( !( (SfxBoolItem*)pPoolItem)->GetValue() )
529*cdf0e10cSrcweir                     bLeftToRight = !bLeftToRight;
530*cdf0e10cSrcweir             }
531*cdf0e10cSrcweir             SfxItemSet aAttr( *aNewAttr.GetPool(),
532*cdf0e10cSrcweir                         EE_PARA_JUST, EE_PARA_JUST,
533*cdf0e10cSrcweir                         EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
534*cdf0e10cSrcweir                         0 );
535*cdf0e10cSrcweir 
536*cdf0e10cSrcweir             sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
537*cdf0e10cSrcweir             if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
538*cdf0e10cSrcweir                 nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir             if( bLeftToRight )
541*cdf0e10cSrcweir             {
542*cdf0e10cSrcweir                 aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
543*cdf0e10cSrcweir                 if( nAdjust == SVX_ADJUST_RIGHT )
544*cdf0e10cSrcweir                     aAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
545*cdf0e10cSrcweir             }
546*cdf0e10cSrcweir             else
547*cdf0e10cSrcweir             {
548*cdf0e10cSrcweir                 aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
549*cdf0e10cSrcweir                 if( nAdjust == SVX_ADJUST_LEFT )
550*cdf0e10cSrcweir                     aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
551*cdf0e10cSrcweir             }
552*cdf0e10cSrcweir             pTmpView->SetAttributes( aAttr );
553*cdf0e10cSrcweir             rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin(), sal_False );
554*cdf0e10cSrcweir             rSh.GetView().AttrChangedNotify( &rSh );
555*cdf0e10cSrcweir         }
556*cdf0e10cSrcweir         return;
557*cdf0e10cSrcweir 		default:
558*cdf0e10cSrcweir 			ASSERT(!this, falscher Dispatcher);
559*cdf0e10cSrcweir 			return;
560*cdf0e10cSrcweir 	}
561*cdf0e10cSrcweir     if(nEEWhich && pNewAttrs)
562*cdf0e10cSrcweir         aNewAttr.Put(pNewAttrs->Get(nWhich), nEEWhich);
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir 	SetAttrToMarked(aNewAttr);
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir 	GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
567*cdf0e10cSrcweir 
568*cdf0e10cSrcweir 	if (IsTextEdit() && pOLV->GetOutliner()->IsModified())
569*cdf0e10cSrcweir 		rSh.SetModified();
570*cdf0e10cSrcweir 
571*cdf0e10cSrcweir 	if (bRestoreSelection)
572*cdf0e10cSrcweir 	{
573*cdf0e10cSrcweir 		// restore selection
574*cdf0e10cSrcweir 		pOLV->GetEditView().SetSelection( aOldSelection );
575*cdf0e10cSrcweir 	}
576*cdf0e10cSrcweir }
577*cdf0e10cSrcweir 
578*cdf0e10cSrcweir /*--------------------------------------------------------------------
579*cdf0e10cSrcweir 	Beschreibung:
580*cdf0e10cSrcweir  --------------------------------------------------------------------*/
581*cdf0e10cSrcweir 
582*cdf0e10cSrcweir void SwDrawTextShell::GetState(SfxItemSet& rSet)
583*cdf0e10cSrcweir {
584*cdf0e10cSrcweir 	if (!IsTextEdit())	// Sonst manchmal Absturz!
585*cdf0e10cSrcweir 		return;
586*cdf0e10cSrcweir 
587*cdf0e10cSrcweir 	OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
588*cdf0e10cSrcweir     SfxWhichIter aIter(rSet);
589*cdf0e10cSrcweir 	sal_uInt16 nWhich = aIter.FirstWhich();
590*cdf0e10cSrcweir 
591*cdf0e10cSrcweir     SfxItemSet aEditAttr( pOLV->GetAttribs() );
592*cdf0e10cSrcweir 	const SfxPoolItem *pAdjust = 0, *pLSpace = 0, *pEscItem = 0;
593*cdf0e10cSrcweir 	int eAdjust, nLSpace, nEsc;
594*cdf0e10cSrcweir 
595*cdf0e10cSrcweir 	while(nWhich)
596*cdf0e10cSrcweir 	{
597*cdf0e10cSrcweir 		sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
598*cdf0e10cSrcweir 		sal_Bool bFlag = sal_False;
599*cdf0e10cSrcweir 		switch( nSlotId )
600*cdf0e10cSrcweir 		{
601*cdf0e10cSrcweir 		    case SID_LANGUAGE_STATUS://20412:
602*cdf0e10cSrcweir             {
603*cdf0e10cSrcweir 				nSlotId = SwLangHelper::GetLanguageStatus(pOLV,rSet);;
604*cdf0e10cSrcweir 				break;
605*cdf0e10cSrcweir 			}
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir             case SID_THES:
608*cdf0e10cSrcweir             {
609*cdf0e10cSrcweir                 String          aStatusVal;
610*cdf0e10cSrcweir                 LanguageType    nLang = LANGUAGE_NONE;
611*cdf0e10cSrcweir                 bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() );
612*cdf0e10cSrcweir                 rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir                 // disable "Thesaurus" context menu entry if there is nothing to look up
615*cdf0e10cSrcweir                 uno::Reference< linguistic2::XThesaurus >  xThes( ::GetThesaurus() );
616*cdf0e10cSrcweir                 lang::Locale aLocale( SvxCreateLocale( nLang ) );
617*cdf0e10cSrcweir                 if (!bIsLookUpWord ||
618*cdf0e10cSrcweir                     !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
619*cdf0e10cSrcweir                     rSet.DisableItem( SID_THES );
620*cdf0e10cSrcweir 
621*cdf0e10cSrcweir                 //! avoid puting the same item as SfxBoolItem at the end of this function
622*cdf0e10cSrcweir                 nSlotId = 0;
623*cdf0e10cSrcweir                 break;
624*cdf0e10cSrcweir             }
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir         case SID_ATTR_PARA_ADJUST_LEFT:     eAdjust = SVX_ADJUST_LEFT; goto ASK_ADJUST;
627*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_RIGHT:	eAdjust = SVX_ADJUST_RIGHT; goto ASK_ADJUST;
628*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_CENTER:	eAdjust = SVX_ADJUST_CENTER; goto ASK_ADJUST;
629*cdf0e10cSrcweir 		case SID_ATTR_PARA_ADJUST_BLOCK:	eAdjust = SVX_ADJUST_BLOCK; goto ASK_ADJUST;
630*cdf0e10cSrcweir ASK_ADJUST:
631*cdf0e10cSrcweir 			{
632*cdf0e10cSrcweir 				if( !pAdjust )
633*cdf0e10cSrcweir 					aEditAttr.GetItemState( EE_PARA_JUST, sal_False, &pAdjust);
634*cdf0e10cSrcweir 
635*cdf0e10cSrcweir 				if( !pAdjust || IsInvalidItem( pAdjust ))
636*cdf0e10cSrcweir 					rSet.InvalidateItem( nSlotId ), nSlotId = 0;
637*cdf0e10cSrcweir 				else
638*cdf0e10cSrcweir 					bFlag = eAdjust == ((SvxAdjustItem*)pAdjust)->GetAdjust();
639*cdf0e10cSrcweir 			}
640*cdf0e10cSrcweir 			break;
641*cdf0e10cSrcweir 
642*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_10:	nLSpace = 100;	goto ASK_LINESPACE;
643*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_15:	nLSpace = 150;	goto ASK_LINESPACE;
644*cdf0e10cSrcweir 		case SID_ATTR_PARA_LINESPACE_20:	nLSpace = 200;	goto ASK_LINESPACE;
645*cdf0e10cSrcweir ASK_LINESPACE:
646*cdf0e10cSrcweir 			{
647*cdf0e10cSrcweir 				if( !pLSpace )
648*cdf0e10cSrcweir 					aEditAttr.GetItemState( EE_PARA_SBL, sal_False, &pLSpace );
649*cdf0e10cSrcweir 
650*cdf0e10cSrcweir 				if( !pLSpace || IsInvalidItem( pLSpace ))
651*cdf0e10cSrcweir 					rSet.InvalidateItem( nSlotId ), nSlotId = 0;
652*cdf0e10cSrcweir 				else if( nLSpace == ((const SvxLineSpacingItem*)pLSpace)->
653*cdf0e10cSrcweir 												GetPropLineSpace() )
654*cdf0e10cSrcweir 					bFlag = sal_True;
655*cdf0e10cSrcweir 				else
656*cdf0e10cSrcweir 					nSlotId = 0;
657*cdf0e10cSrcweir 			}
658*cdf0e10cSrcweir 			break;
659*cdf0e10cSrcweir 
660*cdf0e10cSrcweir 		case FN_SET_SUPER_SCRIPT:	nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
661*cdf0e10cSrcweir 									goto ASK_ESCAPE;
662*cdf0e10cSrcweir 		case FN_SET_SUB_SCRIPT:		nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
663*cdf0e10cSrcweir 									goto ASK_ESCAPE;
664*cdf0e10cSrcweir ASK_ESCAPE:
665*cdf0e10cSrcweir 			{
666*cdf0e10cSrcweir 				if( !pEscItem )
667*cdf0e10cSrcweir 					pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT );
668*cdf0e10cSrcweir 
669*cdf0e10cSrcweir 				if( nEsc == ((const SvxEscapementItem*)
670*cdf0e10cSrcweir 												pEscItem)->GetEnumValue() )
671*cdf0e10cSrcweir 					bFlag = sal_True;
672*cdf0e10cSrcweir 				else
673*cdf0e10cSrcweir 					nSlotId = 0;
674*cdf0e10cSrcweir 			}
675*cdf0e10cSrcweir 			break;
676*cdf0e10cSrcweir 
677*cdf0e10cSrcweir         case SID_THESAURUS:
678*cdf0e10cSrcweir         {
679*cdf0e10cSrcweir             // disable "Thesaurus" if the language is not supported
680*cdf0e10cSrcweir             const SfxPoolItem &rItem = GetShell().GetDoc()->GetDefault(
681*cdf0e10cSrcweir                             GetWhichOfScript( RES_CHRATR_LANGUAGE,
682*cdf0e10cSrcweir                             GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage())) );
683*cdf0e10cSrcweir             LanguageType nLang = ((const SvxLanguageItem &) rItem).GetLanguage();
684*cdf0e10cSrcweir 
685*cdf0e10cSrcweir             uno::Reference< linguistic2::XThesaurus >  xThes( ::GetThesaurus() );
686*cdf0e10cSrcweir             if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( SvxCreateLocale( nLang ) ))
687*cdf0e10cSrcweir                 rSet.DisableItem( SID_THESAURUS );
688*cdf0e10cSrcweir             nSlotId = 0;
689*cdf0e10cSrcweir         }
690*cdf0e10cSrcweir         break;
691*cdf0e10cSrcweir         case SID_HANGUL_HANJA_CONVERSION:
692*cdf0e10cSrcweir         case SID_CHINESE_CONVERSION:
693*cdf0e10cSrcweir         {
694*cdf0e10cSrcweir             if (!SvtCJKOptions().IsAnyEnabled())
695*cdf0e10cSrcweir             {
696*cdf0e10cSrcweir                 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
697*cdf0e10cSrcweir                 rSet.DisableItem(nWhich);
698*cdf0e10cSrcweir             }
699*cdf0e10cSrcweir             else
700*cdf0e10cSrcweir                 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
701*cdf0e10cSrcweir         }
702*cdf0e10cSrcweir         break;
703*cdf0e10cSrcweir 
704*cdf0e10cSrcweir         case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
705*cdf0e10cSrcweir         case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
706*cdf0e10cSrcweir 			if ( !SvtLanguageOptions().IsVerticalTextEnabled() )
707*cdf0e10cSrcweir 			{
708*cdf0e10cSrcweir 				rSet.DisableItem( nSlotId );
709*cdf0e10cSrcweir 				nSlotId = 0;
710*cdf0e10cSrcweir 			}
711*cdf0e10cSrcweir 			else
712*cdf0e10cSrcweir 			{
713*cdf0e10cSrcweir                 SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
714*cdf0e10cSrcweir                 if( pOutliner )
715*cdf0e10cSrcweir 					bFlag = pOutliner->IsVertical() ==
716*cdf0e10cSrcweir 							(SID_TEXTDIRECTION_TOP_TO_BOTTOM == nSlotId);
717*cdf0e10cSrcweir 				else
718*cdf0e10cSrcweir 				{
719*cdf0e10cSrcweir                     text::WritingMode eMode = (text::WritingMode)
720*cdf0e10cSrcweir 									( (const SvxWritingModeItem&) aEditAttr.Get( SDRATTR_TEXTDIRECTION ) ).GetValue();
721*cdf0e10cSrcweir 
722*cdf0e10cSrcweir 					if( nSlotId == SID_TEXTDIRECTION_LEFT_TO_RIGHT )
723*cdf0e10cSrcweir 					{
724*cdf0e10cSrcweir                         bFlag = eMode == text::WritingMode_LR_TB;
725*cdf0e10cSrcweir 					}
726*cdf0e10cSrcweir 					else
727*cdf0e10cSrcweir 					{
728*cdf0e10cSrcweir                         bFlag = eMode != text::WritingMode_TB_RL;
729*cdf0e10cSrcweir 					}
730*cdf0e10cSrcweir 				}
731*cdf0e10cSrcweir 			}
732*cdf0e10cSrcweir 			break;
733*cdf0e10cSrcweir         case SID_ATTR_PARA_LEFT_TO_RIGHT:
734*cdf0e10cSrcweir         case SID_ATTR_PARA_RIGHT_TO_LEFT:
735*cdf0e10cSrcweir         {
736*cdf0e10cSrcweir             if ( !SvtLanguageOptions().IsCTLFontEnabled() )
737*cdf0e10cSrcweir             {
738*cdf0e10cSrcweir 				rSet.DisableItem( nWhich );
739*cdf0e10cSrcweir 				nSlotId = 0;
740*cdf0e10cSrcweir             }
741*cdf0e10cSrcweir             else
742*cdf0e10cSrcweir             {
743*cdf0e10cSrcweir                 SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
744*cdf0e10cSrcweir                 if(pOutliner && pOutliner->IsVertical())
745*cdf0e10cSrcweir 				{
746*cdf0e10cSrcweir 					rSet.DisableItem( nWhich );
747*cdf0e10cSrcweir 					nSlotId = 0;
748*cdf0e10cSrcweir 				}
749*cdf0e10cSrcweir 				else
750*cdf0e10cSrcweir 				{
751*cdf0e10cSrcweir 					switch( ( ( (SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() )
752*cdf0e10cSrcweir 					{
753*cdf0e10cSrcweir 						case FRMDIR_HORI_LEFT_TOP:
754*cdf0e10cSrcweir 							bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT;
755*cdf0e10cSrcweir 						break;
756*cdf0e10cSrcweir 
757*cdf0e10cSrcweir 						case FRMDIR_HORI_RIGHT_TOP:
758*cdf0e10cSrcweir 							bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT;
759*cdf0e10cSrcweir 						break;
760*cdf0e10cSrcweir 					}
761*cdf0e10cSrcweir 				}
762*cdf0e10cSrcweir 			}
763*cdf0e10cSrcweir         }
764*cdf0e10cSrcweir         break;
765*cdf0e10cSrcweir         case SID_TRANSLITERATE_HALFWIDTH:
766*cdf0e10cSrcweir         case SID_TRANSLITERATE_FULLWIDTH:
767*cdf0e10cSrcweir         case SID_TRANSLITERATE_HIRAGANA:
768*cdf0e10cSrcweir         case SID_TRANSLITERATE_KATAGANA:
769*cdf0e10cSrcweir         {
770*cdf0e10cSrcweir             SvtCJKOptions aCJKOptions;
771*cdf0e10cSrcweir             if(!aCJKOptions.IsChangeCaseMapEnabled())
772*cdf0e10cSrcweir             {
773*cdf0e10cSrcweir                 rSet.DisableItem(nWhich);
774*cdf0e10cSrcweir                 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
775*cdf0e10cSrcweir             }
776*cdf0e10cSrcweir             else
777*cdf0e10cSrcweir                 GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
778*cdf0e10cSrcweir         }
779*cdf0e10cSrcweir         break;
780*cdf0e10cSrcweir 		case SID_INSERT_RLM :
781*cdf0e10cSrcweir 		case SID_INSERT_LRM :
782*cdf0e10cSrcweir 		case SID_INSERT_ZWNBSP :
783*cdf0e10cSrcweir 		case SID_INSERT_ZWSP:
784*cdf0e10cSrcweir         {
785*cdf0e10cSrcweir 			SvtCTLOptions aCTLOptions;
786*cdf0e10cSrcweir 			sal_Bool bEnabled = aCTLOptions.IsCTLFontEnabled();
787*cdf0e10cSrcweir 			GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, bEnabled );
788*cdf0e10cSrcweir 			if(!bEnabled)
789*cdf0e10cSrcweir 				rSet.DisableItem(nWhich);
790*cdf0e10cSrcweir 		}
791*cdf0e10cSrcweir 		break;
792*cdf0e10cSrcweir 		default:
793*cdf0e10cSrcweir 			nSlotId = 0;			    // don't know this slot
794*cdf0e10cSrcweir 			break;
795*cdf0e10cSrcweir 		}
796*cdf0e10cSrcweir 
797*cdf0e10cSrcweir 		if( nSlotId )
798*cdf0e10cSrcweir 			rSet.Put( SfxBoolItem( nWhich, bFlag ));
799*cdf0e10cSrcweir 
800*cdf0e10cSrcweir 		nWhich = aIter.NextWhich();
801*cdf0e10cSrcweir 	}
802*cdf0e10cSrcweir }
803*cdf0e10cSrcweir 
804*cdf0e10cSrcweir /*--------------------------------------------------------------------
805*cdf0e10cSrcweir 	Beschreibung:
806*cdf0e10cSrcweir  --------------------------------------------------------------------*/
807*cdf0e10cSrcweir void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet)
808*cdf0e10cSrcweir {
809*cdf0e10cSrcweir 	if (!IsTextEdit())	// Sonst Absturz!
810*cdf0e10cSrcweir 		return;
811*cdf0e10cSrcweir 
812*cdf0e10cSrcweir     OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
813*cdf0e10cSrcweir     SfxItemSet aEditAttr(pOLV->GetAttribs());
814*cdf0e10cSrcweir 
815*cdf0e10cSrcweir 	SfxWhichIter aIter(rSet);
816*cdf0e10cSrcweir 	sal_uInt16 nWhich = aIter.FirstWhich();
817*cdf0e10cSrcweir 	sal_uInt16 nScriptType = pOLV->GetSelectedScriptType();
818*cdf0e10cSrcweir     while(nWhich)
819*cdf0e10cSrcweir 	{
820*cdf0e10cSrcweir         sal_uInt16 nEEWhich = 0;
821*cdf0e10cSrcweir         sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
822*cdf0e10cSrcweir 		switch( nSlotId )
823*cdf0e10cSrcweir 		{
824*cdf0e10cSrcweir             case SID_ATTR_CHAR_FONT:
825*cdf0e10cSrcweir             case SID_ATTR_CHAR_FONTHEIGHT:
826*cdf0e10cSrcweir             case SID_ATTR_CHAR_WEIGHT:
827*cdf0e10cSrcweir             case SID_ATTR_CHAR_POSTURE:
828*cdf0e10cSrcweir 			{
829*cdf0e10cSrcweir                 SfxItemPool* pEditPool = aEditAttr.GetPool()->GetSecondaryPool();
830*cdf0e10cSrcweir                 if( !pEditPool )
831*cdf0e10cSrcweir                     pEditPool = aEditAttr.GetPool();
832*cdf0e10cSrcweir                 SvxScriptSetItem aSetItem( nSlotId, *pEditPool );
833*cdf0e10cSrcweir 				aSetItem.GetItemSet().Put( aEditAttr, sal_False );
834*cdf0e10cSrcweir 				const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
835*cdf0e10cSrcweir 				if( pI )
836*cdf0e10cSrcweir 					rSet.Put( *pI, nWhich );
837*cdf0e10cSrcweir 				else
838*cdf0e10cSrcweir 					rSet.InvalidateItem( nWhich );
839*cdf0e10cSrcweir 			}
840*cdf0e10cSrcweir 			break;
841*cdf0e10cSrcweir             case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
842*cdf0e10cSrcweir             case SID_ATTR_CHAR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE;break;
843*cdf0e10cSrcweir             case SID_ATTR_CHAR_OVERLINE: nEEWhich = EE_CHAR_OVERLINE;break;
844*cdf0e10cSrcweir             case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
845*cdf0e10cSrcweir             case SID_ATTR_CHAR_SHADOWED:  nEEWhich = EE_CHAR_SHADOW;break;
846*cdf0e10cSrcweir             case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT;break;
847*cdf0e10cSrcweir             case SID_AUTOSPELL_CHECK:
848*cdf0e10cSrcweir             {
849*cdf0e10cSrcweir                 const SfxPoolItem* pState = rView.GetSlotState(nWhich);
850*cdf0e10cSrcweir                 if (pState)
851*cdf0e10cSrcweir                     rSet.Put(SfxBoolItem(nWhich, ((const SfxBoolItem*)pState)->GetValue()));
852*cdf0e10cSrcweir                 else
853*cdf0e10cSrcweir                     rSet.DisableItem( nWhich );
854*cdf0e10cSrcweir                 break;
855*cdf0e10cSrcweir             }
856*cdf0e10cSrcweir             case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
857*cdf0e10cSrcweir             case SID_ATTR_CHAR_RELIEF      : nEEWhich = EE_CHAR_RELIEF;  break;
858*cdf0e10cSrcweir             case SID_ATTR_CHAR_LANGUAGE    : nEEWhich = EE_CHAR_LANGUAGE;break;
859*cdf0e10cSrcweir             case SID_ATTR_CHAR_KERNING     : nEEWhich = EE_CHAR_KERNING; break;
860*cdf0e10cSrcweir             case SID_ATTR_CHAR_SCALEWIDTH:   nEEWhich = EE_CHAR_FONTWIDTH;break;
861*cdf0e10cSrcweir             case SID_ATTR_CHAR_AUTOKERN  :   nEEWhich = EE_CHAR_PAIRKERNING; break;
862*cdf0e10cSrcweir             case SID_ATTR_CHAR_ESCAPEMENT:   nEEWhich = EE_CHAR_ESCAPEMENT; break;
863*cdf0e10cSrcweir         }
864*cdf0e10cSrcweir         if(nEEWhich)
865*cdf0e10cSrcweir             rSet.Put(aEditAttr.Get(nEEWhich, sal_True), nWhich);
866*cdf0e10cSrcweir 
867*cdf0e10cSrcweir         nWhich = aIter.NextWhich();
868*cdf0e10cSrcweir 	}
869*cdf0e10cSrcweir }
870*cdf0e10cSrcweir 
871*cdf0e10cSrcweir /*--------------------------------------------------------------------
872*cdf0e10cSrcweir 	Beschreibung:
873*cdf0e10cSrcweir  --------------------------------------------------------------------*/
874*cdf0e10cSrcweir void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq)
875*cdf0e10cSrcweir {
876*cdf0e10cSrcweir 	if (!IsTextEdit())	// Sonst Absturz!
877*cdf0e10cSrcweir 		return;
878*cdf0e10cSrcweir 
879*cdf0e10cSrcweir     OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
880*cdf0e10cSrcweir 
881*cdf0e10cSrcweir     ESelection aSel(pOLV->GetSelection());
882*cdf0e10cSrcweir 	const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos);
883*cdf0e10cSrcweir     sal_uInt16 nId = rReq.GetSlot();
884*cdf0e10cSrcweir 	switch( nId )
885*cdf0e10cSrcweir 	{
886*cdf0e10cSrcweir 		case SID_CUT:
887*cdf0e10cSrcweir 			if (bCopy)
888*cdf0e10cSrcweir 				pOLV->Cut();
889*cdf0e10cSrcweir 			return;
890*cdf0e10cSrcweir 
891*cdf0e10cSrcweir 		case SID_COPY:
892*cdf0e10cSrcweir 			if (bCopy)
893*cdf0e10cSrcweir 				pOLV->Copy();
894*cdf0e10cSrcweir 			return;
895*cdf0e10cSrcweir 
896*cdf0e10cSrcweir 		case SID_PASTE:
897*cdf0e10cSrcweir 			pOLV->PasteSpecial();
898*cdf0e10cSrcweir 			break;
899*cdf0e10cSrcweir 
900*cdf0e10cSrcweir 		default:
901*cdf0e10cSrcweir 			DBG_ERROR("falscher Dispatcher");
902*cdf0e10cSrcweir 			return;
903*cdf0e10cSrcweir 	}
904*cdf0e10cSrcweir }
905*cdf0e10cSrcweir 
906*cdf0e10cSrcweir /*--------------------------------------------------------------------
907*cdf0e10cSrcweir 	Beschreibung:	ClipBoard-Status
908*cdf0e10cSrcweir  --------------------------------------------------------------------*/
909*cdf0e10cSrcweir void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
910*cdf0e10cSrcweir {
911*cdf0e10cSrcweir 	if (!IsTextEdit())	// Sonst Absturz!
912*cdf0e10cSrcweir 		return;
913*cdf0e10cSrcweir 
914*cdf0e10cSrcweir     OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
915*cdf0e10cSrcweir     ESelection aSel(pOLV->GetSelection());
916*cdf0e10cSrcweir 	const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) ||
917*cdf0e10cSrcweir 						   (aSel.nStartPos != aSel.nEndPos);
918*cdf0e10cSrcweir 
919*cdf0e10cSrcweir 
920*cdf0e10cSrcweir 	SfxWhichIter aIter(rSet);
921*cdf0e10cSrcweir 	sal_uInt16 nWhich = aIter.FirstWhich();
922*cdf0e10cSrcweir 
923*cdf0e10cSrcweir 	while(nWhich)
924*cdf0e10cSrcweir 	{
925*cdf0e10cSrcweir 		switch(nWhich)
926*cdf0e10cSrcweir 		{
927*cdf0e10cSrcweir 			case SID_CUT:
928*cdf0e10cSrcweir 			case SID_COPY:
929*cdf0e10cSrcweir 				if( !bCopy )
930*cdf0e10cSrcweir 					rSet.DisableItem( nWhich );
931*cdf0e10cSrcweir 				break;
932*cdf0e10cSrcweir 
933*cdf0e10cSrcweir 			case SID_PASTE:
934*cdf0e10cSrcweir 				{
935*cdf0e10cSrcweir 					TransferableDataHelper aDataHelper(
936*cdf0e10cSrcweir 						TransferableDataHelper::CreateFromSystemClipboard(
937*cdf0e10cSrcweir 								&GetView().GetEditWin() ) );
938*cdf0e10cSrcweir 
939*cdf0e10cSrcweir 					if( !aDataHelper.GetXTransferable().is() ||
940*cdf0e10cSrcweir 						!SwTransferable::IsPaste( GetShell(), aDataHelper ))
941*cdf0e10cSrcweir 						rSet.DisableItem( SID_PASTE );
942*cdf0e10cSrcweir 				}
943*cdf0e10cSrcweir 				break;
944*cdf0e10cSrcweir 
945*cdf0e10cSrcweir             case SID_PASTE_SPECIAL:
946*cdf0e10cSrcweir                 rSet.DisableItem( SID_PASTE_SPECIAL );
947*cdf0e10cSrcweir 				break;
948*cdf0e10cSrcweir             // --> OD 2008-06-20 #151110#
949*cdf0e10cSrcweir             case SID_CLIPBOARD_FORMAT_ITEMS:
950*cdf0e10cSrcweir                 rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
951*cdf0e10cSrcweir                 break;
952*cdf0e10cSrcweir             // <--
953*cdf0e10cSrcweir 		}
954*cdf0e10cSrcweir 		nWhich = aIter.NextWhich();
955*cdf0e10cSrcweir 	}
956*cdf0e10cSrcweir }
957*cdf0e10cSrcweir 
958*cdf0e10cSrcweir /*--------------------------------------------------------------------
959*cdf0e10cSrcweir 	Beschreibung:	Hyperlink-Status
960*cdf0e10cSrcweir  --------------------------------------------------------------------*/
961*cdf0e10cSrcweir 
962*cdf0e10cSrcweir void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
963*cdf0e10cSrcweir {
964*cdf0e10cSrcweir 	if (!IsTextEdit())	// Sonst Absturz!
965*cdf0e10cSrcweir 		return;
966*cdf0e10cSrcweir 
967*cdf0e10cSrcweir     OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
968*cdf0e10cSrcweir     SfxWhichIter aIter(rSet);
969*cdf0e10cSrcweir 	sal_uInt16 nWhich = aIter.FirstWhich();
970*cdf0e10cSrcweir 
971*cdf0e10cSrcweir 	while(nWhich)
972*cdf0e10cSrcweir 	{
973*cdf0e10cSrcweir 		switch(nWhich)
974*cdf0e10cSrcweir 		{
975*cdf0e10cSrcweir 			case SID_HYPERLINK_GETLINK:
976*cdf0e10cSrcweir 				{
977*cdf0e10cSrcweir 					SvxHyperlinkItem aHLinkItem;
978*cdf0e10cSrcweir 					aHLinkItem.SetInsertMode(HLINK_FIELD);
979*cdf0e10cSrcweir 
980*cdf0e10cSrcweir 					const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
981*cdf0e10cSrcweir 
982*cdf0e10cSrcweir 					if (pFieldItem)
983*cdf0e10cSrcweir 					{
984*cdf0e10cSrcweir 						const SvxFieldData* pField = pFieldItem->GetField();
985*cdf0e10cSrcweir 
986*cdf0e10cSrcweir 						if (pField->ISA(SvxURLField))
987*cdf0e10cSrcweir 						{
988*cdf0e10cSrcweir 							aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
989*cdf0e10cSrcweir 							aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
990*cdf0e10cSrcweir 							aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
991*cdf0e10cSrcweir 						}
992*cdf0e10cSrcweir 					}
993*cdf0e10cSrcweir 					else
994*cdf0e10cSrcweir 					{
995*cdf0e10cSrcweir 						String sSel(pOLV->GetSelected());
996*cdf0e10cSrcweir 						sSel.Erase(255);
997*cdf0e10cSrcweir 						sSel.EraseTrailingChars();
998*cdf0e10cSrcweir 						aHLinkItem.SetName(sSel);
999*cdf0e10cSrcweir 					}
1000*cdf0e10cSrcweir 
1001*cdf0e10cSrcweir 					sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1002*cdf0e10cSrcweir 					aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
1003*cdf0e10cSrcweir 						((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
1004*cdf0e10cSrcweir 
1005*cdf0e10cSrcweir 					rSet.Put(aHLinkItem);
1006*cdf0e10cSrcweir 				}
1007*cdf0e10cSrcweir 				break;
1008*cdf0e10cSrcweir 		}
1009*cdf0e10cSrcweir 		nWhich = aIter.NextWhich();
1010*cdf0e10cSrcweir 	}
1011*cdf0e10cSrcweir }
1012*cdf0e10cSrcweir 
1013