xref: /AOO41X/main/sw/source/core/txtnode/txtatr2.cxx (revision 782a276c8a1bedc2d3a53e8b896490eb36cd15c8)
1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5efeef26fSAndrew Rist  * distributed with this work for additional information
6efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17efeef26fSAndrew Rist  * specific language governing permissions and limitations
18efeef26fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20efeef26fSAndrew Rist  *************************************************************/
21efeef26fSAndrew Rist 
22efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <hintids.hxx>
28cdf0e10cSrcweir #include <hints.hxx>
29cdf0e10cSrcweir #include <sfx2/objsh.hxx>
30cdf0e10cSrcweir #include <editeng/xmlcnitm.hxx>
31cdf0e10cSrcweir #include <editeng/twolinesitem.hxx>
32cdf0e10cSrcweir #include <txtinet.hxx>
33cdf0e10cSrcweir #include <txtatr.hxx>
34cdf0e10cSrcweir #include <fchrfmt.hxx>
35cdf0e10cSrcweir #include <fmtinfmt.hxx>
36cdf0e10cSrcweir #include <charfmt.hxx>
37cdf0e10cSrcweir #include <ndtxt.hxx>        // SwCharFmt, SwTxtNode
38cdf0e10cSrcweir #include <poolfmt.hxx>		// RES_POOLCHR_INET_...
39cdf0e10cSrcweir #include <doc.hxx>			// SwDoc
40cdf0e10cSrcweir #include <fmtruby.hxx>
41cdf0e10cSrcweir #include <fmtmeta.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 
44cdf0e10cSrcweir TYPEINIT1(SwTxtINetFmt,SwClient);
45cdf0e10cSrcweir TYPEINIT1(SwTxtRuby,SwClient);
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 
48cdf0e10cSrcweir /*************************************************************************
49cdf0e10cSrcweir  *						class SwTxtCharFmt
50cdf0e10cSrcweir  *************************************************************************/
51cdf0e10cSrcweir 
SwTxtCharFmt(SwFmtCharFmt & rAttr,xub_StrLen nStt,xub_StrLen nEnde)52cdf0e10cSrcweir SwTxtCharFmt::SwTxtCharFmt( SwFmtCharFmt& rAttr,
53cdf0e10cSrcweir                     xub_StrLen nStt, xub_StrLen nEnde )
54cdf0e10cSrcweir     : SwTxtAttrEnd( rAttr, nStt, nEnde )
55cdf0e10cSrcweir     , m_pTxtNode( 0 )
56cdf0e10cSrcweir     , m_nSortNumber( 0 )
57cdf0e10cSrcweir {
58cdf0e10cSrcweir 	rAttr.pTxtAttr = this;
59cdf0e10cSrcweir 	SetCharFmtAttr( sal_True );
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
~SwTxtCharFmt()62cdf0e10cSrcweir SwTxtCharFmt::~SwTxtCharFmt( )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
ModifyNotification(const SfxPoolItem * pOld,const SfxPoolItem * pNew)66cdf0e10cSrcweir void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
67cdf0e10cSrcweir {
68cdf0e10cSrcweir 	sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
69cdf0e10cSrcweir     ASSERT(  isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
70cdf0e10cSrcweir              || (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
71cdf0e10cSrcweir         "SwTxtCharFmt::Modify(): unknown Modify");
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     if ( m_pTxtNode )
74cdf0e10cSrcweir     {
75cdf0e10cSrcweir 		SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
76cdf0e10cSrcweir         m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
77cdf0e10cSrcweir     }
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
GetInfo(SfxPoolItem & rInfo) const80cdf0e10cSrcweir bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
81cdf0e10cSrcweir {
82cdf0e10cSrcweir     if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
83cdf0e10cSrcweir         &m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
84cdf0e10cSrcweir     {
85cdf0e10cSrcweir 		return true;
86cdf0e10cSrcweir     }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
89cdf0e10cSrcweir 	return false;
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 
93cdf0e10cSrcweir /*************************************************************************
94cdf0e10cSrcweir  *                        class SwTxtAttrNesting
95cdf0e10cSrcweir  *************************************************************************/
96cdf0e10cSrcweir 
SwTxtAttrNesting(SfxPoolItem & i_rAttr,const xub_StrLen i_nStart,const xub_StrLen i_nEnd)97cdf0e10cSrcweir SwTxtAttrNesting::SwTxtAttrNesting( SfxPoolItem & i_rAttr,
98cdf0e10cSrcweir             const xub_StrLen i_nStart, const xub_StrLen i_nEnd )
99cdf0e10cSrcweir     : SwTxtAttrEnd( i_rAttr, i_nStart, i_nEnd )
100cdf0e10cSrcweir {
101cdf0e10cSrcweir     SetDontExpand( true );  // never expand this attribute
102cdf0e10cSrcweir     // lock the expand flag: simple guarantee that nesting will not be
103cdf0e10cSrcweir     // invalidated by expand operations
104cdf0e10cSrcweir     SetLockExpandFlag( true );
105cdf0e10cSrcweir     SetDontExpandStartAttr( true );
106cdf0e10cSrcweir     SetNesting( true );
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
~SwTxtAttrNesting()109cdf0e10cSrcweir SwTxtAttrNesting::~SwTxtAttrNesting()
110cdf0e10cSrcweir {
111cdf0e10cSrcweir }
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 
114cdf0e10cSrcweir /*************************************************************************
115cdf0e10cSrcweir  *						class SwTxtINetFmt
116cdf0e10cSrcweir  *************************************************************************/
117cdf0e10cSrcweir 
SwTxtINetFmt(SwFmtINetFmt & rAttr,xub_StrLen nStart,xub_StrLen nEnd)118cdf0e10cSrcweir SwTxtINetFmt::SwTxtINetFmt( SwFmtINetFmt& rAttr,
119cdf0e10cSrcweir                             xub_StrLen nStart, xub_StrLen nEnd )
120cdf0e10cSrcweir     : SwTxtAttrNesting( rAttr, nStart, nEnd )
121cdf0e10cSrcweir     , SwClient( 0 )
122cdf0e10cSrcweir     , m_pTxtNode( 0 )
123cdf0e10cSrcweir     , m_bVisited( false )
124cdf0e10cSrcweir     , m_bVisitedValid( false )
125cdf0e10cSrcweir {
126*782a276cSOliver-Rainer Wittmann     rAttr.mpTxtAttr  = this;
127cdf0e10cSrcweir     SetCharFmtAttr( true );
128cdf0e10cSrcweir }
129cdf0e10cSrcweir 
~SwTxtINetFmt()130cdf0e10cSrcweir SwTxtINetFmt::~SwTxtINetFmt( )
131cdf0e10cSrcweir {
132cdf0e10cSrcweir }
133cdf0e10cSrcweir 
GetCharFmt()134cdf0e10cSrcweir SwCharFmt* SwTxtINetFmt::GetCharFmt()
135cdf0e10cSrcweir {
136cdf0e10cSrcweir     const SwFmtINetFmt& rFmt = SwTxtAttrEnd::GetINetFmt();
137cdf0e10cSrcweir     SwCharFmt* pRet = NULL;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     if ( rFmt.GetValue().Len() )
140cdf0e10cSrcweir     {
141cdf0e10cSrcweir         const SwDoc* pDoc = GetTxtNode().GetDoc();
142cdf0e10cSrcweir         if( !IsVisitedValid() )
143cdf0e10cSrcweir         {
144cdf0e10cSrcweir             SetVisited( pDoc->IsVisitedURL( rFmt.GetValue() ) );
145cdf0e10cSrcweir             SetVisitedValid( true );
146cdf0e10cSrcweir         }
147*782a276cSOliver-Rainer Wittmann 
148*782a276cSOliver-Rainer Wittmann         const sal_uInt16 nId = IsVisited() ? rFmt.GetVisitedFmtId() : rFmt.GetINetFmtId();
149*782a276cSOliver-Rainer Wittmann         const String& rStr = IsVisited() ? rFmt.GetVisitedFmt() : rFmt.GetINetFmt();
150*782a276cSOliver-Rainer Wittmann         if ( rStr.Len() == 0 )
151*782a276cSOliver-Rainer Wittmann         {
152*782a276cSOliver-Rainer Wittmann             ASSERT( false, "<SwTxtINetFmt::GetCharFmt()> - missing character format at hyperlink attribute");
153*782a276cSOliver-Rainer Wittmann         }
154cdf0e10cSrcweir 
155cdf0e10cSrcweir         // JP 10.02.2000, Bug 72806: dont modify the doc for getting the
156cdf0e10cSrcweir         //		correct charstyle.
157cdf0e10cSrcweir         sal_Bool bResetMod = !pDoc->IsModified();
158cdf0e10cSrcweir         Link aOle2Lnk;
159cdf0e10cSrcweir         if ( bResetMod )
160cdf0e10cSrcweir         {
161cdf0e10cSrcweir             aOle2Lnk = pDoc->GetOle2Link();
162cdf0e10cSrcweir             ( (SwDoc*) pDoc )->SetOle2Link( Link() );
163cdf0e10cSrcweir         }
164cdf0e10cSrcweir 
165cdf0e10cSrcweir         pRet = IsPoolUserFmt( nId )
166cdf0e10cSrcweir                ? ( (SwDoc*) pDoc )->FindCharFmtByName( rStr )
167cdf0e10cSrcweir                : ( (SwDoc*) pDoc )->GetCharFmtFromPool( nId );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir         if ( bResetMod )
170cdf0e10cSrcweir         {
171cdf0e10cSrcweir             ( (SwDoc*) pDoc )->ResetModified();
172cdf0e10cSrcweir             ( (SwDoc*) pDoc )->SetOle2Link( aOle2Lnk );
173cdf0e10cSrcweir         }
174cdf0e10cSrcweir     }
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     if ( pRet )
177cdf0e10cSrcweir         pRet->Add( this );
178cdf0e10cSrcweir     else if ( GetRegisteredIn() )
179cdf0e10cSrcweir         GetRegisteredInNonConst()->Remove( this );
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     return pRet;
182cdf0e10cSrcweir }
183cdf0e10cSrcweir 
Modify(const SfxPoolItem * pOld,const SfxPoolItem * pNew)184cdf0e10cSrcweir void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
185cdf0e10cSrcweir {
186cdf0e10cSrcweir 	sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
187cdf0e10cSrcweir     ASSERT(  isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
188cdf0e10cSrcweir              || (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
189cdf0e10cSrcweir         "SwTxtINetFmt::Modify(): unknown Modify");
190cdf0e10cSrcweir 
191cdf0e10cSrcweir     if ( m_pTxtNode )
192cdf0e10cSrcweir     {
193cdf0e10cSrcweir 		SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
194cdf0e10cSrcweir         m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
195cdf0e10cSrcweir     }
196cdf0e10cSrcweir }
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 	// erfrage vom Modify Informationen
GetInfo(SfxPoolItem & rInfo) const199cdf0e10cSrcweir sal_Bool SwTxtINetFmt::GetInfo( SfxPoolItem& rInfo ) const
200cdf0e10cSrcweir {
201cdf0e10cSrcweir     if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
202cdf0e10cSrcweir         &m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
203cdf0e10cSrcweir     {
204cdf0e10cSrcweir 		return sal_True;
205cdf0e10cSrcweir     }
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
208cdf0e10cSrcweir 	return sal_False;
209cdf0e10cSrcweir }
210cdf0e10cSrcweir 
IsProtect() const211cdf0e10cSrcweir sal_Bool SwTxtINetFmt::IsProtect( ) const
212cdf0e10cSrcweir {
213cdf0e10cSrcweir     return m_pTxtNode && m_pTxtNode->IsProtect();
214cdf0e10cSrcweir }
215cdf0e10cSrcweir 
216cdf0e10cSrcweir /*************************************************************************
217cdf0e10cSrcweir  *						class SwTxtRuby
218cdf0e10cSrcweir  *************************************************************************/
219cdf0e10cSrcweir 
SwTxtRuby(SwFmtRuby & rAttr,xub_StrLen nStart,xub_StrLen nEnd)220cdf0e10cSrcweir SwTxtRuby::SwTxtRuby( SwFmtRuby& rAttr,
221cdf0e10cSrcweir                       xub_StrLen nStart, xub_StrLen nEnd )
222cdf0e10cSrcweir     : SwTxtAttrNesting( rAttr, nStart, nEnd )
223cdf0e10cSrcweir     , SwClient( 0 )
224cdf0e10cSrcweir     , m_pTxtNode( 0 )
225cdf0e10cSrcweir {
226cdf0e10cSrcweir     rAttr.pTxtAttr  = this;
227cdf0e10cSrcweir }
228cdf0e10cSrcweir 
~SwTxtRuby()229cdf0e10cSrcweir SwTxtRuby::~SwTxtRuby()
230cdf0e10cSrcweir {
231cdf0e10cSrcweir }
232cdf0e10cSrcweir 
Modify(const SfxPoolItem * pOld,const SfxPoolItem * pNew)233cdf0e10cSrcweir void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
234cdf0e10cSrcweir {
235cdf0e10cSrcweir 	sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
236cdf0e10cSrcweir     ASSERT(  isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
237cdf0e10cSrcweir              || (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
238cdf0e10cSrcweir         "SwTxtRuby::Modify(): unknown Modify");
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     if ( m_pTxtNode )
241cdf0e10cSrcweir     {
242cdf0e10cSrcweir 		SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
243cdf0e10cSrcweir         m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
244cdf0e10cSrcweir     }
245cdf0e10cSrcweir }
246cdf0e10cSrcweir 
GetInfo(SfxPoolItem & rInfo) const247cdf0e10cSrcweir sal_Bool SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const
248cdf0e10cSrcweir {
249cdf0e10cSrcweir     if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
250cdf0e10cSrcweir         &m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
251cdf0e10cSrcweir     {
252cdf0e10cSrcweir         return sal_True;
253cdf0e10cSrcweir     }
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode;
256cdf0e10cSrcweir     return sal_False;
257cdf0e10cSrcweir }
258cdf0e10cSrcweir 
GetCharFmt()259cdf0e10cSrcweir SwCharFmt* SwTxtRuby::GetCharFmt()
260cdf0e10cSrcweir {
261cdf0e10cSrcweir 	const SwFmtRuby& rFmt = SwTxtAttrEnd::GetRuby();
262cdf0e10cSrcweir 	SwCharFmt* pRet = 0;
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	if( rFmt.GetText().Len() )
265cdf0e10cSrcweir 	{
266cdf0e10cSrcweir 		const SwDoc* pDoc = GetTxtNode().GetDoc();
267cdf0e10cSrcweir 		const String& rStr = rFmt.GetCharFmtName();
268cdf0e10cSrcweir         sal_uInt16 nId = RES_POOLCHR_RUBYTEXT;
269cdf0e10cSrcweir         if ( rStr.Len() )
270cdf0e10cSrcweir             nId = rFmt.GetCharFmtId();
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 		// JP 10.02.2000, Bug 72806: dont modify the doc for getting the
273cdf0e10cSrcweir 		//				correct charstyle.
274cdf0e10cSrcweir 		sal_Bool bResetMod = !pDoc->IsModified();
275cdf0e10cSrcweir 		Link aOle2Lnk;
276cdf0e10cSrcweir 		if( bResetMod )
277cdf0e10cSrcweir 		{
278cdf0e10cSrcweir 			aOle2Lnk = pDoc->GetOle2Link();
279cdf0e10cSrcweir 			((SwDoc*)pDoc)->SetOle2Link( Link() );
280cdf0e10cSrcweir 		}
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 		pRet = IsPoolUserFmt( nId )
283cdf0e10cSrcweir 				? ((SwDoc*)pDoc)->FindCharFmtByName( rStr )
284cdf0e10cSrcweir 				: ((SwDoc*)pDoc)->GetCharFmtFromPool( nId );
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 		if( bResetMod )
287cdf0e10cSrcweir 		{
288cdf0e10cSrcweir 			((SwDoc*)pDoc)->ResetModified();
289cdf0e10cSrcweir 			((SwDoc*)pDoc)->SetOle2Link( aOle2Lnk );
290cdf0e10cSrcweir 		}
291cdf0e10cSrcweir 	}
292cdf0e10cSrcweir 
293cdf0e10cSrcweir 	if( pRet )
294cdf0e10cSrcweir 		pRet->Add( this );
295cdf0e10cSrcweir 	else if( GetRegisteredIn() )
296cdf0e10cSrcweir 		GetRegisteredInNonConst()->Remove( this );
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	return pRet;
299cdf0e10cSrcweir }
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 
302cdf0e10cSrcweir /*************************************************************************
303cdf0e10cSrcweir  *                        class SwTxtMeta
304cdf0e10cSrcweir  *************************************************************************/
305cdf0e10cSrcweir 
306cdf0e10cSrcweir SwTxtMeta *
CreateTxtMeta(::sw::MetaFieldManager & i_rTargetDocManager,SwTxtNode * const i_pTargetTxtNode,SwFmtMeta & i_rAttr,xub_StrLen const i_nStart,xub_StrLen const i_nEnd,bool const i_bIsCopy)307cdf0e10cSrcweir SwTxtMeta::CreateTxtMeta(
308cdf0e10cSrcweir     ::sw::MetaFieldManager & i_rTargetDocManager,
309cdf0e10cSrcweir     SwTxtNode *const i_pTargetTxtNode,
310cdf0e10cSrcweir     SwFmtMeta & i_rAttr,
311dec99bbdSOliver-Rainer Wittmann     xub_StrLen const i_nStart,
312dec99bbdSOliver-Rainer Wittmann     xub_StrLen const i_nEnd,
313dec99bbdSOliver-Rainer Wittmann     bool const i_bIsCopy)
314cdf0e10cSrcweir {
315cdf0e10cSrcweir     if (COPY == i_bIsCopy)
316cdf0e10cSrcweir     {   // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta
317cdf0e10cSrcweir         OSL_ENSURE(i_pTargetTxtNode, "cannot copy Meta without target node");
318cdf0e10cSrcweir         i_rAttr.DoCopy(i_rTargetDocManager, *i_pTargetTxtNode);
319cdf0e10cSrcweir     }
320cdf0e10cSrcweir     SwTxtMeta *const pTxtMeta(new SwTxtMeta(i_rAttr, i_nStart, i_nEnd));
321cdf0e10cSrcweir     return pTxtMeta;
322cdf0e10cSrcweir }
323cdf0e10cSrcweir 
SwTxtMeta(SwFmtMeta & i_rAttr,const xub_StrLen i_nStart,const xub_StrLen i_nEnd)324cdf0e10cSrcweir SwTxtMeta::SwTxtMeta( SwFmtMeta & i_rAttr,
325cdf0e10cSrcweir         const xub_StrLen i_nStart, const xub_StrLen i_nEnd )
326cdf0e10cSrcweir     : SwTxtAttrNesting( i_rAttr, i_nStart, i_nEnd )
327cdf0e10cSrcweir {
328cdf0e10cSrcweir     i_rAttr.SetTxtAttr( this );
329cdf0e10cSrcweir     SetHasDummyChar(true);
330cdf0e10cSrcweir }
331cdf0e10cSrcweir 
~SwTxtMeta()332cdf0e10cSrcweir SwTxtMeta::~SwTxtMeta()
333cdf0e10cSrcweir {
334cdf0e10cSrcweir     SwFmtMeta & rFmtMeta( static_cast<SwFmtMeta &>(GetAttr()) );
335cdf0e10cSrcweir     if (rFmtMeta.GetTxtAttr() == this)
336cdf0e10cSrcweir     {
337cdf0e10cSrcweir         rFmtMeta.SetTxtAttr(0);
338cdf0e10cSrcweir     }
339cdf0e10cSrcweir }
340cdf0e10cSrcweir 
ChgTxtNode(SwTxtNode * const pNode)341cdf0e10cSrcweir void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode)
342cdf0e10cSrcweir {
343cdf0e10cSrcweir     SwFmtMeta & rFmtMeta( static_cast<SwFmtMeta &>(GetAttr()) );
344cdf0e10cSrcweir     if (rFmtMeta.GetTxtAttr() == this)
345cdf0e10cSrcweir     {
346cdf0e10cSrcweir         rFmtMeta.NotifyChangeTxtNode(pNode);
347cdf0e10cSrcweir     }
348cdf0e10cSrcweir }
349cdf0e10cSrcweir 
350