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
), m_pBreaks(NULL
), m_pIndentOverride(NULL
)
105 , m_bHasBullet(sal_False
), m_pSilverBullet(NULL
)
106 , /*m_pParaNumbering(NULL),*/ m_pBullOver(NULL
)
107 , m_bBullContinue(sal_False
)
108 , m_bHasDropcap(sal_False
), m_nLines(0), m_nChars(0)
109 , m_pDropcapLayout(NULL
), m_BelowSpacing(0), m_pXFContainer(NULL
)
112 m_SectionStyleName
= A2OUSTR("");
113 m_AllText
= A2OUSTR("");
124 /* if (m_pParaNumbering)
126 delete m_pParaNumbering;
127 m_pParaNumbering = NULL;
135 if(m_pIndentOverride
)
137 delete m_pIndentOverride
;
140 LwpParaProperty
* pNextProp
;
143 pNextProp
= m_pProps
->GetNext();
145 m_pProps
= pNextProp
;
154 sal_Bool Notify
= sal_False
;
155 if(LwpFileHeader::m_nFileRevision
<0x0006)
157 else if(LwpFileHeader::m_nFileRevision
<0x000B)
158 Simple
= m_pObjStrm
->QuickReaduInt8();
161 sal_uInt8 Flag
= m_pObjStrm
->QuickReaduInt8();
163 const int DISK_SIMPLE
= 1;
164 const int DISK_NOTIFY
= 2;
166 Simple
= (Flag
& DISK_SIMPLE
) ? sal_True
: sal_False
;
167 Notify
= (Flag
& DISK_NOTIFY
) ? sal_True
: sal_False
;
172 m_nOrdinal
= m_pObjStrm
->QuickReaduInt32();
173 if(LwpFileHeader::m_nFileRevision
<0x000B)
177 /*pCForked3NotifyList Notify = new CForked3NotifyList(this);
178 Notify->GetExtraList()->QuickRead(pFile);
179 Notify->QuickRead(pFile);
180 if(Notify->GetExtraList()->IsEmpty() &&
184 cNotifyList = Notify;*/
190 LwpForked3NotifyList
* pNotifyList
= new LwpForked3NotifyList();
191 pNotifyList
->GetExtraList()->Read(m_pObjStrm
);
192 pNotifyList
->Read(m_pObjStrm
);
200 m_nFlags
= m_pObjStrm
->QuickReaduInt16();
201 m_ParaStyle
.ReadIndexed(m_pObjStrm
);
205 m_Hint
.Read(m_pObjStrm
);
206 if (IsBadHintsInFile())
208 // This hint is no good, so throw it away -- SDC 9/28/95
213 m_Story
.ReadIndexed(m_pObjStrm
);
216 if(LwpFileHeader::m_nFileRevision
<0x000B)
220 /*PropList = new CParaPropListProperty(this);
221 PropList->GetList()->QuickRead(pFile);
222 if(PropList->GetList()->IsEmpty())
228 m_nLevel
= m_pObjStrm
->QuickReaduInt16();
240 m_Fribs
.SetPara(this);//add by 2/1, 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
);
250 m_pXFContainer
->ToXml(pOutputStream
);
251 m_pXFContainer
->Reset();
252 delete m_pXFContainer
;
253 m_pXFContainer
= NULL
;
256 void LwpPara::XFConvert(XFContentContainer
* pCont
)
258 m_pXFContainer
= pCont
;
260 LwpStory
*pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj());
262 if (pStory
&& pStory
->GetDropcapFlag() == sal_True
)
264 ParseDropcapContent();
268 //Add the break before para
269 if (m_pBreaks
&& m_nOrdinal
!=0)
270 AddBreakBefore(pCont
);
272 //Create an XFPara for this VO_PARA
273 XFParagraph
*pPara
= new XFParagraph
;
274 pPara
->SetStyleName(m_StyleName
);
276 if(!m_SectionStyleName
.isEmpty())
278 XFSection
* pSection
= CreateXFSection();
280 pStory
->AddXFContent(pSection
);
281 //pSection->Add(pPara);
282 m_pXFContainer
= pSection
;
285 if (m_bHasBullet
&& m_pSilverBullet
)
287 XFContentContainer
* pListItem
= AddBulletList(m_pXFContainer
);
290 pListItem
->Add(pPara
);
295 LwpBulletStyleMgr
* pBulletStyleMgr
= this->GetBulletStyleMgr();
298 pBulletStyleMgr
->SetCurrentSilverBullet(LwpObjectID());
299 pBulletStyleMgr
->SetContinueFlag(sal_False
);
301 m_pXFContainer
->Add(pPara
);
304 m_Fribs
.SetXFPara(pPara
);
308 AddBreakAfter(m_pXFContainer
);
311 sal_Bool
LwpPara::RegisterMasterPage(XFParaStyle
* pBaseStyle
)
313 sal_Bool bSuccess
= sal_False
;
315 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj());
316 //if pagelayout is modified, register the pagelayout
317 if(pStory
&& pStory
->IsPMModified())
319 sal_Bool bNewSection
= sal_False
;
320 bNewSection
= pStory
->IsNeedSection();
321 LwpPageLayout
* pLayout
= pStory
->GetCurrentLayout();
324 RegisterNewSectionStyle(pLayout
);
328 //register master page style
329 XFParaStyle
* pOverStyle
= new XFParaStyle();
330 *pOverStyle
= *pBaseStyle
;
331 pOverStyle
->SetStyleName( A2OUSTR(""));
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
)->GetStyleName();
341 * @short register paragraph style
343 void LwpPara::RegisterStyle()
345 // m_Fribs.SetPara(this);
346 // m_Fribs.RegisterStyle();
351 XFParaStyle
* pBaseStyle
= static_cast<XFParaStyle
*>(m_pFoundry
->GetStyleManager()->GetStyle(m_ParaStyle
));
352 if (pBaseStyle
== NULL
) return;
353 m_StyleName
= pBaseStyle
->GetStyleName();//such intf to be added
354 m_ParentStyleName
= m_StyleName
;
355 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
357 if (GetParaStyle()->GetIndent())
359 std::auto_ptr
<LwpIndentOverride
> pIndentOverride(GetParaStyle()->GetIndent()->clone());
360 delete m_pIndentOverride
;
361 m_pIndentOverride
= pIndentOverride
.release();
364 XFParaStyle
* pOverStyle
= NULL
;
365 sal_Bool noSpacing
= sal_True
;
366 sal_Bool noIndent
= sal_True
;
367 LwpParaProperty
* pBulletProps
= NULL
, *pNumberingProps
= NULL
;
369 if (m_pProps
!= NULL
)
371 pOverStyle
= new XFParaStyle
;
372 *pOverStyle
= *pBaseStyle
;
373 pOverStyle
->SetStyleName(A2OUSTR(""));
374 LwpParaProperty
* pProps
= m_pProps
;
376 LwpParaStyle
* pParaStyle
= dynamic_cast<LwpParaStyle
*>(m_ParaStyle
.obj());
379 PropType
= pProps
->GetType();
384 if (!pParaStyle
->GetAlignment())
385 OverrideAlignment(NULL
,static_cast<LwpParaAlignProperty
*>(pProps
)->GetAlignment(),pOverStyle
);
388 boost::scoped_ptr
<LwpAlignmentOverride
> const pAlign(
389 pParaStyle
->GetAlignment()->clone());
390 OverrideAlignment(pAlign
.get(),
391 static_cast<LwpParaAlignProperty
*>(pProps
)->GetAlignment(),
396 case PP_LOCAL_INDENT
:
398 noIndent
= sal_False
;
399 if (!pParaStyle
->GetIndent())
400 OverrideIndent(NULL
,static_cast<LwpParaIndentProperty
*>(pProps
)->GetIndent(),pOverStyle
);
404 OverrideIndent(m_pIndentOverride
,static_cast<LwpParaIndentProperty
*>(pProps
)->GetIndent(),pOverStyle
);
408 case PP_LOCAL_SPACING
:
410 noSpacing
= sal_False
;
411 if (!pParaStyle
->GetSpacing())
412 OverrideSpacing(NULL
,static_cast<LwpParaSpacingProperty
*>(pProps
)->GetSpacing(),pOverStyle
);
415 boost::scoped_ptr
<LwpSpacingOverride
> const
416 pSpacing(pParaStyle
->GetSpacing()->clone());
417 OverrideSpacing(pSpacing
.get(),
418 static_cast<LwpParaSpacingProperty
*>(pProps
)->GetSpacing(),
424 case PP_LOCAL_BORDER
:
426 OverrideParaBorder(pProps
, pOverStyle
);
429 case PP_LOCAL_BREAKS
:
431 OverrideParaBreaks(pProps
, pOverStyle
);
434 case PP_LOCAL_BULLET
:
436 pBulletProps
= pProps
;
437 // OverrideParaBullet(pProps);
440 case PP_LOCAL_NUMBERING
:
442 pNumberingProps
= pProps
;
443 // OverrideParaNumbering(pProps);
447 case PP_LOCAL_TABRACK
:
450 /*LwpTabOverride* pTabOverride=pParaStyle->GetTabOverride();
453 OverrideTab(NULL,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
457 OverrideTab(pTabOverride,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
461 case PP_LOCAL_BACKGROUND
:
463 /* LwpBackgroundOverride aBackground;
464 if (!pParaStyle->GetBackground())
465 OverrideBackground(NULL,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
468 aBackground = *(pParaStyle->GetaBackground());
469 OverrideBackground(&aBackground,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
472 // modified by , 06/03/2005
473 LwpBackgroundOverride
* pBGOver
= static_cast<LwpParaBackGroundProperty
*>(pProps
)->GetBackground();
476 LwpBackgroundStuff
* pBGStuff
= pBGOver
->GetBGStuff();
477 if (pBGStuff
&& !pBGStuff
->IsTransparent() )
479 if (pBGStuff
->IsPatternFill())
481 XFBGImage
* pXFBGImage
= pBGStuff
->GetFillPattern();
482 pOverStyle
->SetBackImage(pXFBGImage
);
486 LwpColor
* pColor
= pBGStuff
->GetFillColor();
487 if (pColor
&& pColor
->IsValidColor())
489 XFColor
aXFColor( pColor
->To24Color());
490 pOverStyle
->SetBackColor( aXFColor
);
501 pProps
= pProps
->GetNext();
504 if (noIndent
&& m_pIndentOverride
)
506 if (m_pIndentOverride
->IsUseRelative() && GetParent())
508 OverrideIndent(NULL
,m_pIndentOverride
,pOverStyle
);
511 if (!m_ParentStyleName
.isEmpty())
512 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
513 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
)->GetStyleName();
516 else //use named style
518 if (m_pIndentOverride
)
520 if (m_pIndentOverride
->IsUseRelative() && GetParent())
522 pOverStyle
= new XFParaStyle
;
523 *pOverStyle
= *pBaseStyle
;
524 OverrideIndent(NULL
,m_pIndentOverride
,pOverStyle
);
525 if (!m_ParentStyleName
.isEmpty())
526 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
527 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
)->GetStyleName();
534 XFParaStyle
* pOldStyle
= pXFStyleManager
->FindParaStyle(m_StyleName
);
535 if (pOldStyle
->GetNumberRight())
537 pOverStyle
= new XFParaStyle
;
538 *pOverStyle
= *pOldStyle
;
539 pOverStyle
->SetAlignType(enumXFAlignStart
);
540 if (!m_ParentStyleName
.isEmpty())
541 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
542 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
)->GetStyleName();
546 // override bullet and numbering
547 OverrideParaBullet(pBulletProps
);
548 OverrideParaNumbering(pNumberingProps
);
551 //register bullet style
552 LwpBulletStyleMgr
* pBulletStyleMgr
= this->GetBulletStyleMgr();
555 // if has bullet or numbering
558 //if it's normal bullet
561 if (m_pSilverBullet
->HasName())
563 m_aBulletStyleName
= m_pSilverBullet
->GetBulletStyleName();
565 else if (!m_pBullOver
->IsEditable())
567 m_aBulletStyleName
= pBulletStyleMgr
->RegisterBulletStyle(this, m_pBullOver
, m_pIndentOverride
);
571 if (m_pSilverBullet
->IsBulletOrdered())
573 OUString aPreBullStyleName
;
574 LwpNumberingOverride
* pNumbering
= this->GetParaNumbering();
575 sal_uInt16 nPosition
= pNumbering
->GetPosition();
576 sal_Bool bLesser
= m_pSilverBullet
->IsLesserLevel(nPosition
);
577 /*sal_Bool bResetSection =*/ m_pSilverBullet
->IsNewSection(nPosition
);
579 LwpPara
* pPara
= this;
580 LwpPara
* pPrePara
= NULL
;
581 LwpSilverBullet
* pParaSilverBullet
= NULL
;
582 sal_uInt16 nNum
= 0, nLevel
= 0, nFoundLevel
= 0xffff, nFoundBound
= 0;
584 nFoundBound
= nLevel
= pNumbering
->GetLevel();
585 if (nPosition
== pNumbering
->GetPosition())
589 bHeading
= pNumbering
->IsHeading();
593 /*// When we hit the hint paragraph, we can stop and check the hint.
594 if (qNumberHint && (qPara == qNumberHint->GetPara()) &&
595 qNumberHint->Lookup(qSilverBullet, Level, Position, &Offset))
601 pParaSilverBullet
= pPara
->GetSilverBullet();
602 pNumbering
= pPara
->GetParaNumbering();
604 if (*(pPara
->GetObjectID()) != *(this->GetObjectID()))
606 if (!pParaSilverBullet
)
611 /* If lesser, stop when we hit an outline style whose level is
612 * higher than our current level.
614 // restart based on Outline level?
615 if (pNumbering
&& bLesser
&& (bHeading
? pNumbering
->IsHeading() : sal_True
))
617 if (nFoundLevel
!= 0xffff)
619 if (pNumbering
->GetLevel() < nFoundLevel
)
623 if ((pNumbering
->GetLevel() == nFoundLevel
)
624 && (*(pParaSilverBullet
->GetObjectID()) != *(m_pSilverBullet
->GetObjectID())
625 || pNumbering
->GetPosition() != nPosition
))
632 if (pNumbering
&& pNumbering
->GetLevel() < nFoundBound
&& pParaSilverBullet
633 && (*(pParaSilverBullet
->GetObjectID()) != *(m_pSilverBullet
->GetObjectID())
634 || pNumbering
->GetPosition() != nPosition
))
636 nFoundBound
= pNumbering
->GetLevel();
642 && qSpecificStyle == qPara->GetParaStyle(LTRUE))
645 // See if we crossed a section boundary
648 CurrPos.SetPara(qPara);
649 if (CurrPos <= SectionPos)
654 // Don't bump the number if this bullet is skipped
655 if (m_pBullOver
->IsSkip())
657 else if ( pParaSilverBullet
658 && *(pParaSilverBullet
->GetObjectID()) == *(m_pSilverBullet
->GetObjectID())
659 && pNumbering
&& nPosition
== pNumbering
->GetPosition())
663 if (nFoundLevel
!= 0xffff)
665 if (nFoundLevel
== pNumbering
->GetLevel())
667 aPreBullStyleName
= pPara
->GetBulletStyleName();
671 else if (pNumbering
->GetLevel() <= nLevel
)
673 if (pNumbering
->GetLevel() >= nFoundBound
)
677 nFoundLevel
= pNumbering
->GetLevel();
678 aPreBullStyleName
= pPara
->GetBulletStyleName();
684 aPreBullStyleName
= pPara
->GetBulletStyleName();
689 if (pPara
&& pPara
->GetPrevious())
690 pPrePara
= dynamic_cast<LwpPara
*>(pPara
->GetPrevious()->obj(VO_PARA
));
696 LwpStory
* pStory
= pPara
->GetStory();
697 pPrePara
= pStory
->GetLastParaOfPreviousStory();
706 nNum
= nNum
? nNum
: 1;
710 m_aBulletStyleName
= aPreBullStyleName
;
711 m_bBullContinue
= sal_True
;
715 m_bBullContinue
= sal_False
;
716 if (this->IsInCell())
718 XFListStyle
* pOldStyle
= static_cast<XFListStyle
*>(pXFStyleManager
->FindStyle(m_aBulletStyleName
));
721 XFListStyle
* pNewStyle
= new XFListStyle(*pOldStyle
);
722 m_aBulletStyleName
= pXFStyleManager
->AddStyle(pNewStyle
)->GetStyleName();
727 LwpStory
* pMyStory
= this->GetStory();
730 if (pMyStory
->IsBullStyleUsedBefore(m_aBulletStyleName
, m_pParaNumbering
->GetPosition()))
732 //m_bBullContinue = sal_True;
736 pMyStory
->AddBullStyleName2List(m_aBulletStyleName
, m_pParaNumbering
->GetPosition());
747 if (noSpacing
&& GetPrevious())
749 LwpPara
* pPrePara
= dynamic_cast<LwpPara
*>(GetPrevious()->obj());
750 if (pPrePara
&& pPrePara
->GetBelowSpacing()!=0)
752 pOverStyle
= new XFParaStyle
;
753 *pOverStyle
= *GetXFParaStyle();
754 XFMargins
* pMargin
= &pOverStyle
->GetMargins();
755 pMargin
->SetTop(pMargin
->GetTop()+pPrePara
->GetBelowSpacing());
756 if (!m_ParentStyleName
.isEmpty())
757 pOverStyle
->SetParentStyleName(m_ParentStyleName
);
758 m_StyleName
= pXFStyleManager
->AddStyle(pOverStyle
)->GetStyleName();
763 if(m_Fribs
.HasFrib(FRIB_TAG_TAB
))
765 XFParaStyle
* pParaStyle
= new XFParaStyle
;
766 *pParaStyle
= *GetXFParaStyle();
767 //pOverStyle->SetStyleName(A2OUSTR(""));
768 this->RegisterTabStyle(pParaStyle
);
769 if (!m_ParentStyleName
.isEmpty())
770 pParaStyle
->SetParentStyleName(m_ParentStyleName
);
771 m_StyleName
= pXFStyleManager
->AddStyle(pParaStyle
)->GetStyleName();
774 //register master page;
775 RegisterMasterPage(GetXFParaStyle());
777 // reg auto style,lay here for pagebreak need overrided para style
778 m_Fribs
.SetPara(this);
779 m_Fribs
.RegisterStyle();
781 if (m_bHasDropcap
== sal_True
)
784 XFParaStyle
* pStyle
= new XFParaStyle
;
785 *pStyle
= *GetXFParaStyle();
786 pStyle
->SetDropCap(m_nChars
-1,m_nLines
);
787 if (!m_ParentStyleName
.isEmpty())
788 pStyle
->SetParentStyleName(m_ParentStyleName
);
789 m_StyleName
= pXFStyleManager
->AddStyle(pStyle
)->GetStyleName();
791 // maybe useful for futer version
792 // deleted because Leader of Table is not supported in this version
793 //AddTabStyleForTOC();
796 void LwpPara::RegisterNewSectionStyle(LwpPageLayout
*pLayout
)
801 XFSectionStyle
* pSectStyle
= new XFSectionStyle();
802 XFColumns
* pColumns
= pLayout
->GetXFColumns();
805 pSectStyle
->SetColumns(pColumns
);
807 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
808 m_SectionStyleName
= pXFStyleManager
->AddStyle(pSectStyle
)->GetStyleName();
811 XFSection
* LwpPara::CreateXFSection()
813 XFSection
* pXFSection
= new XFSection();
814 pXFSection
->SetStyleName(m_SectionStyleName
);
815 m_SectionStyleName
= A2OUSTR("");
819 /**************************************************************************
820 * @descr: register tab style
824 **************************************************************************/
825 void LwpPara::RegisterTabStyle(XFParaStyle
* pXFParaStyle
)
827 LwpTabOverride aFinaOverride
;
828 LwpTabOverride
* pBase
= NULL
;
829 //get the tabrack from the current layout
830 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Story
.obj());
831 LwpMiddleLayout
* pLayout
= pStory
? pStory
->GetTabLayout() : NULL
;
834 pBase
= pLayout
->GetTabOverride();
837 pBase
->Override(&aFinaOverride
);
841 //get the tabrack from the base parastyle
842 LwpParaStyle
* pParaStyle
= GetParaStyle();
843 pBase
= pParaStyle
->GetTabOverride();
846 pBase
->Override(&aFinaOverride
);
848 //get the tabrack from the local property
849 pBase
= GetLocalTabOverride();
852 pBase
->Override(&aFinaOverride
);
855 LwpParaStyle::ApplyTab(pXFParaStyle
, &aFinaOverride
);
858 * @short parse dropcap text
860 void LwpPara::ParseDropcapContent()
864 XFParagraph
* pDropcap
= GetFoundry()->GetDropcapMgr()->GetXFPara();
867 m_Fribs
.SetXFPara(pDropcap
);
872 * @short add paragraph break attribute
874 void LwpPara::AddBreakBefore(XFContentContainer
* pCont
)
878 if (m_pBreaks
->IsPageBreakBefore())
880 XFParagraph
*pPara
= new XFParagraph();
881 pPara
->SetStyleName(m_BefPageBreakName
);
884 else if (m_pBreaks
->IsColumnBreakBefore())
886 XFParagraph
*pPara
= new XFParagraph();
887 pPara
->SetStyleName(m_BefColumnBreakName
);
892 void LwpPara::AddBreakAfter(XFContentContainer
* pCont
)
896 if (m_pBreaks
->IsPageBreakAfter())
898 XFParagraph
*pPara
= new XFParagraph();
899 pPara
->SetStyleName(m_AftPageBreakName
);
902 else if (m_pBreaks
->IsColumnBreakAfter())
904 XFParagraph
*pPara
= new XFParagraph();
905 pPara
->SetStyleName(m_AftColumnBreakName
);
910 LwpBulletStyleMgr
* LwpPara::GetBulletStyleMgr()
914 return m_pFoundry
->GetBulletStyleMgr();
920 XFContentContainer
* LwpPara::AddBulletList(XFContentContainer
* pCont
)
922 LwpBulletStyleMgr
* pBulletStyleMgr
= GetBulletStyleMgr();
923 if (!pBulletStyleMgr
)
929 sal_uInt16 nLevel
= m_nLevel
;
930 sal_Bool bOrdered
= sal_False
;
931 /*LwpStory* pMyStory =*/ GetStory();
933 pBulletStyleMgr
->SetContinueFlag(m_bBullContinue
);
935 if (m_pSilverBullet
->IsBulletOrdered())
939 if (m_pSilverBullet
->HasName())
941 nLevel
= m_pParaNumbering
->GetPosition();
942 m_nLevel
= nLevel
;//add by ,for get para level
943 // m_aBulletStyleName = m_pSilverBullet->GetBulletStyleName();
946 return ( pBulletStyleMgr
->AddBulletList(pCont
, bOrdered
, m_aBulletStyleName
,
947 nLevel
, m_pBullOver
->IsSkip()) );
950 LwpNumberingOverride
* LwpPara::GetParaNumbering()
952 return m_pParaNumbering
.get();
955 void LwpForked3NotifyList::Read(LwpObjectStream
* pObjStrm
)
957 m_PersistentList
.Read(pObjStrm
);
960 void LwpNotifyListPersistent::Read(LwpObjectStream
* pObjStrm
)
962 m_Head
.ReadIndexed(pObjStrm
);
963 pObjStrm
->SkipExtra();
966 void LwpPara::Release()
969 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */