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