xref: /AOO41X/main/sw/source/core/attr/format.cxx (revision 54628ca40d27d15cc98fe861da7fff7e60c2f7d6)
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             while( GetDepends() )
261             {
262                 SwFmtChg aOldFmt(this);
263                 SwFmtChg aNewFmt(pParentFmt);
264                 SwClient * pDepend = (SwClient*)GetDepends();
265                 pParentFmt->Add(pDepend);
266                 pDepend->ModifyNotification(&aOldFmt, &aNewFmt);
267             }
268         }
269     }
270 }
271 
272 
273 /*************************************************************************
274 |*    void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
275 |*
276 |*    Beschreibung      Dokument 1.14
277 |*    Ersterstellung    JP 22.11.90
278 |*    Letzte Aenderung  JP 05.08.94
279 *************************************************************************/
280 
281 
282 void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
283 {
284     sal_Bool bWeiter = sal_True;    // sal_True = Propagierung an die Abhaengigen
285 
286     sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
287                     pNewValue ? pNewValue->Which() : 0 ;
288     switch( nWhich )
289     {
290     case 0:     break;          // Which-Id von 0 ???
291 
292     case RES_OBJECTDYING :
293         {
294             // ist das sterbende Object das "Parent"-Format von diesen Format,
295             // dann haengt sich dieses Format an den Parent vom Parent
296             SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject;
297 
298             // nicht umhaengen wenn dieses das oberste Format ist !!
299             if( GetRegisteredIn() && GetRegisteredIn() == pFmt )
300             {
301                 if( pFmt->GetRegisteredIn() )
302                 {
303                     // wenn Parent, dann im neuen Parent wieder anmelden
304                     pFmt->DerivedFrom()->Add( this );
305                     aSet.SetParent( &DerivedFrom()->aSet );
306                 }
307                 else
308                 {
309                     // sonst auf jeden Fall beim sterbenden abmelden
310                     DerivedFrom()->Remove( this );
311                     aSet.SetParent( 0 );
312                 }
313             }
314         } // OBJECTDYING
315         break;
316 
317     case RES_ATTRSET_CHG:
318         if( ((SwAttrSetChg*)pOldValue)->GetTheChgdSet() != &aSet )
319         {
320             //nur die weiter geben, die hier nicht gesetzt sind !!
321             SwAttrSetChg aOld( *(SwAttrSetChg*)pOldValue );
322             SwAttrSetChg aNew( *(SwAttrSetChg*)pNewValue );
323 
324             aOld.GetChgSet()->Differentiate( aSet );
325             aNew.GetChgSet()->Differentiate( aSet );
326 
327             if( aNew.Count() )
328                 // keine mehr gesetzt, dann Ende !!
329             NotifyClients( &aOld, &aNew );
330             bWeiter = sal_False;
331         }
332         break;
333     case RES_FMT_CHG:
334         // falls mein Format Parent umgesetzt wird, dann melde ich
335         // meinen Attrset beim Neuen an.
336 
337         // sein eigenes Modify ueberspringen !!
338         if( ((SwFmtChg*)pOldValue)->pChangedFmt != this &&
339             ((SwFmtChg*)pNewValue)->pChangedFmt == DerivedFrom() )
340         {
341             // den Set an den neuen Parent haengen
342             aSet.SetParent( DerivedFrom() ? &DerivedFrom()->aSet : 0 );
343         }
344         break;
345 
346     case RES_RESET_FMTWRITTEN:
347         {
348             // IsWritten-Flag zuruecksetzen. Hint nur an abhanegige
349             // Formate (und keine Frames) propagieren.
350             // mba: the code does the opposite from what is written in the comment!
351             ResetWritten();
352             // mba: here we don't use the additional stuff from NotifyClients().
353             // should we?!
354             // mba: move the code that ignores this event to the clients
355             ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) );
356             bWeiter = sal_False;
357         }
358         break;
359 
360     default:
361         {
362             // Ist das Attribut in diesem Format definiert, dann auf
363             // NICHT weiter propagieren !!
364             if( SFX_ITEM_SET == aSet.GetItemState( nWhich, sal_False ))
365             {
366 // wie finde ich heraus, ob nicht ich die Message versende ??
367 // aber wer ruft das hier ????
368 //ASSERT( sal_False, "Modify ohne Absender verschickt" );
369 //JP 11.06.96: DropCaps koennen hierher kommen
370 ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
371                 bWeiter = sal_False;
372             }
373 
374         } // default
375     } // switch
376 
377     if( bWeiter )
378     {
379         // laufe durch alle abhaengigen Formate
380         NotifyClients( pOldValue, pNewValue );
381     }
382 
383 }
384 
385 
386 sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
387 {
388     if ( pDerFrom )
389     {
390         // Zyklus?
391         const SwFmt* pFmt = pDerFrom;
392         while ( pFmt != 0 )
393         {
394             if ( pFmt == this )
395                 return sal_False;
396 
397             pFmt=pFmt->DerivedFrom();
398         }
399     }
400     else
401     {
402         // Nichts angegeben, Dflt-Format suchen
403         pDerFrom = this;
404         while ( pDerFrom->DerivedFrom() )
405             pDerFrom = pDerFrom->DerivedFrom();
406     }
407     if ( (pDerFrom == DerivedFrom()) || (pDerFrom == this) )
408         return sal_False;
409 
410     ASSERT( Which()==pDerFrom->Which()
411             || ( Which()==RES_CONDTXTFMTCOLL && pDerFrom->Which()==RES_TXTFMTCOLL)
412             || ( Which()==RES_TXTFMTCOLL && pDerFrom->Which()==RES_CONDTXTFMTCOLL)
413             || ( Which()==RES_FLYFRMFMT && pDerFrom->Which()==RES_FRMFMT ),
414             "SetDerivedFrom: Aepfel von Birnen ableiten?");
415 
416     if ( IsInCache() )
417     {
418         SwFrm::GetCache().Delete( this );
419         SetInCache( sal_False );
420     }
421     SetInSwFntCache( sal_False );
422 
423     pDerFrom->Add(this);
424     aSet.SetParent( &pDerFrom->aSet );
425 
426     SwFmtChg aOldFmt(this);
427     SwFmtChg aNewFmt(this);
428     ModifyNotification( &aOldFmt, &aNewFmt );
429 
430     return sal_True;
431 }
432 
433 
434 sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
435 {
436     if ( IsInCache() || IsInSwFntCache() )
437     {
438         const sal_uInt16 nWhich = rAttr.Which();
439         CheckCaching( nWhich );
440     }
441 
442     // wenn Modify gelockt ist, werden keine Modifies verschickt;
443     // fuer FrmFmt's immer das Modify verschicken!
444     sal_Bool bRet = sal_False;
445     const sal_uInt16 nFmtWhich = Which();
446     if( IsModifyLocked() || (!GetDepends() &&
447         (RES_GRFFMTCOLL == nFmtWhich  ||
448          RES_TXTFMTCOLL == nFmtWhich ) ) )
449     {
450         if( 0 != ( bRet = (0 != aSet.Put( rAttr ))) )
451             aSet.SetModifyAtAttr( this );
452         // --> OD 2006-11-22 #i71574#
453         if ( nFmtWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE )
454         {
455             TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
456         }
457         // <--
458     }
459     else
460     {
461         // kopiere nur das Attribut-Delta Array
462         SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
463                     aNew( *aSet.GetPool(), aSet.GetRanges() );
464 
465         bRet = 0 != aSet.Put_BC( rAttr, &aOld, &aNew );
466         if( bRet )
467         {
468             // einige Sonderbehandlungen fuer Attribute
469             aSet.SetModifyAtAttr( this );
470 
471             SwAttrSetChg aChgOld( aSet, aOld );
472             SwAttrSetChg aChgNew( aSet, aNew );
473             ModifyNotification( &aChgOld, &aChgNew );       // alle veraenderten werden verschickt
474         }
475     }
476     return bRet;
477 }
478 
479 
480 sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
481 {
482     if( !rSet.Count() )
483         return sal_False;
484 
485     if ( IsInCache() )
486     {
487         SwFrm::GetCache().Delete( this );
488         SetInCache( sal_False );
489     }
490     SetInSwFntCache( sal_False );
491 
492     // wenn Modify gelockt ist, werden keine Modifies verschickt;
493     // fuer FrmFmt's immer das Modify verschicken!
494     sal_Bool bRet = sal_False;
495     const sal_uInt16 nFmtWhich = Which();
496     if ( IsModifyLocked() ||
497          ( !GetDepends() &&
498            ( RES_GRFFMTCOLL == nFmtWhich ||
499              RES_TXTFMTCOLL == nFmtWhich ) ) )
500     {
501         if( 0 != ( bRet = (0 != aSet.Put( rSet ))) )
502             aSet.SetModifyAtAttr( this );
503         // --> OD 2006-11-22 #i71574#
504         if ( nFmtWhich == RES_TXTFMTCOLL )
505         {
506             TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
507         }
508         // <--
509     }
510     else
511     {
512         SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
513                     aNew( *aSet.GetPool(), aSet.GetRanges() );
514         bRet = 0 != aSet.Put_BC( rSet, &aOld, &aNew );
515         if( bRet )
516         {
517             // einige Sonderbehandlungen fuer Attribute
518             aSet.SetModifyAtAttr( this );
519             SwAttrSetChg aChgOld( aSet, aOld );
520             SwAttrSetChg aChgNew( aSet, aNew );
521             ModifyNotification( &aChgOld, &aChgNew );       // alle veraenderten werden verschickt
522         }
523     }
524     return bRet;
525 }
526 
527 // Nimmt den Hint mit nWhich aus dem Delta-Array
528 
529 
530 sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
531 {
532     if( !aSet.Count() )
533         return sal_False;
534 
535     if( !nWhich2 || nWhich2 < nWhich1 )
536         nWhich2 = nWhich1;      // dann setze auf 1. Id, nur dieses Item
537 
538     if ( IsInCache() || IsInSwFntCache() )
539     {
540         for( sal_uInt16 n = nWhich1; n < nWhich2; ++n )
541             CheckCaching( n );
542     }
543 
544     // wenn Modify gelockt ist, werden keine Modifies verschickt
545     if( IsModifyLocked() )
546         return 0 != (( nWhich2 == nWhich1 )
547                 ? aSet.ClearItem( nWhich1 )
548                 : aSet.ClearItem_BC( nWhich1, nWhich2 ));
549 
550     SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
551                 aNew( *aSet.GetPool(), aSet.GetRanges() );
552     sal_Bool bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew );
553 
554     if( bRet )
555     {
556         SwAttrSetChg aChgOld( aSet, aOld );
557         SwAttrSetChg aChgNew( aSet, aNew );
558         ModifyNotification( &aChgOld, &aChgNew );       // alle veraenderten werden verschickt
559     }
560     return bRet;
561 }
562 
563 
564 
565 // --> OD 2007-01-24 #i73790#
566 // method renamed
567 sal_uInt16 SwFmt::ResetAllFmtAttr()
568 // <--
569 {
570     if( !aSet.Count() )
571         return 0;
572 
573     if ( IsInCache() )
574     {
575         SwFrm::GetCache().Delete( this );
576         SetInCache( sal_False );
577     }
578     SetInSwFntCache( sal_False );
579 
580     // wenn Modify gelockt ist, werden keine Modifies verschickt
581     if( IsModifyLocked() )
582         return aSet.ClearItem( 0 );
583 
584     SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
585                 aNew( *aSet.GetPool(), aSet.GetRanges() );
586     sal_Bool bRet = 0 != aSet.ClearItem_BC( 0, &aOld, &aNew );
587 
588     if( bRet )
589     {
590         SwAttrSetChg aChgOld( aSet, aOld );
591         SwAttrSetChg aChgNew( aSet, aNew );
592         ModifyNotification( &aChgOld, &aChgNew );       // alle veraenderten werden verschickt
593     }
594     return aNew.Count();
595 }
596 
597 
598 /*************************************************************************
599 |*    void SwFmt::GetInfo( const SfxPoolItem& ) const
600 |*
601 |*    Beschreibung
602 |*    Ersterstellung    JP 18.04.94
603 |*    Letzte Aenderung  JP 05.08.94
604 *************************************************************************/
605 
606 
607 sal_Bool SwFmt::GetInfo( SfxPoolItem& rInfo ) const
608 {
609     sal_Bool bRet = SwModify::GetInfo( rInfo );
610     return bRet;
611 }
612 
613 
614 void SwFmt::DelDiffs( const SfxItemSet& rSet )
615 {
616     if( !aSet.Count() )
617         return;
618 
619     if ( IsInCache() )
620     {
621         SwFrm::GetCache().Delete( this );
622         SetInCache( sal_False );
623     }
624     SetInSwFntCache( sal_False );
625 
626     // wenn Modify gelockt ist, werden keine Modifies verschickt
627     if( IsModifyLocked() )
628     {
629         aSet.Intersect( rSet );
630         return;
631     }
632 
633     SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ),
634                 aNew( *aSet.GetPool(), aSet.GetRanges() );
635     sal_Bool bRet = 0 != aSet.Intersect_BC( rSet, &aOld, &aNew );
636 
637     if( bRet )
638     {
639         SwAttrSetChg aChgOld( aSet, aOld );
640         SwAttrSetChg aChgNew( aSet, aNew );
641         ModifyNotification( &aChgOld, &aChgNew );       // alle veraenderten werden verschickt
642     }
643 }
644 
645 /** SwFmt::IsBackgroundTransparent - for feature #99657#
646 
647     OD 22.08.2002
648     Virtual method to determine, if background of format is transparent.
649     Default implementation returns false. Thus, subclasses have to overload
650     method, if the specific subclass can have a transparent background.
651 
652     @author OD
653 
654     @return false, default implementation
655 */
656 sal_Bool SwFmt::IsBackgroundTransparent() const
657 {
658     return sal_False;
659 }
660 
661 /** SwFmt::IsShadowTransparent - for feature #99657#
662 
663     OD 22.08.2002
664     Virtual method to determine, if shadow of format is transparent.
665     Default implementation returns false. Thus, subclasses have to overload
666     method, if the specific subclass can have a transparent shadow.
667 
668     @author OD
669 
670     @return false, default implementation
671 */
672 sal_Bool SwFmt::IsShadowTransparent() const
673 {
674     return sal_False;
675 }
676 
677 /*
678  * Document Interface Access
679  */
680 const IDocumentSettingAccess* SwFmt::getIDocumentSettingAccess() const { return GetDoc(); }
681 const IDocumentDrawModelAccess* SwFmt::getIDocumentDrawModelAccess() const { return GetDoc(); }
682 IDocumentDrawModelAccess* SwFmt::getIDocumentDrawModelAccess() { return GetDoc(); }
683 const IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() const { return GetDoc(); }
684 IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() { return GetDoc(); }
685 IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); }
686 IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); }
687 IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); }
688 
689