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 28 #include <hintids.hxx> // fuer RES_.. 29 #include <frame.hxx> // fuer AttrCache 30 #include <format.hxx> 31 #include <hints.hxx> // fuer SwFmtChg 32 #include <doc.hxx> 33 #include <paratr.hxx> // fuer SwParaFmt - SwHyphenBug 34 #include <swcache.hxx> 35 #include <fmtcolfunc.hxx> 36 37 TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt 38 39 /************************************************************************* 40 |* SwFmt::SwFmt 41 *************************************************************************/ 42 43 44 SwFmt::SwFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, 45 const sal_uInt16* pWhichRanges, SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich ) 46 : SwModify( pDrvdFrm ), 47 aSet( rPool, pWhichRanges ), 48 nWhichId( nFmtWhich ), 49 nFmtId( 0 ), 50 nPoolFmtId( USHRT_MAX ), 51 nPoolHelpId( USHRT_MAX ), 52 nPoolHlpFileId( UCHAR_MAX ) 53 { 54 aFmtName.AssignAscii( pFmtNm ); 55 bWritten = bFmtInDTOR = bAutoUpdateFmt = sal_False; // LAYER_IMPL 56 bAutoFmt = sal_True; 57 58 if( pDrvdFrm ) 59 aSet.SetParent( &pDrvdFrm->aSet ); 60 } 61 62 63 SwFmt::SwFmt( SwAttrPool& rPool, const String &rFmtNm, 64 const sal_uInt16* pWhichRanges, SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich ) 65 : SwModify( pDrvdFrm ), 66 aFmtName( rFmtNm ), 67 aSet( rPool, pWhichRanges ), 68 nWhichId( nFmtWhich ), 69 nFmtId( 0 ), 70 nPoolFmtId( USHRT_MAX ), 71 nPoolHelpId( USHRT_MAX ), 72 nPoolHlpFileId( UCHAR_MAX ) 73 { 74 bWritten = bFmtInDTOR = bAutoUpdateFmt = sal_False; // LAYER_IMPL 75 bAutoFmt = sal_True; 76 77 if( pDrvdFrm ) 78 aSet.SetParent( &pDrvdFrm->aSet ); 79 } 80 81 82 SwFmt::SwFmt( const SwFmt& rFmt ) 83 : SwModify( rFmt.DerivedFrom() ), 84 aFmtName( rFmt.aFmtName ), 85 aSet( rFmt.aSet ), 86 nWhichId( rFmt.nWhichId ), 87 nFmtId( 0 ), 88 nPoolFmtId( rFmt.GetPoolFmtId() ), 89 nPoolHelpId( rFmt.GetPoolHelpId() ), 90 nPoolHlpFileId( rFmt.GetPoolHlpFileId() ) 91 { 92 bWritten = bFmtInDTOR = sal_False; // LAYER_IMPL 93 bAutoFmt = rFmt.bAutoFmt; 94 bAutoUpdateFmt = rFmt.bAutoUpdateFmt; 95 96 if( rFmt.DerivedFrom() ) 97 aSet.SetParent( &rFmt.DerivedFrom()->aSet ); 98 // einige Sonderbehandlungen fuer Attribute 99 aSet.SetModifyAtAttr( this ); 100 } 101 102 /************************************************************************* 103 |* SwFmt &SwFmt::operator=(const SwFmt& aFmt) 104 |* 105 |* Beschreibung Dokument 1.14 106 |* Ersterstellung JP 22.11.90 107 |* Letzte Aenderung JP 05.08.94 108 *************************************************************************/ 109 110 111 SwFmt &SwFmt::operator=(const SwFmt& rFmt) 112 { 113 nWhichId = rFmt.nWhichId; 114 nPoolFmtId = rFmt.GetPoolFmtId(); 115 nPoolHelpId = rFmt.GetPoolHelpId(); 116 nPoolHlpFileId = rFmt.GetPoolHlpFileId(); 117 118 if ( IsInCache() ) 119 { 120 SwFrm::GetCache().Delete( this ); 121 SetInCache( sal_False ); 122 } 123 SetInSwFntCache( sal_False ); 124 125 // kopiere nur das Attribut-Delta Array 126 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 127 aNew( *aSet.GetPool(), aSet.GetRanges() ); 128 aSet.Intersect_BC( rFmt.aSet, &aOld, &aNew ); 129 aSet.Put_BC( rFmt.aSet, &aOld, &aNew ); 130 131 // einige Sonderbehandlungen fuer Attribute 132 aSet.SetModifyAtAttr( this ); 133 134 // PoolItem-Attr erzeugen fuers Modify !!! 135 if( aOld.Count() ) 136 { 137 SwAttrSetChg aChgOld( aSet, aOld ); 138 SwAttrSetChg aChgNew( aSet, aNew ); 139 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 140 } 141 142 if( GetRegisteredIn() != rFmt.GetRegisteredIn() ) 143 { 144 if( GetRegisteredIn() ) 145 GetRegisteredInNonConst()->Remove(this); 146 if(rFmt.GetRegisteredIn()) 147 { 148 const_cast<SwFmt&>(rFmt).GetRegisteredInNonConst()->Add(this); 149 aSet.SetParent( &rFmt.aSet ); 150 } 151 else 152 aSet.SetParent( 0 ); 153 } 154 bAutoFmt = rFmt.bAutoFmt; 155 bAutoUpdateFmt = rFmt.bAutoUpdateFmt; 156 return *this; 157 } 158 159 void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast ) 160 { 161 ASSERT(!IsDefault(), "SetName: Defaultformat" ); 162 if( bBroadcast ) 163 { 164 SwStringMsgPoolItem aOld( RES_NAME_CHANGED, aFmtName ); 165 SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName ); 166 aFmtName = rNewName; 167 ModifyNotification( &aOld, &aNew ); 168 } 169 else 170 { 171 aFmtName = rNewName; 172 } 173 } 174 175 /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 176 * diese Funktion wird in jedem Copy-Ctor gerufen, damit die 177 * Attribute kopiert werden. Diese koennen erst kopiert werden, 178 * wenn die abgeleitet Klasse existiert, denn beim Setzen der 179 * Attribute wird die Which()-Methode gerufen, die hier in der 180 * Basis-Klasse auf 0 defaultet ist. 181 * 182 * Zusatz: JP 8.4.1994 183 * Wird ueber Dokumentgrenzen kopiert, so muss das neue Dokument 184 * mit angeben werden, in dem this steht. Z.Z. ist das fuers 185 * DropCaps wichtig, dieses haelt Daten, die tief kopiert werden 186 * muessen !! 187 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ 188 189 190 void SwFmt::CopyAttrs( const SwFmt& rFmt, sal_Bool bReplace ) 191 { 192 // kopiere nur das Attribut-Delta Array 193 194 if ( IsInCache() ) 195 { 196 SwFrm::GetCache().Delete( this ); 197 SetInCache( sal_False ); 198 } 199 SetInSwFntCache( sal_False ); 200 201 // Sonderbehandlung fuer einige Attribute 202 SwAttrSet* pChgSet = (SwAttrSet*)&rFmt.aSet; 203 204 if( !bReplace ) // nur die neu, die nicht gesetzt sind ?? 205 { 206 if( pChgSet == (SwAttrSet*)&rFmt.aSet ) // Set hier kopieren 207 pChgSet = new SwAttrSet( rFmt.aSet ); 208 pChgSet->Differentiate( aSet ); 209 } 210 211 // kopiere nur das Attribut-Delta Array 212 if( pChgSet->GetPool() != aSet.GetPool() ) 213 pChgSet->CopyToModify( *this ); 214 else 215 { 216 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 217 aNew( *aSet.GetPool(), aSet.GetRanges() ); 218 219 if ( 0 != aSet.Put_BC( *pChgSet, &aOld, &aNew ) ) 220 { 221 // einige Sonderbehandlungen fuer Attribute 222 aSet.SetModifyAtAttr( this ); 223 224 SwAttrSetChg aChgOld( aSet, aOld ); 225 SwAttrSetChg aChgNew( aSet, aNew ); 226 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 227 } 228 } 229 230 if( pChgSet != (SwAttrSet*)&rFmt.aSet ) // Set hier angelegt ? 231 delete pChgSet; 232 } 233 234 /************************************************************************* 235 |* SwFmt::~SwFmt() 236 |* 237 |* Beschreibung Dokument 1.14 238 |* Ersterstellung JP 22.11.90 239 |* Letzte Aenderung JP 14.02.91 240 *************************************************************************/ 241 242 243 SwFmt::~SwFmt() 244 { 245 /* das passiert bei der ObjectDying Message */ 246 /* alle Abhaengigen auf DerivedFrom umhaengen */ 247 if( GetDepends() ) 248 { 249 ASSERT(DerivedFrom(), "SwFmt::~SwFmt: Def Abhaengige!" ); 250 251 bFmtInDTOR = sal_True; 252 253 SwFmt *pParentFmt = DerivedFrom(); 254 if (!pParentFmt) // see #112405# 255 { 256 DBG_ERROR( "~SwFmt: parent format missing" ); 257 } 258 else 259 { 260 //IAccessibility2 Implementation 2009----- 261 while( GetDepends() && pParentFmt) 262 //-----IAccessibility2 Implementation 2009 263 { 264 SwFmtChg aOldFmt(this); 265 SwFmtChg aNewFmt(pParentFmt); 266 SwClient * pDepend = (SwClient*)GetDepends(); 267 pParentFmt->Add(pDepend); 268 pDepend->ModifyNotification(&aOldFmt, &aNewFmt); 269 } 270 } 271 } 272 } 273 274 275 /************************************************************************* 276 |* void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) 277 |* 278 |* Beschreibung Dokument 1.14 279 |* Ersterstellung JP 22.11.90 280 |* Letzte Aenderung JP 05.08.94 281 *************************************************************************/ 282 283 284 void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) 285 { 286 sal_Bool bWeiter = sal_True; // sal_True = Propagierung an die Abhaengigen 287 288 sal_uInt16 nWhich = pOldValue ? pOldValue->Which() : 289 pNewValue ? pNewValue->Which() : 0 ; 290 switch( nWhich ) 291 { 292 case 0: break; // Which-Id von 0 ??? 293 294 case RES_OBJECTDYING : 295 { 296 // ist das sterbende Object das "Parent"-Format von diesen Format, 297 // dann haengt sich dieses Format an den Parent vom Parent 298 SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject; 299 300 // nicht umhaengen wenn dieses das oberste Format ist !! 301 if( GetRegisteredIn() && GetRegisteredIn() == pFmt ) 302 { 303 if( pFmt->GetRegisteredIn() ) 304 { 305 // wenn Parent, dann im neuen Parent wieder anmelden 306 pFmt->DerivedFrom()->Add( this ); 307 aSet.SetParent( &DerivedFrom()->aSet ); 308 } 309 else 310 { 311 // sonst auf jeden Fall beim sterbenden abmelden 312 DerivedFrom()->Remove( this ); 313 aSet.SetParent( 0 ); 314 } 315 } 316 } // OBJECTDYING 317 break; 318 319 case RES_ATTRSET_CHG: 320 if( ((SwAttrSetChg*)pOldValue)->GetTheChgdSet() != &aSet ) 321 { 322 //nur die weiter geben, die hier nicht gesetzt sind !! 323 SwAttrSetChg aOld( *(SwAttrSetChg*)pOldValue ); 324 SwAttrSetChg aNew( *(SwAttrSetChg*)pNewValue ); 325 326 aOld.GetChgSet()->Differentiate( aSet ); 327 aNew.GetChgSet()->Differentiate( aSet ); 328 329 if( aNew.Count() ) 330 // keine mehr gesetzt, dann Ende !! 331 NotifyClients( &aOld, &aNew ); 332 bWeiter = sal_False; 333 } 334 break; 335 case RES_FMT_CHG: 336 // falls mein Format Parent umgesetzt wird, dann melde ich 337 // meinen Attrset beim Neuen an. 338 339 // sein eigenes Modify ueberspringen !! 340 if( ((SwFmtChg*)pOldValue)->pChangedFmt != this && 341 ((SwFmtChg*)pNewValue)->pChangedFmt == DerivedFrom() ) 342 { 343 // den Set an den neuen Parent haengen 344 aSet.SetParent( DerivedFrom() ? &DerivedFrom()->aSet : 0 ); 345 } 346 break; 347 348 case RES_RESET_FMTWRITTEN: 349 { 350 // IsWritten-Flag zuruecksetzen. Hint nur an abhanegige 351 // Formate (und keine Frames) propagieren. 352 // mba: the code does the opposite from what is written in the comment! 353 ResetWritten(); 354 // mba: here we don't use the additional stuff from NotifyClients(). 355 // should we?! 356 // mba: move the code that ignores this event to the clients 357 ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) ); 358 bWeiter = sal_False; 359 } 360 break; 361 362 default: 363 { 364 // Ist das Attribut in diesem Format definiert, dann auf 365 // NICHT weiter propagieren !! 366 if( SFX_ITEM_SET == aSet.GetItemState( nWhich, sal_False )) 367 { 368 // wie finde ich heraus, ob nicht ich die Message versende ?? 369 // aber wer ruft das hier ???? 370 //ASSERT( sal_False, "Modify ohne Absender verschickt" ); 371 //JP 11.06.96: DropCaps koennen hierher kommen 372 ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" ); 373 bWeiter = sal_False; 374 } 375 376 } // default 377 } // switch 378 379 if( bWeiter ) 380 { 381 // laufe durch alle abhaengigen Formate 382 NotifyClients( pOldValue, pNewValue ); 383 } 384 385 } 386 387 388 sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom) 389 { 390 if ( pDerFrom ) 391 { 392 // Zyklus? 393 const SwFmt* pFmt = pDerFrom; 394 while ( pFmt != 0 ) 395 { 396 if ( pFmt == this ) 397 return sal_False; 398 399 pFmt=pFmt->DerivedFrom(); 400 } 401 } 402 else 403 { 404 // Nichts angegeben, Dflt-Format suchen 405 pDerFrom = this; 406 while ( pDerFrom->DerivedFrom() ) 407 pDerFrom = pDerFrom->DerivedFrom(); 408 } 409 if ( (pDerFrom == DerivedFrom()) || (pDerFrom == this) ) 410 return sal_False; 411 412 ASSERT( Which()==pDerFrom->Which() 413 || ( Which()==RES_CONDTXTFMTCOLL && pDerFrom->Which()==RES_TXTFMTCOLL) 414 || ( Which()==RES_TXTFMTCOLL && pDerFrom->Which()==RES_CONDTXTFMTCOLL) 415 || ( Which()==RES_FLYFRMFMT && pDerFrom->Which()==RES_FRMFMT ), 416 "SetDerivedFrom: Aepfel von Birnen ableiten?"); 417 418 if ( IsInCache() ) 419 { 420 SwFrm::GetCache().Delete( this ); 421 SetInCache( sal_False ); 422 } 423 SetInSwFntCache( sal_False ); 424 425 pDerFrom->Add(this); 426 aSet.SetParent( &pDerFrom->aSet ); 427 428 SwFmtChg aOldFmt(this); 429 SwFmtChg aNewFmt(this); 430 ModifyNotification( &aOldFmt, &aNewFmt ); 431 432 return sal_True; 433 } 434 435 436 sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr ) 437 { 438 if ( IsInCache() || IsInSwFntCache() ) 439 { 440 const sal_uInt16 nWhich = rAttr.Which(); 441 CheckCaching( nWhich ); 442 } 443 444 // wenn Modify gelockt ist, werden keine Modifies verschickt; 445 // fuer FrmFmt's immer das Modify verschicken! 446 sal_Bool bRet = sal_False; 447 const sal_uInt16 nFmtWhich = Which(); 448 if( IsModifyLocked() || (!GetDepends() && 449 (RES_GRFFMTCOLL == nFmtWhich || 450 RES_TXTFMTCOLL == nFmtWhich ) ) ) 451 { 452 if( 0 != ( bRet = (0 != aSet.Put( rAttr ))) ) 453 aSet.SetModifyAtAttr( this ); 454 // --> OD 2006-11-22 #i71574# 455 if ( nFmtWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE ) 456 { 457 TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this ); 458 } 459 // <-- 460 } 461 else 462 { 463 // kopiere nur das Attribut-Delta Array 464 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 465 aNew( *aSet.GetPool(), aSet.GetRanges() ); 466 467 bRet = 0 != aSet.Put_BC( rAttr, &aOld, &aNew ); 468 if( bRet ) 469 { 470 // einige Sonderbehandlungen fuer Attribute 471 aSet.SetModifyAtAttr( this ); 472 473 SwAttrSetChg aChgOld( aSet, aOld ); 474 SwAttrSetChg aChgNew( aSet, aNew ); 475 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 476 } 477 } 478 return bRet; 479 } 480 481 482 sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) 483 { 484 if( !rSet.Count() ) 485 return sal_False; 486 487 if ( IsInCache() ) 488 { 489 SwFrm::GetCache().Delete( this ); 490 SetInCache( sal_False ); 491 } 492 SetInSwFntCache( sal_False ); 493 494 // wenn Modify gelockt ist, werden keine Modifies verschickt; 495 // fuer FrmFmt's immer das Modify verschicken! 496 sal_Bool bRet = sal_False; 497 const sal_uInt16 nFmtWhich = Which(); 498 if ( IsModifyLocked() || 499 ( !GetDepends() && 500 ( RES_GRFFMTCOLL == nFmtWhich || 501 RES_TXTFMTCOLL == nFmtWhich ) ) ) 502 { 503 if( 0 != ( bRet = (0 != aSet.Put( rSet ))) ) 504 aSet.SetModifyAtAttr( this ); 505 // --> OD 2006-11-22 #i71574# 506 if ( nFmtWhich == RES_TXTFMTCOLL ) 507 { 508 TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this ); 509 } 510 // <-- 511 } 512 else 513 { 514 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 515 aNew( *aSet.GetPool(), aSet.GetRanges() ); 516 bRet = 0 != aSet.Put_BC( rSet, &aOld, &aNew ); 517 if( bRet ) 518 { 519 // einige Sonderbehandlungen fuer Attribute 520 aSet.SetModifyAtAttr( this ); 521 SwAttrSetChg aChgOld( aSet, aOld ); 522 SwAttrSetChg aChgNew( aSet, aNew ); 523 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 524 } 525 } 526 return bRet; 527 } 528 529 // Nimmt den Hint mit nWhich aus dem Delta-Array 530 531 532 sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) 533 { 534 if( !aSet.Count() ) 535 return sal_False; 536 537 if( !nWhich2 || nWhich2 < nWhich1 ) 538 nWhich2 = nWhich1; // dann setze auf 1. Id, nur dieses Item 539 540 if ( IsInCache() || IsInSwFntCache() ) 541 { 542 for( sal_uInt16 n = nWhich1; n < nWhich2; ++n ) 543 CheckCaching( n ); 544 } 545 546 // wenn Modify gelockt ist, werden keine Modifies verschickt 547 if( IsModifyLocked() ) 548 return 0 != (( nWhich2 == nWhich1 ) 549 ? aSet.ClearItem( nWhich1 ) 550 : aSet.ClearItem_BC( nWhich1, nWhich2 )); 551 552 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 553 aNew( *aSet.GetPool(), aSet.GetRanges() ); 554 sal_Bool bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew ); 555 556 if( bRet ) 557 { 558 SwAttrSetChg aChgOld( aSet, aOld ); 559 SwAttrSetChg aChgNew( aSet, aNew ); 560 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 561 } 562 return bRet; 563 } 564 565 566 567 // --> OD 2007-01-24 #i73790# 568 // method renamed 569 sal_uInt16 SwFmt::ResetAllFmtAttr() 570 // <-- 571 { 572 if( !aSet.Count() ) 573 return 0; 574 575 if ( IsInCache() ) 576 { 577 SwFrm::GetCache().Delete( this ); 578 SetInCache( sal_False ); 579 } 580 SetInSwFntCache( sal_False ); 581 582 // wenn Modify gelockt ist, werden keine Modifies verschickt 583 if( IsModifyLocked() ) 584 return aSet.ClearItem( 0 ); 585 586 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 587 aNew( *aSet.GetPool(), aSet.GetRanges() ); 588 sal_Bool bRet = 0 != aSet.ClearItem_BC( 0, &aOld, &aNew ); 589 590 if( bRet ) 591 { 592 SwAttrSetChg aChgOld( aSet, aOld ); 593 SwAttrSetChg aChgNew( aSet, aNew ); 594 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 595 } 596 return aNew.Count(); 597 } 598 599 600 /************************************************************************* 601 |* void SwFmt::GetInfo( const SfxPoolItem& ) const 602 |* 603 |* Beschreibung 604 |* Ersterstellung JP 18.04.94 605 |* Letzte Aenderung JP 05.08.94 606 *************************************************************************/ 607 608 609 sal_Bool SwFmt::GetInfo( SfxPoolItem& rInfo ) const 610 { 611 sal_Bool bRet = SwModify::GetInfo( rInfo ); 612 return bRet; 613 } 614 615 616 void SwFmt::DelDiffs( const SfxItemSet& rSet ) 617 { 618 if( !aSet.Count() ) 619 return; 620 621 if ( IsInCache() ) 622 { 623 SwFrm::GetCache().Delete( this ); 624 SetInCache( sal_False ); 625 } 626 SetInSwFntCache( sal_False ); 627 628 // wenn Modify gelockt ist, werden keine Modifies verschickt 629 if( IsModifyLocked() ) 630 { 631 aSet.Intersect( rSet ); 632 return; 633 } 634 635 SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), 636 aNew( *aSet.GetPool(), aSet.GetRanges() ); 637 sal_Bool bRet = 0 != aSet.Intersect_BC( rSet, &aOld, &aNew ); 638 639 if( bRet ) 640 { 641 SwAttrSetChg aChgOld( aSet, aOld ); 642 SwAttrSetChg aChgNew( aSet, aNew ); 643 ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt 644 } 645 } 646 647 /** SwFmt::IsBackgroundTransparent - for feature #99657# 648 649 OD 22.08.2002 650 Virtual method to determine, if background of format is transparent. 651 Default implementation returns false. Thus, subclasses have to overload 652 method, if the specific subclass can have a transparent background. 653 654 @author OD 655 656 @return false, default implementation 657 */ 658 sal_Bool SwFmt::IsBackgroundTransparent() const 659 { 660 return sal_False; 661 } 662 663 /** SwFmt::IsShadowTransparent - for feature #99657# 664 665 OD 22.08.2002 666 Virtual method to determine, if shadow of format is transparent. 667 Default implementation returns false. Thus, subclasses have to overload 668 method, if the specific subclass can have a transparent shadow. 669 670 @author OD 671 672 @return false, default implementation 673 */ 674 sal_Bool SwFmt::IsShadowTransparent() const 675 { 676 return sal_False; 677 } 678 679 /* 680 * Document Interface Access 681 */ 682 const IDocumentSettingAccess* SwFmt::getIDocumentSettingAccess() const { return GetDoc(); } 683 const IDocumentDrawModelAccess* SwFmt::getIDocumentDrawModelAccess() const { return GetDoc(); } 684 IDocumentDrawModelAccess* SwFmt::getIDocumentDrawModelAccess() { return GetDoc(); } 685 const IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() const { return GetDoc(); } 686 IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() { return GetDoc(); } 687 IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); } 688 IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); } 689 IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); } 690 691