LCOV - code coverage report
Current view: top level - lotuswordpro/source/filter - lwppara1.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 165 218 75.7 %
Date: 2014-11-03 Functions: 15 21 71.4 %
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(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         184 : void LwpPara::SetFirstFrib(const OUString& Content,sal_uInt32 FontID)
     146             : {
     147         184 :     m_FontID= FontID;
     148         184 :     m_Content=Content;
     149         184 : }
     150             : /**
     151             :  * @short   get paragraph xfstyle
     152             :  */
     153         624 : XFParaStyle* LwpPara::GetXFParaStyle()
     154             : {
     155         624 :     XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
     156         624 :     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         260 : LwpPara* LwpPara::GetParent()
     171             : {
     172             :     LwpPara* pPara;
     173             :     sal_uInt16 otherlevel;
     174         260 :     sal_uInt16 level = GetLevel();
     175             : 
     176         260 :     if (level != 1)
     177             :     {
     178           8 :         pPara = dynamic_cast<LwpPara*>(GetPrevious().obj().get());
     179          28 :         while (pPara)
     180             :         {
     181          20 :             otherlevel = pPara->GetLevel();
     182          20 :             if ((otherlevel < level) || (otherlevel && (level == 0)))
     183           8 :                 return pPara;
     184          12 :             pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get());
     185             :         }
     186             :     }
     187         252 :     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         218 : void LwpPara::GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering)
     197             : {
     198         218 :     if (nPosition > 9)
     199             :     {
     200           0 :         return;
     201             :     }
     202         218 :     sal_uInt16 nCurrentPos = 0;
     203             : 
     204         218 :     LwpFrib* pPreFrib = NULL;
     205         218 :     LwpFrib* pFrib = m_Fribs.GetFribs();
     206         218 :     if (!pFrib)
     207             :     {
     208           0 :         return;
     209             :     }
     210             : 
     211        2236 :     while (pFrib)
     212             :     {
     213        2018 :         sal_uInt8 nFribType = pFrib->GetType();
     214        2018 :         if (nFribType == FRIB_TAG_PARANUMBER)
     215             :         {
     216        1082 :             nCurrentPos++;
     217        1082 :             ModifierInfo* pModInfo = pFrib->GetModifiers();
     218        1082 :             if (pModInfo)
     219             :             {
     220        1082 :                 sal_uInt16 nHideLevels = pModInfo->aTxtAttrOverride.GetHideLevels();
     221        1082 :                 if (nCurrentPos == nPosition)
     222             :                 {
     223             :                     //get prefix text frib
     224         218 :                     if (pPreFrib)
     225             :                     {
     226         384 :                         if ((pPreFrib->GetType() == FRIB_TAG_TEXT) &&
     227         192 :                             (pPreFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels))
     228             :                         {
     229         136 :                             pParaNumbering->pPrefix = static_cast<LwpFribText*>(pPreFrib);
     230             :                         }
     231             :                     }
     232             : 
     233             :                     //get para numbering
     234         218 :                     pParaNumbering->pParaNumber = static_cast<LwpFribParaNumber*>(pFrib);
     235         218 :                     pParaNumbering->nNumLevel = nHideLevels;
     236             : 
     237             :                     //get suffix text frib
     238         218 :                     if ( (pFrib = pFrib->GetNext()) )
     239             :                     {
     240         218 :                         if( pFrib->GetType() == FRIB_TAG_TEXT )
     241             :                         {
     242         200 :                             if (
     243         384 :                                  (pFrib->GetNext() && pFrib->GetNext()->GetType() == FRIB_TAG_TEXT) ||
     244         184 :                                  (pFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels)
     245             :                                )
     246             :                             {
     247          80 :                                 pParaNumbering->pSuffix = static_cast<LwpFribText*>(pFrib);
     248             :                             }
     249             :                         }
     250             :                     }
     251             : 
     252         218 :                     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        1800 :         pPreFrib = pFrib;
     284        1800 :         if (pFrib)
     285             :         {
     286        1800 :             pFrib = pFrib->GetNext();
     287             :         }
     288             :     }
     289             : }
     290             : /**
     291             :  * @short   override alignment
     292             :  */
     293           8 : void LwpPara::OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle)
     294             : {
     295           8 :     if (base)//the latter two parameter never be null
     296             :     {
     297           8 :         over->Override(base);
     298           8 :         LwpParaStyle::ApplyAlignment(pOverStyle,base);
     299             :     }
     300             :     else
     301           0 :         LwpParaStyle::ApplyAlignment(pOverStyle,over);
     302           8 : }
     303             : /**
     304             :  * @short   override indent attribute
     305             :  */
     306         260 : void LwpPara::OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle)
     307             : {
     308         260 :     if (base)//the latter two parameter never be null
     309             :     {
     310         202 :             over->Override(base);
     311         202 :             LwpParaStyle::ApplyIndent(this,pOverStyle,base);
     312             :     }
     313             :     else
     314             :     {
     315          58 :             LwpParaStyle::ApplyIndent(this,pOverStyle,over);
     316             :         }
     317         260 : }
     318             : /**
     319             :  * @short   override spacing
     320             :  */
     321         224 : void LwpPara::OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle)
     322             : {
     323         224 :     if (base)//the latter two parameter never be null
     324             :     {
     325         224 :         if (over)
     326         224 :             over->Override(base);
     327         224 :         LwpParaStyle::ApplySpacing(this,pOverStyle,base);
     328             :     }
     329             :     else
     330           0 :         LwpParaStyle::ApplySpacing(this,pOverStyle,over);
     331         224 : }
     332             : 
     333             : /**
     334             :  * @short:   Get parastyle object according to the objID.
     335             :  * @return:  pointer to the parastyle.
     336             :  */
     337        2316 : LwpParaStyle* LwpPara::GetParaStyle()
     338             : {
     339        2316 :     return dynamic_cast<LwpParaStyle*>(m_ParaStyle.obj(VO_PARASTYLE).get());
     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           4 : void LwpPara::OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
     348             : {
     349             :     // get paraborder in parastyle
     350           4 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     351           4 :     if (!pParaStyle)
     352             :     {
     353           4 :         return;
     354             :     }
     355             : 
     356           4 :     LwpOverride* pBorder = pParaStyle->GetParaBorder();
     357             :     boost::scoped_ptr<LwpParaBorderOverride> pFinalBorder(
     358             :         pBorder
     359           4 :             ? polymorphic_downcast<LwpParaBorderOverride*>(pBorder->clone())
     360           8 :             : new LwpParaBorderOverride)
     361             :         ;
     362             : 
     363             :     // get local border
     364           4 :     pBorder = static_cast<LwpParaBorderProperty*>(pProps)->GetLocalParaBorder();
     365           4 :     if (pBorder)
     366             :     {
     367             :         boost::scoped_ptr<LwpParaBorderOverride> pLocalBorder(
     368           4 :                 polymorphic_downcast<LwpParaBorderOverride*>(pBorder->clone()));
     369           4 :         pLocalBorder->Override(pFinalBorder.get());
     370             :     }
     371             : 
     372           4 :     pParaStyle->ApplyParaBorder(pOverStyle, pFinalBorder.get());
     373             : }
     374             : /**
     375             :  * @short:   Override parabreaks style.
     376             :  * @param:   pProps pointer to the LwpParaProperty and we can get local breaks through it.
     377             :  * @param:   pOverStyle pointer to XFParaStyle which contains the parastyle for XFilter.
     378             :  */
     379         254 : void LwpPara::OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
     380             : {
     381             :     // get breaks in parastyle
     382         254 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     383         254 :     if (!pParaStyle)
     384             :     {
     385         254 :         return;
     386             :     }
     387             : 
     388         254 :     LwpOverride* pBreaks = pParaStyle->GetBreaks();
     389             :     std::unique_ptr<LwpBreaksOverride> pFinalBreaks(
     390             :         pBreaks
     391         254 :             ? polymorphic_downcast<LwpBreaksOverride*>(pBreaks->clone())
     392         508 :             : new LwpBreaksOverride)
     393             :         ;
     394             : 
     395             :     // get local breaks
     396         254 :     pBreaks = static_cast<LwpParaBreaksProperty*>(pProps)->GetLocalParaBreaks();
     397         254 :     if (pBreaks)
     398             :     {
     399             :         boost::scoped_ptr<LwpBreaksOverride> const pLocalBreaks(
     400         254 :                 polymorphic_downcast<LwpBreaksOverride*>(pBreaks->clone()));
     401         254 :         pLocalBreaks->Override(pFinalBreaks.get());
     402             :     }
     403             : 
     404             :     // save the breaks
     405         254 :     delete m_pBreaks;
     406         254 :     m_pBreaks = pFinalBreaks.release();
     407             : 
     408         254 :     XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
     409         254 :     if (m_pBreaks->IsKeepWithNext())
     410             :     {
     411           0 :         pOverStyle->SetBreaks(enumXFBreakKeepWithNext);
     412             :     }
     413         254 :     if (m_pBreaks->IsPageBreakBefore())
     414             :     {
     415           0 :         XFParaStyle* pStyle = new XFParaStyle();
     416           0 :         pStyle->SetBreaks(enumXFBreakAftPage);
     417           0 :         m_BefPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     418             :     }
     419         254 :     if (m_pBreaks->IsPageBreakAfter())
     420             :     {
     421           0 :         XFParaStyle* pStyle = new XFParaStyle();
     422           0 :         pStyle->SetBreaks(enumXFBreakAftPage);
     423           0 :         m_AftPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     424             :     }
     425         254 :     if (m_pBreaks->IsColumnBreakBefore())
     426             :     {
     427           0 :         XFParaStyle* pStyle = new XFParaStyle();
     428           0 :         pStyle->SetBreaks(enumXFBreakAftColumn);//tmp after, should change when layout read
     429           0 :         m_BefColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     430             :     }
     431         254 :     if (m_pBreaks->IsColumnBreakAfter())
     432             :     {
     433           0 :         XFParaStyle* pStyle = new XFParaStyle();
     434           0 :         pStyle->SetBreaks(enumXFBreakAftColumn);
     435           0 :         m_AftColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
     436         254 :     }
     437             : 
     438             : //  pParaStyle->ApplyBreaks(pOverStyle, &aFinalBreaks);
     439             : }
     440             : 
     441             : /**
     442             :  * @short:   Override bullet styles.
     443             :  * @param:   pProps pointer to the LwpParaProperty and we can get local bullet through it.
     444             :  */
     445         518 : void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
     446             : {
     447             :     // get bulletoverride in parastyle
     448         518 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     449         518 :     if (!pParaStyle)
     450             :     {
     451           0 :         return;
     452             :     }
     453             : 
     454         518 :     if (pProps)
     455             :     {
     456           8 :         m_pBullOver = new LwpBulletOverride();
     457             :         // get local bulletoverride
     458           8 :         LwpBulletOverride* pLocalBullet  = static_cast<LwpParaBulletProperty*>(pProps)->GetLocalParaBullet();
     459           8 :         if (!pLocalBullet)
     460             :         {
     461           0 :             return;
     462             :         }
     463             : 
     464           8 :         LwpObjectID aSilverBulletID = pLocalBullet->GetSilverBullet();
     465           8 :         if (aSilverBulletID.IsNull())
     466             :         {
     467           0 :             return;
     468             :         }
     469             :         else
     470             :         {
     471           8 :             m_bHasBullet = true;
     472             : 
     473           8 :             LwpOverride* pBullet= pParaStyle->GetBulletOverride();
     474             :             std::unique_ptr<LwpBulletOverride> pFinalBullet(
     475             :                 pBullet
     476           8 :                     ? polymorphic_downcast<LwpBulletOverride*>(pBullet->clone())
     477          16 :                     : new LwpBulletOverride)
     478             :                 ;
     479             : 
     480          16 :             boost::scoped_ptr<LwpBulletOverride> const pLocalBullet2(pLocalBullet->clone());
     481           8 :             pLocalBullet2->Override(pFinalBullet.get());
     482             : 
     483           8 :             aSilverBulletID = pFinalBullet->GetSilverBullet();
     484           8 :             delete m_pBullOver;
     485           8 :             m_pBullOver = pFinalBullet.release();
     486           8 :             if (!aSilverBulletID.IsNull())
     487             :             {
     488           8 :                 m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(aSilverBulletID.obj(VO_SILVERBULLET).get());
     489           8 :                 if (m_pSilverBullet)
     490           8 :                     m_pSilverBullet->SetFoundry(m_pFoundry);
     491             :             }
     492             : 
     493          16 :             m_aSilverBulletID = aSilverBulletID;
     494             :         }
     495             :     }
     496             :     else
     497             :     {
     498             : //      m_pBullOver = pParaStyle->GetBulletOverride();
     499         510 :         LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
     500         510 :         if (pBullOver)
     501             :         {
     502         510 :             m_aSilverBulletID = pBullOver->GetSilverBullet();
     503         510 :             if (!m_aSilverBulletID.IsNull())
     504             :             {
     505           4 :                 m_bHasBullet = true;
     506             : 
     507           4 :                 m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET).get());
     508           4 :                 if (m_pSilverBullet)
     509           4 :                     m_pSilverBullet->SetFoundry(m_pFoundry);
     510             :             }
     511             : 
     512         510 :             std::unique_ptr<LwpBulletOverride> pBulletOverride(pBullOver->clone());
     513         510 :             delete m_pBullOver;
     514         510 :             m_pBullOver = pBulletOverride.release();
     515             :         }
     516             :     }
     517             : }
     518             : /**
     519             :  * @short:   Override paranumbering properties.
     520             :  * @param:   pProps pointer to the LwpParaProperty and we can get local paranumbering through it.
     521             :  */
     522         518 : void LwpPara::OverrideParaNumbering(LwpParaProperty* pProps)
     523             : {
     524             :     // get numbering override in parastyle
     525         518 :     LwpParaStyle* pParaStyle = this->GetParaStyle();
     526         518 :     if (!pParaStyle)
     527             :     {
     528         518 :         return;
     529             :     }
     530             : 
     531         518 :     LwpNumberingOverride* pParaNumbering = pParaStyle->GetNumberingOverride();
     532         518 :     std::unique_ptr<LwpNumberingOverride> pOver(new LwpNumberingOverride);
     533             :     //Override with the local numbering, if any
     534         518 :     if (pProps)
     535             :     {
     536           8 :         LwpNumberingOverride* pPropNumbering = static_cast<LwpParaNumberingProperty*>(pProps)->GetLocalNumbering();
     537           8 :         if (pPropNumbering)
     538             :         {
     539           8 :             pOver.reset(pPropNumbering->clone());
     540             :         }
     541             :     }
     542             :     else
     543             :     {
     544         510 :         if (pParaNumbering)
     545             :         {
     546         442 :             pOver.reset(pParaNumbering->clone());
     547             :         }
     548             :     }
     549             : 
     550         518 :     if (m_nFlags & VALID_LEVEL)
     551             :     {
     552         138 :         pOver->OverrideLevel(m_nLevel);
     553             :     }
     554             : 
     555         518 :     m_pParaNumbering.reset(pOver.release());
     556             : }
     557             : 
     558           0 : void LwpPara::FindLayouts()
     559             : {
     560           0 :     m_Fribs.SetPara(this);
     561           0 :     m_Fribs.FindLayouts();
     562           0 :     LwpPara* pNextPara = dynamic_cast<LwpPara*>(GetNext().obj().get());
     563           0 :     if(pNextPara)
     564             :     {
     565           0 :         pNextPara->FindLayouts();
     566             :     }
     567           0 : }
     568             : 
     569             : /**************************************************************************
     570             :  * @descr:  Get property according to the property type
     571             :  * @param:
     572             :  * @param:
     573             :  * @return:
     574             : **************************************************************************/
     575          54 : LwpParaProperty* LwpPara::GetProperty(sal_uInt32 nPropType)
     576             : {
     577          54 :     LwpParaProperty* pProps = m_pProps;
     578         204 :     while(pProps)
     579             :     {
     580         100 :         if(pProps->GetType() == nPropType)
     581             :         {
     582           4 :             return pProps;
     583             :         }
     584          96 :         pProps = pProps->GetNext();
     585             : 
     586             :     }
     587          50 :     return NULL;
     588             : }
     589             : 
     590             : /**************************************************************************
     591             :  * @descr:  Get local tab rack
     592             :  * @param:
     593             :  * @param:
     594             :  * @return:
     595             : **************************************************************************/
     596          50 : LwpTabOverride* LwpPara::GetLocalTabOverride()
     597             : {
     598          50 :     LwpParaProperty* pProp = GetProperty(PP_LOCAL_TABRACK);
     599          50 :     if(pProp)
     600             :     {
     601           4 :         return static_cast<LwpParaTabRackProperty*>(pProp)->GetTab();
     602             :     }
     603          46 :     return NULL;
     604             : }
     605             : 
     606             : /**
     607             : * @descr:   Determined which para is earlier in position
     608             : *
     609             : */
     610           0 : bool LwpPara::operator< (LwpPara& Other)
     611             : {
     612           0 :     return m_nOrdinal < Other.GetOrdinal();
     613             : }
     614             : 
     615             : /**
     616             : * @descr:  If the two layouts in the same para, compare which layout is earlied according to frib order
     617             : *
     618             : */
     619           0 : bool LwpPara::ComparePagePosition(LwpVirtualLayout * pPreLayout, LwpVirtualLayout * pNextLayout)
     620             : {
     621           0 :     m_Fribs.SetPara(this);
     622           0 :     return m_Fribs.ComparePagePosition(pPreLayout, pNextLayout);
     623             : }
     624             : 
     625             : /**
     626             :  * @short   check paragraph in cell or not
     627             :  */
     628         524 : bool LwpPara::IsInCell()
     629             : {
     630         524 :     LwpStory *pStory = GetStory();
     631         524 :     LwpVirtualLayout* pLayout = pStory ? pStory->GetLayout(NULL) : NULL;
     632         524 :     if(pLayout && pLayout->IsCell())
     633           2 :         return true;
     634         522 :     return false;
     635             : }
     636             : 
     637             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10