1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
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
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.
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.
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,
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.
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.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /*************************************************************************
58 * For LWP filter architecture prototype
59 ************************************************************************/
60 /*************************************************************************
63 ************************************************************************/
65 #include "lwppara.hxx"
66 #include "lwpglobalmgr.hxx"
67 #include "lwpfilehdr.hxx"
68 #include "lwpparaproperty.hxx"
69 #include "lwptools.hxx"
70 #include "lwpparastyle.hxx"
71 #include "xfilter/xffont.hxx"
72 #include "xfilter/xftextstyle.hxx"
73 #include "xfilter/xfstylemanager.hxx"
74 #include "xfilter/xfparagraph.hxx"
75 #include "xfilter/xftextcontent.hxx"
76 #include "xfilter/xftextspan.hxx"
77 #include "xfilter/xfmargins.hxx"
78 #include "xfilter/xftabstop.hxx"
79 #include "xfilter/xflinebreak.hxx"
80 #include "xfilter/xfsection.hxx"
81 #include "xfilter/xfsectionstyle.hxx"
82 #include "xfilter/xfcolor.hxx"
83 #include "xfilter/xfhyperlink.hxx"
84 #include "xfilter/xfliststyle.hxx"
85 #include "lwpcharsetmgr.hxx"
86 #include "lwpsection.hxx"
87 #include "lwplayout.hxx"
88 #include "lwpusewhen.hxx"
89 #include "lwpbulletstylemgr.hxx"
90 #include "lwpstory.hxx"
91 #include "lwpsilverbullet.hxx"
92 #include "xfilter/xflist.hxx"
93 #include "xfilter/xfframe.hxx"
95 #include "lwpdivinfo.hxx"
97 #include "lwpholder.hxx"
98 #include "lwppagehint.hxx"
100 #include "lwpdropcapmgr.hxx"
101 #include "lwptable.hxx"
103 LwpPara::LwpPara(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
)
104 : LwpDLVList(objHdr
, pStrm
)
110 , m_pIndentOverride(NULL
)
113 , m_bHasBullet(false)
114 , m_pSilverBullet(NULL
)
116 , m_bBullContinue(false)
117 , m_SectionStyleName("")
118 , m_bHasDropcap(false)
121 , m_pDropcapLayout(NULL
)
123 , m_pXFContainer(NULL
)
135 /* if (m_pParaNumbering)
137 delete m_pParaNumbering;
138 m_pParaNumbering = NULL;
146 if(m_pIndentOverride
)
148 delete m_pIndentOverride
;
151 LwpParaProperty
* pNextProp
;
154 pNextProp
= m_pProps
->GetNext();
156 m_pProps
= pNextProp
;
166 if(LwpFileHeader::m_nFileRevision
<0x0006)
168 else if(LwpFileHeader::m_nFileRevision
<0x000B)
169 Simple
= m_pObjStrm
->QuickReaduInt8() != 0;
172 sal_uInt8 Flag
= m_pObjStrm
->QuickReaduInt8();
174 const int DISK_SIMPLE
= 1;
175 const int DISK_NOTIFY
= 2;
177 Simple
= (Flag
& DISK_SIMPLE
) != 0;
178 Notify
= (Flag
& DISK_NOTIFY
) != 0;
183 m_nOrdinal
= m_pObjStrm
->QuickReaduInt32();
184 if(LwpFileHeader::m_nFileRevision
<0x000B)
188 /*pCForked3NotifyList Notify = new CForked3NotifyList(this);
189 Notify->GetExtraList()->QuickRead(pFile);
190 Notify->QuickRead(pFile);
191 if(Notify->GetExtraList()->IsEmpty() &&
195 cNotifyList = Notify;*/
201 LwpForked3NotifyList
* pNotifyList
= new LwpForked3NotifyList();
202 pNotifyList
->GetExtraList().Read(m_pObjStrm
);
203 pNotifyList
->Read(m_pObjStrm
);
211 m_nFlags
= m_pObjStrm
->QuickReaduInt16();
212 m_ParaStyle
.ReadIndexed(m_pObjStrm
);
216 m_Hint
.Read(m_pObjStrm
);
219 m_Story
.ReadIndexed(m_pObjStrm
);
222 if(LwpFileHeader::m_nFileRevision
<0x000B)
226 /*PropList = new CParaPropListProperty(this);
227 PropList->GetList()->QuickRead(pFile);
228 if(PropList->GetList()->IsEmpty())
234 m_nLevel
= m_pObjStrm
->QuickReaduInt16();
246 m_Fribs
.SetPara(this);//add by 2/1, for silver bullet
247 m_Fribs
.ReadPara(m_pObjStrm
);
249 m_pProps
= LwpParaProperty::ReadPropertyList(m_pObjStrm
,this);
252 void LwpPara::Parse(IXFStream
* pOutputStream
)
254 m_pXFContainer
= new XFContentContainer
;
255 XFConvert(m_pXFContainer
);
256 m_pXFContainer
->ToXml(pOutputStream
);
257 m_pXFContainer
->Reset();
258 delete m_pXFContainer
;
259 m_pXFContainer
= NULL
;
262 void LwpPara::XFConvert(XFContentContainer
* pCont
)
264 m_pXFContainer
= pCont
;
266 LwpStory
*pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
268 if (pStory
&& pStory
->GetDropcapFlag())
270 ParseDropcapContent();
274 //Add the break before para
275 if (m_pBreaks
&& m_nOrdinal
!=0)
276 AddBreakBefore(pCont
);
278 //Create an XFPara for this VO_PARA
279 XFParagraph
*pPara
= new XFParagraph
;
280 pPara
->SetStyleName(m_StyleName
);
282 if(!m_SectionStyleName
.isEmpty())
284 XFSection
* pSection
= CreateXFSection();
286 pStory
->AddXFContent(pSection
);
287 //pSection->Add(pPara);
288 m_pXFContainer
= pSection
;
291 if (m_bHasBullet
&& m_pSilverBullet
)
293 XFContentContainer
* pListItem
= AddBulletList(m_pXFContainer
);
296 pListItem
->Add(pPara
);
301 LwpBulletStyleMgr
* pBulletStyleMgr
= this->GetBulletStyleMgr();
304 pBulletStyleMgr
->SetCurrentSilverBullet(LwpObjectID());
305 pBulletStyleMgr
->SetContinueFlag(false);
307 m_pXFContainer
->Add(pPara
);
310 m_Fribs
.SetXFPara(pPara
);
314 AddBreakAfter(m_pXFContainer
);
317 bool LwpPara::RegisterMasterPage(XFParaStyle
* pBaseStyle
)
319 bool bSuccess
= false;
321 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
322 //if pagelayout is modified, register the pagelayout
323 if(pStory
&& pStory
->IsPMModified())
325 bool bNewSection
= pStory
->IsNeedSection();
326 LwpPageLayout
* pLayout
= pStory
->GetCurrentLayout();
329 RegisterNewSectionStyle(pLayout
);
333 //register master page style
334 XFParaStyle
* pOverStyle
= new XFParaStyle();
335 *pOverStyle
= *pBaseStyle
;
336 pOverStyle
->SetStyleName( "");
337 pOverStyle
->SetMasterPage(pLayout
->GetStyleName());
338 if (!m_ParentStyleName
.isEmpty())
339 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
340 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
341 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
346 * @short register paragraph style
348 void LwpPara::RegisterStyle()
350 // m_Fribs.SetPara(this);
351 // m_Fribs.RegisterStyle();
356 XFParaStyle
* pBaseStyle
= static_cast<XFParaStyle
*>(m_pFoundry
->GetStyleManager()->GetStyle(m_ParaStyle
));
357 if (pBaseStyle
== NULL
) return;
358 m_StyleName
= pBaseStyle
->GetStyleName();//such intf to be added
359 m_ParentStyleName
= m_StyleName
;
360 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
362 if (GetParaStyle()->GetIndent())
364 std::unique_ptr
<LwpIndentOverride
> pIndentOverride(GetParaStyle()->GetIndent()->clone());
365 delete m_pIndentOverride
;
366 m_pIndentOverride
= pIndentOverride
.release();
369 XFParaStyle
* pOverStyle
= NULL
;
370 bool noSpacing
= true;
371 LwpParaProperty
* pBulletProps
= NULL
, *pNumberingProps
= NULL
;
373 if (m_pProps
!= NULL
)
375 bool noIndent
= true;
376 pOverStyle
= new XFParaStyle
;
377 *pOverStyle
= *pBaseStyle
;
378 pOverStyle
->SetStyleName("");
379 LwpParaProperty
* pProps
= m_pProps
;
381 LwpParaStyle
& rParaStyle
= dynamic_cast<LwpParaStyle
&>(*m_ParaStyle
.obj());
384 PropType
= pProps
->GetType();
389 if (!rParaStyle
.GetAlignment())
390 OverrideAlignment(NULL
,static_cast<LwpParaAlignProperty
*>(pProps
)->GetAlignment(),pOverStyle
);
393 boost::scoped_ptr
<LwpAlignmentOverride
> const pAlign(
394 rParaStyle
.GetAlignment()->clone());
395 OverrideAlignment(pAlign
.get(),
396 static_cast<LwpParaAlignProperty
*>(pProps
)->GetAlignment(),
401 case PP_LOCAL_INDENT
:
404 if (!rParaStyle
.GetIndent())
405 OverrideIndent(NULL
,static_cast<LwpParaIndentProperty
*>(pProps
)->GetIndent(),pOverStyle
);
409 OverrideIndent(m_pIndentOverride
,static_cast<LwpParaIndentProperty
*>(pProps
)->GetIndent(),pOverStyle
);
413 case PP_LOCAL_SPACING
:
416 if (!rParaStyle
.GetSpacing())
417 OverrideSpacing(NULL
,static_cast<LwpParaSpacingProperty
*>(pProps
)->GetSpacing(),pOverStyle
);
420 boost::scoped_ptr
<LwpSpacingOverride
> const
421 pSpacing(rParaStyle
.GetSpacing()->clone());
422 OverrideSpacing(pSpacing
.get(),
423 static_cast<LwpParaSpacingProperty
*>(pProps
)->GetSpacing(),
428 case PP_LOCAL_BORDER
:
430 OverrideParaBorder(pProps
, pOverStyle
);
433 case PP_LOCAL_BREAKS
:
435 OverrideParaBreaks(pProps
, pOverStyle
);
438 case PP_LOCAL_BULLET
:
440 pBulletProps
= pProps
;
441 // OverrideParaBullet(pProps);
444 case PP_LOCAL_NUMBERING
:
446 pNumberingProps
= pProps
;
447 // OverrideParaNumbering(pProps);
451 case PP_LOCAL_TABRACK
:
454 /*LwpTabOverride* pTabOverride=rParaStyle.GetTabOverride();
457 OverrideTab(NULL,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
461 OverrideTab(pTabOverride,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
465 case PP_LOCAL_BACKGROUND
:
467 /* LwpBackgroundOverride aBackground;
468 if (!rParaStyle.GetBackground())
469 OverrideBackground(NULL,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
472 aBackground = *(rParaStyle.GetaBackground());
473 OverrideBackground(&aBackground,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
476 // modified by , 06/03/2005
477 LwpBackgroundOverride
* pBGOver
= static_cast<LwpParaBackGroundProperty
*>(pProps
)->GetBackground();
480 LwpBackgroundStuff
& rBGStuff
= pBGOver
->GetBGStuff();
481 if (!rBGStuff
.IsTransparent() )
483 if (rBGStuff
.IsPatternFill())
485 XFBGImage
* pXFBGImage
= rBGStuff
.GetFillPattern();
486 pOverStyle
->SetBackImage(pXFBGImage
);
490 LwpColor
* pColor
= rBGStuff
.GetFillColor();
491 if (pColor
&& pColor
->IsValidColor())
493 XFColor
aXFColor( pColor
->To24Color());
494 pOverStyle
->SetBackColor( aXFColor
);
505 pProps
= pProps
->GetNext();
508 if (noIndent
&& m_pIndentOverride
)
510 if (m_pIndentOverride
->IsUseRelative() && GetParent())
512 OverrideIndent(NULL
,m_pIndentOverride
,pOverStyle
);
515 if (!m_ParentStyleName
.isEmpty())
516 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
517 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
520 else //use named style
522 if (m_pIndentOverride
)
524 if (m_pIndentOverride
->IsUseRelative() && GetParent())
526 pOverStyle
= new XFParaStyle
;
527 *pOverStyle
= *pBaseStyle
;
528 OverrideIndent(NULL
,m_pIndentOverride
,pOverStyle
);
529 if (!m_ParentStyleName
.isEmpty())
530 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
531 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
538 XFParaStyle
* pOldStyle
= pXFStyleManager
->FindParaStyle(m_StyleName
);
539 if (pOldStyle
->GetNumberRight())
541 pOverStyle
= new XFParaStyle
;
542 *pOverStyle
= *pOldStyle
;
543 pOverStyle
->SetAlignType(enumXFAlignStart
);
544 if (!m_ParentStyleName
.isEmpty())
545 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
546 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
550 // override bullet and numbering
551 OverrideParaBullet(pBulletProps
);
552 OverrideParaNumbering(pNumberingProps
);
555 //register bullet style
556 LwpBulletStyleMgr
* pBulletStyleMgr
= this->GetBulletStyleMgr();
559 // if has bullet or numbering
562 //if it's normal bullet
565 if (m_pSilverBullet
->HasName())
567 m_aBulletStyleName
= m_pSilverBullet
->GetBulletStyleName();
569 else if (!m_pBullOver
->IsEditable())
571 m_aBulletStyleName
= pBulletStyleMgr
->RegisterBulletStyle(this, m_pBullOver
, m_pIndentOverride
);
575 if (m_pSilverBullet
->IsBulletOrdered())
577 OUString aPreBullStyleName
;
578 LwpNumberingOverride
* pNumbering
= this->GetParaNumbering();
579 sal_uInt16 nPosition
= pNumbering
->GetPosition();
580 bool bLesser
= m_pSilverBullet
->IsLesserLevel(nPosition
);
581 LwpPara
* pPara
= this;
582 LwpPara
* pPrePara
= NULL
;
583 sal_uInt16 nNum
= 0, nLevel
= 0, nFoundLevel
= 0xffff, nFoundBound
= 0;
585 nFoundBound
= nLevel
= pNumbering
->GetLevel();
586 if (nPosition
== pNumbering
->GetPosition())
590 bool bHeading
= pNumbering
->IsHeading();
594 /*// When we hit the hint paragraph, we can stop and check the hint.
595 if (qNumberHint && (qPara == qNumberHint->GetPara()) &&
596 qNumberHint->Lookup(qSilverBullet, Level, Position, &Offset))
602 LwpSilverBullet
* pParaSilverBullet
= pPara
->GetSilverBullet();
603 pNumbering
= pPara
->GetParaNumbering();
605 if (pPara
->GetObjectID() != this->GetObjectID())
607 if (!pParaSilverBullet
)
612 /* If lesser, stop when we hit an outline style whose level is
613 * higher than our current level.
615 // restart based on Outline level?
616 if (pNumbering
&& bLesser
&& (!bHeading
|| pNumbering
->IsHeading()))
618 if (nFoundLevel
!= 0xffff)
620 if (pNumbering
->GetLevel() < nFoundLevel
)
624 if ((pNumbering
->GetLevel() == nFoundLevel
)
625 && (pParaSilverBullet
->GetObjectID() != m_pSilverBullet
->GetObjectID()
626 || pNumbering
->GetPosition() != nPosition
))
633 if (pNumbering
&& pNumbering
->GetLevel() < nFoundBound
&& pParaSilverBullet
634 && (pParaSilverBullet
->GetObjectID() != m_pSilverBullet
->GetObjectID()
635 || pNumbering
->GetPosition() != nPosition
))
637 nFoundBound
= pNumbering
->GetLevel();
643 && qSpecificStyle == qPara->GetParaStyle(LTRUE))
646 // See if we crossed a section boundary
649 CurrPos.SetPara(qPara);
650 if (CurrPos <= SectionPos)
655 // Don't bump the number if this bullet is skipped
656 if (m_pBullOver
->IsSkip())
658 else if ( pParaSilverBullet
659 && pParaSilverBullet
->GetObjectID() == m_pSilverBullet
->GetObjectID()
660 && pNumbering
&& nPosition
== pNumbering
->GetPosition())
664 if (nFoundLevel
!= 0xffff)
666 if (nFoundLevel
== pNumbering
->GetLevel())
668 aPreBullStyleName
= pPara
->GetBulletStyleName();
672 else if (pNumbering
->GetLevel() <= nLevel
)
674 if (pNumbering
->GetLevel() >= nFoundBound
)
678 nFoundLevel
= pNumbering
->GetLevel();
679 aPreBullStyleName
= pPara
->GetBulletStyleName();
685 aPreBullStyleName
= pPara
->GetBulletStyleName();
690 pPrePara
= dynamic_cast<LwpPara
*>(pPara
->GetPrevious().obj(VO_PARA
).get());
694 LwpStory
* pStory
= pPara
->GetStory();
695 pPrePara
= pStory
->GetLastParaOfPreviousStory();
704 nNum
= nNum
? nNum
: 1;
708 m_aBulletStyleName
= aPreBullStyleName
;
709 m_bBullContinue
= true;
713 m_bBullContinue
= false;
714 if (this->IsInCell())
716 XFListStyle
* pOldStyle
= static_cast<XFListStyle
*>(pXFStyleManager
->FindStyle(m_aBulletStyleName
));
719 XFListStyle
* pNewStyle
= new XFListStyle(*pOldStyle
);
720 m_aBulletStyleName
= pXFStyleManager
->AddStyle(pNewStyle
).m_pStyle
->GetStyleName();
725 LwpStory
* pMyStory
= this->GetStory();
728 if (pMyStory
->IsBullStyleUsedBefore(m_aBulletStyleName
, m_pParaNumbering
->GetPosition()))
730 //m_bBullContinue = sal_True;
734 pMyStory
->AddBullStyleName2List(m_aBulletStyleName
, m_pParaNumbering
->GetPosition());
747 LwpPara
* pPrePara
= dynamic_cast<LwpPara
*>(GetPrevious().obj().get());
748 if (pPrePara
&& pPrePara
->GetBelowSpacing()!=0)
750 pOverStyle
= new XFParaStyle
;
751 *pOverStyle
= *GetXFParaStyle();
752 XFMargins
* pMargin
= &pOverStyle
->GetMargins();
753 pMargin
->SetTop(pMargin
->GetTop()+pPrePara
->GetBelowSpacing());
754 if (!m_ParentStyleName
.isEmpty())
755 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
756 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
761 if(m_Fribs
.HasFrib(FRIB_TAG_TAB
))
763 XFParaStyle
* pParaStyle
= new XFParaStyle
;
764 *pParaStyle
= *GetXFParaStyle();
765 //pOverStyle->SetStyleName("");
766 this->RegisterTabStyle(pParaStyle
);
767 if (!m_ParentStyleName
.isEmpty())
768 pParaStyle
->SetParentStyleName(m_ParentStyleName
);
769 m_StyleName
= pXFStyleManager
->AddStyle(pParaStyle
).m_pStyle
->GetStyleName();
772 //register master page;
773 RegisterMasterPage(GetXFParaStyle());
775 // reg auto style,lay here for pagebreak need overrided para style
776 m_Fribs
.SetPara(this);
777 m_Fribs
.RegisterStyle();
782 XFParaStyle
* pStyle
= new XFParaStyle
;
783 *pStyle
= *GetXFParaStyle();
784 pStyle
->SetDropCap(m_nChars
-1,m_nLines
);
785 if (!m_ParentStyleName
.isEmpty())
786 pStyle
->SetParentStyleName(m_ParentStyleName
);
787 m_StyleName
= pXFStyleManager
->AddStyle(pStyle
).m_pStyle
->GetStyleName();
789 // maybe useful for futer version
790 // deleted because Leader of Table is not supported in this version
791 //AddTabStyleForTOC();
794 void LwpPara::RegisterNewSectionStyle(LwpPageLayout
*pLayout
)
799 XFSectionStyle
* pSectStyle
= new XFSectionStyle();
800 XFColumns
* pColumns
= pLayout
->GetXFColumns();
803 pSectStyle
->SetColumns(pColumns
);
805 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
806 m_SectionStyleName
= pXFStyleManager
->AddStyle(pSectStyle
).m_pStyle
->GetStyleName();
809 XFSection
* LwpPara::CreateXFSection()
811 XFSection
* pXFSection
= new XFSection();
812 pXFSection
->SetStyleName(m_SectionStyleName
);
813 m_SectionStyleName
.clear();
817 /**************************************************************************
818 * @descr: register tab style
822 **************************************************************************/
823 void LwpPara::RegisterTabStyle(XFParaStyle
* pXFParaStyle
)
825 LwpTabOverride aFinaOverride
;
826 LwpTabOverride
* pBase
= NULL
;
827 //get the tabrack from the current layout
828 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
829 LwpMiddleLayout
* pLayout
= pStory
? pStory
->GetTabLayout() : NULL
;
832 pBase
= pLayout
->GetTabOverride();
835 pBase
->Override(&aFinaOverride
);
839 //get the tabrack from the base parastyle
840 LwpParaStyle
* pParaStyle
= GetParaStyle();
841 pBase
= pParaStyle
->GetTabOverride();
844 pBase
->Override(&aFinaOverride
);
846 //get the tabrack from the local property
847 pBase
= GetLocalTabOverride();
850 pBase
->Override(&aFinaOverride
);
853 LwpParaStyle::ApplyTab(pXFParaStyle
, &aFinaOverride
);
856 * @short parse dropcap text
858 void LwpPara::ParseDropcapContent()
862 XFParagraph
* pDropcap
= GetFoundry()->GetDropcapMgr()->GetXFPara();
865 m_Fribs
.SetXFPara(pDropcap
);
870 * @short add paragraph break attribute
872 void LwpPara::AddBreakBefore(XFContentContainer
* pCont
)
876 if (m_pBreaks
->IsPageBreakBefore())
878 XFParagraph
*pPara
= new XFParagraph();
879 pPara
->SetStyleName(m_BefPageBreakName
);
882 else if (m_pBreaks
->IsColumnBreakBefore())
884 XFParagraph
*pPara
= new XFParagraph();
885 pPara
->SetStyleName(m_BefColumnBreakName
);
890 void LwpPara::AddBreakAfter(XFContentContainer
* pCont
)
894 if (m_pBreaks
->IsPageBreakAfter())
896 XFParagraph
*pPara
= new XFParagraph();
897 pPara
->SetStyleName(m_AftPageBreakName
);
900 else if (m_pBreaks
->IsColumnBreakAfter())
902 XFParagraph
*pPara
= new XFParagraph();
903 pPara
->SetStyleName(m_AftColumnBreakName
);
908 LwpBulletStyleMgr
* LwpPara::GetBulletStyleMgr()
912 return m_pFoundry
->GetBulletStyleMgr();
918 XFContentContainer
* LwpPara::AddBulletList(XFContentContainer
* pCont
)
920 LwpBulletStyleMgr
* pBulletStyleMgr
= GetBulletStyleMgr();
921 if (!pBulletStyleMgr
)
927 sal_uInt16 nLevel
= m_nLevel
;
928 bool bOrdered
= false;
929 /*LwpStory* pMyStory =*/ GetStory();
931 pBulletStyleMgr
->SetContinueFlag(m_bBullContinue
);
933 if (m_pSilverBullet
->IsBulletOrdered())
937 if (m_pSilverBullet
->HasName())
939 nLevel
= m_pParaNumbering
->GetPosition();
940 m_nLevel
= nLevel
;//add by ,for get para level
941 // m_aBulletStyleName = m_pSilverBullet->GetBulletStyleName();
944 return ( pBulletStyleMgr
->AddBulletList(pCont
, bOrdered
, m_aBulletStyleName
,
945 nLevel
, m_pBullOver
->IsSkip()) );
948 LwpNumberingOverride
* LwpPara::GetParaNumbering()
950 return m_pParaNumbering
.get();
953 void LwpForked3NotifyList::Read(LwpObjectStream
* pObjStrm
)
955 m_PersistentList
.Read(pObjStrm
);
958 void LwpNotifyListPersistent::Read(LwpObjectStream
* pObjStrm
)
960 m_Head
.ReadIndexed(pObjStrm
);
961 pObjStrm
->SkipExtra();
964 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */