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 ************************************************************************/
61 #include "lwppara.hxx"
62 #include "lwpglobalmgr.hxx"
63 #include "lwpfilehdr.hxx"
64 #include "lwpparaproperty.hxx"
65 #include "lwptools.hxx"
66 #include "lwpparastyle.hxx"
67 #include "xfilter/xffont.hxx"
68 #include "xfilter/xftextstyle.hxx"
69 #include "xfilter/xfstylemanager.hxx"
70 #include "xfilter/xfparagraph.hxx"
71 #include "xfilter/xftextcontent.hxx"
72 #include "xfilter/xftextspan.hxx"
73 #include "xfilter/xfmargins.hxx"
74 #include "xfilter/xftabstop.hxx"
75 #include "xfilter/xflinebreak.hxx"
76 #include "xfilter/xfsection.hxx"
77 #include "xfilter/xfsectionstyle.hxx"
78 #include "xfilter/xfcolor.hxx"
79 #include "xfilter/xfhyperlink.hxx"
80 #include "xfilter/xfliststyle.hxx"
81 #include "lwpcharsetmgr.hxx"
82 #include "lwpsection.hxx"
83 #include "lwplayout.hxx"
84 #include "lwpusewhen.hxx"
85 #include "lwpbulletstylemgr.hxx"
86 #include "lwpstory.hxx"
87 #include "lwpsilverbullet.hxx"
88 #include "xfilter/xflist.hxx"
89 #include "xfilter/xfframe.hxx"
91 #include "lwpdivinfo.hxx"
93 #include "lwpholder.hxx"
94 #include "lwppagehint.hxx"
96 #include "lwpdropcapmgr.hxx"
97 #include "lwptable.hxx"
99 LwpPara::LwpPara(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
)
100 : LwpDLVList(objHdr
, pStrm
)
106 , m_pIndentOverride(nullptr)
109 , m_bHasBullet(false)
110 , m_pSilverBullet(nullptr)
111 , m_pBullOver(nullptr)
112 , m_bBullContinue(false)
113 , m_SectionStyleName("")
114 , m_bHasDropcap(false)
117 , m_pDropcapLayout(nullptr)
119 , m_pXFContainer(nullptr)
131 /* if (m_pParaNumbering)
133 delete m_pParaNumbering;
134 m_pParaNumbering = NULL;
140 m_pBullOver
= nullptr;
142 if(m_pIndentOverride
)
144 delete m_pIndentOverride
;
147 LwpParaProperty
* pNextProp
;
150 pNextProp
= m_pProps
->GetNext();
152 m_pProps
= pNextProp
;
162 if(LwpFileHeader::m_nFileRevision
<0x0006)
164 else if(LwpFileHeader::m_nFileRevision
<0x000B)
165 Simple
= m_pObjStrm
->QuickReaduInt8() != 0;
168 sal_uInt8 Flag
= m_pObjStrm
->QuickReaduInt8();
170 const int DISK_SIMPLE
= 1;
171 const int DISK_NOTIFY
= 2;
173 Simple
= (Flag
& DISK_SIMPLE
) != 0;
174 Notify
= (Flag
& DISK_NOTIFY
) != 0;
179 m_nOrdinal
= m_pObjStrm
->QuickReaduInt32();
180 if(LwpFileHeader::m_nFileRevision
<0x000B)
184 /*pCForked3NotifyList Notify = new CForked3NotifyList(this);
185 Notify->GetExtraList()->QuickRead(pFile);
186 Notify->QuickRead(pFile);
187 if(Notify->GetExtraList()->IsEmpty() &&
191 cNotifyList = Notify;*/
197 LwpForked3NotifyList
* pNotifyList
= new LwpForked3NotifyList();
198 pNotifyList
->GetExtraList().Read(m_pObjStrm
);
199 pNotifyList
->Read(m_pObjStrm
);
207 m_nFlags
= m_pObjStrm
->QuickReaduInt16();
208 m_ParaStyle
.ReadIndexed(m_pObjStrm
);
212 m_Hint
.Read(m_pObjStrm
);
215 m_Story
.ReadIndexed(m_pObjStrm
);
218 if(LwpFileHeader::m_nFileRevision
<0x000B)
222 /*PropList = new CParaPropListProperty(this);
223 PropList->GetList()->QuickRead(pFile);
224 if(PropList->GetList()->IsEmpty())
230 m_nLevel
= m_pObjStrm
->QuickReaduInt16();
240 m_Fribs
.SetPara(this);// for silver bullet
241 m_Fribs
.ReadPara(m_pObjStrm
);
243 m_pProps
= LwpParaProperty::ReadPropertyList(m_pObjStrm
,this);
246 void LwpPara::Parse(IXFStream
* pOutputStream
)
248 m_pXFContainer
= new XFContentContainer
;
249 XFConvert(m_pXFContainer
);
252 m_pXFContainer
->ToXml(pOutputStream
);
253 m_pXFContainer
->Reset();
254 delete m_pXFContainer
;
255 m_pXFContainer
= nullptr;
258 void LwpPara::XFConvert(XFContentContainer
* pCont
)
260 m_pXFContainer
= pCont
;
262 LwpStory
*pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
264 if (pStory
&& pStory
->GetDropcapFlag())
266 ParseDropcapContent();
270 //Add the break before para
271 if (m_pBreaks
&& m_nOrdinal
!=0)
272 AddBreakBefore(pCont
);
274 //Create an XFPara for this VO_PARA
275 XFParagraph
*pPara
= new XFParagraph
;
276 rtl::Reference
<XFContentContainer
> xHolder(pPara
);
277 pPara
->SetStyleName(m_StyleName
);
279 if(!m_SectionStyleName
.isEmpty())
281 XFSection
* pSection
= CreateXFSection();
283 pStory
->AddXFContent(pSection
);
284 //pSection->Add(pPara);
285 m_pXFContainer
= pSection
;
288 if (m_bHasBullet
&& m_pSilverBullet
)
290 XFContentContainer
* pListItem
= AddBulletList(m_pXFContainer
);
293 pListItem
->Add(pPara
);
296 else if (m_pXFContainer
)
298 LwpBulletStyleMgr
* pBulletStyleMgr
= GetBulletStyleMgr();
301 pBulletStyleMgr
->SetCurrentSilverBullet(LwpObjectID());
302 pBulletStyleMgr
->SetContinueFlag(false);
304 m_pXFContainer
->Add(pPara
);
307 m_Fribs
.SetXFPara(pPara
);
310 if (m_pBreaks
&& m_pXFContainer
)
311 AddBreakAfter(m_pXFContainer
);
314 void LwpPara::RegisterMasterPage(XFParaStyle
* pBaseStyle
)
317 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
318 //if pagelayout is modified, register the pagelayout
319 if(pStory
&& pStory
->IsPMModified())
321 bool bNewSection
= pStory
->IsNeedSection();
322 LwpPageLayout
* pLayout
= pStory
->GetCurrentLayout();
325 RegisterNewSectionStyle(pLayout
);
328 //register master page style
329 XFParaStyle
* pOverStyle
= new XFParaStyle();
330 *pOverStyle
= *pBaseStyle
;
331 pOverStyle
->SetStyleName( "");
332 pOverStyle
->SetMasterPage(pLayout
->GetStyleName());
333 if (!m_ParentStyleName
.isEmpty())
334 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
335 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
336 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
340 * @short register paragraph style
342 void LwpPara::RegisterStyle()
344 // m_Fribs.SetPara(this);
345 // m_Fribs.RegisterStyle();
350 XFParaStyle
* pBaseStyle
= dynamic_cast<XFParaStyle
*>(m_pFoundry
->GetStyleManager()->GetStyle(m_ParaStyle
));
351 if (pBaseStyle
== nullptr) return;
352 m_StyleName
= pBaseStyle
->GetStyleName();//such intf to be added
353 m_ParentStyleName
= m_StyleName
;
354 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
356 LwpParaStyle
* pParaStyle
= GetParaStyle();
357 if (pParaStyle
&& pParaStyle
->GetIndent())
359 std::unique_ptr
<LwpIndentOverride
> pIndentOverride(GetParaStyle()->GetIndent()->clone());
360 delete m_pIndentOverride
;
361 m_pIndentOverride
= pIndentOverride
.release();
364 XFParaStyle
* pOverStyle
= nullptr;
365 bool noSpacing
= true;
366 LwpParaProperty
* pBulletProps
= nullptr, *pNumberingProps
= nullptr;
368 if (m_pProps
!= nullptr)
370 bool noIndent
= true;
371 pOverStyle
= new XFParaStyle
;
372 *pOverStyle
= *pBaseStyle
;
373 pOverStyle
->SetStyleName("");
374 LwpParaProperty
* pProps
= m_pProps
;
376 LwpParaStyle
& rParaStyle
= dynamic_cast<LwpParaStyle
&>(*m_ParaStyle
.obj());
379 PropType
= pProps
->GetType();
384 LwpAlignmentOverride
*pAlignment
= static_cast<LwpParaAlignProperty
*>(pProps
)->GetAlignment();
387 if (!rParaStyle
.GetAlignment())
388 OverrideAlignment(nullptr, pAlignment
, pOverStyle
);
391 std::unique_ptr
<LwpAlignmentOverride
> const pAlign(
392 rParaStyle
.GetAlignment()->clone());
393 OverrideAlignment(pAlign
.get(),
400 case PP_LOCAL_INDENT
:
403 LwpIndentOverride
*pIndent
= static_cast<LwpParaIndentProperty
*>(pProps
)->GetIndent();
406 if (!rParaStyle
.GetIndent())
407 OverrideIndent(nullptr, pIndent
, pOverStyle
);
409 OverrideIndent(m_pIndentOverride
, pIndent
, pOverStyle
);
413 case PP_LOCAL_SPACING
:
416 LwpSpacingOverride
*pSpacing
= static_cast<LwpParaSpacingProperty
*>(pProps
)->GetSpacing();
419 if (!rParaStyle
.GetSpacing())
420 OverrideSpacing(nullptr, pSpacing
, pOverStyle
);
423 std::unique_ptr
<LwpSpacingOverride
> const
424 pNewSpacing(rParaStyle
.GetSpacing()->clone());
425 OverrideSpacing(pNewSpacing
.get(), pSpacing
, pOverStyle
);
430 case PP_LOCAL_BORDER
:
432 OverrideParaBorder(pProps
, pOverStyle
);
435 case PP_LOCAL_BREAKS
:
437 OverrideParaBreaks(pProps
, pOverStyle
);
440 case PP_LOCAL_BULLET
:
442 pBulletProps
= pProps
;
445 case PP_LOCAL_NUMBERING
:
447 pNumberingProps
= pProps
;
450 case PP_LOCAL_TABRACK
:
454 case PP_LOCAL_BACKGROUND
:
456 LwpBackgroundOverride
* pBGOver
= static_cast<LwpParaBackGroundProperty
*>(pProps
)->GetBackground();
459 LwpBackgroundStuff
& rBGStuff
= pBGOver
->GetBGStuff();
460 if (!rBGStuff
.IsTransparent() )
462 if (rBGStuff
.IsPatternFill())
464 XFBGImage
* pXFBGImage
= rBGStuff
.GetFillPattern();
465 pOverStyle
->SetBackImage(pXFBGImage
);
469 LwpColor
* pColor
= rBGStuff
.GetFillColor();
470 if (pColor
&& pColor
->IsValidColor())
472 XFColor
aXFColor( pColor
->To24Color());
473 pOverStyle
->SetBackColor( aXFColor
);
483 pProps
= pProps
->GetNext();
486 if (noIndent
&& m_pIndentOverride
)
488 if (m_pIndentOverride
->IsUseRelative() && GetParent())
490 OverrideIndent(nullptr,m_pIndentOverride
,pOverStyle
);
493 if (!m_ParentStyleName
.isEmpty())
494 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
495 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
498 else //use named style
500 if (m_pIndentOverride
)
502 if (m_pIndentOverride
->IsUseRelative() && GetParent())
504 pOverStyle
= new XFParaStyle
;
505 *pOverStyle
= *pBaseStyle
;
506 OverrideIndent(nullptr,m_pIndentOverride
,pOverStyle
);
507 if (!m_ParentStyleName
.isEmpty())
508 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
509 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
516 XFParaStyle
* pOldStyle
= pXFStyleManager
->FindParaStyle(m_StyleName
);
517 if (pOldStyle
->GetNumberRight())
519 pOverStyle
= new XFParaStyle
;
520 *pOverStyle
= *pOldStyle
;
521 pOverStyle
->SetAlignType(enumXFAlignStart
);
522 if (!m_ParentStyleName
.isEmpty())
523 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
524 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
528 // override bullet and numbering
529 OverrideParaBullet(pBulletProps
);
530 OverrideParaNumbering(pNumberingProps
);
532 //register bullet style
533 LwpBulletStyleMgr
* pBulletStyleMgr
= GetBulletStyleMgr();
536 // if has bullet or numbering
539 //if it's normal bullet
542 if (m_pSilverBullet
->HasName())
544 m_aBulletStyleName
= m_pSilverBullet
->GetBulletStyleName();
546 else if (!m_pBullOver
->IsEditable())
548 m_aBulletStyleName
= pBulletStyleMgr
->RegisterBulletStyle(this, m_pBullOver
, m_pIndentOverride
);
552 if (m_pSilverBullet
->IsBulletOrdered())
554 OUString aPreBullStyleName
;
555 LwpNumberingOverride
* pNumbering
= GetParaNumbering();
556 sal_uInt16 nPosition
= pNumbering
->GetPosition();
557 bool bLesser
= m_pSilverBullet
->IsLesserLevel(nPosition
);
558 LwpPara
* pPara
= this;
559 LwpPara
* pPrePara
= nullptr;
560 sal_uInt16 nNum
= 0, nLevel
= 0, nFoundLevel
= 0xffff, nFoundBound
= 0;
562 nFoundBound
= nLevel
= pNumbering
->GetLevel();
563 if (nPosition
== pNumbering
->GetPosition())
567 bool bHeading
= pNumbering
->IsHeading();
571 /*// When we hit the hint paragraph, we can stop and check the hint.
572 if (qNumberHint && (qPara == qNumberHint->GetPara()) &&
573 qNumberHint->Lookup(qSilverBullet, Level, Position, &Offset))
579 LwpSilverBullet
* pParaSilverBullet
= pPara
->GetSilverBullet();
580 pNumbering
= pPara
->GetParaNumbering();
582 if (pPara
->GetObjectID() != GetObjectID())
584 if (!pParaSilverBullet
)
589 /* If lesser, stop when we hit an outline style whose level is
590 * higher than our current level.
592 // restart based on Outline level?
593 if (pNumbering
&& bLesser
&& (!bHeading
|| pNumbering
->IsHeading()))
595 if (nFoundLevel
!= 0xffff)
597 if (pNumbering
->GetLevel() < nFoundLevel
)
601 if ((pNumbering
->GetLevel() == nFoundLevel
)
602 && (pParaSilverBullet
->GetObjectID() != m_pSilverBullet
->GetObjectID()
603 || pNumbering
->GetPosition() != nPosition
))
610 if (pNumbering
&& pNumbering
->GetLevel() < nFoundBound
&& pParaSilverBullet
611 && (pParaSilverBullet
->GetObjectID() != m_pSilverBullet
->GetObjectID()
612 || pNumbering
->GetPosition() != nPosition
))
614 nFoundBound
= pNumbering
->GetLevel();
620 && qSpecificStyle == qPara->GetParaStyle(LTRUE))
623 // See if we crossed a section boundary
626 CurrPos.SetPara(qPara);
627 if (CurrPos <= SectionPos)
632 // Don't bump the number if this bullet is skipped
633 if (m_pBullOver
->IsSkip())
635 else if ( pParaSilverBullet
636 && pParaSilverBullet
->GetObjectID() == m_pSilverBullet
->GetObjectID()
637 && pNumbering
&& nPosition
== pNumbering
->GetPosition())
641 if (nFoundLevel
!= 0xffff)
643 if (nFoundLevel
== pNumbering
->GetLevel())
645 aPreBullStyleName
= pPara
->GetBulletStyleName();
649 else if (pNumbering
->GetLevel() <= nLevel
)
651 if (pNumbering
->GetLevel() >= nFoundBound
)
655 nFoundLevel
= pNumbering
->GetLevel();
656 aPreBullStyleName
= pPara
->GetBulletStyleName();
662 aPreBullStyleName
= pPara
->GetBulletStyleName();
667 pPrePara
= dynamic_cast<LwpPara
*>(pPara
->GetPrevious().obj(VO_PARA
).get());
671 LwpStory
* pStory
= pPara
->GetStory();
672 pPrePara
= pStory
? pStory
->GetLastParaOfPreviousStory() : nullptr;
681 nNum
= nNum
? nNum
: 1;
685 m_aBulletStyleName
= aPreBullStyleName
;
686 m_bBullContinue
= true;
690 m_bBullContinue
= false;
693 XFListStyle
* pOldStyle
= static_cast<XFListStyle
*>(pXFStyleManager
->FindStyle(m_aBulletStyleName
));
696 XFListStyle
* pNewStyle
= new XFListStyle(*pOldStyle
);
697 m_aBulletStyleName
= pXFStyleManager
->AddStyle(pNewStyle
).m_pStyle
->GetStyleName();
702 LwpStory
* pMyStory
= GetStory();
705 if (pMyStory
->IsBullStyleUsedBefore(m_aBulletStyleName
, m_pParaNumbering
->GetPosition()))
707 //m_bBullContinue = sal_True;
711 pMyStory
->AddBullStyleName2List(m_aBulletStyleName
, m_pParaNumbering
->GetPosition());
723 LwpPara
* pPrePara
= dynamic_cast<LwpPara
*>(GetPrevious().obj().get());
724 if (pPrePara
&& pPrePara
->GetBelowSpacing()!=0)
726 pOverStyle
= new XFParaStyle
;
727 *pOverStyle
= *GetXFParaStyle();
728 XFMargins
* pMargin
= &pOverStyle
->GetMargins();
729 pMargin
->SetTop(pMargin
->GetTop()+pPrePara
->GetBelowSpacing());
730 if (!m_ParentStyleName
.isEmpty())
731 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
732 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
).m_pStyle
->GetStyleName();
737 if(m_Fribs
.HasFrib(FRIB_TAG_TAB
))
739 XFParaStyle
* pNewParaStyle
= new XFParaStyle
;
740 *pNewParaStyle
= *GetXFParaStyle();
741 //pOverStyle->SetStyleName("");
742 RegisterTabStyle(pNewParaStyle
);
743 if (!m_ParentStyleName
.isEmpty())
744 pNewParaStyle
->SetParentStyleName(m_ParentStyleName
);
745 m_StyleName
= pXFStyleManager
->AddStyle(pNewParaStyle
).m_pStyle
->GetStyleName();
748 //register master page;
749 RegisterMasterPage(GetXFParaStyle());
751 // reg auto style,lay here for pagebreak need overrided para style
752 m_Fribs
.SetPara(this);
753 m_Fribs
.RegisterStyle();
758 XFParaStyle
* pStyle
= new XFParaStyle
;
759 *pStyle
= *GetXFParaStyle();
760 pStyle
->SetDropCap(m_nChars
-1,m_nLines
);
761 if (!m_ParentStyleName
.isEmpty())
762 pStyle
->SetParentStyleName(m_ParentStyleName
);
763 m_StyleName
= pXFStyleManager
->AddStyle(pStyle
).m_pStyle
->GetStyleName();
765 // maybe useful for further version
766 // deleted because Leader of Table is not supported in this version
767 //AddTabStyleForTOC();
770 void LwpPara::RegisterNewSectionStyle(LwpPageLayout
*pLayout
)
775 XFSectionStyle
* pSectStyle
= new XFSectionStyle();
776 XFColumns
* pColumns
= pLayout
->GetXFColumns();
779 pSectStyle
->SetColumns(pColumns
);
781 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
782 m_SectionStyleName
= pXFStyleManager
->AddStyle(pSectStyle
).m_pStyle
->GetStyleName();
785 XFSection
* LwpPara::CreateXFSection()
787 XFSection
* pXFSection
= new XFSection();
788 pXFSection
->SetStyleName(m_SectionStyleName
);
789 m_SectionStyleName
.clear();
793 /**************************************************************************
794 * @descr: register tab style
795 **************************************************************************/
796 void LwpPara::RegisterTabStyle(XFParaStyle
* pXFParaStyle
)
798 LwpTabOverride aFinaOverride
;
799 LwpTabOverride
* pBase
= nullptr;
800 //get the tabrack from the current layout
801 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj().get());
802 LwpMiddleLayout
* pLayout
= pStory
? pStory
->GetTabLayout() : nullptr;
805 pBase
= pLayout
->GetTabOverride();
808 pBase
->Override(&aFinaOverride
);
812 //get the tabrack from the base parastyle
813 LwpParaStyle
* pParaStyle
= GetParaStyle();
814 pBase
= pParaStyle
->GetTabOverride();
817 pBase
->Override(&aFinaOverride
);
819 //get the tabrack from the local property
820 pBase
= GetLocalTabOverride();
823 pBase
->Override(&aFinaOverride
);
826 LwpParaStyle::ApplyTab(pXFParaStyle
, &aFinaOverride
);
829 * @short parse dropcap text
831 void LwpPara::ParseDropcapContent()
835 XFParagraph
* pDropcap
= GetFoundry()->GetDropcapMgr()->GetXFPara();
838 m_Fribs
.SetXFPara(pDropcap
);
843 * @short add paragraph break attribute
845 void LwpPara::AddBreakBefore(XFContentContainer
* pCont
)
847 if (!m_pBreaks
|| !pCont
)
849 if (m_pBreaks
->IsPageBreakBefore())
851 XFParagraph
*pPara
= new XFParagraph();
852 pPara
->SetStyleName(m_BefPageBreakName
);
855 else if (m_pBreaks
->IsColumnBreakBefore())
857 XFParagraph
*pPara
= new XFParagraph();
858 pPara
->SetStyleName(m_BefColumnBreakName
);
863 void LwpPara::AddBreakAfter(XFContentContainer
* pCont
)
867 if (m_pBreaks
->IsPageBreakAfter())
869 XFParagraph
*pPara
= new XFParagraph();
870 pPara
->SetStyleName(m_AftPageBreakName
);
873 else if (m_pBreaks
->IsColumnBreakAfter())
875 XFParagraph
*pPara
= new XFParagraph();
876 pPara
->SetStyleName(m_AftColumnBreakName
);
881 LwpBulletStyleMgr
* LwpPara::GetBulletStyleMgr()
885 return m_pFoundry
->GetBulletStyleMgr();
891 XFContentContainer
* LwpPara::AddBulletList(XFContentContainer
* pCont
)
893 LwpBulletStyleMgr
* pBulletStyleMgr
= GetBulletStyleMgr();
894 if (!pBulletStyleMgr
)
900 sal_uInt16 nLevel
= m_nLevel
;
901 bool bOrdered
= false;
902 /*LwpStory* pMyStory =*/ GetStory();
904 pBulletStyleMgr
->SetContinueFlag(m_bBullContinue
);
906 if (m_pSilverBullet
->IsBulletOrdered())
910 if (m_pSilverBullet
->HasName())
912 nLevel
= m_pParaNumbering
->GetPosition();
913 m_nLevel
= nLevel
;//for get para level
916 return ( pBulletStyleMgr
->AddBulletList(pCont
, bOrdered
, m_aBulletStyleName
,
917 nLevel
, m_pBullOver
->IsSkip()) );
920 LwpNumberingOverride
* LwpPara::GetParaNumbering()
922 return m_pParaNumbering
.get();
925 void LwpForked3NotifyList::Read(LwpObjectStream
* pObjStrm
)
927 m_PersistentList
.Read(pObjStrm
);
930 void LwpNotifyListPersistent::Read(LwpObjectStream
* pObjStrm
)
932 m_Head
.ReadIndexed(pObjStrm
);
933 pObjStrm
->SkipExtra();
936 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */