LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwppara1.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 218 0.0 %
Date: 2014-04-14 Functions: 0 21 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 <boost/cast.hpp>
      68             : 
      69             : #include "lwppara.hxx"
      70             : #include "lwpglobalmgr.hxx"
      71             : #include "lwpfilehdr.hxx"
      72             : #include "lwpparaproperty.hxx"
      73             : #include "lwptools.hxx"
      74             : #include "lwpparastyle.hxx"
      75             : #include "xfilter/xffont.hxx"
      76             : #include "xfilter/xftextstyle.hxx"
      77             : #include "xfilter/xfstylemanager.hxx"
      78             : #include "xfilter/xfparagraph.hxx"
      79             : #include "xfilter/xftextcontent.hxx"
      80             : #include "xfilter/xftextspan.hxx"
      81             : #include "xfilter/xfmargins.hxx"
      82             : #include "xfilter/xftabstop.hxx"
      83             : #include "xfilter/xflinebreak.hxx"
      84             : #include "xfilter/xfsection.hxx"
      85             : #include "xfilter/xfsectionstyle.hxx"
      86             : #include "xfilter/xfcolor.hxx"
      87             : #include "xfilter/xfhyperlink.hxx"
      88             : #include "lwpcharsetmgr.hxx"
      89             : #include "lwpsection.hxx"
      90             : #include "lwplayout.hxx"
      91             : #include "lwpusewhen.hxx"
      92             : 
      93             : #include "lwpbulletstylemgr.hxx"
      94             : #include "lwpstory.hxx"
      95             : #include "lwpsilverbullet.hxx"
      96             : #include "xfilter/xflist.hxx"
      97             : #include "xfilter/xfframe.hxx"
      98             : 
      99             : #include "lwpdivinfo.hxx"
     100             : #include "lwpdoc.hxx"
     101             : #include "lwpholder.hxx"
     102             : #include "lwppagehint.hxx"
     103             : 
     104             : #include "lwpdropcapmgr.hxx"
     105             : #include "lwptable.hxx"
     106             : #include "lwpcelllayout.hxx"
     107             : 
     108             : // boost::polymorphic_downcast checks and reports (using assert), if the
     109             : // cast is incorrect. We want this in debug builds.
     110             : #if OSL_DEBUG_LEVEL > 0
     111             : #   undef NDEBUG
     112             : #elif !defined(NDEBUG)
     113             : #   define NDEBUG 1
     114             : #endif
     115             : 
     116             : using boost::polymorphic_downcast;
     117             : 
     118             : /**
     119             :  * @short   get text of paragraph
     120             :  */
     121           0 : OUString LwpPara::GetContentText(sal_Bool bAllText)
     122             : {
     123             : //  rFont = m_FontID;
     124           0 :     if (bAllText)
     125             :     {
     126           0 :         m_Fribs.SetPara(this);
     127           0 :         m_Fribs.GatherAllText();
     128           0 :         return m_AllText;
     129             :     }
     130             :     else
     131           0 :         return m_Content;
     132             : }
     133             : 
     134             : /**
     135             :  * @short   set text of paragraph
     136             :  */
     137           0 : void LwpPara::SetAllText(const OUString& sText)
     138             : {
     139           0 :     m_AllText+=sText;
     140           0 : }
     141             : 
     142             : /**
     143             :  * @short   set first frib content
     144             :  */
     145           0 : void LwpPara::SetFirstFrib(const OUString& Content,sal_uInt32 FontID)
     146             : {
     147           0 :     m_FontID= FontID;
     148           0 :     m_Content=Content;
     149           0 : }
     150             : /**
     151             :  * @short   get paragraph xfstyle
     152             :  */
     153           0 : XFParaStyle* LwpPara::GetXFParaStyle()
     154             : {
     155           0 :     XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
     156           0 :     return pXFStyleManager->FindParaStyle(m_StyleName);
     157             : }
     158             : /**
     159             :  * @short   get drop cap info
     160             :  */
     161             : #include "lwpframelayout.hxx"
     162           0 : void LwpPara::GatherDropcapInfo()
     163             : {
     164           0 :     SetDropcapLines(m_pDropcapLayout->GetLines());
     165           0 :     SetDropcapChars(m_pDropcapLayout->GetChars());
     166           0 : }
     167             : /**
     168             :  * @short   get parent paragraph
     169             :  */
     170           0 : LwpPara* LwpPara::GetParent()
     171             : {
     172             :     LwpPara* pPara;
     173             :     sal_uInt16 otherlevel;
     174           0 :     sal_uInt16 level = GetLevel();
     175             : 
     176           0 :     if (level != 1)
     177             :     {
     178           0 :         pPara = dynamic_cast<LwpPara*>(GetPrevious()->obj());
     179           0 :         while (pPara)
     180             :         {
     181           0 :             otherlevel = pPara->GetLevel();
     182           0 :             if ((otherlevel < level) || (otherlevel && (level == 0)))
     183           0 :                 return pPara;
     184           0 :             pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious()->obj());
     185             :         }
     186             :     }
     187           0 :     return NULL;
     188             : }
     189             : 
     190             : /**
     191             :  * @short:   Offer prefix, paranumber and suffix according to position.
     192             :  * @param:   nPosition index of wanted paranumbering in the style-list.
     193             :  * @param:   pParaNumbering a pointer to the structure which contains prefix, paranumber and
     194             :  *       suffix.
     195             :  */
     196           0 : void LwpPara::GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering)
     197             : {
     198           0 :     if (nPosition > 9)
     199             :     {
     200           0 :         return;
     201             :     }
     202           0 :     sal_uInt16 nCurrentPos = 0;
     203             : 
     204           0 :     LwpFrib* pPreFrib = NULL;
     205           0 :     LwpFrib* pFrib = m_Fribs.GetFribs();
     206           0 :     if (!pFrib)
     207             :     {
     208           0 :         return;
     209             :     }
     210             : 
     211           0 :     while (pFrib)
     212             :     {
     213           0 :         sal_uInt8 nFribType = pFrib->GetType();
     214           0 :         if (nFribType == FRIB_TAG_PARANUMBER)
     215             :         {
     216           0 :             nCurrentPos++;
     217           0 :             ModifierInfo* pModInfo = pFrib->GetModifiers();
     218           0 :             if (pModInfo)
     219             :             {
     220           0 :                 sal_uInt16 nHideLevels = pModInfo->aTxtAttrOverride.GetHideLevels();
     221           0 :                 if (nCurrentPos == nPosition)
     222             :                 {
     223             :                     //get prefix text frib
     224           0 :                     if (pPreFrib)
     225             :                     {
     226           0 :                         if ((pPreFrib->GetType() == FRIB_TAG_TEXT) &&
     227           0 :                             (pPreFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels))
     228             :                         {
     229           0 :                             pParaNumbering->pPrefix = static_cast<LwpFribText*>(pPreFrib);
     230             :                         }
     231             :                     }
     232             : 
     233             :                     //get para numbering
     234           0 :                     pParaNumbering->pParaNumber = static_cast<LwpFribParaNumber*>(pFrib);
     235           0 :                     pParaNumbering->nNumLevel = nHideLevels;
     236             : 
     237             :                     //get suffix text frib
     238           0 :                     if ( (pFrib = pFrib->GetNext()) )
     239             :                     {
     240           0 :                         if( pFrib->GetType() == FRIB_TAG_TEXT )
     241             :                         {
     242           0 :                             if (
     243           0 :                                  (pFrib->GetNext() && pFrib->GetNext()->GetType() == FRIB_TAG_TEXT) ||
     244           0 :                                  (pFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels)
     245             :                                )
     246             :                             {
     247           0 :                                 pParaNumbering->pSuffix = static_cast<LwpFribText*>(pFrib);
     248             :                             }
     249             :                         }
     250             :                     }
     251             : 
     252           0 :                     break;
     253             :                 }
     254             :             }
     255             :             else
     256             :             {
     257           0 :                 if (nCurrentPos == nPosition)
     258             :                 {
     259             :                     //get prefix text frib
     260           0 :                     if (pPreFrib)
     261             :                     {
     262           0 :                         if (pPreFrib->GetType() == FRIB_TAG_TEXT)
     263             :                         {
     264           0 :                             pParaNumbering->pPrefix = static_cast<LwpFribText*>(pPreFrib);
     265             :                         }
     266             :                     }
     267             : 
     268             :                     //get para numbering
     269           0 :                     pParaNumbering->pParaNumber = static_cast<LwpFribParaNumber*>(pFrib);
     270             : 
     271             :                     //get suffix text frib
     272           0 :                     if ( (pFrib = pFrib->GetNext()) )
     273             :                     {
     274           0 :                         if (pFrib->GetType() == FRIB_TAG_TEXT)
     275             :                         {
     276           0 :                             pParaNumbering->pSuffix = static_cast<LwpFribText*>(pFrib);
     277             :                         }
     278             :                     }
     279             : 
     280             :                 }
     281             :             }
     282             :         }
     283           0 :         pPreFrib = pFrib;
     284           0 :         if (pFrib)
     285             :         {
     286           0 :             pFrib = pFrib->GetNext();
     287             :         }
     288             :     }
     289             : }
     290             : /**
     291             :  * @short   override alignment
     292             :  */
     293           0 : void LwpPara::OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle)
     294             : {
     295           0 :     if (base)//the latter two parameter never be null
     296             :     {
     297           0 :         over->Override(base);
     298           0 :         LwpParaStyle::ApplyAlignment(pOverStyle,base);
     299             :     }
     300             :     else
     301           0 :         LwpParaStyle::ApplyAlignment(pOverStyle,over);
     302           0 : }
     303             : /**
     304             :  * @short   override indent attribute
     305             :  */
     306           0 : void LwpPara::OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle)
     307             : {
     308           0 :     if (base)//the latter two parameter never be null
     309             :     {
     310           0 :             over->Override(base);
     311           0 :             LwpParaStyle::ApplyIndent(this,pOverStyle,base);
     312             :     }
     313             :     else
     314             :     {
     315           0 :             LwpParaStyle::ApplyIndent(this,pOverStyle,over);
     316             :         }
     317           0 : }
     318             : /**
     319             :  * @short   override spacing
     320             :  */
     321           0 : void LwpPara::OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle)
     322             : {
     323           0 :     if (base)//the latter two parameter never be null
     324             :     {
     325           0 :         if (over)
     326           0 :             over->Override(base);
     327           0 :         LwpParaStyle::ApplySpacing(this,pOverStyle,base);
     328             :     }
     329             :     else
     330           0 :         LwpParaStyle::ApplySpacing(this,pOverStyle,over);
     331           0 : }
     332             : 
     333             : /**
     334             :  * @short:   Get parastyle object according to the objID.
     335             :  * @return:  pointer to the parastyle.
     336             :  */
     337           0 : LwpParaStyle* LwpPara::GetParaStyle()
     338             : {
     339           0 :     return dynamic_cast<LwpParaStyle*>(m_ParaStyle.obj(VO_PARASTYLE));
     340             : }
     341             : 
     342             : /**
     343             :  * @short:   Override paraborder style.
     344             :  * @param:   pProps pointer to the LwpParaProperty and we can get local breaks through it.
     345             :  * @param:   pOverStyle pointer to XFParaStyle which contains the parastyle for XFilter.
     346             :  */
     347           0 : void LwpPara::OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
     348             : {
     349             :     // get paraborder in parastyle
     350           0 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     351           0 :     if (!pParaStyle)
     352             :     {
     353           0 :         return;
     354             :     }
     355             : 
     356           0 :     LwpOverride* pBorder = pParaStyle->GetParaBorder();
     357             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     358             :     boost::scoped_ptr<LwpParaBorderOverride> pFinalBorder(
     359             :         pBorder
     360           0 :             ? polymorphic_downcast<LwpParaBorderOverride*>(pBorder->clone())
     361           0 :             : new LwpParaBorderOverride)
     362             :         ;
     363             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     364             : 
     365             :     // get local border
     366           0 :     pBorder = static_cast<LwpParaBorderProperty*>(pProps)->GetLocalParaBorder();
     367           0 :     if (pBorder)
     368             :     {
     369             :         boost::scoped_ptr<LwpParaBorderOverride> pLocalBorder(
     370           0 :                 polymorphic_downcast<LwpParaBorderOverride*>(pBorder->clone()));
     371           0 :         pLocalBorder->Override(pFinalBorder.get());
     372             :     }
     373             : 
     374           0 :     pParaStyle->ApplyParaBorder(pOverStyle, pFinalBorder.get());
     375             : }
     376             : /**
     377             :  * @short:   Override parabreaks style.
     378             :  * @param:   pProps pointer to the LwpParaProperty and we can get local breaks through it.
     379             :  * @param:   pOverStyle pointer to XFParaStyle which contains the parastyle for XFilter.
     380             :  */
     381           0 : void LwpPara::OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
     382             : {
     383             :     // get breaks in parastyle
     384           0 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     385           0 :     if (!pParaStyle)
     386             :     {
     387           0 :         return;
     388             :     }
     389             : 
     390           0 :     LwpOverride* pBreaks = pParaStyle->GetBreaks();
     391             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     392             :     std::auto_ptr<LwpBreaksOverride> pFinalBreaks(
     393             :         pBreaks
     394           0 :             ? polymorphic_downcast<LwpBreaksOverride*>(pBreaks->clone())
     395           0 :             : new LwpBreaksOverride)
     396             :         ;
     397             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     398             : 
     399             :     // get local breaks
     400           0 :     pBreaks = static_cast<LwpParaBreaksProperty*>(pProps)->GetLocalParaBreaks();
     401           0 :     if (pBreaks)
     402             :     {
     403             :         boost::scoped_ptr<LwpBreaksOverride> const pLocalBreaks(
     404           0 :                 polymorphic_downcast<LwpBreaksOverride*>(pBreaks->clone()));
     405           0 :         pLocalBreaks->Override(pFinalBreaks.get());
     406             :     }
     407             : 
     408             :     // save the breaks
     409           0 :     delete m_pBreaks;
     410           0 :     m_pBreaks = pFinalBreaks.release();
     411             : 
     412           0 :     XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
     413           0 :     if (m_pBreaks->IsKeepWithNext())
     414             :     {
     415           0 :         pOverStyle->SetBreaks(enumXFBreakKeepWithNext);
     416             :     }
     417           0 :     if (m_pBreaks->IsPageBreakBefore())
     418             :     {
     419           0 :         XFParaStyle* pStyle = new XFParaStyle();
     420           0 :         pStyle->SetBreaks(enumXFBreakAftPage);
     421           0 :         m_BefPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     422             :     }
     423           0 :     if (m_pBreaks->IsPageBreakAfter())
     424             :     {
     425           0 :         XFParaStyle* pStyle = new XFParaStyle();
     426           0 :         pStyle->SetBreaks(enumXFBreakAftPage);
     427           0 :         m_AftPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     428             :     }
     429           0 :     if (m_pBreaks->IsColumnBreakBefore())
     430             :     {
     431           0 :         XFParaStyle* pStyle = new XFParaStyle();
     432           0 :         pStyle->SetBreaks(enumXFBreakAftColumn);//tmp after, should change when layout read
     433           0 :         m_BefColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     434             :     }
     435           0 :     if (m_pBreaks->IsColumnBreakAfter())
     436             :     {
     437           0 :         XFParaStyle* pStyle = new XFParaStyle();
     438           0 :         pStyle->SetBreaks(enumXFBreakAftColumn);
     439           0 :         m_AftColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     440           0 :     }
     441             : 
     442             : //  pParaStyle->ApplyBreaks(pOverStyle, &aFinalBreaks);
     443             : }
     444             : 
     445             : /**
     446             :  * @short:   Override bullet styles.
     447             :  * @param:   pProps pointer to the LwpParaProperty and we can get local bullet through it.
     448             :  */
     449           0 : void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
     450             : {
     451             :     // get bulletoverride in parastyle
     452           0 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     453           0 :     if (!pParaStyle)
     454             :     {
     455           0 :         return;
     456             :     }
     457             : 
     458           0 :     if (pProps)
     459             :     {
     460           0 :         m_pBullOver = new LwpBulletOverride();
     461             :         // get local bulletoverride
     462           0 :         LwpBulletOverride* pLocalBullet  = static_cast<LwpParaBulletProperty*>(pProps)->GetLocalParaBullet();
     463           0 :         if (!pLocalBullet)
     464             :         {
     465           0 :             return;
     466             :         }
     467             : 
     468           0 :         LwpObjectID aSilverBulletID = pLocalBullet->GetSilverBullet();
     469           0 :         if (aSilverBulletID.IsNull())
     470             :         {
     471           0 :             return;
     472             :         }
     473             :         else
     474             :         {
     475           0 :             m_bHasBullet = sal_True;
     476             : 
     477           0 :             LwpOverride* pBullet= pParaStyle->GetBulletOverride();
     478             :             SAL_WNODEPRECATED_DECLARATIONS_PUSH
     479             :             std::auto_ptr<LwpBulletOverride> pFinalBullet(
     480             :                 pBullet
     481           0 :                     ? polymorphic_downcast<LwpBulletOverride*>(pBullet->clone())
     482           0 :                     : new LwpBulletOverride)
     483             :                 ;
     484             :             SAL_WNODEPRECATED_DECLARATIONS_POP
     485             : 
     486           0 :             boost::scoped_ptr<LwpBulletOverride> const pLocalBullet2(pLocalBullet->clone());
     487           0 :             pLocalBullet2->Override(pFinalBullet.get());
     488             : 
     489           0 :             aSilverBulletID = pFinalBullet->GetSilverBullet();
     490           0 :             delete m_pBullOver;
     491           0 :             m_pBullOver = pFinalBullet.release();
     492           0 :             if (!aSilverBulletID.IsNull())
     493             :             {
     494           0 :                 m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(aSilverBulletID.obj(VO_SILVERBULLET));
     495           0 :                 if (m_pSilverBullet)
     496           0 :                     m_pSilverBullet->SetFoundry(m_pFoundry);
     497             :             }
     498             : 
     499           0 :             m_aSilverBulletID = aSilverBulletID;
     500             :         }
     501             :     }
     502             :     else
     503             :     {
     504             : //      m_pBullOver = pParaStyle->GetBulletOverride();
     505           0 :         LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
     506           0 :         if (pBullOver)
     507             :         {
     508           0 :             m_aSilverBulletID = pBullOver->GetSilverBullet();
     509           0 :             if (!m_aSilverBulletID.IsNull())
     510             :             {
     511           0 :                 m_bHasBullet = sal_True;
     512             : 
     513           0 :                 m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET));
     514           0 :                 if (m_pSilverBullet)
     515           0 :                     m_pSilverBullet->SetFoundry(m_pFoundry);
     516             :             }
     517             : 
     518             :             SAL_WNODEPRECATED_DECLARATIONS_PUSH
     519           0 :             std::auto_ptr<LwpBulletOverride> pBulletOverride(pBullOver->clone());
     520             :             SAL_WNODEPRECATED_DECLARATIONS_POP
     521           0 :             delete m_pBullOver;
     522           0 :             m_pBullOver = pBulletOverride.release();
     523             :         }
     524             :     }
     525             : }
     526             : /**
     527             :  * @short:   Override paranumbering properties.
     528             :  * @param:   pProps pointer to the LwpParaProperty and we can get local paranumbering through it.
     529             :  */
     530           0 : void LwpPara::OverrideParaNumbering(LwpParaProperty* pProps)
     531             : {
     532             :     // get numbering override in parastyle
     533           0 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     534           0 :     if (!pParaStyle)
     535             :     {
     536           0 :         return;
     537             :     }
     538             : 
     539           0 :     LwpNumberingOverride* pParaNumbering = pParaStyle->GetNumberingOverride();
     540             :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     541           0 :     std::auto_ptr<LwpNumberingOverride> pOver(new LwpNumberingOverride);
     542             :     SAL_WNODEPRECATED_DECLARATIONS_POP
     543             :     //Override with the local numbering, if any
     544           0 :     if (pProps)
     545             :     {
     546           0 :         LwpNumberingOverride* pPropNumbering = static_cast<LwpParaNumberingProperty*>(pProps)->GetLocalNumbering();
     547           0 :         if (pPropNumbering)
     548             :         {
     549           0 :             pOver.reset(pPropNumbering->clone());
     550             :         }
     551             :     }
     552             :     else
     553             :     {
     554           0 :         if (pParaNumbering)
     555             :         {
     556           0 :             pOver.reset(pParaNumbering->clone());
     557             :         }
     558             :     }
     559             : 
     560           0 :     if (m_nFlags & VALID_LEVEL)
     561             :     {
     562           0 :         pOver->OverrideLevel(m_nLevel);
     563             :     }
     564             : 
     565           0 :     m_pParaNumbering.reset(pOver.release());
     566             : }
     567             : 
     568           0 : void LwpPara::FindLayouts()
     569             : {
     570           0 :     m_Fribs.SetPara(this);
     571           0 :     m_Fribs.FindLayouts();
     572           0 :     LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext()->obj());
     573           0 :     if(pNextPara)
     574             :     {
     575           0 :         pNextPara->FindLayouts();
     576             :     }
     577           0 : }
     578             : 
     579             : /**************************************************************************
     580             :  * @descr:  Get property according to the property type
     581             :  * @param:
     582             :  * @param:
     583             :  * @return:
     584             : **************************************************************************/
     585           0 : LwpParaProperty* LwpPara::GetProperty(sal_uInt32 nPropType)
     586             : {
     587           0 :     LwpParaProperty* pProps = m_pProps;
     588           0 :     while(pProps)
     589             :     {
     590           0 :         if(pProps->GetType() == nPropType)
     591             :         {
     592           0 :             return pProps;
     593             :         }
     594           0 :         pProps = pProps->GetNext();
     595             : 
     596             :     }
     597           0 :     return NULL;
     598             : }
     599             : 
     600             : /**************************************************************************
     601             :  * @descr:  Get local tab rack
     602             :  * @param:
     603             :  * @param:
     604             :  * @return:
     605             : **************************************************************************/
     606           0 : LwpTabOverride* LwpPara::GetLocalTabOverride()
     607             : {
     608           0 :     LwpParaProperty* pProp = GetProperty(PP_LOCAL_TABRACK);
     609           0 :     if(pProp)
     610             :     {
     611           0 :         return static_cast<LwpParaTabRackProperty*>(pProp)->GetTab();
     612             :     }
     613           0 :     return NULL;
     614             : }
     615             : 
     616             : /**
     617             : * @descr:   Determined which para is earlier in position
     618             : *
     619             : */
     620           0 : sal_Bool LwpPara::operator< (LwpPara& Other)
     621             : {
     622           0 :     return m_nOrdinal < Other.GetOrdinal();
     623             : }
     624             : 
     625             : /**
     626             : * @descr:  If the two layouts in the same para, compare which layout is earlied according to frib order
     627             : *
     628             : */
     629           0 : sal_Bool LwpPara::ComparePagePosition(LwpVirtualLayout * pPreLayout, LwpVirtualLayout * pNextLayout)
     630             : {
     631           0 :     m_Fribs.SetPara(this);
     632           0 :     return m_Fribs.ComparePagePosition(pPreLayout, pNextLayout);
     633             : }
     634             : 
     635             : /**
     636             :  * @short   check paragraph in cell or not
     637             :  */
     638           0 : sal_Bool LwpPara::IsInCell()
     639             : {
     640           0 :     LwpStory *pStory = GetStory();
     641           0 :     LwpVirtualLayout* pLayout = pStory ? pStory->GetLayout(NULL) : NULL;
     642           0 :     if(pLayout && pLayout->IsCell())
     643           0 :         return sal_True;
     644           0 :     return sal_False;
     645             : }
     646             : 
     647             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10