1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
57 * For LWP filter architecture prototype - footnote layouts
59 /*************************************************************************
62 ************************************************************************/
64 #include "lwpfnlayout.hxx"
66 LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
67 :LwpTableLayout(objHdr
, pStrm
)
71 LwpFootnoteLayout::~LwpFootnoteLayout()
75 * @descr Read object info
77 void LwpFootnoteLayout::Read()
79 LwpTableLayout::Read();
80 m_pObjStrm
->SkipExtra();
86 void LwpFootnoteLayout::RegisterStyle()
93 void LwpFootnoteLayout::XFConvert(XFContentContainer
* pCont
)
97 LwpFnRowLayout::LwpFnRowLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
98 :LwpRowLayout(objHdr
, pStrm
)
102 LwpFnRowLayout::~LwpFnRowLayout()
106 * @descr Read object info
108 void LwpFnRowLayout::Read()
110 LwpRowLayout::Read();
111 m_pObjStrm
->SkipExtra();
115 * @descr Register footnote/endnote contents style
117 void LwpFnRowLayout::RegisterStyle()
119 // register cells' style
120 LwpObjectID
*pCellID
= GetChildHead();
121 LwpCellLayout
* pCellLayout
= static_cast<LwpCellLayout
*>(pCellID
->obj());
125 pCellLayout
->SetFoundry(m_pFoundry
);
126 pCellLayout
->RegisterStyle();
127 pCellID
= pCellLayout
->GetNext();
128 pCellLayout
= static_cast<LwpCellLayout
*>(pCellID
->obj());
135 void LwpFnRowLayout::XFConvert(XFContentContainer
* pCont
)
139 LwpFnCellLayout::LwpFnCellLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
140 :LwpCellLayout(objHdr
, pStrm
)
144 LwpFnCellLayout::~LwpFnCellLayout()
148 * @descr Read object info
150 void LwpFnCellLayout::Read()
152 LwpCellLayout::Read();
153 m_pObjStrm
->SkipExtra();
157 * @descr Register footnote/endnote contents style
159 void LwpFnCellLayout::RegisterStyle()
161 // content object register styles
162 LwpObject
* pObj
= m_Content
.obj();
165 pObj
->SetFoundry(m_pFoundry
);
166 pObj
->RegisterStyle();
173 void LwpFnCellLayout::XFConvert(XFContentContainer
* pCont
)
177 LwpEndnoteLayout::LwpEndnoteLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
178 :LwpTableLayout(objHdr
, pStrm
)
182 LwpEndnoteLayout::~LwpEndnoteLayout()
186 * @descr Read object info
188 void LwpEndnoteLayout::Read()
190 LwpTableLayout::Read();
191 m_pObjStrm
->SkipExtra();
195 * @descr Register footnote/endnote contents style
197 void LwpEndnoteLayout::RegisterStyle()
199 // register style of rows
200 LwpObjectID
*pRowID
= GetChildHead();
201 LwpRowLayout
* pRowLayout
= static_cast<LwpRowLayout
*>(pRowID
->obj());
204 pRowLayout
->SetFoundry(m_pFoundry
);
205 pRowLayout
->RegisterStyle();
207 pRowID
= pRowLayout
->GetNext();
208 pRowLayout
= static_cast<LwpRowLayout
*>(pRowID
->obj());
215 void LwpEndnoteLayout::XFConvert(XFContentContainer
* pCont
)
219 LwpEnSuperTableLayout::LwpEnSuperTableLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
220 :LwpSuperTableLayout(objHdr
, pStrm
)
224 LwpEnSuperTableLayout::~LwpEnSuperTableLayout()
228 * @descr Read object info
230 void LwpEnSuperTableLayout::Read()
232 LwpSuperTableLayout::Read();
233 m_pObjStrm
->SkipExtra();
236 void LwpEnSuperTableLayout::RegisterStyle()
238 // if this layout is style of real table entry
239 LwpVirtualLayout
* pTableLayout
= GetMainTableLayout();
240 if (pTableLayout
!= NULL
)
242 pTableLayout
->SetFoundry(m_pFoundry
);
243 pTableLayout
->RegisterStyle();;
250 void LwpEnSuperTableLayout::XFConvert(XFContentContainer
* pCont
)
255 * @short Get child endnote layout
256 * @return pointer to endnote layout
258 LwpVirtualLayout
* LwpEnSuperTableLayout::GetMainTableLayout()
260 LwpObjectID
*pID
= GetChildTail();
262 while(pID
&& !pID
->IsNull())
264 LwpVirtualLayout
* pLayout
= static_cast<LwpVirtualLayout
*>(pID
->obj());
269 if (pLayout
&& pLayout
->GetLayoutType() == LWP_ENDNOTE_LAYOUT
)
273 pID
= pLayout
->GetPrevious();
279 LwpFnSuperTableLayout::LwpFnSuperTableLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
280 :LwpEnSuperTableLayout(objHdr
, pStrm
)
284 LwpFnSuperTableLayout::~LwpFnSuperTableLayout()
288 * @descr Read object info
290 void LwpFnSuperTableLayout::Read()
292 LwpEnSuperTableLayout::Read();
293 m_pObjStrm
->SkipExtra();
299 void LwpFnSuperTableLayout::RegisterStyle()
306 void LwpFnSuperTableLayout::XFConvert(XFContentContainer
* pCont
)
311 * @short Get child footnote layout
312 * @return pointer to footnote layout
314 LwpVirtualLayout
* LwpFnSuperTableLayout::GetMainTableLayout()
316 LwpObjectID
*pID
= GetChildTail();
318 while(pID
&& !pID
->IsNull())
320 LwpVirtualLayout
* pLayout
= static_cast<LwpVirtualLayout
*>(pID
->obj());
325 if (pLayout
&& pLayout
->GetLayoutType() == LWP_FOOTNOTE_LAYOUT
)
329 pID
= pLayout
->GetPrevious();
335 LwpContFromLayout::LwpContFromLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
336 :LwpPlacableLayout(objHdr
, pStrm
)
340 LwpContFromLayout::~LwpContFromLayout()
344 * @descr Read object info
346 void LwpContFromLayout::Read()
348 LwpPlacableLayout::Read();
349 m_pObjStrm
->SkipExtra();
355 void LwpContFromLayout::RegisterStyle()
362 void LwpContFromLayout::XFConvert(XFContentContainer
* pCont
)
366 LwpContOnLayout::LwpContOnLayout(LwpObjectHeader
&objHdr
, LwpSvStream
*pStrm
)
367 :LwpPlacableLayout(objHdr
, pStrm
)
371 LwpContOnLayout::~LwpContOnLayout()
375 * @descr Read object info
377 void LwpContOnLayout::Read()
379 LwpPlacableLayout::Read();
380 m_pObjStrm
->SkipExtra();
386 void LwpContOnLayout::RegisterStyle()
393 void LwpContOnLayout::XFConvert(XFContentContainer
* pCont
)