LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwplaypiece.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 236 0.0 %
Date: 2014-04-14 Functions: 0 71 0.0 %
Legend: Lines: hit not hit

          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
      59             :  ************************************************************************/
      60             : 
      61             : #include "lwplaypiece.hxx"
      62             : 
      63             : #include "lwpfilehdr.hxx"
      64           0 : LwpRotor::LwpRotor()
      65           0 :     : m_nRotation(0)
      66           0 : {}
      67             : 
      68           0 : LwpRotor::~LwpRotor()
      69           0 : {}
      70             : 
      71           0 : void LwpRotor:: Read(LwpObjectStream *pStrm)
      72             : {
      73           0 :     m_nRotation = pStrm->QuickReadInt16();
      74           0 : }
      75             : 
      76           0 : LwpLayoutGeometry::LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
      77             :     : LwpVirtualPiece(objHdr, pStrm)
      78             :     , m_nWidth(0)
      79             :     , m_nHeight(0)
      80           0 :     , m_ContentOrientation(0)
      81           0 : {}
      82             : 
      83           0 : LwpLayoutGeometry::~LwpLayoutGeometry()
      84           0 : {}
      85             : 
      86           0 : void LwpLayoutGeometry::Read()
      87             : {
      88           0 :     LwpVirtualPiece::Read();
      89             : 
      90           0 :     if(LwpFileHeader::m_nFileRevision >= 0x000B)
      91             :     {
      92           0 :         m_nWidth = m_pObjStrm->QuickReadInt32();
      93           0 :         m_nHeight = m_pObjStrm->QuickReadInt32();
      94           0 :         m_Origin.Read(m_pObjStrm);
      95           0 :         m_AbsoluteOrigin.Read(m_pObjStrm);
      96           0 :         m_ContainerRotor.Read(m_pObjStrm);
      97           0 :         m_ContentOrientation = m_pObjStrm->QuickReaduInt8();
      98           0 :         m_pObjStrm->SkipExtra();
      99             :     }
     100           0 : }
     101           0 : void LwpLayoutGeometry::Parse(IXFStream* /*pOutputStream*/)
     102           0 : {}
     103             : 
     104           0 : LwpLayoutScale::LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     105             :     : LwpVirtualPiece(objHdr, pStrm)
     106             :     , m_nScaleMode(0)
     107             :     , m_nScalePercentage(0)
     108             :     , m_nScaleWidth(0)
     109             :     , m_nScaleHeight(0)
     110             :     , m_nContentRotation(0)
     111           0 :     , m_nPlacement(0)
     112           0 : {}
     113             : 
     114           0 : LwpLayoutScale::~LwpLayoutScale()
     115           0 : {}
     116             : 
     117           0 : void LwpLayoutScale::Read()
     118             : {
     119           0 :     LwpVirtualPiece::Read();
     120             : 
     121           0 :     if(LwpFileHeader::m_nFileRevision >= 0x000B)
     122             :     {
     123           0 :         m_nScaleMode = m_pObjStrm->QuickReaduInt16();
     124           0 :         m_nScalePercentage = m_pObjStrm->QuickReaduInt32();
     125           0 :         m_nScaleWidth = m_pObjStrm->QuickReadInt32();
     126           0 :         m_nScaleHeight = m_pObjStrm->QuickReadInt32();
     127           0 :         m_nContentRotation = m_pObjStrm->QuickReaduInt16();
     128           0 :         m_Offset.Read(m_pObjStrm);
     129             : 
     130           0 :         m_nPlacement = m_pObjStrm->QuickReaduInt16();
     131           0 :         m_pObjStrm->SkipExtra();
     132             :     }
     133           0 : }
     134             : 
     135           0 : void LwpLayoutScale::Parse(IXFStream* /*pOutputStream*/)
     136           0 : {}
     137             : 
     138           0 : LwpLayoutMargins::LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     139           0 :     : LwpVirtualPiece(objHdr, pStrm)
     140           0 : {}
     141             : 
     142           0 : LwpLayoutMargins::~LwpLayoutMargins()
     143           0 : {}
     144             : 
     145           0 : void LwpLayoutMargins::Read()
     146             : {
     147           0 :     LwpVirtualPiece::Read();
     148             : 
     149           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     150             :     {
     151           0 :         m_Margins.Read(m_pObjStrm);
     152           0 :         m_ExtMargins.Read(m_pObjStrm);
     153           0 :         m_ExtraMargins.Read(m_pObjStrm);
     154           0 :         m_pObjStrm->SkipExtra();
     155             :     }
     156           0 : }
     157             : 
     158           0 : void LwpLayoutMargins::Parse(IXFStream* /*pOutputStream*/)
     159           0 : {}
     160             : 
     161           0 : LwpLayoutBorder::LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     162           0 :     : LwpVirtualPiece(objHdr, pStrm)
     163           0 : {}
     164             : 
     165           0 : LwpLayoutBorder::~LwpLayoutBorder()
     166           0 : {}
     167             : 
     168           0 : void LwpLayoutBorder::Read()
     169             : {
     170           0 :     LwpVirtualPiece::Read();
     171             : 
     172           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     173             :     {
     174           0 :         m_BorderStuff.Read(m_pObjStrm);
     175           0 :         m_pObjStrm->SkipExtra();
     176             :     }
     177           0 : }
     178             : 
     179           0 : void LwpLayoutBorder::Parse(IXFStream* /*pOutputStream*/)
     180           0 : {}
     181             : 
     182           0 : LwpLayoutBackground::LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     183           0 :     : LwpVirtualPiece(objHdr, pStrm)
     184           0 : {}
     185             : 
     186           0 : LwpLayoutBackground::~LwpLayoutBackground()
     187           0 : {}
     188             : 
     189           0 : void LwpLayoutBackground::Read()
     190             : {
     191           0 :     LwpVirtualPiece::Read();
     192             : 
     193           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     194             :     {
     195           0 :         m_BackgroundStuff.Read(m_pObjStrm);
     196           0 :         m_pObjStrm->SkipExtra();
     197             :     }
     198           0 : }
     199             : 
     200           0 : void LwpLayoutBackground::Parse(IXFStream* /*pOutputStream*/)
     201           0 : {}
     202             : 
     203           0 : LwpExternalBorder::LwpExternalBorder()
     204           0 : {}
     205             : 
     206           0 : LwpExternalBorder::~LwpExternalBorder()
     207           0 : {}
     208             : 
     209           0 : void LwpExternalBorder:: Read(LwpObjectStream *pStrm)
     210             : {
     211           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000F )
     212             :     {
     213             :         //enum {BORDER,JOIN};
     214           0 :         m_LeftName.Read(pStrm);
     215           0 :         m_TopName.Read(pStrm);
     216           0 :         m_RightName.Read(pStrm);
     217           0 :         m_BottomName.Read(pStrm);
     218             :         // TODO: Do not know what it is for
     219             :         /*cLeftName = CStyleMgr::GetUniqueMetaFileName(cLeftName,BORDER);
     220             :         cRightName = CStyleMgr::GetUniqueMetaFileName(cRightName,BORDER);
     221             :         cTopName = CStyleMgr::GetUniqueMetaFileName(cTopName,BORDER);
     222             :         cBottomName = CStyleMgr::GetUniqueMetaFileName(cBottomName,BORDER);*/
     223           0 :         pStrm->SkipExtra();
     224             :     }
     225           0 : }
     226             : 
     227           0 : LwpLayoutExternalBorder::LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     228           0 :     : LwpVirtualPiece(objHdr, pStrm)
     229           0 : {}
     230             : 
     231           0 : LwpLayoutExternalBorder::~LwpLayoutExternalBorder()
     232           0 : {}
     233             : 
     234           0 : void LwpLayoutExternalBorder::Read()
     235             : {
     236           0 :     LwpVirtualPiece::Read();
     237             : 
     238           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     239             :     {
     240           0 :         m_ExtranalBorder.Read(m_pObjStrm);
     241           0 :         m_pObjStrm->SkipExtra();
     242             :     }
     243           0 : }
     244             : 
     245           0 : void LwpLayoutExternalBorder::Parse(IXFStream* /*pOutputStream*/)
     246           0 : {}
     247             : 
     248           0 : LwpColumnInfo::LwpColumnInfo()
     249             :     : m_nWidth(0)
     250           0 :     , m_nGap(0)
     251           0 : {}
     252             : 
     253           0 : LwpColumnInfo::~LwpColumnInfo()
     254           0 : {}
     255             : 
     256           0 : void LwpColumnInfo:: Read(LwpObjectStream *pStrm)
     257             : {
     258           0 :     m_nWidth = pStrm->QuickReadInt32();
     259           0 :     m_nGap = pStrm->QuickReadInt32();
     260           0 : }
     261             : 
     262           0 : LwpLayoutColumns::LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     263             :     : LwpVirtualPiece(objHdr, pStrm)
     264             :     , m_nNumCols(0)
     265           0 :     , m_pColumns(NULL)
     266           0 : {}
     267             : 
     268           0 : LwpLayoutColumns::~LwpLayoutColumns()
     269             : {
     270           0 :     if(m_pColumns)
     271             :     {
     272           0 :         delete[] m_pColumns;
     273           0 :         m_pColumns = NULL;
     274             :     }
     275             : 
     276           0 : }
     277             : 
     278           0 : void LwpLayoutColumns::Read()
     279             : {
     280           0 :     LwpVirtualPiece::Read();
     281             : 
     282           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     283             :     {
     284           0 :         m_nNumCols = m_pObjStrm->QuickReaduInt16();
     285           0 :         m_pColumns = new LwpColumnInfo[m_nNumCols];
     286           0 :         for(int i=0; i<m_nNumCols; i++)
     287             :         {
     288           0 :             m_pColumns[i].Read(m_pObjStrm);
     289             :         }
     290           0 :         m_pObjStrm->SkipExtra();
     291             :     }
     292           0 : }
     293             : 
     294           0 : double LwpLayoutColumns::GetColWidth(sal_uInt16 nIndex)
     295             : {
     296           0 :     if(nIndex >= m_nNumCols)
     297             :     {
     298           0 :         return 0;
     299             :     }
     300           0 :     return m_pColumns[nIndex].GetWidth();
     301             : }
     302             : 
     303           0 : double LwpLayoutColumns::GetColGap(sal_uInt16 nIndex)
     304             : {
     305           0 :     if(nIndex >= m_nNumCols)
     306             :     {
     307           0 :         return 0;
     308             :     }
     309           0 :     return m_pColumns[nIndex].GetGap();
     310             : }
     311             : 
     312           0 : void LwpLayoutColumns::Parse(IXFStream* /*pOutputStream*/)
     313           0 : {}
     314             : 
     315           0 : LwpLayoutGutters::LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     316           0 :     : LwpVirtualPiece(objHdr, pStrm)
     317           0 : {}
     318             : 
     319           0 : LwpLayoutGutters::~LwpLayoutGutters()
     320           0 : {}
     321             : 
     322           0 : void LwpLayoutGutters::Read()
     323             : {
     324           0 :     LwpVirtualPiece::Read();
     325             : 
     326           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     327             :     {
     328           0 :         m_BorderBuffer.Read(m_pObjStrm);
     329           0 :         m_pObjStrm->SkipExtra();
     330             :     }
     331           0 : }
     332             : 
     333           0 : void LwpLayoutGutters::Parse(IXFStream* /*pOutputStream*/)
     334           0 : {}
     335             : 
     336           0 : LwpJoinStuff::LwpJoinStuff()
     337             :     : m_nPercentage(0)
     338             :     , m_nCorners(0)
     339             :     , m_nWidth(0)
     340             :     , m_nHeight(0)
     341             :     , m_nID(0)
     342           0 :     , m_nScaling(0)
     343           0 : {}
     344             : 
     345           0 : LwpJoinStuff::~LwpJoinStuff()
     346           0 : {}
     347             : 
     348             : #include "lwpstyledef.hxx"
     349           0 : void LwpJoinStuff:: Read(LwpObjectStream *pStrm)
     350             : {
     351           0 :     m_nWidth = pStrm->QuickReadInt32();
     352           0 :     m_nHeight = pStrm->QuickReadInt32();
     353           0 :     m_nPercentage = pStrm->QuickReaduInt16();
     354           0 :     m_nID = pStrm->QuickReaduInt16();
     355           0 :     m_nCorners = pStrm->QuickReaduInt16();
     356           0 :     m_nScaling = pStrm->QuickReaduInt16();
     357           0 :     m_Color.Read(pStrm);
     358           0 :     pStrm->SkipExtra();
     359             : 
     360             :     // Bug fix: if reading in from something older than Release 9
     361             :     // then check for the external ID and change it to solid.
     362           0 :     if (LwpFileHeader::m_nFileRevision < 0x0010)
     363             :     {
     364           0 :         if (m_nID & EXTERNAL_ID)
     365           0 :             m_nID = MITRE;
     366             :     }
     367           0 : }
     368             : 
     369           0 : LwpLayoutJoins::LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     370           0 :     : LwpVirtualPiece(objHdr, pStrm)
     371           0 : {}
     372             : 
     373           0 : LwpLayoutJoins::~LwpLayoutJoins()
     374           0 : {}
     375             : 
     376           0 : void LwpLayoutJoins::Read()
     377             : {
     378           0 :     LwpVirtualPiece::Read();
     379             : 
     380           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     381             :     {
     382           0 :         m_JoinStuff.Read(m_pObjStrm);
     383           0 :         m_pObjStrm->SkipExtra();
     384             :     }
     385           0 : }
     386             : 
     387           0 : void LwpLayoutJoins::Parse(IXFStream* /*pOutputStream*/)
     388           0 : {}
     389             : 
     390           0 : LwpLayoutShadow::LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
     391           0 :     : LwpVirtualPiece(objHdr, pStrm)
     392           0 : {}
     393             : 
     394           0 : LwpLayoutShadow::~LwpLayoutShadow()
     395           0 : {}
     396             : 
     397           0 : void LwpLayoutShadow::Read()
     398             : {
     399           0 :     LwpVirtualPiece::Read();
     400             : 
     401           0 :     if( LwpFileHeader::m_nFileRevision >= 0x000B )
     402             :     {
     403           0 :         m_Shadow.Read(m_pObjStrm);
     404           0 :         m_pObjStrm->SkipExtra();
     405             :     }
     406           0 : }
     407             : 
     408           0 : void LwpLayoutShadow::Parse(IXFStream* /*pOutputStream*/)
     409           0 : {}
     410             : /**************************************************************************
     411             :  * @descr: Constructor
     412             :  * @param:
     413             :  * @param:
     414             :  * @return:
     415             : **************************************************************************/
     416           0 : LwpLayoutRelativityGuts::LwpLayoutRelativityGuts()
     417             : {
     418           0 :     m_nRelType = LAY_PARENT_RELATIVE;
     419           0 :     m_nRelFromWhere = LAY_UPPERLEFT;
     420           0 :     m_RelDistance.SetX(0);
     421           0 :     m_RelDistance.SetY(0);
     422           0 :     m_nTether = LAY_UPPERLEFT;
     423           0 :     m_nTetherWhere = LAY_BORDER;
     424           0 :     m_nFlags = 0;
     425           0 : }
     426             : /**************************************************************************
     427             :  * @descr: Read LayoutRelativityGuts' information.
     428             :  * @param:
     429             :  * @param:
     430             :  * @return:
     431             : **************************************************************************/
     432           0 : void LwpLayoutRelativityGuts::Read(LwpObjectStream *pStrm)
     433             : {
     434           0 :     m_nRelType = pStrm->QuickReaduInt8();
     435           0 :     m_nRelFromWhere = pStrm->QuickReaduInt8();
     436           0 :     m_RelDistance.Read(pStrm);
     437           0 :     m_nTether = pStrm->QuickReaduInt8();
     438           0 :     m_nTetherWhere = pStrm->QuickReaduInt8();
     439           0 :     if(LwpFileHeader::m_nFileRevision >= 0x000B)
     440             :     {
     441           0 :         m_nFlags = pStrm->QuickReaduInt8();
     442             :     }
     443             :     else
     444             :     {
     445           0 :         m_nFlags = 0;
     446             :     }
     447           0 : }
     448             : /**************************************************************************
     449             :  * @descr: Constructor
     450             :  * @param:
     451             :  * @param:
     452             :  * @return:
     453             : **************************************************************************/
     454           0 : LwpLayoutRelativity::LwpLayoutRelativity(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
     455           0 :     : LwpVirtualPiece(objHdr, pStrm)
     456             : {
     457           0 : }
     458             : /**************************************************************************
     459             :  * @descr: destructor
     460             :  * @param:
     461             :  * @param:
     462             :  * @return:
     463             : **************************************************************************/
     464           0 : LwpLayoutRelativity::~LwpLayoutRelativity()
     465             : {
     466           0 : }
     467             : 
     468           0 : void LwpLayoutRelativity::Read()
     469             : {
     470           0 :     LwpVirtualPiece::Read();
     471           0 :     if(LwpFileHeader::m_nFileRevision >= 0x000B)
     472             :     {
     473           0 :         m_RelGuts.Read(m_pObjStrm);
     474           0 :         m_pObjStrm->SkipExtra();
     475             :     }
     476           0 : }
     477             : 
     478           0 : void LwpLayoutRelativity::Parse(IXFStream * /*pOutputStream*/)
     479             : {
     480           0 : }
     481             : 
     482             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10