xref: /trunk/main/sd/source/ui/view/drtxtob1.cxx (revision 79aad27f)
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_sd.hxx"
26 
27 #include "TextObjectBar.hxx"
28 
29 
30 #include <svx/svxids.hrc>
31 
32 #include <editeng/editview.hxx>
33 #include <editeng/editeng.hxx>
34 #include <editeng/unolingu.hxx>
35 #include <editeng/outliner.hxx>
36 #include <editeng/ulspitem.hxx>
37 #include <editeng/lspcitem.hxx>
38 #include <editeng/adjitem.hxx>
39 #include <vcl/vclenum.hxx>
40 #include <sfx2/app.hxx>
41 #include <svl/whiter.hxx>
42 #include <svl/itempool.hxx>
43 #include <svl/style.hxx>
44 #include <sfx2/tplpitem.hxx>
45 #include <sfx2/request.hxx>
46 #include <sfx2/viewfrm.hxx>
47 #include <sfx2/dispatch.hxx>
48 #include <editeng/escpitem.hxx>
49 #include <editeng/wghtitem.hxx>
50 #include <editeng/postitem.hxx>
51 #include <editeng/udlnitem.hxx>
52 #include <editeng/crsditem.hxx>
53 #include <editeng/cntritem.hxx>
54 #include <editeng/shdditem.hxx>
55 #include <svx/xtable.hxx>
56 #include <svx/svdobj.hxx>
57 #include <editeng/outlobj.hxx>
58 #include <editeng/flstitem.hxx>
59 #include <editeng/editeng.hxx>
60 #include <svl/intitem.hxx>
61 #include <editeng/scripttypeitem.hxx>
62 #include <svx/svdoutl.hxx>
63 #include <editeng/writingmodeitem.hxx>
64 #include <editeng/frmdiritem.hxx>
65 #include <svl/itemiter.hxx>
66 
67 
68 #include "app.hrc"
69 
70 #include "eetext.hxx"
71 #include "ViewShell.hxx"
72 #include "drawview.hxx"
73 #include "drawdoc.hxx"
74 #include "OutlineView.hxx"
75 #include "Window.hxx"
76 #include "futempl.hxx"
77 #include "DrawDocShell.hxx"
78 #include "Outliner.hxx"
79 #include "futext.hxx"
80 
81 namespace sd {
82 
83 /*************************************************************************
84 |*
85 |* Bearbeitung der SfxRequests
86 |*
87 \************************************************************************/
88 
89 void TextObjectBar::Execute( SfxRequest &rReq )
90 {
91 	const SfxItemSet* pArgs = rReq.GetArgs();
92 	const SfxPoolItem* pPoolItem = NULL;
93 	sal_uInt16 nSlot = rReq.GetSlot();
94 	sal_Bool bOutlineMode = sal_False;
95 	OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
96 
97 	std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
98 
99 	if (mpView->ISA(OutlineView))
100 	{
101 		bOutlineMode = sal_True;
102 		pOLV = static_cast<OutlineView*>(mpView)
103             ->GetViewByWindow(mpViewShell->GetActiveWindow());
104 
105 		aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
106 	}
107 
108 	switch (nSlot)
109 	{
110 		case SID_STYLE_APPLY:
111 		{
112 			if( pArgs )
113 			{
114 				SdDrawDocument* pDoc = mpView->GetDoc();
115                 OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
116 				FunctionReference xFunc( FuTemplate::Create( mpViewShell, static_cast< ::sd::Window*>( mpViewShell->GetViewShell()->GetWindow()), mpView, pDoc, rReq ) );
117 
118 				if(xFunc.is())
119 				{
120 					xFunc->Activate();
121 					xFunc->Deactivate();
122 
123 					if( rReq.GetSlot() == SID_STYLE_APPLY )
124 					{
125 						if( mpViewShell && mpViewShell->GetViewFrame() )
126 							mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY );
127 					}
128 				}
129 			}
130 			else
131 			{
132 				if( mpViewShell && mpViewShell->GetViewFrame() )
133 					mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SFX_CALLMODE_ASYNCHRON );
134 			}
135 
136 			rReq.Done();
137 		}
138 		break;
139 
140 		case SID_PARASPACE_INCREASE:
141 		case SID_PARASPACE_DECREASE:
142 		{
143 			if( pOLV )
144 			{
145 				ESelection aSel = pOLV->GetSelection();
146 				aSel.Adjust();
147 				sal_uLong nStartPara = aSel.nStartPara;
148 				sal_uLong nEndPara = aSel.nEndPara;
149 				if( !aSel.HasRange() )
150 				{
151 					nStartPara = 0;
152 					nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
153 				}
154 				for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
155 				{
156                     SfxStyleSheet* pStyleSheet = NULL;
157 					if (pOLV->GetOutliner() != NULL)
158                         pStyleSheet = pOLV->GetOutliner()->GetStyleSheet(nPara);
159                     if (pStyleSheet != NULL)
160                     {
161                         SfxItemSet aAttr( pStyleSheet->GetItemSet() );
162                         SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16) nPara ) );
163                         aAttr.Put( aTmpSet, sal_False ); // sal_False= InvalidItems nicht als Default, sondern als "Loecher" betrachten
164                         const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aAttr.Get( EE_PARA_ULSPACE );
165                         SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
166 
167                         long nUpper = pNewItem->GetUpper();
168                         if( nSlot == SID_PARASPACE_INCREASE )
169                             nUpper += 100;
170                         else
171                         {
172                             nUpper -= 100;
173                             nUpper = Max( (long) nUpper, 0L );
174                         }
175                         pNewItem->SetUpper( (sal_uInt16) nUpper );
176 
177                         long nLower = pNewItem->GetLower();
178                         if( nSlot == SID_PARASPACE_INCREASE )
179                             nLower += 100;
180                         else
181                         {
182                             nLower -= 100;
183                             nLower = Max( (long) nLower, 0L );
184                         }
185                         pNewItem->SetLower( (sal_uInt16) nLower );
186 
187                         SfxItemSet aNewAttrs( aAttr );
188                         aNewAttrs.Put( *pNewItem );
189                         delete pNewItem;
190                         pOLV->GetOutliner()->SetParaAttribs( (sal_uInt16)nPara, aNewAttrs );
191                     }
192 				}
193 			}
194 			else
195 			{
196 				// Der folgende Code kann enabled werden, wenn ich von
197 				// JOE einen richtigen Status (DontCare) bekomme;
198 
199 				// Wird enabled, obwohl es nicht richtig funktioniert (s.o.)
200 				SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
201 				mpView->GetAttributes( aEditAttr );
202                 if( aEditAttr.GetItemState( EE_PARA_ULSPACE ) >= SFX_ITEM_AVAILABLE )
203 				{
204 					SfxItemSet aNewAttrs(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
205                     const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aEditAttr.Get( EE_PARA_ULSPACE );
206 					SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
207 					long nUpper = pNewItem->GetUpper();
208 
209 					if( nSlot == SID_PARASPACE_INCREASE )
210 						nUpper += 100;
211 					else
212 					{
213 						nUpper -= 100;
214 						nUpper = Max( (long) nUpper, 0L );
215 					}
216 					pNewItem->SetUpper( (sal_uInt16) nUpper );
217 
218 					long nLower = pNewItem->GetLower();
219 					if( nSlot == SID_PARASPACE_INCREASE )
220 						nLower += 100;
221 					else
222 					{
223 						nLower -= 100;
224 						nLower = Max( (long) nLower, 0L );
225 					}
226 					pNewItem->SetLower( (sal_uInt16) nLower );
227 
228 					aNewAttrs.Put( *pNewItem );
229 					delete pNewItem;
230 
231 					mpView->SetAttributes( aNewAttrs );
232 				}
233 			}
234 			rReq.Done();
235 
236 			Invalidate();
237 			// Um die Preview (im Gliederungsmodus) zu aktualisieren muss
238 			// der Slot invalidiert werden:
239 			mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
240 		}
241 		break;
242 
243 		case SID_OUTLINE_LEFT:
244 		{
245 			if (pOLV)
246 			{
247 				pOLV->AdjustDepth( -1 );
248 
249                 // Ensure bold/italic etc. icon state updates
250 				Invalidate();
251 				// #96551# trigger preview refresh
252 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
253 			}
254 			rReq.Done();
255 		}
256 		break;
257 
258 		case SID_OUTLINE_RIGHT:
259 		{
260 			if (pOLV)
261 			{
262 				pOLV->AdjustDepth( 1 );
263 
264                 // Ensure bold/italic etc. icon state updates
265 				Invalidate();
266 				// #96551# trigger preview refresh
267 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
268 			}
269 			rReq.Done();
270 		}
271 		break;
272 
273 		case SID_OUTLINE_UP:
274 		{
275 			if (pOLV)
276 			{
277 				pOLV->AdjustHeight( -1 );
278 
279 				// #96551# trigger preview refresh
280 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
281 			}
282 			rReq.Done();
283 		}
284 		break;
285 
286 		case SID_OUTLINE_DOWN:
287 		{
288 			if (pOLV)
289 			{
290 				pOLV->AdjustHeight( 1 );
291 
292 				// #96551# trigger preview refresh
293 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
294 			}
295 			rReq.Done();
296 		}
297 		break;
298 
299 		case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
300 		case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
301 		{
302 			mpView->SdrEndTextEdit();
303 			SfxItemSet aAttr( mpView->GetDoc()->GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
304             aAttr.Put( SvxWritingModeItem(
305                 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
306                     com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
307                     SDRATTR_TEXTDIRECTION ) );
308 			rReq.Done( aAttr );
309 			mpView->SetAttributes( aAttr );
310 			Invalidate();
311 			mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
312 		}
313 		break;
314 
315 		case FN_NUM_BULLET_ON:
316             if( pOLV )
317 			    pOLV->ToggleBullets();
318 		break;
319 
320         case SID_GROW_FONT_SIZE:
321         case SID_SHRINK_FONT_SIZE:
322         {
323             const SvxFontListItem* pFonts =	(const SvxFontListItem*)mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST );
324             const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0;
325             if( pFontList )
326             {
327                 FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView );
328                 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
329             }
330             rReq.Done();
331         }
332         break;
333 
334         case SID_THES:
335         {
336             String aReplaceText;
337             SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
338             if (pItem2)
339                 aReplaceText = pItem2->GetValue();
340             if (aReplaceText.Len() > 0)
341                 ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
342         }
343         break;
344 
345 		default:
346 		{
347 			SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
348 			mpView->GetAttributes( aEditAttr );
349 			SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
350 
351 			if( !pArgs )
352 			{
353 				//aNewAttr.InvalidateAllItems(); <- Macht Probleme (#35465#)
354 
355 				switch ( nSlot )
356 				{
357 					case SID_ATTR_CHAR_WEIGHT:
358 					{
359 						FontWeight eFW = ( (const SvxWeightItem&) aEditAttr.
360                                         Get( EE_CHAR_WEIGHT ) ).GetWeight();
361 						aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ?
362                                             WEIGHT_BOLD : WEIGHT_NORMAL,
363                                             EE_CHAR_WEIGHT ) );
364 					}
365 					break;
366 					case SID_ATTR_CHAR_POSTURE:
367 					{
368 						FontItalic eFI = ( (const SvxPostureItem&) aEditAttr.
369                                         Get( EE_CHAR_ITALIC ) ).GetPosture();
370 						aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ?
371                                             ITALIC_NONE : ITALIC_NORMAL,
372                                             EE_CHAR_ITALIC ) );
373 					}
374 					break;
375 					case SID_ATTR_CHAR_UNDERLINE:
376 					{
377 						FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.
378                                         Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
379 						aNewAttr.Put( SvxUnderlineItem( eFU == UNDERLINE_SINGLE ?
380                                             UNDERLINE_NONE : UNDERLINE_SINGLE,
381                                             EE_CHAR_UNDERLINE ) );
382 					}
383 					break;
384 					case SID_ATTR_CHAR_OVERLINE:
385 					{
386 						FontUnderline eFO = ( (const SvxOverlineItem&) aEditAttr.
387                                         Get( EE_CHAR_OVERLINE ) ).GetLineStyle();
388 						aNewAttr.Put( SvxOverlineItem( eFO == UNDERLINE_SINGLE ?
389                                             UNDERLINE_NONE : UNDERLINE_SINGLE,
390                                             EE_CHAR_OVERLINE ) );
391 					}
392 					break;
393 					case SID_ATTR_CHAR_CONTOUR:
394 					{
395 						aNewAttr.Put( SvxContourItem( !( (const SvxContourItem&) aEditAttr.
396                                         Get( EE_CHAR_OUTLINE ) ).GetValue(), EE_CHAR_OUTLINE ) );
397 					}
398 					break;
399 					case SID_ATTR_CHAR_SHADOWED:
400 					{
401 						aNewAttr.Put( SvxShadowedItem( !( (const SvxShadowedItem&) aEditAttr.
402                                         Get( EE_CHAR_SHADOW ) ).GetValue(), EE_CHAR_SHADOW ) );
403 					}
404 					break;
405 					case SID_ATTR_CHAR_STRIKEOUT:
406 					{
407 						FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr.
408                                         Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() );
409 						aNewAttr.Put( SvxCrossedOutItem( eFSO == STRIKEOUT_SINGLE ?
410                                             STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) );
411 					}
412 					break;
413 
414 					case SID_ATTR_PARA_ADJUST_LEFT:
415 					{
416                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
417 					}
418 					break;
419 					case SID_ATTR_PARA_ADJUST_CENTER:
420 					{
421                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
422 					}
423 					break;
424 					case SID_ATTR_PARA_ADJUST_RIGHT:
425 					{
426                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
427 					}
428 					break;
429 					case SID_ATTR_PARA_ADJUST_BLOCK:
430 					{
431                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, EE_PARA_JUST ) );
432 					}
433 					break;
434 					case SID_ATTR_PARA_LINESPACE_10:
435 					{
436                         SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_LINE, EE_PARA_SBL );
437 						aItem.SetPropLineSpace( 100 );
438 						aNewAttr.Put( aItem );
439 					}
440 					break;
441 					case SID_ATTR_PARA_LINESPACE_15:
442 					{
443                         SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL );
444 						aItem.SetPropLineSpace( 150 );
445 						aNewAttr.Put( aItem );
446 					}
447 					break;
448 					case SID_ATTR_PARA_LINESPACE_20:
449 					{
450                         SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
451 						aItem.SetPropLineSpace( 200 );
452 						aNewAttr.Put( aItem );
453 					}
454     				break;
455 					case SID_SET_SUPER_SCRIPT:
456 					{
457                         SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
458 						SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
459                                         aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
460 
461 						if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
462 							aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
463 						else
464 							aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
465 						aNewAttr.Put( aItem );
466 					}
467 					break;
468 					case SID_SET_SUB_SCRIPT:
469 					{
470                         SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
471 						SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
472                                         aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
473 
474 						if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
475 							aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
476 						else
477 							aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
478 						aNewAttr.Put( aItem );
479 					}
480 					break;
481 
482 					// Attribute fuer die TextObjectBar
483 					case SID_ATTR_CHAR_FONT:
484 					{
485 						if( pArgs )
486 						{
487                             if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTINFO, sal_True, &pPoolItem ) )
488 								aNewAttr.Put( *pPoolItem );
489 						}
490 						else
491 							mpViewShell->GetViewFrame()->GetDispatcher()->
492 							Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
493 					}
494 					break;
495 					case SID_ATTR_CHAR_FONTHEIGHT:
496 					{
497 						if( pArgs )
498 						{
499                             if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTHEIGHT, sal_True, &pPoolItem ) )
500 								aNewAttr.Put( *pPoolItem );
501 						}
502 						else
503 							mpViewShell->GetViewFrame()->GetDispatcher()->
504 							Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
505 					}
506 					break;
507 					case SID_ATTR_CHAR_COLOR:
508 					{
509                         if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_COLOR, sal_True, &pPoolItem ) )
510 							aNewAttr.Put( *pPoolItem );
511 					}
512 					break;
513 /* #i35937#
514 					case FN_NUM_BULLET_ON:
515 					{
516 						if (aEditAttr.GetItemState(EE_PARA_BULLETSTATE) == SFX_ITEM_ON)
517 						{
518 							SfxUInt16Item aBulletState((const SfxUInt16Item&) aEditAttr.Get(EE_PARA_BULLETSTATE));
519 
520 							if (aBulletState.GetValue() != 0)
521 							{
522 								// Ausschalten
523 								aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 0));
524 							}
525 							else
526 							{
527 								// Einschalten
528 								aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 1));
529 							}
530 						}
531 						else
532 						{
533 							// Einschalten
534 							aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 1));
535 						}
536 					}
537 					break;
538 */
539 				}
540 
541 				rReq.Done( aNewAttr );
542 				pArgs = rReq.GetArgs();
543 			}
544 			else if ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ||
545 					  nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT )
546 			{
547 				sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
548 
549 				sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
550                 if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
551 					nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
552 
553 				if( bLeftToRight )
554 				{
555 					aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
556 					if( nAdjust == SVX_ADJUST_RIGHT )
557                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
558 				}
559 				else
560 				{
561 					aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
562 					if( nAdjust == SVX_ADJUST_LEFT )
563                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
564 				}
565 
566 				rReq.Done( aNewAttr );
567 				pArgs = rReq.GetArgs();
568 
569 				Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
570 			}
571 			else if ( nSlot == SID_ATTR_CHAR_FONT       ||
572                 	  nSlot == SID_ATTR_CHAR_FONTHEIGHT ||
573                 	  nSlot == SID_ATTR_CHAR_POSTURE    ||
574                 	  nSlot == SID_ATTR_CHAR_WEIGHT )
575             {
576 				// #i78017 establish the same behaviour as in Writer
577 				sal_uInt16 nScriptType = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX;
578 				if (nSlot == SID_ATTR_CHAR_FONT)
579 					nScriptType = mpView->GetScriptType();
580 
581 				SfxItemPool& rPool = mpView->GetDoc()->GetPool();
582                 SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
583                 aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) );
584 				aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
585 				rReq.Done( aNewAttr );
586 				pArgs = rReq.GetArgs();
587 			}
588 
589 			mpView->SetAttributes(*pArgs);
590 
591 			// Aus Performance- und Erweiterungsgruenden wird
592 			// jetzt die komplette Shell invalidiert
593 			Invalidate();
594 
595 			// Um die Preview (im Gliederungsmodus) zu aktualisieren muss
596 			// der Slot invalidiert werden:
597 			mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
598 		}
599 		break;
600 	}
601 
602 	Invalidate( SID_OUTLINE_LEFT );
603 	Invalidate( SID_OUTLINE_RIGHT );
604 	Invalidate( SID_OUTLINE_UP );
605 	Invalidate( SID_OUTLINE_DOWN );
606 }
607 
608 } // end of namespace sd
609