LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwptable.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 29 87 33.3 %
Date: 2012-08-25 Functions: 9 27 33.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 10 54 18.5 %

           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 - table object
      59                 :            :  */
      60                 :            : /*************************************************************************
      61                 :            :  * Change History
      62                 :            :  Mar 2005           Created
      63                 :            :  ************************************************************************/
      64                 :            : 
      65                 :            :  #include "lwptable.hxx"
      66                 :            : 
      67                 :          3 :  LwpSuperTable::LwpSuperTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpContent(objHdr, pStrm)
      68                 :          3 : {}
      69                 :            : 
      70                 :          3 : LwpSuperTable::~LwpSuperTable()
      71         [ -  + ]:          6 : {}
      72                 :            : 
      73                 :          3 : void LwpSuperTable::Read()
      74                 :            : {
      75                 :          3 :     LwpContent::Read();
      76                 :          3 :     m_pObjStrm->SkipExtra();
      77                 :            : 
      78                 :          3 : }
      79                 :            : 
      80                 :          0 : void  LwpSuperTable::Parse(IXFStream* /*pOutputStream*/)
      81                 :            : {
      82                 :          0 : }
      83                 :            : 
      84                 :            : //Added by  for XFConvert refactor, 03/31/2005
      85                 :          0 : void LwpSuperTable::XFConvert(XFContentContainer* /*pCont*/)
      86                 :            : {
      87                 :          0 : }
      88                 :            : 
      89                 :            : //End of Add
      90                 :            : /*****************************************************************************/
      91 [ +  - ][ +  - ]:          6 :  LwpTable::LwpTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpContent(objHdr, pStrm)
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
      92                 :          6 : {}
      93                 :            : 
      94                 :          6 : LwpTable::~LwpTable()
      95         [ -  + ]:          9 : {}
      96                 :            : 
      97                 :          6 : void LwpTable::Read()
      98                 :            : {
      99                 :          6 :     LwpContent::Read();
     100                 :            :     //m_RowCache.Read(m_pObjStrm);
     101                 :            :     //m_ColumnCache.Read(m_pObjStrm);
     102                 :            : 
     103                 :            :     //m_CPNotifyList.Read(m_pObjStrm);
     104                 :            :     //m_CPTempVersionedNotifyList.Read(m_pObjStrm);
     105                 :            : 
     106                 :          6 :     m_nRow = m_pObjStrm->QuickReaduInt16();
     107                 :          6 :     m_nColumn = m_pObjStrm->QuickReaduInt16();
     108                 :            : 
     109                 :          6 :     m_nHeight = m_pObjStrm->QuickReadInt32();
     110                 :          6 :     m_nWidth = m_pObjStrm->QuickReadInt32();
     111                 :            : 
     112                 :          6 :     m_nDefaultAutoGrowRowHeight = m_pObjStrm->QuickReadInt32();
     113                 :            : 
     114                 :          6 :     m_nAttributes = m_pObjStrm->QuickReaduInt16();
     115                 :            : 
     116                 :          6 :     m_Layout.ReadIndexed(m_pObjStrm);
     117                 :            : 
     118                 :          6 :     m_DefaultCellStyle.ReadIndexed(m_pObjStrm);
     119         [ +  - ]:          6 :     if (LwpFileHeader::m_nFileRevision >= 0x0007)
     120                 :          6 :         m_CPNotifyList.Read(m_pObjStrm);
     121                 :            : 
     122                 :          6 :     m_pObjStrm->SkipExtra();
     123                 :          6 : }
     124                 :            : 
     125                 :          3 : sal_Bool LwpTable::IsNumberDown()
     126                 :            : {
     127         [ -  + ]:          3 :     if (m_nAttributes & NUMBER_DOWN)
     128                 :          0 :         return sal_True;
     129                 :          3 :     return sal_False;
     130                 :            : }
     131                 :            : 
     132                 :          0 : void  LwpTable::Parse(IXFStream* /*pOutputStream*/)
     133                 :            : {
     134                 :          0 : }
     135                 :            : 
     136                 :          0 :  LwpSuperTableLayout* LwpTable::GetSuperTableLayout()
     137                 :            : {
     138         [ #  # ]:          0 :     LwpTableLayout* pLayout = dynamic_cast<LwpTableLayout*>(m_Layout.obj());
     139         [ #  # ]:          0 :     if(pLayout)
     140         [ #  # ]:          0 :         return dynamic_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj());
     141                 :            : 
     142                 :          0 :     return NULL;
     143                 :            : }
     144                 :            : 
     145                 :            :  /*****************************************************************************/
     146                 :          0 :  LwpTableHeading::LwpTableHeading(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpTable(objHdr, pStrm)
     147                 :          0 : {}
     148                 :            : 
     149                 :          0 : LwpTableHeading::~LwpTableHeading()
     150         [ #  # ]:          0 : {}
     151                 :            : 
     152                 :          0 : void LwpTableHeading::Read()
     153                 :            : {
     154                 :          0 :     m_pObjStrm->SkipExtra();
     155                 :          0 : }
     156                 :            : 
     157                 :          0 : void  LwpTableHeading::Parse(IXFStream* /*pOutputStream*/)
     158                 :            : {
     159                 :          0 : }
     160                 :            : 
     161                 :            :  /*****************************************************************************/
     162 [ #  # ][ #  # ]:          0 : LwpParallelColumns::LwpParallelColumns(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpTable(objHdr, pStrm)
     163                 :            : {
     164                 :          0 : }
     165                 :            : 
     166                 :          0 : LwpParallelColumns::~LwpParallelColumns()
     167                 :            : {
     168         [ #  # ]:          0 : }
     169                 :            : 
     170                 :          0 : void LwpParallelColumns::Read()
     171                 :            : {
     172                 :          0 :     LwpTable::Read();
     173                 :          0 :     cDefaultLeftColumnStyle.ReadIndexed(m_pObjStrm);
     174                 :          0 :     cDefaultRightColumnStyle.ReadIndexed(m_pObjStrm);
     175                 :            : 
     176                 :          0 :     m_pObjStrm->SkipExtra();
     177                 :          0 : }
     178                 :            :  /*****************************************************************************/
     179                 :          0 : LwpGlossary::LwpGlossary(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpParallelColumns(objHdr, pStrm)
     180                 :            : {
     181                 :          0 : }
     182                 :            : 
     183                 :          0 : LwpGlossary::~LwpGlossary()
     184                 :            : {
     185         [ #  # ]:          0 : }
     186                 :          0 : sal_uInt16 LwpGlossary::GetNumIndexRows(void)
     187                 :            : {
     188 [ #  # ][ #  # ]:          0 :     if (GetRow() > 0 && GetRow() <= MAX_NUM_ROWS)
                 [ #  # ]
     189                 :          0 :         return GetRow() - 1;    // Minus one row for repeated heading.
     190                 :          0 :     return 0;
     191                 :            : }
     192                 :            : 
     193                 :          0 : void LwpGlossary::Read()
     194                 :            : {
     195                 :          0 :     LwpParallelColumns::Read();
     196                 :            : 
     197                 :          0 :     sal_uInt16 FiledEntries = m_pObjStrm->QuickReaduInt16();
     198                 :          0 :     sal_uInt16 NumIndexRows = GetNumIndexRows();
     199                 :            : 
     200                 :          0 :     sal_uInt16 * cpIndex = NULL;
     201         [ #  # ]:          0 :     if (FiledEntries < NumIndexRows)
     202                 :            :     {
     203                 :            :         /* We'll have to do sequential (slow) searches. */
     204                 :          0 :         m_pObjStrm->SeekRel( FiledEntries * sizeof(sal_uInt16));
     205                 :            :     }
     206                 :            :     else
     207                 :            :     {
     208         [ #  # ]:          0 :         if (NumIndexRows)
     209                 :            :         {
     210                 :            :             sal_uInt16 EntriesRead, EntryCount;
     211                 :            :             sal_uInt16 *pRowID;
     212                 :            : 
     213                 :          0 :             cpIndex = new sal_uInt16[NumIndexRows];
     214                 :            : 
     215         [ #  # ]:          0 :             if (cpIndex)
     216                 :            :             {
     217                 :          0 :                 pRowID = cpIndex;
     218                 :            : 
     219         [ #  # ]:          0 :                 EntriesRead = (FiledEntries > NumIndexRows)? NumIndexRows:FiledEntries;
     220                 :            : 
     221         [ #  # ]:          0 :                 for (EntryCount = 1; EntryCount <= EntriesRead; EntryCount++)
     222                 :          0 :                     *pRowID++ = m_pObjStrm->QuickReaduInt16();
     223                 :            : 
     224         [ #  # ]:          0 :                 if (FiledEntries > EntriesRead)
     225                 :          0 :                     m_pObjStrm->SeekRel((FiledEntries - EntriesRead)* sizeof(sal_uInt16));
     226                 :            :             }
     227                 :            :         }
     228                 :            :         else
     229                 :          0 :             m_pObjStrm->SeekRel(FiledEntries * sizeof(sal_uInt16));
     230                 :            :     }
     231                 :            : 
     232                 :          0 :     m_pObjStrm->SkipExtra();
     233                 :          0 : }
     234                 :            : 
     235                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10