xref: /trunk/main/sd/source/ui/view/drtxtob1.cxx (revision 766ce4d0)
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 		case SID_ATTR_PARA_LEFT:
245 		{
246 			if (pOLV)
247 			{
248 				pOLV->AdjustDepth( -1 );
249 
250                 // Ensure bold/italic etc. icon state updates
251 				Invalidate();
252 				// #96551# trigger preview refresh
253 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
254 			}
255 			rReq.Done();
256 		}
257 		break;
258 
259 		case SID_OUTLINE_RIGHT:
260 		case SID_ATTR_PARA_RIGHT:
261 		{
262 			if (pOLV)
263 			{
264 				pOLV->AdjustDepth( 1 );
265 
266                 // Ensure bold/italic etc. icon state updates
267 				Invalidate();
268 				// #96551# trigger preview refresh
269 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
270 			}
271 			rReq.Done();
272 		}
273 		break;
274 
275 		case SID_ATTR_PARA_LRSPACE:
276 		{
277 			sal_uInt16 nSlot = SID_ATTR_PARA_LRSPACE;
278 			SvxLRSpaceItem aLRSpace = (const SvxLRSpaceItem&)pArgs->Get(
279 				GetPool().GetWhich(nSlot));
280 
281 			SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
282 			aLRSpace.SetWhich( EE_PARA_LRSPACE );
283 
284 			aEditAttr.Put( aLRSpace );
285 			mpView->SetAttributes( aEditAttr );
286 
287 			Invalidate(SID_ATTR_PARA_LRSPACE);
288 		}
289 		break;
290 
291 		case SID_OUTLINE_UP:
292 		{
293 			if (pOLV)
294 			{
295 				pOLV->AdjustHeight( -1 );
296 
297 				// #96551# trigger preview refresh
298 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
299 			}
300 			rReq.Done();
301 		}
302 		break;
303 
304 		case SID_OUTLINE_DOWN:
305 		{
306 			if (pOLV)
307 			{
308 				pOLV->AdjustHeight( 1 );
309 
310 				// #96551# trigger preview refresh
311 				mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
312 			}
313 			rReq.Done();
314 		}
315 		break;
316 
317 		case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
318 		case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
319 		{
320 			mpView->SdrEndTextEdit();
321 			SfxItemSet aAttr( mpView->GetDoc()->GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
322             aAttr.Put( SvxWritingModeItem(
323                 nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
324                     com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
325                     SDRATTR_TEXTDIRECTION ) );
326 			rReq.Done( aAttr );
327 			mpView->SetAttributes( aAttr );
328 			Invalidate();
329 			mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
330 		}
331 		break;
332 
333 		case FN_NUM_BULLET_ON:
334             if( pOLV )
335 			    pOLV->ToggleBullets();
336 		break;
337 
338         case SID_GROW_FONT_SIZE:
339         case SID_SHRINK_FONT_SIZE:
340         {
341             const SvxFontListItem* pFonts =	(const SvxFontListItem*)mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST );
342             const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0;
343             if( pFontList )
344             {
345                 FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView );
346                 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
347             }
348             rReq.Done();
349         }
350         break;
351 
352         case SID_THES:
353         {
354             String aReplaceText;
355             SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
356             if (pItem2)
357                 aReplaceText = pItem2->GetValue();
358             if (aReplaceText.Len() > 0)
359                 ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
360         }
361         break;
362 
363 		default:
364 		{
365 			SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
366 			mpView->GetAttributes( aEditAttr );
367 			SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
368 
369 			if( !pArgs )
370 			{
371 				//aNewAttr.InvalidateAllItems(); <- Macht Probleme (#35465#)
372 
373 				switch ( nSlot )
374 				{
375 					case SID_ATTR_CHAR_WEIGHT:
376 					{
377 						FontWeight eFW = ( (const SvxWeightItem&) aEditAttr.
378                                         Get( EE_CHAR_WEIGHT ) ).GetWeight();
379 						aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ?
380                                             WEIGHT_BOLD : WEIGHT_NORMAL,
381                                             EE_CHAR_WEIGHT ) );
382 					}
383 					break;
384 					case SID_ATTR_CHAR_POSTURE:
385 					{
386 						FontItalic eFI = ( (const SvxPostureItem&) aEditAttr.
387                                         Get( EE_CHAR_ITALIC ) ).GetPosture();
388 						aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ?
389                                             ITALIC_NONE : ITALIC_NORMAL,
390                                             EE_CHAR_ITALIC ) );
391 					}
392 					break;
393 					case SID_ATTR_CHAR_UNDERLINE:
394 					{
395 						FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.
396                                         Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
397 						aNewAttr.Put( SvxUnderlineItem( eFU == UNDERLINE_SINGLE ?
398                                             UNDERLINE_NONE : UNDERLINE_SINGLE,
399                                             EE_CHAR_UNDERLINE ) );
400 					}
401 					break;
402 					case SID_ATTR_CHAR_OVERLINE:
403 					{
404 						FontUnderline eFO = ( (const SvxOverlineItem&) aEditAttr.
405                                         Get( EE_CHAR_OVERLINE ) ).GetLineStyle();
406 						aNewAttr.Put( SvxOverlineItem( eFO == UNDERLINE_SINGLE ?
407                                             UNDERLINE_NONE : UNDERLINE_SINGLE,
408                                             EE_CHAR_OVERLINE ) );
409 					}
410 					break;
411 					case SID_ATTR_CHAR_CONTOUR:
412 					{
413 						aNewAttr.Put( SvxContourItem( !( (const SvxContourItem&) aEditAttr.
414                                         Get( EE_CHAR_OUTLINE ) ).GetValue(), EE_CHAR_OUTLINE ) );
415 					}
416 					break;
417 					case SID_ATTR_CHAR_SHADOWED:
418 					{
419 						aNewAttr.Put( SvxShadowedItem( !( (const SvxShadowedItem&) aEditAttr.
420                                         Get( EE_CHAR_SHADOW ) ).GetValue(), EE_CHAR_SHADOW ) );
421 					}
422 					break;
423 					case SID_ATTR_CHAR_STRIKEOUT:
424 					{
425 						FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr.
426                                         Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() );
427 						aNewAttr.Put( SvxCrossedOutItem( eFSO == STRIKEOUT_SINGLE ?
428                                             STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) );
429 					}
430 					break;
431 
432 					case SID_ATTR_PARA_ADJUST_LEFT:
433 					{
434                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
435 					}
436 					break;
437 					case SID_ATTR_PARA_ADJUST_CENTER:
438 					{
439                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
440 					}
441 					break;
442 					case SID_ATTR_PARA_ADJUST_RIGHT:
443 					{
444                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
445 					}
446 					break;
447 					case SID_ATTR_PARA_ADJUST_BLOCK:
448 					{
449                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, EE_PARA_JUST ) );
450 					}
451 					break;
452 					case SID_ATTR_PARA_LINESPACE_10:
453 					{
454                         SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_LINE, EE_PARA_SBL );
455 						aItem.SetPropLineSpace( 100 );
456 						aNewAttr.Put( aItem );
457 					}
458 					break;
459 					case SID_ATTR_PARA_LINESPACE_15:
460 					{
461                         SvxLineSpacingItem aItem( SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL );
462 						aItem.SetPropLineSpace( 150 );
463 						aNewAttr.Put( aItem );
464 					}
465 					break;
466 					case SID_ATTR_PARA_LINESPACE_20:
467 					{
468                         SvxLineSpacingItem aItem( SVX_LINESPACE_TWO_LINES, EE_PARA_SBL );
469 						aItem.SetPropLineSpace( 200 );
470 						aNewAttr.Put( aItem );
471 					}
472     				break;
473 					case SID_SET_SUPER_SCRIPT:
474 					{
475                         SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
476 						SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
477                                         aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
478 
479 						if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
480 							aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
481 						else
482 							aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
483 						aNewAttr.Put( aItem );
484 					}
485 					break;
486 					case SID_SET_SUB_SCRIPT:
487 					{
488                         SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
489 						SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
490                                         aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
491 
492 						if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
493 							aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
494 						else
495 							aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
496 						aNewAttr.Put( aItem );
497 					}
498 					break;
499 
500 					// Attribute fuer die TextObjectBar
501 					case SID_ATTR_CHAR_FONT:
502 					{
503 						if( pArgs )
504 						{
505                             if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTINFO, sal_True, &pPoolItem ) )
506 								aNewAttr.Put( *pPoolItem );
507 						}
508 						else
509 							mpViewShell->GetViewFrame()->GetDispatcher()->
510 							Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
511 					}
512 					break;
513 					case SID_ATTR_CHAR_FONTHEIGHT:
514 					{
515 						if( pArgs )
516 						{
517                             if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTHEIGHT, sal_True, &pPoolItem ) )
518 								aNewAttr.Put( *pPoolItem );
519 						}
520 						else
521 							mpViewShell->GetViewFrame()->GetDispatcher()->
522 							Execute( SID_CHAR_DLG, SFX_CALLMODE_ASYNCHRON );
523 					}
524 					break;
525 					case SID_ATTR_CHAR_COLOR:
526 					{
527                         if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_COLOR, sal_True, &pPoolItem ) )
528 							aNewAttr.Put( *pPoolItem );
529 					}
530 					break;
531 /* #i35937#
532 					case FN_NUM_BULLET_ON:
533 					{
534 						if (aEditAttr.GetItemState(EE_PARA_BULLETSTATE) == SFX_ITEM_ON)
535 						{
536 							SfxUInt16Item aBulletState((const SfxUInt16Item&) aEditAttr.Get(EE_PARA_BULLETSTATE));
537 
538 							if (aBulletState.GetValue() != 0)
539 							{
540 								// Ausschalten
541 								aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 0));
542 							}
543 							else
544 							{
545 								// Einschalten
546 								aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 1));
547 							}
548 						}
549 						else
550 						{
551 							// Einschalten
552 							aNewAttr.Put(SfxUInt16Item(EE_PARA_BULLETSTATE, 1));
553 						}
554 					}
555 					break;
556 */
557 				}
558 
559 				rReq.Done( aNewAttr );
560 				pArgs = rReq.GetArgs();
561 			}
562 			else if ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ||
563 					  nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT )
564 			{
565 				sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
566 
567 				sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
568                 if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
569 					nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
570 
571 				if( bLeftToRight )
572 				{
573 					aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
574 					if( nAdjust == SVX_ADJUST_RIGHT )
575                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
576 				}
577 				else
578 				{
579 					aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
580 					if( nAdjust == SVX_ADJUST_LEFT )
581                         aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
582 				}
583 
584 				rReq.Done( aNewAttr );
585 				pArgs = rReq.GetArgs();
586 
587 				Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT );
588 			}
589 			else if ( nSlot == SID_ATTR_CHAR_FONT       ||
590                 	  nSlot == SID_ATTR_CHAR_FONTHEIGHT ||
591                 	  nSlot == SID_ATTR_CHAR_POSTURE    ||
592                 	  nSlot == SID_ATTR_CHAR_WEIGHT )
593             {
594 				// #i78017 establish the same behaviour as in Writer
595 				sal_uInt16 nScriptType = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX;
596 				if (nSlot == SID_ATTR_CHAR_FONT)
597 					nScriptType = mpView->GetScriptType();
598 
599 				SfxItemPool& rPool = mpView->GetDoc()->GetPool();
600                 SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
601                 aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) );
602 				aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
603 				rReq.Done( aNewAttr );
604 				pArgs = rReq.GetArgs();
605 			}
606 			else if (nSlot == SID_ATTR_PARA_ADJUST_LEFT ||
607 				nSlot == SID_ATTR_PARA_ADJUST_CENTER ||
608 				nSlot == SID_ATTR_PARA_ADJUST_RIGHT ||
609 				nSlot == SID_ATTR_PARA_ADJUST_BLOCK)
610 			{
611 				switch( nSlot )
612 				{
613 				case SID_ATTR_PARA_ADJUST_LEFT:
614 					{
615 						aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
616 					}
617 					break;
618 				case SID_ATTR_PARA_ADJUST_CENTER:
619 					{
620 						aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
621 					}
622 					break;
623 				case SID_ATTR_PARA_ADJUST_RIGHT:
624 					{
625 						aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
626 					}
627 					break;
628 				case SID_ATTR_PARA_ADJUST_BLOCK:
629 					{
630 						aNewAttr.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, EE_PARA_JUST ) );
631 					}
632 					break;
633 				}
634 				rReq.Done( aNewAttr );
635 				pArgs = rReq.GetArgs();
636 			}
637 			else if(nSlot == SID_ATTR_CHAR_KERNING)
638 			{
639 				aNewAttr.Put(pArgs->Get(pArgs->GetPool()->GetWhich(nSlot)));
640 				rReq.Done( aNewAttr );
641 				pArgs = rReq.GetArgs();
642 			}
643 			else if(nSlot ==  SID_SET_SUPER_SCRIPT )
644 			{
645 				SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
646 				SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
647 								aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
648 
649 				if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
650 					aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
651 				else
652 					aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
653 				aNewAttr.Put( aItem );
654 				rReq.Done( aNewAttr );
655 				pArgs = rReq.GetArgs();
656 			}
657 			else if( nSlot ==  SID_SET_SUB_SCRIPT )
658 			{
659 				SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
660 				SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
661 								aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
662 
663 				if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
664 					aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
665 				else
666 					aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
667 				aNewAttr.Put( aItem );
668 				rReq.Done( aNewAttr );
669 				pArgs = rReq.GetArgs();
670 			}
671 
672 			mpView->SetAttributes(*pArgs);
673 
674 			// Aus Performance- und Erweiterungsgruenden wird
675 			// jetzt die komplette Shell invalidiert
676 			Invalidate();
677 
678 			// Um die Preview (im Gliederungsmodus) zu aktualisieren muss
679 			// der Slot invalidiert werden:
680 			mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
681 		}
682 		break;
683 	}
684 
685 	Invalidate( SID_OUTLINE_LEFT );
686 	Invalidate( SID_OUTLINE_RIGHT );
687 	Invalidate( SID_OUTLINE_UP );
688 	Invalidate( SID_OUTLINE_DOWN );
689 }
690 
691 } // end of namespace sd
692