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