LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpfnlayout.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 31 146 21.2 %
Date: 2012-08-25 Functions: 13 50 26.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 52 7.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  *  The Contents of this file are made available subject to the terms of
       5                 :            :  *  either of the following licenses
       6                 :            :  *
       7                 :            :  *         - GNU Lesser General Public License Version 2.1
       8                 :            :  *         - Sun Industry Standards Source License Version 1.1
       9                 :            :  *
      10                 :            :  *  Sun Microsystems Inc., October, 2000
      11                 :            :  *
      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
      16                 :            :  *
      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.
      20                 :            :  *
      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.
      25                 :            :  *
      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
      30                 :            :  *
      31                 :            :  *
      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.
      38                 :            :  *
      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.
      45                 :            :  *
      46                 :            :  *  The Initial Developer of the Original Code is: IBM Corporation
      47                 :            :  *
      48                 :            :  *  Copyright: 2008 by IBM Corporation
      49                 :            :  *
      50                 :            :  *  All Rights Reserved.
      51                 :            :  *
      52                 :            :  *  Contributor(s): _______________________________________
      53                 :            :  *
      54                 :            :  *
      55                 :            :  ************************************************************************/
      56                 :            : /**
      57                 :            :  * @file
      58                 :            :  *  For LWP filter architecture prototype - footnote layouts
      59                 :            :  */
      60                 :            : /*************************************************************************
      61                 :            :  * Change History
      62                 :            :  Mar 2005           Created
      63                 :            :  ************************************************************************/
      64                 :            : 
      65                 :            : #include "lwpfnlayout.hxx"
      66                 :            : 
      67                 :          3 : LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
      68                 :          3 :     :LwpTableLayout(objHdr, pStrm)
      69                 :            : {
      70                 :          3 : }
      71                 :            : 
      72                 :          3 : LwpFootnoteLayout::~LwpFootnoteLayout()
      73         [ -  + ]:          6 : {}
      74                 :            : 
      75                 :            : /**
      76                 :            :  * @descr  Read object info
      77                 :            :  */
      78                 :          3 : void LwpFootnoteLayout::Read()
      79                 :            : {
      80                 :          3 :     LwpTableLayout::Read();
      81                 :          3 :     m_pObjStrm->SkipExtra();
      82                 :          3 : }
      83                 :            : 
      84                 :            : /**
      85                 :            :  * @descr  Do nothing
      86                 :            :  */
      87                 :          0 : void LwpFootnoteLayout::RegisterStyle()
      88                 :            : {
      89                 :          0 : }
      90                 :            : 
      91                 :            : /**
      92                 :            :  * @descr  Do nothing
      93                 :            :  */
      94                 :          0 : void LwpFootnoteLayout::XFConvert(XFContentContainer * /*pCont*/)
      95                 :            : {
      96                 :          0 : }
      97                 :            : 
      98                 :          3 : LwpFnRowLayout::LwpFnRowLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
      99                 :          3 :     :LwpRowLayout(objHdr, pStrm)
     100                 :            : {
     101                 :          3 : }
     102                 :            : 
     103                 :          3 : LwpFnRowLayout::~LwpFnRowLayout()
     104         [ -  + ]:          6 : {}
     105                 :            : 
     106                 :            : /**
     107                 :            :  * @descr  Read object info
     108                 :            :  */
     109                 :          3 : void LwpFnRowLayout::Read()
     110                 :            : {
     111                 :          3 :     LwpRowLayout::Read();
     112                 :          3 :     m_pObjStrm->SkipExtra();
     113                 :          3 : }
     114                 :            : 
     115                 :            : /**
     116                 :            :  * @descr  Register footnote/endnote contents style
     117                 :            :  */
     118                 :          0 : void LwpFnRowLayout::RegisterStyle()
     119                 :            : {
     120                 :            :     // register cells' style
     121                 :          0 :     LwpObjectID *pCellID= GetChildHead();
     122                 :          0 :     LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
     123                 :            : 
     124         [ #  # ]:          0 :     while(pCellLayout)
     125                 :            :     {
     126                 :          0 :         pCellLayout->SetFoundry(m_pFoundry);
     127                 :          0 :         pCellLayout->RegisterStyle();
     128                 :          0 :         pCellID = pCellLayout->GetNext();
     129                 :          0 :         pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
     130                 :            :     }
     131                 :          0 : }
     132                 :            : 
     133                 :            : /**
     134                 :            :  * @descr  Do nothing
     135                 :            :  */
     136                 :          0 : void LwpFnRowLayout::XFConvert(XFContentContainer * /*pCont*/)
     137                 :            : {
     138                 :          0 : }
     139                 :            : 
     140                 :          6 : LwpFnCellLayout::LwpFnCellLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     141                 :          6 :     :LwpCellLayout(objHdr, pStrm)
     142                 :            : {
     143                 :          6 : }
     144                 :            : 
     145                 :          6 : LwpFnCellLayout::~LwpFnCellLayout()
     146         [ -  + ]:         12 : {}
     147                 :            : 
     148                 :            : /**
     149                 :            :  * @descr  Read object info
     150                 :            :  */
     151                 :          6 : void LwpFnCellLayout::Read()
     152                 :            : {
     153                 :          6 :     LwpCellLayout::Read();
     154                 :          6 :     m_pObjStrm->SkipExtra();
     155                 :          6 : }
     156                 :            : 
     157                 :            : /**
     158                 :            :  * @descr  Register footnote/endnote contents style
     159                 :            :  */
     160                 :          3 : void LwpFnCellLayout::RegisterStyle()
     161                 :            : {
     162                 :            :     // content object register styles
     163                 :          3 :     LwpObject * pObj = m_Content.obj();
     164         [ -  + ]:          3 :     if (pObj)
     165                 :            :     {
     166                 :          0 :         pObj->SetFoundry(m_pFoundry);
     167                 :          0 :         pObj->RegisterStyle();
     168                 :            :     }
     169                 :          3 : }
     170                 :            : 
     171                 :            : /**
     172                 :            :  * @descr  Do nothing
     173                 :            :  */
     174                 :          0 : void LwpFnCellLayout::XFConvert(XFContentContainer * /*pCont*/)
     175                 :            : {
     176                 :          0 : }
     177                 :            : 
     178                 :          0 : LwpEndnoteLayout::LwpEndnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     179                 :          0 :     :LwpTableLayout(objHdr, pStrm)
     180                 :            : {
     181                 :          0 : }
     182                 :            : 
     183                 :          0 : LwpEndnoteLayout::~LwpEndnoteLayout()
     184         [ #  # ]:          0 : {}
     185                 :            : 
     186                 :            : /**
     187                 :            :  * @descr  Read object info
     188                 :            :  */
     189                 :          0 : void LwpEndnoteLayout::Read()
     190                 :            : {
     191                 :          0 :     LwpTableLayout::Read();
     192                 :          0 :     m_pObjStrm->SkipExtra();
     193                 :          0 : }
     194                 :            : 
     195                 :            : /**
     196                 :            :  * @descr  Register footnote/endnote contents style
     197                 :            :  */
     198                 :          0 : void LwpEndnoteLayout::RegisterStyle()
     199                 :            : {
     200                 :            :     // register style of rows
     201                 :          0 :     LwpObjectID *pRowID = GetChildHead();
     202                 :          0 :     LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
     203         [ #  # ]:          0 :     while (pRowLayout)
     204                 :            :     {
     205                 :          0 :         pRowLayout->SetFoundry(m_pFoundry);
     206                 :          0 :         pRowLayout->RegisterStyle();
     207                 :            : 
     208                 :          0 :         pRowID = pRowLayout->GetNext();
     209                 :          0 :         pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
     210                 :            :     }
     211                 :          0 : }
     212                 :            : 
     213                 :            : /**
     214                 :            :  * @descr  Do nothing
     215                 :            :  */
     216                 :          0 : void LwpEndnoteLayout::XFConvert(XFContentContainer * /*pCont*/)
     217                 :            : {
     218                 :          0 : }
     219                 :            : 
     220                 :          0 : LwpEnSuperTableLayout::LwpEnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     221                 :          0 :     :LwpSuperTableLayout(objHdr, pStrm)
     222                 :            : {
     223                 :          0 : }
     224                 :            : 
     225                 :          0 : LwpEnSuperTableLayout::~LwpEnSuperTableLayout()
     226         [ #  # ]:          0 : {}
     227                 :            : 
     228                 :            : /**
     229                 :            :  * @descr  Read object info
     230                 :            :  */
     231                 :          0 : void LwpEnSuperTableLayout::Read()
     232                 :            : {
     233                 :          0 :     LwpSuperTableLayout::Read();
     234                 :          0 :     m_pObjStrm->SkipExtra();
     235                 :          0 : }
     236                 :            : 
     237                 :          0 : void LwpEnSuperTableLayout::RegisterStyle()
     238                 :            : {
     239                 :            :     // if this layout is style of real table entry
     240                 :          0 :     LwpVirtualLayout* pTableLayout = GetMainTableLayout();
     241         [ #  # ]:          0 :     if (pTableLayout != NULL)
     242                 :            :     {
     243                 :          0 :         pTableLayout->SetFoundry(m_pFoundry);
     244                 :          0 :         pTableLayout->RegisterStyle();;
     245                 :            :     }
     246                 :          0 : }
     247                 :            : 
     248                 :            : /**
     249                 :            :  * @descr  Do nothing
     250                 :            :  */
     251                 :          0 : void LwpEnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
     252                 :            : {
     253                 :          0 : }
     254                 :            : 
     255                 :            : /**
     256                 :            :  * @short   Get child endnote layout
     257                 :            :  * @return pointer to endnote layout
     258                 :            :  */
     259                 :          0 :  LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
     260                 :            : {
     261                 :          0 :     LwpObjectID *pID = GetChildTail();
     262                 :            : 
     263 [ #  # ][ #  # ]:          0 :     while(pID && !pID->IsNull())
                 [ #  # ]
     264                 :            :     {
     265                 :          0 :         LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
     266         [ #  # ]:          0 :         if(!pLayout)
     267                 :            :         {
     268                 :          0 :             break;
     269                 :            :         }
     270 [ #  # ][ #  # ]:          0 :         if (pLayout && pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
                 [ #  # ]
     271                 :            :         {
     272                 :          0 :             return pLayout;
     273                 :            :         }
     274                 :          0 :         pID = pLayout->GetPrevious();
     275                 :            :     }
     276                 :            : 
     277                 :          0 :     return NULL;
     278                 :            : }
     279                 :            : 
     280                 :          0 : LwpFnSuperTableLayout::LwpFnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     281                 :          0 :     :LwpEnSuperTableLayout(objHdr, pStrm)
     282                 :            : {
     283                 :          0 : }
     284                 :            : 
     285                 :          0 : LwpFnSuperTableLayout::~LwpFnSuperTableLayout()
     286         [ #  # ]:          0 : {}
     287                 :            : 
     288                 :            : /**
     289                 :            :  * @descr  Read object info
     290                 :            :  */
     291                 :          0 : void LwpFnSuperTableLayout::Read()
     292                 :            : {
     293                 :          0 :     LwpEnSuperTableLayout::Read();
     294                 :          0 :     m_pObjStrm->SkipExtra();
     295                 :          0 : }
     296                 :            : 
     297                 :            : /**
     298                 :            :  * @descr  Do nothing
     299                 :            :  */
     300                 :          0 : void LwpFnSuperTableLayout::RegisterStyle()
     301                 :            : {
     302                 :          0 : }
     303                 :            : 
     304                 :            : /**
     305                 :            :  * @descr  Do nothing
     306                 :            :  */
     307                 :          0 : void LwpFnSuperTableLayout::XFConvert(XFContentContainer * /*pCont*/)
     308                 :            : {
     309                 :          0 : }
     310                 :            : 
     311                 :            : /**
     312                 :            :  * @short   Get child footnote layout
     313                 :            :  * @return pointer to footnote layout
     314                 :            :  */
     315                 :          0 : LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
     316                 :            : {
     317                 :          0 :     LwpObjectID *pID = GetChildTail();
     318                 :            : 
     319 [ #  # ][ #  # ]:          0 :     while(pID && !pID->IsNull())
                 [ #  # ]
     320                 :            :     {
     321                 :          0 :         LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
     322         [ #  # ]:          0 :         if(!pLayout)
     323                 :            :         {
     324                 :          0 :             break;
     325                 :            :         }
     326 [ #  # ][ #  # ]:          0 :         if (pLayout && pLayout->GetLayoutType() == LWP_FOOTNOTE_LAYOUT)
                 [ #  # ]
     327                 :            :         {
     328                 :          0 :             return pLayout;
     329                 :            :         }
     330                 :          0 :         pID = pLayout->GetPrevious();
     331                 :            :     }
     332                 :            : 
     333                 :          0 :     return NULL;
     334                 :            : }
     335                 :            : 
     336                 :          0 : LwpContFromLayout::LwpContFromLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     337                 :          0 :     :LwpPlacableLayout(objHdr, pStrm)
     338                 :            : {
     339                 :          0 : }
     340                 :            : 
     341                 :          0 : LwpContFromLayout::~LwpContFromLayout()
     342         [ #  # ]:          0 : {}
     343                 :            : 
     344                 :            : /**
     345                 :            :  * @descr  Read object info
     346                 :            :  */
     347                 :          0 : void LwpContFromLayout::Read()
     348                 :            : {
     349                 :          0 :     LwpPlacableLayout::Read();
     350                 :          0 :     m_pObjStrm->SkipExtra();
     351                 :          0 : }
     352                 :            : 
     353                 :            : /**
     354                 :            :  * @descr  Do nothing
     355                 :            :  */
     356                 :          0 : void LwpContFromLayout::RegisterStyle()
     357                 :            : {
     358                 :          0 : }
     359                 :            : 
     360                 :            : /**
     361                 :            :  * @descr  Do nothing
     362                 :            :  */
     363                 :          0 : void LwpContFromLayout::XFConvert(XFContentContainer * /*pCont*/)
     364                 :            : {
     365                 :          0 : }
     366                 :            : 
     367                 :          0 : LwpContOnLayout::LwpContOnLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     368                 :          0 :     :LwpPlacableLayout(objHdr, pStrm)
     369                 :            : {
     370                 :          0 : }
     371                 :            : 
     372                 :          0 : LwpContOnLayout::~LwpContOnLayout()
     373         [ #  # ]:          0 : {}
     374                 :            : 
     375                 :            : /**
     376                 :            :  * @descr  Read object info
     377                 :            :  */
     378                 :          0 : void LwpContOnLayout::Read()
     379                 :            : {
     380                 :          0 :     LwpPlacableLayout::Read();
     381                 :          0 :     m_pObjStrm->SkipExtra();
     382                 :          0 : }
     383                 :            : 
     384                 :            : /**
     385                 :            :  * @descr  Do nothing
     386                 :            :  */
     387                 :          0 : void LwpContOnLayout::RegisterStyle()
     388                 :            : {
     389                 :          0 : }
     390                 :            : 
     391                 :            : /**
     392                 :            :  * @descr  Do nothing
     393                 :            :  */
     394                 :          0 : void LwpContOnLayout::XFConvert(XFContentContainer * /*pCont*/)
     395                 :            : {
     396                 :          0 : }
     397                 :            : 
     398                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10