cURL: follow redirects
[LibreOffice.git] / lotuswordpro / source / filter / lwpfnlayout.cxx
blob13c505d983730e1c63845f32c7c8ce783f53e594
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /**
57 * @file
58 * For LWP filter architecture prototype - footnote layouts
61 #include "lwpfnlayout.hxx"
63 LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
64 :LwpTableLayout(objHdr, pStrm)
68 LwpFootnoteLayout::~LwpFootnoteLayout()
71 /**
72 * @descr Read object info
74 void LwpFootnoteLayout::Read()
76 LwpTableLayout::Read();
77 m_pObjStrm->SkipExtra();
80 /**
81 * @descr Do nothing
83 void LwpFootnoteLayout::RegisterStyle()
87 /**
88 * @descr Do nothing
90 void LwpFootnoteLayout::XFConvert(XFContentContainer * /*pCont*/)
94 LwpFnRowLayout::LwpFnRowLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
95 :LwpRowLayout(objHdr, pStrm)
99 LwpFnRowLayout::~LwpFnRowLayout()
103 * @descr Read object info
105 void LwpFnRowLayout::Read()
107 LwpRowLayout::Read();
108 m_pObjStrm->SkipExtra();
112 * @descr Register footnote/endnote contents style
114 void LwpFnRowLayout::RegisterStyle()
116 // register cells' style
117 LwpObjectID& rCellID = GetChildHead();
118 LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
120 while(pCellLayout)
122 pCellLayout->SetFoundry(m_pFoundry);
123 pCellLayout->RegisterStyle();
124 rCellID = pCellLayout->GetNext();
125 pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
130 * @descr Do nothing
132 void LwpFnRowLayout::XFConvert(XFContentContainer * /*pCont*/)
136 LwpFnCellLayout::LwpFnCellLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
137 :LwpCellLayout(objHdr, pStrm)
141 LwpFnCellLayout::~LwpFnCellLayout()
145 * @descr Read object info
147 void LwpFnCellLayout::Read()
149 LwpCellLayout::Read();
150 m_pObjStrm->SkipExtra();
154 * @descr Register footnote/endnote contents style
156 void LwpFnCellLayout::RegisterStyle()
158 // content object register styles
159 rtl::Reference<LwpObject> pObj = m_Content.obj();
160 if (pObj.is())
162 pObj->SetFoundry(m_pFoundry);
163 pObj->DoRegisterStyle();
168 * @descr Do nothing
170 void LwpFnCellLayout::XFConvert(XFContentContainer * /*pCont*/)
174 LwpEndnoteLayout::LwpEndnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
175 :LwpTableLayout(objHdr, pStrm)
179 LwpEndnoteLayout::~LwpEndnoteLayout()
183 * @descr Read object info
185 void LwpEndnoteLayout::Read()
187 LwpTableLayout::Read();
188 m_pObjStrm->SkipExtra();
192 * @descr Register footnote/endnote contents style
194 void LwpEndnoteLayout::RegisterStyle()
196 // register style of rows
197 LwpObjectID& rRowID = GetChildHead();
198 LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
199 while (pRowLayout)
201 pRowLayout->SetFoundry(m_pFoundry);
202 pRowLayout->RegisterStyle();
204 rRowID = pRowLayout->GetNext();
205 pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get());
210 * @descr Do nothing
212 void LwpEndnoteLayout::XFConvert(XFContentContainer * /*pCont*/)
216 LwpEnSuperTableLayout::LwpEnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
217 :LwpSuperTableLayout(objHdr, pStrm)
221 LwpEnSuperTableLayout::~LwpEnSuperTableLayout()
225 * @descr Read object info
227 void LwpEnSuperTableLayout::Read()
229 LwpSuperTableLayout::Read();
230 m_pObjStrm->SkipExtra();
233 void LwpEnSuperTableLayout::RegisterStyle()
235 // if this layout is style of real table entry
236 LwpVirtualLayout* pTableLayout = GetMainTableLayout();
237 if (pTableLayout != nullptr)
239 pTableLayout->SetFoundry(m_pFoundry);
240 pTableLayout->DoRegisterStyle();
245 * @descr Do nothing
247 void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
252 * @short Get child endnote layout
253 * @return pointer to endnote layout
255 LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
257 LwpObjectID& rID = GetChildTail();
259 while(!rID.IsNull())
261 LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout*>(rID.obj().get());
262 if(!pLayout)
264 break;
266 if (pLayout && pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
268 return pLayout;
270 rID = pLayout->GetPrevious();
273 return nullptr;
276 LwpFnSuperTableLayout::LwpFnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
277 :LwpEnSuperTableLayout(objHdr, pStrm)
281 LwpFnSuperTableLayout::~LwpFnSuperTableLayout()
285 * @descr Read object info
287 void LwpFnSuperTableLayout::Read()
289 LwpEnSuperTableLayout::Read();
290 m_pObjStrm->SkipExtra();
294 * @descr Do nothing
296 void LwpFnSuperTableLayout::RegisterStyle()
301 * @descr Do nothing
303 void LwpFnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
308 * @short Get child footnote layout
309 * @return pointer to footnote layout
311 LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
313 LwpObjectID& rID = GetChildTail();
315 while(!rID.IsNull())
317 LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
318 if(!pLayout)
320 break;
322 if (pLayout && pLayout->GetLayoutType() == LWP_FOOTNOTE_LAYOUT)
324 return pLayout;
326 rID = pLayout->GetPrevious();
329 return nullptr;
332 LwpContFromLayout::LwpContFromLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
333 :LwpPlacableLayout(objHdr, pStrm)
337 LwpContFromLayout::~LwpContFromLayout()
341 * @descr Read object info
343 void LwpContFromLayout::Read()
345 LwpPlacableLayout::Read();
346 m_pObjStrm->SkipExtra();
350 * @descr Do nothing
352 void LwpContFromLayout::RegisterStyle()
357 * @descr Do nothing
359 void LwpContFromLayout::XFConvert(XFContentContainer * /*pCont*/)
363 LwpContOnLayout::LwpContOnLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
364 :LwpPlacableLayout(objHdr, pStrm)
368 LwpContOnLayout::~LwpContOnLayout()
372 * @descr Read object info
374 void LwpContOnLayout::Read()
376 LwpPlacableLayout::Read();
377 m_pObjStrm->SkipExtra();
381 * @descr Do nothing
383 void LwpContOnLayout::RegisterStyle()
388 * @descr Do nothing
390 void LwpContOnLayout::XFConvert(XFContentContainer * /*pCont*/)
394 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */