LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpoverride.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 220 295 74.6 %
Date: 2012-08-25 Functions: 44 58 75.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 72 142 50.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
      59                 :            :  ************************************************************************/
      60                 :            : /*************************************************************************
      61                 :            :  * Change History
      62                 :            :  Jan 2005           Created
      63                 :            :  ************************************************************************/
      64                 :            : 
      65                 :            : #include <memory>
      66                 :            : 
      67                 :            : #include "clone.hxx"
      68                 :            : #include "lwpoverride.hxx"
      69                 :            : #include "lwpfilehdr.hxx"
      70                 :            : #include "lwpatomholder.hxx"
      71                 :            : #include "lwpborderstuff.hxx"
      72                 :            : #include "lwpmargins.hxx"
      73                 :            : #include "lwpbackgroundstuff.hxx"
      74                 :            : 
      75                 :            : /*class LwpOverride*/
      76                 :       5295 : LwpOverride::LwpOverride(LwpOverride const& rOther)
      77                 :            :     : m_nValues(rOther.m_nValues)
      78                 :            :     , m_nOverride(rOther.m_nOverride)
      79                 :       5295 :     , m_nApply(rOther.m_nApply)
      80                 :            : {
      81                 :       5295 : }
      82                 :            : 
      83                 :       1824 : void LwpOverride::ReadCommon(LwpObjectStream* pStrm)
      84                 :            : {
      85                 :       1824 :     m_nValues = pStrm->QuickReaduInt16();
      86                 :       1824 :     m_nOverride = pStrm->QuickReaduInt16();
      87                 :       1824 :     m_nApply = pStrm->QuickReaduInt16();
      88                 :       1824 :     pStrm->SkipExtra();
      89                 :       1824 : }
      90                 :            : 
      91                 :          0 : void LwpOverride::Clear()
      92                 :            : {
      93                 :          0 :     m_nValues = 0;
      94                 :          0 :     m_nOverride = 0;
      95                 :          0 :     m_nApply = 0;
      96                 :          0 : }
      97                 :            : 
      98                 :        657 : void LwpOverride::Override(sal_uInt16 nBits, STATE eState)
      99                 :            : {
     100         [ -  + ]:        657 :     if (eState == STATE_STYLE)
     101                 :            :     {
     102                 :          0 :         m_nValues &= ~nBits;
     103                 :          0 :         m_nOverride &= ~nBits;
     104                 :            :     }
     105                 :            :     else
     106                 :            :     {
     107                 :        657 :         m_nOverride |= nBits;
     108         [ +  - ]:        657 :         if (eState == STATE_ON)
     109                 :            :         {
     110                 :        657 :             m_nValues |= nBits;
     111                 :            :         }
     112                 :            :         else    /* State == STATE_OFF */
     113                 :            :         {
     114                 :          0 :             m_nValues &= ~nBits;
     115                 :            :         }
     116                 :            :     }
     117                 :        657 :     m_nApply |= nBits;
     118                 :        657 : }
     119                 :            : 
     120                 :            : /*class LwpTextLanguageOverride*/
     121                 :          0 : LwpTextLanguageOverride::LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther)
     122                 :            :     : LwpOverride(rOther)
     123                 :          0 :     , m_nLanguage(rOther.m_nLanguage)
     124                 :            : {
     125                 :          0 : }
     126                 :            : 
     127                 :          0 : LwpTextLanguageOverride* LwpTextLanguageOverride::clone() const
     128                 :            : {
     129                 :          0 :     return new LwpTextLanguageOverride(*this);
     130                 :            : }
     131                 :            : 
     132                 :        204 : void LwpTextLanguageOverride::Read(LwpObjectStream* pStrm)
     133                 :            : {
     134         [ +  + ]:        204 :     if (pStrm->QuickReadBool())
     135                 :            :     {
     136                 :        159 :         ReadCommon(pStrm);
     137                 :        159 :         m_nLanguage = pStrm->QuickReaduInt16();
     138                 :            :     }
     139                 :            : 
     140                 :        204 :     pStrm->SkipExtra();
     141                 :            : 
     142                 :        204 : }
     143                 :            : 
     144                 :            : /*class LwpTextAttributeOverride*/
     145                 :          0 : LwpTextAttributeOverride::LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther)
     146                 :            :     : LwpOverride(rOther)
     147                 :            :     , m_nHideLevels(rOther.m_nHideLevels)
     148                 :          0 :     , m_nBaseLineOffset(rOther.m_nBaseLineOffset)
     149                 :            : {
     150                 :          0 : }
     151                 :            : 
     152                 :          0 : LwpTextAttributeOverride* LwpTextAttributeOverride::clone() const
     153                 :            : {
     154                 :          0 :     return new LwpTextAttributeOverride(*this);
     155                 :            : }
     156                 :            : 
     157                 :        987 : void LwpTextAttributeOverride::Read(LwpObjectStream* pStrm)
     158                 :            : {
     159         [ +  + ]:        987 :     if (pStrm->QuickReadBool())
     160                 :            :     {
     161                 :        942 :         ReadCommon(pStrm);
     162                 :        942 :         m_nHideLevels = pStrm->QuickReaduInt16();
     163                 :            : 
     164         [ +  - ]:        942 :         if (LwpFileHeader::m_nFileRevision > 0x000A)
     165                 :        942 :             m_nBaseLineOffset = pStrm->QuickReaduInt32();
     166                 :            :     }
     167                 :            : 
     168                 :        987 :     pStrm->SkipExtra();
     169                 :        987 : }
     170                 :            : 
     171                 :        783 : sal_Bool LwpTextAttributeOverride::IsHighLight()
     172                 :            : {
     173                 :        783 :     return (m_nValues & TAO_HIGHLIGHT);
     174                 :            : }
     175                 :            : 
     176                 :            : /*class LwpKinsokuOptsOverride*/
     177                 :          0 : LwpKinsokuOptsOverride::LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther)
     178                 :            :     : LwpOverride(rOther)
     179                 :          0 :     , m_nLevels(rOther.m_nLevels)
     180                 :            : {
     181                 :          0 : }
     182                 :            : 
     183                 :          0 : LwpKinsokuOptsOverride* LwpKinsokuOptsOverride::clone() const
     184                 :            : {
     185                 :          0 :     return new LwpKinsokuOptsOverride(*this);
     186                 :            : }
     187                 :            : 
     188                 :        204 : void LwpKinsokuOptsOverride::Read(LwpObjectStream* pStrm)
     189                 :            : {
     190         [ +  + ]:        204 :     if (pStrm->QuickReadBool())
     191                 :            :     {
     192                 :         12 :         ReadCommon(pStrm);
     193                 :         12 :         m_nLevels = pStrm->QuickReaduInt16();
     194                 :            :     }
     195                 :            : 
     196                 :        204 :     pStrm->SkipExtra();
     197                 :        204 : }
     198                 :            : 
     199                 :            : /*class LwpBulletOverride*/
     200                 :        804 : LwpBulletOverride::LwpBulletOverride(LwpBulletOverride const& rOther)
     201                 :            :     : LwpOverride(rOther)
     202                 :            :     , m_SilverBullet(rOther.m_SilverBullet)
     203                 :        804 :     , m_bIsNull(rOther.m_bIsNull)
     204                 :            : {
     205                 :        804 : }
     206                 :            : 
     207                 :        804 : LwpBulletOverride* LwpBulletOverride::clone() const
     208                 :            : {
     209                 :        804 :     return new LwpBulletOverride(*this);
     210                 :            : }
     211                 :            : 
     212                 :        216 : void LwpBulletOverride::Read(LwpObjectStream * pStrm)
     213                 :            : {
     214         [ +  + ]:        216 :     if (pStrm->QuickReadBool())
     215                 :            :     {
     216                 :        135 :         m_bIsNull= sal_False;
     217                 :        135 :         ReadCommon(pStrm);
     218                 :        135 :         m_SilverBullet.ReadIndexed(pStrm);
     219                 :            :     }
     220                 :            :     else
     221                 :         81 :         m_bIsNull = sal_True;
     222                 :            : 
     223                 :        216 :     pStrm->SkipExtra();
     224                 :        216 : }
     225                 :          0 : void LwpBulletOverride::OverrideSkip(sal_Bool bOver)
     226                 :            : {
     227         [ #  # ]:          0 :     if (bOver)
     228                 :            :     {
     229                 :          0 :         LwpOverride::Override(BO_SKIP, STATE_ON);
     230                 :            :     }
     231                 :            :     else
     232                 :            :     {
     233                 :          0 :         LwpOverride::Override(BO_SKIP, STATE_OFF);
     234                 :            :     }
     235                 :          0 : }
     236                 :            : 
     237                 :          0 : void LwpBulletOverride::OverrideRightAligned(sal_Bool bOver)
     238                 :            : {
     239         [ #  # ]:          0 :     if(bOver)
     240                 :            :     {
     241                 :          0 :         LwpOverride::Override(BO_RIGHTALIGN,STATE_ON);
     242                 :            :     }
     243                 :            :     else
     244                 :            :     {
     245                 :          0 :         LwpOverride::Override(BO_RIGHTALIGN,STATE_OFF);
     246                 :            :     }
     247                 :          0 : }
     248                 :            : 
     249                 :         12 : void LwpBulletOverride::OverrideSilverBullet(LwpObjectID aID)
     250                 :            : {
     251         [ +  - ]:         12 :     if (!aID.IsNull())
     252                 :            :     {
     253                 :         12 :         m_SilverBullet = aID;
     254                 :            :     }
     255                 :            : 
     256                 :         12 :     LwpOverride::Override(BO_SILVERBULLET,STATE_ON);
     257                 :         12 : }
     258                 :            : 
     259                 :         12 : void LwpBulletOverride::Override(LwpBulletOverride* pOther)
     260                 :            : {
     261         [ +  - ]:         12 :     if (m_nApply & BO_SILVERBULLET)
     262                 :            :     {
     263         [ +  - ]:         12 :         if (IsSilverBulletOverridden())
     264                 :            :         {
     265                 :         12 :             pOther->OverrideSilverBullet(m_SilverBullet);
     266                 :            :         }
     267                 :            :         else
     268                 :            :         {
     269                 :          0 :             pOther->RevertSilverBullet();
     270                 :            :         }
     271                 :            :     }
     272                 :            : 
     273         [ -  + ]:         12 :     if (m_nApply & BO_SKIP)
     274                 :            :     {
     275         [ #  # ]:          0 :         if (IsSkipOverridden())
     276                 :            :         {
     277                 :          0 :             pOther->OverrideSkip(IsSkip());
     278                 :            :         }
     279                 :            :         else
     280                 :            :         {
     281                 :          0 :             pOther->RevertSkip();
     282                 :            :         }
     283                 :            :     }
     284                 :            : 
     285         [ -  + ]:         12 :     if (m_nApply & BO_RIGHTALIGN)
     286                 :            :     {
     287         [ #  # ]:          0 :         if (IsRightAlignedOverridden())
     288                 :            :         {
     289                 :          0 :             pOther->OverrideRightAligned(IsRightAligned());
     290                 :            :         }
     291                 :            :         else
     292                 :            :         {
     293                 :          0 :             pOther->RevertRightAligned();
     294                 :            :         }
     295                 :            :     }
     296                 :            : 
     297                 :         12 : }
     298                 :            : 
     299                 :            : /*class LwpAlignmentOverride*/
     300                 :         12 : LwpAlignmentOverride::LwpAlignmentOverride(LwpAlignmentOverride const& rOther)
     301                 :            :     : LwpOverride(rOther)
     302                 :            :     , m_nAlignType(rOther.m_nAlignType)
     303                 :            :     , m_nPosition(rOther.m_nPosition)
     304                 :         12 :     , m_nAlignChar(rOther.m_nAlignChar)
     305                 :            : {
     306                 :         12 : }
     307                 :            : 
     308                 :         12 : LwpAlignmentOverride* LwpAlignmentOverride::clone() const
     309                 :            : {
     310                 :         12 :     return new LwpAlignmentOverride(*this);
     311                 :            : }
     312                 :            : 
     313                 :         51 : void LwpAlignmentOverride::Read(LwpObjectStream * pStrm)
     314                 :            : {
     315         [ +  - ]:         51 :     if (pStrm->QuickReadBool())
     316                 :            :     {
     317                 :         51 :         ReadCommon(pStrm);
     318                 :         51 :         m_nAlignType = static_cast<AlignType>(pStrm->QuickReaduInt8());
     319                 :         51 :         m_nPosition = pStrm->QuickReaduInt32();
     320                 :         51 :         m_nAlignChar = pStrm->QuickReaduInt16();
     321                 :            :     }
     322                 :            : 
     323                 :         51 :     pStrm->SkipExtra();
     324                 :         51 : }
     325                 :            : 
     326                 :            : /*class LwpSpacingCommonOverride*/
     327                 :       1344 : LwpSpacingCommonOverride::LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther)
     328                 :            :     : LwpOverride(rOther)
     329                 :            :     , m_nSpacingType(rOther.m_nSpacingType)
     330                 :            :     , m_nAmount(rOther.m_nAmount)
     331                 :       1344 :     , m_nMultiple(rOther.m_nMultiple)
     332                 :            : {
     333                 :       1344 : }
     334                 :            : 
     335                 :       1344 : LwpSpacingCommonOverride* LwpSpacingCommonOverride::clone() const
     336                 :            : {
     337                 :       1344 :     return new LwpSpacingCommonOverride(*this);
     338                 :            : }
     339                 :            : 
     340                 :        312 : void LwpSpacingCommonOverride::Read(LwpObjectStream* pStrm)
     341                 :            : {
     342         [ +  + ]:        312 :     if (pStrm->QuickReadBool())
     343                 :            :     {
     344                 :        261 :         ReadCommon(pStrm);
     345                 :        261 :         m_nSpacingType = static_cast<SpacingType>(pStrm->QuickReaduInt16());
     346                 :        261 :         m_nAmount = pStrm->QuickReadInt32();
     347                 :        261 :         m_nMultiple = pStrm->QuickReadInt32();
     348                 :            :     }
     349                 :            : 
     350                 :        312 :     pStrm->SkipExtra();
     351                 :        312 : }
     352                 :            : 
     353                 :            : /*class LwpSpacingOverride*/
     354                 :         78 : LwpSpacingOverride::LwpSpacingOverride() :
     355                 :         78 : m_pSpacing(new LwpSpacingCommonOverride),
     356                 :         78 : m_pAboveLineSpacing(new LwpSpacingCommonOverride),
     357                 :         78 : m_pParaSpacingAbove(new LwpSpacingCommonOverride),
     358   [ +  -  +  -  :        312 : m_pParaSpacingBelow(new LwpSpacingCommonOverride)
             +  -  +  - ]
     359                 :            : {
     360                 :         78 : }
     361                 :            : 
     362                 :        414 : LwpSpacingOverride::~LwpSpacingOverride()
     363                 :            : {
     364         [ +  - ]:        414 :     if (m_pSpacing)
     365                 :            :     {
     366 [ +  - ][ +  - ]:        414 :         delete m_pSpacing;
     367                 :            :     }
     368         [ +  - ]:        414 :     if (m_pAboveLineSpacing)
     369                 :            :     {
     370 [ +  - ][ +  - ]:        414 :         delete m_pAboveLineSpacing;
     371                 :            :     }
     372         [ +  - ]:        414 :     if (m_pParaSpacingAbove)
     373                 :            :     {
     374 [ +  - ][ +  - ]:        414 :         delete m_pParaSpacingAbove;
     375                 :            :     }
     376         [ +  - ]:        414 :     if (m_pParaSpacingBelow)
     377                 :            :     {
     378 [ +  - ][ +  - ]:        414 :         delete m_pParaSpacingBelow;
     379                 :            :     }
     380         [ -  + ]:        828 : }
     381                 :            : 
     382                 :        336 : LwpSpacingOverride::LwpSpacingOverride(LwpSpacingOverride const& rOther)
     383                 :            :     : LwpOverride(rOther)
     384                 :            :     , m_pSpacing(0)
     385                 :            :     , m_pAboveLineSpacing(0)
     386                 :            :     , m_pParaSpacingAbove(0)
     387                 :        336 :     , m_pParaSpacingBelow(0)
     388                 :            : {
     389                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     390         [ +  - ]:        336 :     std::auto_ptr<LwpSpacingCommonOverride> pSpacing(::clone(rOther.m_pSpacing));
     391         [ +  - ]:        336 :     std::auto_ptr<LwpSpacingCommonOverride> pAboveLineSpacing(::clone(rOther.m_pAboveLineSpacing));
     392         [ +  - ]:        336 :     std::auto_ptr<LwpSpacingCommonOverride> pParaSpacingAbove(::clone(rOther.m_pParaSpacingAbove));
     393         [ +  - ]:        336 :     std::auto_ptr<LwpSpacingCommonOverride> pParaSpacingBelow(::clone(rOther.m_pParaSpacingBelow));
     394                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     395                 :        336 :     m_pSpacing = pSpacing.release();
     396                 :        336 :     m_pAboveLineSpacing = pAboveLineSpacing.release();
     397                 :        336 :     m_pParaSpacingAbove = pParaSpacingAbove.release();
     398 [ +  - ][ +  - ]:        336 :     m_pParaSpacingBelow = pParaSpacingBelow.release();
         [ +  - ][ +  - ]
     399                 :        336 : }
     400                 :            : 
     401                 :        336 : LwpSpacingOverride* LwpSpacingOverride::clone() const
     402                 :            : {
     403         [ +  - ]:        336 :     return new LwpSpacingOverride(*this);
     404                 :            : }
     405                 :            : 
     406                 :         78 : void LwpSpacingOverride::Read(LwpObjectStream* pStrm)
     407                 :            : {
     408         [ +  - ]:         78 :     if (pStrm->QuickReadBool())
     409                 :            :     {
     410                 :         78 :         ReadCommon(pStrm);
     411                 :         78 :         m_pSpacing->Read(pStrm);
     412         [ +  - ]:         78 :         if (LwpFileHeader::m_nFileRevision >= 0x000d)
     413                 :            :         {
     414                 :         78 :             m_pAboveLineSpacing->Read(pStrm);
     415                 :            :         }
     416                 :         78 :         m_pParaSpacingAbove->Read(pStrm);
     417                 :         78 :         m_pParaSpacingBelow->Read(pStrm);
     418                 :            :     }
     419                 :            : 
     420                 :         78 :     pStrm->SkipExtra();
     421                 :         78 : }
     422                 :            : 
     423                 :            : /*class LwpIndentOverride*/
     424                 :       1350 : LwpIndentOverride::LwpIndentOverride(LwpIndentOverride const& rOther)
     425                 :            :     : LwpOverride(rOther)
     426                 :            :     , m_nAll(rOther.m_nAll)
     427                 :            :     , m_nFirst(rOther.m_nFirst)
     428                 :            :     , m_nRest(rOther.m_nRest)
     429                 :       1350 :     , m_nRight(rOther.m_nRight)
     430                 :            : {
     431                 :       1350 : }
     432                 :            : 
     433                 :       1350 : LwpIndentOverride* LwpIndentOverride::clone() const
     434                 :            : {
     435                 :       1350 :     return new LwpIndentOverride(*this);
     436                 :            : }
     437                 :            : 
     438                 :         72 : void LwpIndentOverride::Read(LwpObjectStream* pStrm)
     439                 :            : {
     440         [ +  - ]:         72 :     if (pStrm->QuickReadBool())
     441                 :            :     {
     442                 :         72 :         ReadCommon(pStrm);
     443                 :            : 
     444                 :         72 :         m_nAll = pStrm->QuickReadInt32();
     445                 :         72 :         m_nFirst = pStrm->QuickReadInt32();
     446                 :         72 :         m_nRest = pStrm->QuickReadInt32();
     447                 :         72 :         m_nRight = pStrm->QuickReadInt32();
     448                 :            :     }
     449                 :            : 
     450                 :         72 :     pStrm->SkipExtra();
     451                 :         72 : }
     452                 :            : 
     453                 :            : 
     454                 :            : /*class LwpAmikakeOverride*/
     455                 :        204 : LwpAmikakeOverride::LwpAmikakeOverride() :
     456         [ +  - ]:        204 : m_pBackgroundStuff(new LwpBackgroundStuff), m_nType(AMIKAKE_NONE)
     457                 :            : {
     458                 :        204 : }
     459                 :            : 
     460                 :        204 : LwpAmikakeOverride::~LwpAmikakeOverride()
     461                 :            : {
     462         [ +  - ]:        204 :     if (m_pBackgroundStuff)
     463                 :            :     {
     464         [ +  - ]:        204 :         delete m_pBackgroundStuff;
     465                 :            :     }
     466         [ -  + ]:        408 : }
     467                 :            : 
     468                 :          0 : LwpAmikakeOverride::LwpAmikakeOverride(LwpAmikakeOverride const& rOther)
     469                 :            :     : LwpOverride(rOther)
     470                 :            :     , m_pBackgroundStuff(0)
     471                 :          0 :     , m_nType(rOther.m_nType)
     472                 :            : {
     473                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     474         [ #  # ]:          0 :     std::auto_ptr<LwpBackgroundStuff> pBackgroundStuff(::clone(rOther.m_pBackgroundStuff));
     475                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     476                 :          0 :     m_pBackgroundStuff = pBackgroundStuff.release();
     477                 :          0 : }
     478                 :            : 
     479                 :          0 : LwpAmikakeOverride* LwpAmikakeOverride::clone() const
     480                 :            : {
     481         [ #  # ]:          0 :     return new LwpAmikakeOverride(*this);
     482                 :            : }
     483                 :            : 
     484                 :          0 : void LwpAmikakeOverride::Read(LwpObjectStream* pStrm)
     485                 :            : {
     486         [ #  # ]:          0 :     if (pStrm->QuickReadBool())
     487                 :            :     {
     488                 :          0 :         ReadCommon(pStrm);
     489                 :          0 :         m_pBackgroundStuff->Read(pStrm);
     490                 :            :     }
     491                 :            :     else
     492                 :            :     {
     493                 :          0 :         Clear();
     494                 :            :     }
     495                 :            : 
     496         [ #  # ]:          0 :     if (pStrm->CheckExtra())
     497                 :            :     {
     498                 :          0 :         m_nType = pStrm->QuickReaduInt16();
     499                 :          0 :         pStrm->SkipExtra();
     500                 :            :     }
     501                 :            :     else
     502                 :            :     {
     503                 :          0 :         m_nType = AMIKAKE_NONE;
     504                 :            :     }
     505                 :          0 : }
     506                 :            : 
     507                 :         12 : void LwpAlignmentOverride::Override(LwpAlignmentOverride* other)//add by  1-24
     508                 :            : {
     509         [ +  - ]:         12 :     if (m_nOverride & AO_TYPE)
     510                 :            :     {
     511                 :         12 :         other->OverrideAlignment(m_nAlignType);
     512                 :            :     }
     513                 :            : /*  if (m_nOverride & AO_POSITION)
     514                 :            :     {
     515                 :            :         Other->OverridePosition(GetPosition());
     516                 :            :     }
     517                 :            :     if (m_nOverride & AO_CHAR)
     518                 :            :     {
     519                 :            :         Other->OverrideAlignChar(GetAlignChar());
     520                 :            :     }
     521                 :            : */
     522                 :         12 : }
     523                 :            : 
     524                 :         12 : void LwpAlignmentOverride::OverrideAlignment(AlignType val)//add by  1-24
     525                 :            : {
     526                 :         12 :     m_nAlignType = val;
     527                 :         12 :     m_nOverride |= AO_TYPE;
     528                 :         12 : }
     529                 :            : 
     530                 :        303 : void LwpIndentOverride::Override(LwpIndentOverride* other)
     531                 :            : {
     532         [ +  + ]:        303 :     if(m_nOverride & IO_ALL)
     533                 :        291 :         other->OverrideIndentAll(m_nAll);
     534         [ +  + ]:        303 :     if(m_nOverride & IO_FIRST)
     535                 :        300 :         other->OverrideIndentFirst(m_nFirst);
     536         [ +  + ]:        303 :     if(m_nOverride & IO_RIGHT)
     537                 :        288 :         other->OverrideIndentRight(m_nRight);
     538         [ +  + ]:        303 :     if(m_nOverride & IO_REST)
     539                 :        300 :         other->OverrideIndentRest(m_nRest);
     540         [ +  + ]:        303 :     if(m_nOverride & IO_USE_RELATIVE)
     541                 :          6 :         other->OverrideUseRelative(IsUseRelative());
     542         [ -  + ]:        303 :     if (m_nOverride & IO_REL_FLAGS)
     543                 :          0 :         other->OverrideRelative(GetRelative());
     544                 :        303 : }
     545                 :            : 
     546                 :          0 : sal_uInt16 LwpIndentOverride::GetRelative()
     547                 :            : {
     548         [ #  # ]:          0 :     if ((m_nOverride & IO_REL_FLAGS) == IO_REL_FIRST)
     549                 :          0 :         return RELATIVE_FIRST;
     550         [ #  # ]:          0 :     else if ((m_nOverride & IO_REL_FLAGS) == IO_REL_ALL)
     551                 :          0 :         return RELATIVE_ALL;
     552                 :          0 :     return RELATIVE_REST;
     553                 :            : }
     554                 :            : 
     555                 :        930 : sal_Bool LwpIndentOverride::IsUseRelative()
     556                 :            : {
     557                 :        930 :     return (m_nValues & IO_USE_RELATIVE) != 0;
     558                 :            : }
     559                 :            : 
     560                 :        291 : void LwpIndentOverride::OverrideIndentAll(sal_Int32 val)
     561                 :            : {
     562                 :        291 :     m_nAll = val;
     563                 :        291 :     m_nOverride |= IO_ALL;
     564                 :        291 : }
     565                 :            : 
     566                 :        300 : void LwpIndentOverride::OverrideIndentFirst(sal_Int32 val)
     567                 :            : {
     568                 :        300 :     m_nFirst = val;
     569                 :        300 :     m_nOverride |= IO_FIRST;
     570                 :        300 : }
     571                 :            : 
     572                 :        288 : void LwpIndentOverride::OverrideIndentRight(sal_Int32 val)
     573                 :            : {
     574                 :        288 :     m_nRight = val;
     575                 :        288 :     m_nOverride |= IO_RIGHT;
     576                 :        288 : }
     577                 :            : 
     578                 :        300 : void LwpIndentOverride::OverrideIndentRest(sal_Int32 val)
     579                 :            : {
     580                 :        300 :     m_nRest = val;
     581                 :            : //    m_nAll = val;
     582                 :            : //    m_nFirst = 0-val;
     583                 :        300 :     m_nOverride |= IO_REST;
     584                 :        300 : }
     585                 :            : 
     586                 :          6 : void LwpIndentOverride::OverrideUseRelative(sal_Bool use)
     587                 :            : {
     588         [ -  + ]:          6 :     if (use)
     589                 :            :     {
     590                 :          0 :         m_nOverride |= IO_USE_RELATIVE;
     591                 :          0 :         m_nValues |= IO_USE_RELATIVE;
     592                 :            :     }
     593                 :            :     else
     594                 :            :     {
     595                 :          6 :         m_nOverride &= ~IO_USE_RELATIVE;
     596                 :          6 :         m_nValues &= ~IO_USE_RELATIVE;
     597                 :            :     }
     598                 :          6 : }
     599                 :            : 
     600                 :          0 : void LwpIndentOverride::OverrideRelative(sal_uInt16 relative)
     601                 :            : {
     602                 :            :     sal_uInt16 Flag;
     603                 :            : 
     604         [ #  # ]:          0 :     if (relative == RELATIVE_FIRST)
     605                 :          0 :         Flag = IO_REL_FIRST;
     606         [ #  # ]:          0 :     else if (relative == RELATIVE_ALL)
     607                 :          0 :         Flag = IO_REL_ALL;
     608                 :            :     else
     609                 :          0 :         Flag = IO_REL_REST;
     610                 :            : 
     611                 :          0 :     m_nOverride &= ~IO_REL_FLAGS;
     612                 :          0 :     m_nOverride |= Flag;
     613                 :          0 : }
     614                 :            : 
     615                 :        336 : void LwpSpacingOverride::Override(LwpSpacingOverride* other)
     616                 :            : {
     617         [ +  - ]:        336 :     if (other)
     618                 :            :     {
     619                 :        336 :         m_pSpacing->Override(other->GetSpacing());
     620                 :        336 :         m_pAboveLineSpacing->Override(other->GetAboveLineSpacing());
     621                 :        336 :         m_pParaSpacingAbove->Override(other->GetAboveSpacing());
     622                 :        336 :         m_pParaSpacingBelow->Override(other->GetBelowSpacing());
     623                 :            :     }
     624                 :        336 : }
     625                 :            : 
     626                 :       1344 : void LwpSpacingCommonOverride::Override(LwpSpacingCommonOverride* other)
     627                 :            : {
     628         [ +  + ]:       1344 :     if (m_nOverride & SPO_TYPE)
     629                 :        954 :         other->OverrideType(m_nSpacingType);
     630         [ +  + ]:       1344 :     if (m_nOverride & SPO_AMOUNT)
     631                 :        954 :         other->OverrideAmount(m_nAmount);
     632         [ +  + ]:       1344 :     if (m_nOverride & SPO_MULTIPLE)
     633                 :        873 :         other->OverrideMultiple(m_nMultiple);
     634                 :       1344 : }
     635                 :            : 
     636                 :        954 : void LwpSpacingCommonOverride::OverrideType(SpacingType val)
     637                 :            : {
     638                 :        954 :     m_nSpacingType = val;
     639                 :        954 :     m_nOverride |= SPO_TYPE;
     640                 :        954 : }
     641                 :            : 
     642                 :        954 : void LwpSpacingCommonOverride::OverrideAmount(sal_Int32 val)
     643                 :            : {
     644                 :        954 :     m_nAmount = val;
     645                 :        954 :     m_nOverride |= SPO_AMOUNT;
     646                 :        954 : }
     647                 :            : 
     648                 :        873 : void LwpSpacingCommonOverride::OverrideMultiple(sal_Int32 val)
     649                 :            : {
     650                 :        873 :     m_nMultiple = val;
     651                 :        873 :     m_nOverride |= SPO_MULTIPLE;
     652                 :        873 : }
     653                 :            : 
     654                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10