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