1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*efeef26fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*efeef26fSAndrew Rist * distributed with this work for additional information
6*efeef26fSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*efeef26fSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist * with the License. You may obtain a copy of the License at
10*efeef26fSAndrew Rist *
11*efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*efeef26fSAndrew Rist *
13*efeef26fSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist * KIND, either express or implied. See the License for the
17*efeef26fSAndrew Rist * specific language governing permissions and limitations
18*efeef26fSAndrew Rist * under the License.
19*efeef26fSAndrew Rist *
20*efeef26fSAndrew Rist *************************************************************/
21*efeef26fSAndrew Rist
22*efeef26fSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include <hintids.hxx>
30cdf0e10cSrcweir #include <editeng/pbinitem.hxx>
31cdf0e10cSrcweir #include <editeng/ulspitem.hxx>
32cdf0e10cSrcweir #include <editeng/boxitem.hxx>
33cdf0e10cSrcweir #include <editeng/brshitem.hxx>
34cdf0e10cSrcweir #include <editeng/shaditem.hxx>
35cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
36cdf0e10cSrcweir #include "editeng/frmdiritem.hxx"
37cdf0e10cSrcweir #include <fmtclds.hxx>
38cdf0e10cSrcweir #include <fmtfsize.hxx>
39cdf0e10cSrcweir #include <frmatr.hxx>
40cdf0e10cSrcweir #include <pagefrm.hxx>
41cdf0e10cSrcweir #include <pagedesc.hxx>
42cdf0e10cSrcweir #include <frmfmt.hxx>
43cdf0e10cSrcweir #include <fmtcol.hxx> // SwTxtFmtColl
44cdf0e10cSrcweir #include <node.hxx>
45cdf0e10cSrcweir #include <swtable.hxx>
46cdf0e10cSrcweir #include <frmtool.hxx>
47cdf0e10cSrcweir #include <doc.hxx> // fuer GetAttrPool
48cdf0e10cSrcweir #include <poolfmt.hxx>
49cdf0e10cSrcweir #include <switerator.hxx>
50cdf0e10cSrcweir
51cdf0e10cSrcweir /*************************************************************************
52cdf0e10cSrcweir |*
53cdf0e10cSrcweir |* SwPageDesc::SwPageDesc()
54cdf0e10cSrcweir |*
55cdf0e10cSrcweir |* Ersterstellung MA 25. Jan. 93
56cdf0e10cSrcweir |* Letzte Aenderung MA 16. Feb. 94
57cdf0e10cSrcweir |*
58cdf0e10cSrcweir |*************************************************************************/
59cdf0e10cSrcweir
60cdf0e10cSrcweir
61cdf0e10cSrcweir
SwPageDesc(const String & rName,SwFrmFmt * pFmt,SwDoc * pDc)62cdf0e10cSrcweir SwPageDesc::SwPageDesc( const String& rName, SwFrmFmt *pFmt, SwDoc *pDc ) :
63cdf0e10cSrcweir SwModify( 0 ),
64cdf0e10cSrcweir aDescName( rName ),
65cdf0e10cSrcweir aMaster( pDc->GetAttrPool(), rName, pFmt ),
66cdf0e10cSrcweir aLeft( pDc->GetAttrPool(), rName, pFmt ),
67cdf0e10cSrcweir aDepend( this, 0 ),
68cdf0e10cSrcweir pFollow( this ),
69cdf0e10cSrcweir nRegHeight( 0 ),
70cdf0e10cSrcweir nRegAscent( 0 ),
71cdf0e10cSrcweir eUse( (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE) ),
72cdf0e10cSrcweir bLandscape( sal_False ),
73cdf0e10cSrcweir aFtnInfo()
74cdf0e10cSrcweir {
75cdf0e10cSrcweir }
76cdf0e10cSrcweir
SwPageDesc(const SwPageDesc & rCpy)77cdf0e10cSrcweir SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) :
78cdf0e10cSrcweir SwModify( 0 ),
79cdf0e10cSrcweir aDescName( rCpy.GetName() ),
80cdf0e10cSrcweir aNumType( rCpy.GetNumType() ),
81cdf0e10cSrcweir aMaster( rCpy.GetMaster() ),
82cdf0e10cSrcweir aLeft( rCpy.GetLeft() ),
83cdf0e10cSrcweir aDepend( this, (SwModify*)rCpy.aDepend.GetRegisteredIn() ),
84cdf0e10cSrcweir pFollow( rCpy.pFollow ),
85cdf0e10cSrcweir nRegHeight( rCpy.GetRegHeight() ),
86cdf0e10cSrcweir nRegAscent( rCpy.GetRegAscent() ),
87cdf0e10cSrcweir eUse( rCpy.ReadUseOn() ),
88cdf0e10cSrcweir bLandscape( rCpy.GetLandscape() ),
89cdf0e10cSrcweir aFtnInfo( rCpy.GetFtnInfo() )
90cdf0e10cSrcweir {
91cdf0e10cSrcweir }
92cdf0e10cSrcweir
operator =(const SwPageDesc & rSrc)93cdf0e10cSrcweir SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir aDescName = rSrc.aDescName;
96cdf0e10cSrcweir aNumType = rSrc.aNumType;
97cdf0e10cSrcweir aMaster = rSrc.aMaster;
98cdf0e10cSrcweir aLeft = rSrc.aLeft;
99cdf0e10cSrcweir
100cdf0e10cSrcweir if (rSrc.pFollow == &rSrc)
101cdf0e10cSrcweir pFollow = this;
102cdf0e10cSrcweir else
103cdf0e10cSrcweir pFollow = rSrc.pFollow;
104cdf0e10cSrcweir
105cdf0e10cSrcweir nRegHeight = rSrc.nRegHeight;
106cdf0e10cSrcweir nRegAscent = rSrc.nRegAscent;
107cdf0e10cSrcweir eUse = rSrc.eUse;
108cdf0e10cSrcweir bLandscape = rSrc.bLandscape;
109cdf0e10cSrcweir return *this;
110cdf0e10cSrcweir }
111cdf0e10cSrcweir
~SwPageDesc()112cdf0e10cSrcweir SwPageDesc::~SwPageDesc()
113cdf0e10cSrcweir {
114cdf0e10cSrcweir }
115cdf0e10cSrcweir
116cdf0e10cSrcweir /*************************************************************************
117cdf0e10cSrcweir |*
118cdf0e10cSrcweir |* SwPageDesc::Mirror()
119cdf0e10cSrcweir |*
120cdf0e10cSrcweir |* Beschreibung Gespiegelt werden nur die Raender.
121cdf0e10cSrcweir |* Attribute wie Umrandung und dergleichen werden 1:1 kopiert.
122cdf0e10cSrcweir |* Ersterstellung MA 25. Jan. 93
123cdf0e10cSrcweir |* Letzte Aenderung 01. Nov. 94
124cdf0e10cSrcweir |*
125cdf0e10cSrcweir |*************************************************************************/
126cdf0e10cSrcweir
127cdf0e10cSrcweir
128cdf0e10cSrcweir
Mirror()129cdf0e10cSrcweir void SwPageDesc::Mirror()
130cdf0e10cSrcweir {
131cdf0e10cSrcweir //Das Spiegeln findet nur beim RandAttribut statt, alle anderen Werte
132cdf0e10cSrcweir //werden schlicht uebertragen.
133cdf0e10cSrcweir SvxLRSpaceItem aLR( RES_LR_SPACE );
134cdf0e10cSrcweir const SvxLRSpaceItem &rLR = aMaster.GetLRSpace();
135cdf0e10cSrcweir aLR.SetLeft( rLR.GetRight() );
136cdf0e10cSrcweir aLR.SetRight( rLR.GetLeft() );
137cdf0e10cSrcweir
138cdf0e10cSrcweir SfxItemSet aSet( *aMaster.GetAttrSet().GetPool(),
139cdf0e10cSrcweir aMaster.GetAttrSet().GetRanges() );
140cdf0e10cSrcweir aSet.Put( aLR );
141cdf0e10cSrcweir aSet.Put( aMaster.GetFrmSize() );
142cdf0e10cSrcweir aSet.Put( aMaster.GetPaperBin() );
143cdf0e10cSrcweir aSet.Put( aMaster.GetULSpace() );
144cdf0e10cSrcweir aSet.Put( aMaster.GetBox() );
145cdf0e10cSrcweir aSet.Put( aMaster.GetBackground() );
146cdf0e10cSrcweir aSet.Put( aMaster.GetShadow() );
147cdf0e10cSrcweir aSet.Put( aMaster.GetCol() );
148cdf0e10cSrcweir aSet.Put( aMaster.GetFrmDir() ); // #112217#
149cdf0e10cSrcweir aLeft.SetFmtAttr( aSet );
150cdf0e10cSrcweir }
151cdf0e10cSrcweir
ResetAllAttr(sal_Bool bLeft)152cdf0e10cSrcweir void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
153cdf0e10cSrcweir {
154cdf0e10cSrcweir SwFrmFmt& rFmt = bLeft ? GetLeft() : GetMaster();
155cdf0e10cSrcweir
156cdf0e10cSrcweir // --> OD 2007-01-25 #i73790# - method renamed
157cdf0e10cSrcweir rFmt.ResetAllFmtAttr();
158cdf0e10cSrcweir // <--
159cdf0e10cSrcweir rFmt.SetFmtAttr( SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR) );
160cdf0e10cSrcweir }
161cdf0e10cSrcweir
162cdf0e10cSrcweir /*************************************************************************
163cdf0e10cSrcweir |*
164cdf0e10cSrcweir |* SwPageDesc::GetInfo()
165cdf0e10cSrcweir |*
166cdf0e10cSrcweir |* Beschreibung erfragt Informationen
167cdf0e10cSrcweir |* Ersterstellung JP 31.03.94
168cdf0e10cSrcweir |* Letzte Aenderung JP 31.03.94
169cdf0e10cSrcweir |*
170cdf0e10cSrcweir *************************************************************************/
171cdf0e10cSrcweir
172cdf0e10cSrcweir
173cdf0e10cSrcweir // erfrage vom Modify Informationen
GetInfo(SfxPoolItem & rInfo) const174cdf0e10cSrcweir sal_Bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
175cdf0e10cSrcweir {
176cdf0e10cSrcweir // if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
177cdf0e10cSrcweir // {
178cdf0e10cSrcweir // dann weiter zum Format
179cdf0e10cSrcweir if( !aMaster.GetInfo( rInfo ) )
180cdf0e10cSrcweir return sal_False; // gefunden
181cdf0e10cSrcweir return aLeft.GetInfo( rInfo );
182cdf0e10cSrcweir // }
183cdf0e10cSrcweir // return sal_True; // weiter suchen
184cdf0e10cSrcweir }
185cdf0e10cSrcweir
186cdf0e10cSrcweir /*************************************************************************
187cdf0e10cSrcweir |*
188cdf0e10cSrcweir |* SwPageDesc::SetRegisterFmtColl()
189cdf0e10cSrcweir |*
190cdf0e10cSrcweir |* Beschreibung setzt die Vorlage fuer die Registerhaltigkeit
191cdf0e10cSrcweir |* Ersterstellung AMA 22.07.96
192cdf0e10cSrcweir |* Letzte Aenderung AMA 22.07.96
193cdf0e10cSrcweir |*
194cdf0e10cSrcweir *************************************************************************/
195cdf0e10cSrcweir
196cdf0e10cSrcweir
SetRegisterFmtColl(const SwTxtFmtColl * pFmt)197cdf0e10cSrcweir void SwPageDesc::SetRegisterFmtColl( const SwTxtFmtColl* pFmt )
198cdf0e10cSrcweir {
199cdf0e10cSrcweir if( pFmt != GetRegisterFmtColl() )
200cdf0e10cSrcweir {
201cdf0e10cSrcweir if( pFmt )
202cdf0e10cSrcweir ((SwTxtFmtColl*)pFmt)->Add( &aDepend );
203cdf0e10cSrcweir else
204cdf0e10cSrcweir ((SwTxtFmtColl*)GetRegisterFmtColl())->Remove( &aDepend );
205cdf0e10cSrcweir
206cdf0e10cSrcweir RegisterChange();
207cdf0e10cSrcweir }
208cdf0e10cSrcweir }
209cdf0e10cSrcweir
210cdf0e10cSrcweir /*************************************************************************
211cdf0e10cSrcweir |*
212cdf0e10cSrcweir |* SwPageDesc::GetRegisterFmtColl()
213cdf0e10cSrcweir |*
214cdf0e10cSrcweir |* Beschreibung holt die Vorlage fuer die Registerhaltigkeit
215cdf0e10cSrcweir |* Ersterstellung AMA 22.07.96
216cdf0e10cSrcweir |* Letzte Aenderung AMA 22.07.96
217cdf0e10cSrcweir |*
218cdf0e10cSrcweir *************************************************************************/
219cdf0e10cSrcweir
220cdf0e10cSrcweir
GetRegisterFmtColl() const221cdf0e10cSrcweir const SwTxtFmtColl* SwPageDesc::GetRegisterFmtColl() const
222cdf0e10cSrcweir {
223cdf0e10cSrcweir const SwModify* pReg = aDepend.GetRegisteredIn();
224cdf0e10cSrcweir return (SwTxtFmtColl*)pReg;
225cdf0e10cSrcweir }
226cdf0e10cSrcweir
227cdf0e10cSrcweir /*************************************************************************
228cdf0e10cSrcweir |*
229cdf0e10cSrcweir |* SwPageDesc::RegisterChange()
230cdf0e10cSrcweir |*
231cdf0e10cSrcweir |* Beschreibung benachrichtigt alle betroffenen PageFrames
232cdf0e10cSrcweir |* Ersterstellung AMA 22.07.96
233cdf0e10cSrcweir |* Letzte Aenderung AMA 22.07.96
234cdf0e10cSrcweir |*
235cdf0e10cSrcweir *************************************************************************/
236cdf0e10cSrcweir
237cdf0e10cSrcweir
RegisterChange()238cdf0e10cSrcweir void SwPageDesc::RegisterChange()
239cdf0e10cSrcweir {
240cdf0e10cSrcweir // --> OD 2004-06-15 #117072# - During destruction of the document <SwDoc>
241cdf0e10cSrcweir // the page description is modified. Thus, do nothing, if the document
242cdf0e10cSrcweir // is in destruction respectively if no viewshell exists.
243cdf0e10cSrcweir SwDoc* pDoc = GetMaster().GetDoc();
244cdf0e10cSrcweir if ( !pDoc || pDoc->IsInDtor() )
245cdf0e10cSrcweir {
246cdf0e10cSrcweir return;
247cdf0e10cSrcweir }
248cdf0e10cSrcweir ViewShell* pSh = 0L;
249cdf0e10cSrcweir pDoc->GetEditShell( &pSh );
250cdf0e10cSrcweir if ( !pSh )
251cdf0e10cSrcweir {
252cdf0e10cSrcweir return;
253cdf0e10cSrcweir }
254cdf0e10cSrcweir
255cdf0e10cSrcweir nRegHeight = 0;
256cdf0e10cSrcweir {
257cdf0e10cSrcweir SwIterator<SwFrm,SwFmt> aIter( GetMaster() );
258cdf0e10cSrcweir for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
259cdf0e10cSrcweir {
260cdf0e10cSrcweir if( pLast->IsPageFrm() )
261cdf0e10cSrcweir ((SwPageFrm*)pLast)->PrepareRegisterChg();
262cdf0e10cSrcweir }
263cdf0e10cSrcweir }
264cdf0e10cSrcweir {
265cdf0e10cSrcweir SwIterator<SwFrm,SwFmt> aIter( GetLeft() );
266cdf0e10cSrcweir for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
267cdf0e10cSrcweir {
268cdf0e10cSrcweir if( pLast->IsPageFrm() )
269cdf0e10cSrcweir ((SwPageFrm*)pLast)->PrepareRegisterChg();
270cdf0e10cSrcweir }
271cdf0e10cSrcweir }
272cdf0e10cSrcweir }
273cdf0e10cSrcweir
274cdf0e10cSrcweir /*************************************************************************
275cdf0e10cSrcweir |*
276cdf0e10cSrcweir |* SwPageDesc::Modify()
277cdf0e10cSrcweir |*
278cdf0e10cSrcweir |* Beschreibung reagiert insbesondere auf Aenderungen
279cdf0e10cSrcweir |* der Vorlage fuer die Registerhaltigkeit
280cdf0e10cSrcweir |* Ersterstellung AMA 22.07.96
281cdf0e10cSrcweir |* Letzte Aenderung AMA 22.07.96
282cdf0e10cSrcweir |*
283cdf0e10cSrcweir *************************************************************************/
284cdf0e10cSrcweir
285cdf0e10cSrcweir
Modify(const SfxPoolItem * pOld,const SfxPoolItem * pNew)286cdf0e10cSrcweir void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
287cdf0e10cSrcweir {
288cdf0e10cSrcweir const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
289cdf0e10cSrcweir NotifyClients( pOld, pNew );
290cdf0e10cSrcweir
291cdf0e10cSrcweir if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich)
292cdf0e10cSrcweir || isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) )
293cdf0e10cSrcweir {
294cdf0e10cSrcweir RegisterChange();
295cdf0e10cSrcweir }
296cdf0e10cSrcweir }
297cdf0e10cSrcweir
lcl_GetFrmOfNode(const SwNode & rNd)298cdf0e10cSrcweir static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd )
299cdf0e10cSrcweir {
300cdf0e10cSrcweir SwModify* pMod;
301cdf0e10cSrcweir sal_uInt16 nFrmType = FRM_CNTNT;
302cdf0e10cSrcweir
303cdf0e10cSrcweir if( rNd.IsCntntNode() )
304cdf0e10cSrcweir {
305cdf0e10cSrcweir pMod = &(SwCntntNode&)rNd;
306cdf0e10cSrcweir }
307cdf0e10cSrcweir else if( rNd.IsTableNode() )
308cdf0e10cSrcweir {
309cdf0e10cSrcweir pMod = ((SwTableNode&)rNd).GetTable().GetFrmFmt();
310cdf0e10cSrcweir nFrmType = FRM_TAB;
311cdf0e10cSrcweir }
312cdf0e10cSrcweir else
313cdf0e10cSrcweir pMod = 0;
314cdf0e10cSrcweir
315cdf0e10cSrcweir Point aNullPt;
316cdf0e10cSrcweir return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, sal_False )
317cdf0e10cSrcweir : 0;
318cdf0e10cSrcweir }
319cdf0e10cSrcweir
GetPageDescOfNode(const SwNode & rNd)320cdf0e10cSrcweir const SwPageDesc* SwPageDesc::GetPageDescOfNode(const SwNode& rNd)
321cdf0e10cSrcweir {
322cdf0e10cSrcweir const SwPageDesc* pRet = 0;
323cdf0e10cSrcweir const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd );
324cdf0e10cSrcweir if (pChkFrm && 0 != (pChkFrm = pChkFrm->FindPageFrm()))
325cdf0e10cSrcweir pRet = ((const SwPageFrm*)pChkFrm)->GetPageDesc();
326cdf0e10cSrcweir return pRet;
327cdf0e10cSrcweir }
328cdf0e10cSrcweir
GetPageFmtOfNode(const SwNode & rNd,sal_Bool bCheckForThisPgDc) const329cdf0e10cSrcweir const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
330cdf0e10cSrcweir sal_Bool bCheckForThisPgDc ) const
331cdf0e10cSrcweir {
332cdf0e10cSrcweir // welches PageDescFormat ist fuer diesen Node gueltig?
333cdf0e10cSrcweir const SwFrmFmt* pRet;
334cdf0e10cSrcweir const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd );
335cdf0e10cSrcweir
336cdf0e10cSrcweir if( pChkFrm && 0 != ( pChkFrm = pChkFrm->FindPageFrm() ))
337cdf0e10cSrcweir {
338cdf0e10cSrcweir const SwPageDesc* pPd = bCheckForThisPgDc ? this :
339cdf0e10cSrcweir ((SwPageFrm*)pChkFrm)->GetPageDesc();
340cdf0e10cSrcweir pRet = &pPd->GetMaster();
341cdf0e10cSrcweir ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd, "Wrong node for detection of page format!" );
342cdf0e10cSrcweir // an welchem Format haengt diese Seite?
343cdf0e10cSrcweir if( !pChkFrm->KnowsFormat(*pRet) )
344cdf0e10cSrcweir {
345cdf0e10cSrcweir pRet = &pPd->GetLeft();
346cdf0e10cSrcweir ASSERT( pChkFrm->KnowsFormat(*pRet), "Wrong node for detection of page format!" );
347cdf0e10cSrcweir }
348cdf0e10cSrcweir }
349cdf0e10cSrcweir else
350cdf0e10cSrcweir pRet = &GetMaster();
351cdf0e10cSrcweir return pRet;
352cdf0e10cSrcweir }
353cdf0e10cSrcweir
IsFollowNextPageOfNode(const SwNode & rNd) const354cdf0e10cSrcweir sal_Bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
355cdf0e10cSrcweir {
356cdf0e10cSrcweir sal_Bool bRet = sal_False;
357cdf0e10cSrcweir if( GetFollow() && this != GetFollow() )
358cdf0e10cSrcweir {
359cdf0e10cSrcweir const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd );
360cdf0e10cSrcweir if( pChkFrm && 0 != ( pChkFrm = pChkFrm->FindPageFrm() ) &&
361cdf0e10cSrcweir pChkFrm->IsPageFrm() &&
362cdf0e10cSrcweir ( !pChkFrm->GetNext() || GetFollow() ==
363cdf0e10cSrcweir ((SwPageFrm*)pChkFrm->GetNext())->GetPageDesc() ))
364cdf0e10cSrcweir // die Seite gefunden, auf die der Follow verweist
365cdf0e10cSrcweir bRet = sal_True;
366cdf0e10cSrcweir }
367cdf0e10cSrcweir return bRet;
368cdf0e10cSrcweir }
369cdf0e10cSrcweir
370cdf0e10cSrcweir /*************************************************************************
371cdf0e10cSrcweir |*
372cdf0e10cSrcweir |* SwPageFtnInfo::SwPageFtnInfo()
373cdf0e10cSrcweir |*
374cdf0e10cSrcweir |* Ersterstellung MA 24. Feb. 93
375cdf0e10cSrcweir |* Letzte Aenderung MA 24. Feb. 93
376cdf0e10cSrcweir |*
377cdf0e10cSrcweir |*************************************************************************/
378cdf0e10cSrcweir
379cdf0e10cSrcweir
380cdf0e10cSrcweir
SwPageFtnInfo()381cdf0e10cSrcweir SwPageFtnInfo::SwPageFtnInfo() :
382cdf0e10cSrcweir nMaxHeight( 0 ),
383cdf0e10cSrcweir // aPen( PEN_SOLID ),
384cdf0e10cSrcweir nLineWidth(10),
385cdf0e10cSrcweir aWidth( 25, 100 ),
386cdf0e10cSrcweir nTopDist( 57 ), //1mm
387cdf0e10cSrcweir nBottomDist( 57 )
388cdf0e10cSrcweir {
389cdf0e10cSrcweir eAdj = FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ?
390cdf0e10cSrcweir FTNADJ_RIGHT :
391cdf0e10cSrcweir FTNADJ_LEFT;
392cdf0e10cSrcweir // aPen.SetWidth( 10 );
393cdf0e10cSrcweir }
394cdf0e10cSrcweir
395cdf0e10cSrcweir
396cdf0e10cSrcweir
SwPageFtnInfo(const SwPageFtnInfo & rCpy)397cdf0e10cSrcweir SwPageFtnInfo::SwPageFtnInfo( const SwPageFtnInfo &rCpy ) :
398cdf0e10cSrcweir nMaxHeight( rCpy.GetHeight() ),
399cdf0e10cSrcweir nLineWidth(rCpy.nLineWidth),
400cdf0e10cSrcweir aLineColor(rCpy.aLineColor),
401cdf0e10cSrcweir aWidth( rCpy.GetWidth() ),
402cdf0e10cSrcweir eAdj( rCpy.GetAdj() ),
403cdf0e10cSrcweir nTopDist( rCpy.GetTopDist() ),
404cdf0e10cSrcweir nBottomDist( rCpy.GetBottomDist() )
405cdf0e10cSrcweir {
406cdf0e10cSrcweir }
407cdf0e10cSrcweir
408cdf0e10cSrcweir /*************************************************************************
409cdf0e10cSrcweir |*
410cdf0e10cSrcweir |* SwPageFtnInfo::operator=
411cdf0e10cSrcweir |*
412cdf0e10cSrcweir |* Ersterstellung MA 24. Feb. 93
413cdf0e10cSrcweir |* Letzte Aenderung MA 24. Feb. 93
414cdf0e10cSrcweir |*
415cdf0e10cSrcweir |*************************************************************************/
416cdf0e10cSrcweir
417cdf0e10cSrcweir
418cdf0e10cSrcweir
operator =(const SwPageFtnInfo & rCpy)419cdf0e10cSrcweir SwPageFtnInfo &SwPageFtnInfo::operator=( const SwPageFtnInfo& rCpy )
420cdf0e10cSrcweir {
421cdf0e10cSrcweir nMaxHeight = rCpy.GetHeight();
422cdf0e10cSrcweir nLineWidth = rCpy.nLineWidth;
423cdf0e10cSrcweir aLineColor = rCpy.aLineColor;
424cdf0e10cSrcweir aWidth = rCpy.GetWidth();
425cdf0e10cSrcweir eAdj = rCpy.GetAdj();
426cdf0e10cSrcweir nTopDist = rCpy.GetTopDist();
427cdf0e10cSrcweir nBottomDist = rCpy.GetBottomDist();
428cdf0e10cSrcweir return *this;
429cdf0e10cSrcweir }
430cdf0e10cSrcweir /*************************************************************************
431cdf0e10cSrcweir |*
432cdf0e10cSrcweir |* SwPageFtnInfo::operator==
433cdf0e10cSrcweir |*
434cdf0e10cSrcweir |* Ersterstellung MA 01. Mar. 93
435cdf0e10cSrcweir |* Letzte Aenderung MA 01. Mar. 93
436cdf0e10cSrcweir |*
437cdf0e10cSrcweir |*************************************************************************/
438cdf0e10cSrcweir
439cdf0e10cSrcweir
440cdf0e10cSrcweir
operator ==(const SwPageFtnInfo & rCmp) const441cdf0e10cSrcweir sal_Bool SwPageFtnInfo::operator==( const SwPageFtnInfo& rCmp ) const
442cdf0e10cSrcweir {
443cdf0e10cSrcweir return ( nMaxHeight == rCmp.GetHeight() &&
444cdf0e10cSrcweir nLineWidth == rCmp.nLineWidth &&
445cdf0e10cSrcweir aLineColor == rCmp.aLineColor &&
446cdf0e10cSrcweir aWidth == rCmp.GetWidth() &&
447cdf0e10cSrcweir eAdj == rCmp.GetAdj() &&
448cdf0e10cSrcweir nTopDist == rCmp.GetTopDist() &&
449cdf0e10cSrcweir nBottomDist== rCmp.GetBottomDist() );
450cdf0e10cSrcweir }
451cdf0e10cSrcweir
SwPageDescExt(const SwPageDesc & rPageDesc,SwDoc * _pDoc)452cdf0e10cSrcweir SwPageDescExt::SwPageDescExt(const SwPageDesc & rPageDesc, SwDoc * _pDoc)
453cdf0e10cSrcweir : aPageDesc(rPageDesc), pDoc(_pDoc)
454cdf0e10cSrcweir {
455cdf0e10cSrcweir SetPageDesc(rPageDesc);
456cdf0e10cSrcweir }
457cdf0e10cSrcweir
SwPageDescExt(const SwPageDescExt & rSrc)458cdf0e10cSrcweir SwPageDescExt::SwPageDescExt(const SwPageDescExt & rSrc)
459cdf0e10cSrcweir : aPageDesc(rSrc.aPageDesc), pDoc(rSrc.pDoc)
460cdf0e10cSrcweir {
461cdf0e10cSrcweir SetPageDesc(rSrc.aPageDesc);
462cdf0e10cSrcweir }
463cdf0e10cSrcweir
~SwPageDescExt()464cdf0e10cSrcweir SwPageDescExt::~SwPageDescExt()
465cdf0e10cSrcweir {
466cdf0e10cSrcweir }
467cdf0e10cSrcweir
GetName() const468cdf0e10cSrcweir const String & SwPageDescExt::GetName() const
469cdf0e10cSrcweir {
470cdf0e10cSrcweir return aPageDesc.GetName();
471cdf0e10cSrcweir }
472cdf0e10cSrcweir
SetPageDesc(const SwPageDesc & _aPageDesc)473cdf0e10cSrcweir void SwPageDescExt::SetPageDesc(const SwPageDesc & _aPageDesc)
474cdf0e10cSrcweir {
475cdf0e10cSrcweir aPageDesc = _aPageDesc;
476cdf0e10cSrcweir
477cdf0e10cSrcweir if (aPageDesc.GetFollow())
478cdf0e10cSrcweir sFollow = aPageDesc.GetFollow()->GetName();
479cdf0e10cSrcweir }
480cdf0e10cSrcweir
operator =(const SwPageDesc & rSrc)481cdf0e10cSrcweir SwPageDescExt & SwPageDescExt::operator = (const SwPageDesc & rSrc)
482cdf0e10cSrcweir {
483cdf0e10cSrcweir SetPageDesc(rSrc);
484cdf0e10cSrcweir
485cdf0e10cSrcweir return *this;
486cdf0e10cSrcweir }
487cdf0e10cSrcweir
operator =(const SwPageDescExt & rSrc)488cdf0e10cSrcweir SwPageDescExt & SwPageDescExt::operator = (const SwPageDescExt & rSrc)
489cdf0e10cSrcweir {
490cdf0e10cSrcweir SetPageDesc(rSrc.aPageDesc);
491cdf0e10cSrcweir
492cdf0e10cSrcweir return *this;
493cdf0e10cSrcweir }
494cdf0e10cSrcweir
operator SwPageDesc() const495cdf0e10cSrcweir SwPageDescExt::operator SwPageDesc() const
496cdf0e10cSrcweir {
497cdf0e10cSrcweir SwPageDesc aResult(aPageDesc);
498cdf0e10cSrcweir
499cdf0e10cSrcweir SwPageDesc * pPageDesc = pDoc->GetPageDesc(sFollow);
500cdf0e10cSrcweir
501cdf0e10cSrcweir if ( 0 != pPageDesc )
502cdf0e10cSrcweir aResult.SetFollow(pPageDesc);
503cdf0e10cSrcweir
504cdf0e10cSrcweir return aResult;
505cdf0e10cSrcweir }
506