LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwpoverride.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 295 0.0 %
Date: 2014-04-14 Functions: 0 58 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             :  * 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           0 : LwpOverride::LwpOverride(LwpOverride const& rOther)
      77             :     : m_nValues(rOther.m_nValues)
      78             :     , m_nOverride(rOther.m_nOverride)
      79           0 :     , m_nApply(rOther.m_nApply)
      80             : {
      81           0 : }
      82             : 
      83           0 : void LwpOverride::ReadCommon(LwpObjectStream* pStrm)
      84             : {
      85           0 :     m_nValues = pStrm->QuickReaduInt16();
      86           0 :     m_nOverride = pStrm->QuickReaduInt16();
      87           0 :     m_nApply = pStrm->QuickReaduInt16();
      88           0 :     pStrm->SkipExtra();
      89           0 : }
      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           0 : void LwpOverride::Override(sal_uInt16 nBits, STATE eState)
      99             : {
     100           0 :     if (eState == STATE_STYLE)
     101             :     {
     102           0 :         m_nValues &= ~nBits;
     103           0 :         m_nOverride &= ~nBits;
     104             :     }
     105             :     else
     106             :     {
     107           0 :         m_nOverride |= nBits;
     108           0 :         if (eState == STATE_ON)
     109             :         {
     110           0 :             m_nValues |= nBits;
     111             :         }
     112             :         else    /* State == STATE_OFF */
     113             :         {
     114           0 :             m_nValues &= ~nBits;
     115             :         }
     116             :     }
     117           0 :     m_nApply |= nBits;
     118           0 : }
     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           0 : void LwpTextLanguageOverride::Read(LwpObjectStream* pStrm)
     133             : {
     134           0 :     if (pStrm->QuickReadBool())
     135             :     {
     136           0 :         ReadCommon(pStrm);
     137           0 :         m_nLanguage = pStrm->QuickReaduInt16();
     138             :     }
     139             : 
     140           0 :     pStrm->SkipExtra();
     141             : 
     142           0 : }
     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           0 : void LwpTextAttributeOverride::Read(LwpObjectStream* pStrm)
     158             : {
     159           0 :     if (pStrm->QuickReadBool())
     160             :     {
     161           0 :         ReadCommon(pStrm);
     162           0 :         m_nHideLevels = pStrm->QuickReaduInt16();
     163             : 
     164           0 :         if (LwpFileHeader::m_nFileRevision > 0x000A)
     165           0 :             m_nBaseLineOffset = pStrm->QuickReaduInt32();
     166             :     }
     167             : 
     168           0 :     pStrm->SkipExtra();
     169           0 : }
     170             : 
     171           0 : sal_Bool LwpTextAttributeOverride::IsHighlight()
     172             : {
     173           0 :     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           0 : void LwpKinsokuOptsOverride::Read(LwpObjectStream* pStrm)
     189             : {
     190           0 :     if (pStrm->QuickReadBool())
     191             :     {
     192           0 :         ReadCommon(pStrm);
     193           0 :         m_nLevels = pStrm->QuickReaduInt16();
     194             :     }
     195             : 
     196           0 :     pStrm->SkipExtra();
     197           0 : }
     198             : 
     199             : /*class LwpBulletOverride*/
     200           0 : LwpBulletOverride::LwpBulletOverride(LwpBulletOverride const& rOther)
     201             :     : LwpOverride(rOther)
     202             :     , m_SilverBullet(rOther.m_SilverBullet)
     203           0 :     , m_bIsNull(rOther.m_bIsNull)
     204             : {
     205           0 : }
     206             : 
     207           0 : LwpBulletOverride* LwpBulletOverride::clone() const
     208             : {
     209           0 :     return new LwpBulletOverride(*this);
     210             : }
     211             : 
     212           0 : void LwpBulletOverride::Read(LwpObjectStream * pStrm)
     213             : {
     214           0 :     if (pStrm->QuickReadBool())
     215             :     {
     216           0 :         m_bIsNull= sal_False;
     217           0 :         ReadCommon(pStrm);
     218           0 :         m_SilverBullet.ReadIndexed(pStrm);
     219             :     }
     220             :     else
     221           0 :         m_bIsNull = sal_True;
     222             : 
     223           0 :     pStrm->SkipExtra();
     224           0 : }
     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           0 : void LwpBulletOverride::OverrideSilverBullet(LwpObjectID aID)
     250             : {
     251           0 :     if (!aID.IsNull())
     252             :     {
     253           0 :         m_SilverBullet = aID;
     254             :     }
     255             : 
     256           0 :     LwpOverride::Override(BO_SILVERBULLET,STATE_ON);
     257           0 : }
     258             : 
     259           0 : void LwpBulletOverride::Override(LwpBulletOverride* pOther)
     260             : {
     261           0 :     if (m_nApply & BO_SILVERBULLET)
     262             :     {
     263           0 :         if (IsSilverBulletOverridden())
     264             :         {
     265           0 :             pOther->OverrideSilverBullet(m_SilverBullet);
     266             :         }
     267             :         else
     268             :         {
     269           0 :             pOther->RevertSilverBullet();
     270             :         }
     271             :     }
     272             : 
     273           0 :     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           0 :     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           0 : }
     298             : 
     299             : /*class LwpAlignmentOverride*/
     300           0 : LwpAlignmentOverride::LwpAlignmentOverride(LwpAlignmentOverride const& rOther)
     301             :     : LwpOverride(rOther)
     302             :     , m_nAlignType(rOther.m_nAlignType)
     303             :     , m_nPosition(rOther.m_nPosition)
     304           0 :     , m_nAlignChar(rOther.m_nAlignChar)
     305             : {
     306           0 : }
     307             : 
     308           0 : LwpAlignmentOverride* LwpAlignmentOverride::clone() const
     309             : {
     310           0 :     return new LwpAlignmentOverride(*this);
     311             : }
     312             : 
     313           0 : void LwpAlignmentOverride::Read(LwpObjectStream * pStrm)
     314             : {
     315           0 :     if (pStrm->QuickReadBool())
     316             :     {
     317           0 :         ReadCommon(pStrm);
     318           0 :         m_nAlignType = static_cast<AlignType>(pStrm->QuickReaduInt8());
     319           0 :         m_nPosition = pStrm->QuickReaduInt32();
     320           0 :         m_nAlignChar = pStrm->QuickReaduInt16();
     321             :     }
     322             : 
     323           0 :     pStrm->SkipExtra();
     324           0 : }
     325             : 
     326             : /*class LwpSpacingCommonOverride*/
     327           0 : LwpSpacingCommonOverride::LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther)
     328             :     : LwpOverride(rOther)
     329             :     , m_nSpacingType(rOther.m_nSpacingType)
     330             :     , m_nAmount(rOther.m_nAmount)
     331           0 :     , m_nMultiple(rOther.m_nMultiple)
     332             : {
     333           0 : }
     334             : 
     335           0 : LwpSpacingCommonOverride* LwpSpacingCommonOverride::clone() const
     336             : {
     337           0 :     return new LwpSpacingCommonOverride(*this);
     338             : }
     339             : 
     340           0 : void LwpSpacingCommonOverride::Read(LwpObjectStream* pStrm)
     341             : {
     342           0 :     if (pStrm->QuickReadBool())
     343             :     {
     344           0 :         ReadCommon(pStrm);
     345           0 :         m_nSpacingType = static_cast<SpacingType>(pStrm->QuickReaduInt16());
     346           0 :         m_nAmount = pStrm->QuickReadInt32();
     347           0 :         m_nMultiple = pStrm->QuickReadInt32();
     348             :     }
     349             : 
     350           0 :     pStrm->SkipExtra();
     351           0 : }
     352             : 
     353             : /*class LwpSpacingOverride*/
     354           0 : LwpSpacingOverride::LwpSpacingOverride() :
     355           0 : m_pSpacing(new LwpSpacingCommonOverride),
     356           0 : m_pAboveLineSpacing(new LwpSpacingCommonOverride),
     357           0 : m_pParaSpacingAbove(new LwpSpacingCommonOverride),
     358           0 : m_pParaSpacingBelow(new LwpSpacingCommonOverride)
     359             : {
     360           0 : }
     361             : 
     362           0 : LwpSpacingOverride::~LwpSpacingOverride()
     363             : {
     364           0 :     if (m_pSpacing)
     365             :     {
     366           0 :         delete m_pSpacing;
     367             :     }
     368           0 :     if (m_pAboveLineSpacing)
     369             :     {
     370           0 :         delete m_pAboveLineSpacing;
     371             :     }
     372           0 :     if (m_pParaSpacingAbove)
     373             :     {
     374           0 :         delete m_pParaSpacingAbove;
     375             :     }
     376           0 :     if (m_pParaSpacingBelow)
     377             :     {
     378           0 :         delete m_pParaSpacingBelow;
     379             :     }
     380           0 : }
     381             : 
     382           0 : LwpSpacingOverride::LwpSpacingOverride(LwpSpacingOverride const& rOther)
     383             :     : LwpOverride(rOther)
     384             :     , m_pSpacing(0)
     385             :     , m_pAboveLineSpacing(0)
     386             :     , m_pParaSpacingAbove(0)
     387           0 :     , m_pParaSpacingBelow(0)
     388             : {
     389             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     390           0 :     std::auto_ptr<LwpSpacingCommonOverride> pSpacing(::clone(rOther.m_pSpacing));
     391           0 :     std::auto_ptr<LwpSpacingCommonOverride> pAboveLineSpacing(::clone(rOther.m_pAboveLineSpacing));
     392           0 :     std::auto_ptr<LwpSpacingCommonOverride> pParaSpacingAbove(::clone(rOther.m_pParaSpacingAbove));
     393           0 :     std::auto_ptr<LwpSpacingCommonOverride> pParaSpacingBelow(::clone(rOther.m_pParaSpacingBelow));
     394             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     395           0 :     m_pSpacing = pSpacing.release();
     396           0 :     m_pAboveLineSpacing = pAboveLineSpacing.release();
     397           0 :     m_pParaSpacingAbove = pParaSpacingAbove.release();
     398           0 :     m_pParaSpacingBelow = pParaSpacingBelow.release();
     399           0 : }
     400             : 
     401           0 : LwpSpacingOverride* LwpSpacingOverride::clone() const
     402             : {
     403           0 :     return new LwpSpacingOverride(*this);
     404             : }
     405             : 
     406           0 : void LwpSpacingOverride::Read(LwpObjectStream* pStrm)
     407             : {
     408           0 :     if (pStrm->QuickReadBool())
     409             :     {
     410           0 :         ReadCommon(pStrm);
     411           0 :         m_pSpacing->Read(pStrm);
     412           0 :         if (LwpFileHeader::m_nFileRevision >= 0x000d)
     413             :         {
     414           0 :             m_pAboveLineSpacing->Read(pStrm);
     415             :         }
     416           0 :         m_pParaSpacingAbove->Read(pStrm);
     417           0 :         m_pParaSpacingBelow->Read(pStrm);
     418             :     }
     419             : 
     420           0 :     pStrm->SkipExtra();
     421           0 : }
     422             : 
     423             : /*class LwpIndentOverride*/
     424           0 : 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           0 :     , m_nRight(rOther.m_nRight)
     430             : {
     431           0 : }
     432             : 
     433           0 : LwpIndentOverride* LwpIndentOverride::clone() const
     434             : {
     435           0 :     return new LwpIndentOverride(*this);
     436             : }
     437             : 
     438           0 : void LwpIndentOverride::Read(LwpObjectStream* pStrm)
     439             : {
     440           0 :     if (pStrm->QuickReadBool())
     441             :     {
     442           0 :         ReadCommon(pStrm);
     443             : 
     444           0 :         m_nAll = pStrm->QuickReadInt32();
     445           0 :         m_nFirst = pStrm->QuickReadInt32();
     446           0 :         m_nRest = pStrm->QuickReadInt32();
     447           0 :         m_nRight = pStrm->QuickReadInt32();
     448             :     }
     449             : 
     450           0 :     pStrm->SkipExtra();
     451           0 : }
     452             : 
     453             : /*class LwpAmikakeOverride*/
     454           0 : LwpAmikakeOverride::LwpAmikakeOverride() :
     455           0 : m_pBackgroundStuff(new LwpBackgroundStuff), m_nType(AMIKAKE_NONE)
     456             : {
     457           0 : }
     458             : 
     459           0 : LwpAmikakeOverride::~LwpAmikakeOverride()
     460             : {
     461           0 :     if (m_pBackgroundStuff)
     462             :     {
     463           0 :         delete m_pBackgroundStuff;
     464             :     }
     465           0 : }
     466             : 
     467           0 : LwpAmikakeOverride::LwpAmikakeOverride(LwpAmikakeOverride const& rOther)
     468             :     : LwpOverride(rOther)
     469             :     , m_pBackgroundStuff(0)
     470           0 :     , m_nType(rOther.m_nType)
     471             : {
     472             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     473           0 :     std::auto_ptr<LwpBackgroundStuff> pBackgroundStuff(::clone(rOther.m_pBackgroundStuff));
     474             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     475           0 :     m_pBackgroundStuff = pBackgroundStuff.release();
     476           0 : }
     477             : 
     478           0 : LwpAmikakeOverride* LwpAmikakeOverride::clone() const
     479             : {
     480           0 :     return new LwpAmikakeOverride(*this);
     481             : }
     482             : 
     483           0 : void LwpAmikakeOverride::Read(LwpObjectStream* pStrm)
     484             : {
     485           0 :     if (pStrm->QuickReadBool())
     486             :     {
     487           0 :         ReadCommon(pStrm);
     488           0 :         m_pBackgroundStuff->Read(pStrm);
     489             :     }
     490             :     else
     491             :     {
     492           0 :         Clear();
     493             :     }
     494             : 
     495           0 :     if (pStrm->CheckExtra())
     496             :     {
     497           0 :         m_nType = pStrm->QuickReaduInt16();
     498           0 :         pStrm->SkipExtra();
     499             :     }
     500             :     else
     501             :     {
     502           0 :         m_nType = AMIKAKE_NONE;
     503             :     }
     504           0 : }
     505             : 
     506           0 : void LwpAlignmentOverride::Override(LwpAlignmentOverride* other)//add by  1-24
     507             : {
     508           0 :     if (m_nOverride & AO_TYPE)
     509             :     {
     510           0 :         other->OverrideAlignment(m_nAlignType);
     511             :     }
     512             : /*  if (m_nOverride & AO_POSITION)
     513             :     {
     514             :         Other->OverridePosition(GetPosition());
     515             :     }
     516             :     if (m_nOverride & AO_CHAR)
     517             :     {
     518             :         Other->OverrideAlignChar(GetAlignChar());
     519             :     }
     520             : */
     521           0 : }
     522             : 
     523           0 : void LwpAlignmentOverride::OverrideAlignment(AlignType val)//add by  1-24
     524             : {
     525           0 :     m_nAlignType = val;
     526           0 :     m_nOverride |= AO_TYPE;
     527           0 : }
     528             : 
     529           0 : void LwpIndentOverride::Override(LwpIndentOverride* other)
     530             : {
     531           0 :     if(m_nOverride & IO_ALL)
     532           0 :         other->OverrideIndentAll(m_nAll);
     533           0 :     if(m_nOverride & IO_FIRST)
     534           0 :         other->OverrideIndentFirst(m_nFirst);
     535           0 :     if(m_nOverride & IO_RIGHT)
     536           0 :         other->OverrideIndentRight(m_nRight);
     537           0 :     if(m_nOverride & IO_REST)
     538           0 :         other->OverrideIndentRest(m_nRest);
     539           0 :     if(m_nOverride & IO_USE_RELATIVE)
     540           0 :         other->OverrideUseRelative(IsUseRelative());
     541           0 :     if (m_nOverride & IO_REL_FLAGS)
     542           0 :         other->OverrideRelative(GetRelative());
     543           0 : }
     544             : 
     545           0 : sal_uInt16 LwpIndentOverride::GetRelative()
     546             : {
     547           0 :     if ((m_nOverride & IO_REL_FLAGS) == IO_REL_FIRST)
     548           0 :         return RELATIVE_FIRST;
     549           0 :     else if ((m_nOverride & IO_REL_FLAGS) == IO_REL_ALL)
     550           0 :         return RELATIVE_ALL;
     551           0 :     return RELATIVE_REST;
     552             : }
     553             : 
     554           0 : sal_Bool LwpIndentOverride::IsUseRelative()
     555             : {
     556           0 :     return (m_nValues & IO_USE_RELATIVE) != 0;
     557             : }
     558             : 
     559           0 : void LwpIndentOverride::OverrideIndentAll(sal_Int32 val)
     560             : {
     561           0 :     m_nAll = val;
     562           0 :     m_nOverride |= IO_ALL;
     563           0 : }
     564             : 
     565           0 : void LwpIndentOverride::OverrideIndentFirst(sal_Int32 val)
     566             : {
     567           0 :     m_nFirst = val;
     568           0 :     m_nOverride |= IO_FIRST;
     569           0 : }
     570             : 
     571           0 : void LwpIndentOverride::OverrideIndentRight(sal_Int32 val)
     572             : {
     573           0 :     m_nRight = val;
     574           0 :     m_nOverride |= IO_RIGHT;
     575           0 : }
     576             : 
     577           0 : void LwpIndentOverride::OverrideIndentRest(sal_Int32 val)
     578             : {
     579           0 :     m_nRest = val;
     580             : //    m_nAll = val;
     581             : //    m_nFirst = 0-val;
     582           0 :     m_nOverride |= IO_REST;
     583           0 : }
     584             : 
     585           0 : void LwpIndentOverride::OverrideUseRelative(sal_Bool use)
     586             : {
     587           0 :     if (use)
     588             :     {
     589           0 :         m_nOverride |= IO_USE_RELATIVE;
     590           0 :         m_nValues |= IO_USE_RELATIVE;
     591             :     }
     592             :     else
     593             :     {
     594           0 :         m_nOverride &= ~IO_USE_RELATIVE;
     595           0 :         m_nValues &= ~IO_USE_RELATIVE;
     596             :     }
     597           0 : }
     598             : 
     599           0 : void LwpIndentOverride::OverrideRelative(sal_uInt16 relative)
     600             : {
     601             :     sal_uInt16 Flag;
     602             : 
     603           0 :     if (relative == RELATIVE_FIRST)
     604           0 :         Flag = IO_REL_FIRST;
     605           0 :     else if (relative == RELATIVE_ALL)
     606           0 :         Flag = IO_REL_ALL;
     607             :     else
     608           0 :         Flag = IO_REL_REST;
     609             : 
     610           0 :     m_nOverride &= ~IO_REL_FLAGS;
     611           0 :     m_nOverride |= Flag;
     612           0 : }
     613             : 
     614           0 : void LwpSpacingOverride::Override(LwpSpacingOverride* other)
     615             : {
     616           0 :     if (other)
     617             :     {
     618           0 :         m_pSpacing->Override(other->GetSpacing());
     619           0 :         m_pAboveLineSpacing->Override(other->GetAboveLineSpacing());
     620           0 :         m_pParaSpacingAbove->Override(other->GetAboveSpacing());
     621           0 :         m_pParaSpacingBelow->Override(other->GetBelowSpacing());
     622             :     }
     623           0 : }
     624             : 
     625           0 : void LwpSpacingCommonOverride::Override(LwpSpacingCommonOverride* other)
     626             : {
     627           0 :     if (m_nOverride & SPO_TYPE)
     628           0 :         other->OverrideType(m_nSpacingType);
     629           0 :     if (m_nOverride & SPO_AMOUNT)
     630           0 :         other->OverrideAmount(m_nAmount);
     631           0 :     if (m_nOverride & SPO_MULTIPLE)
     632           0 :         other->OverrideMultiple(m_nMultiple);
     633           0 : }
     634             : 
     635           0 : void LwpSpacingCommonOverride::OverrideType(SpacingType val)
     636             : {
     637           0 :     m_nSpacingType = val;
     638           0 :     m_nOverride |= SPO_TYPE;
     639           0 : }
     640             : 
     641           0 : void LwpSpacingCommonOverride::OverrideAmount(sal_Int32 val)
     642             : {
     643           0 :     m_nAmount = val;
     644           0 :     m_nOverride |= SPO_AMOUNT;
     645           0 : }
     646             : 
     647           0 : void LwpSpacingCommonOverride::OverrideMultiple(sal_Int32 val)
     648             : {
     649           0 :     m_nMultiple = val;
     650           0 :     m_nOverride |= SPO_MULTIPLE;
     651           0 : }
     652             : 
     653             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10