LibreOffice Module lotuswordpro (master) 1
lwppara.cxx
Go to the documentation of this file.
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#include "lwppara.hxx"
62#include <lwpglobalmgr.hxx>
63#include <lwpfilehdr.hxx>
64#include "lwppagelayout.hxx"
65#include "lwpparaproperty.hxx"
66#include "lwpparastyle.hxx"
69#include <xfilter/xfmargins.hxx>
70#include <xfilter/xfsection.hxx>
72#include <xfilter/xfcolor.hxx>
74#include "lwpfribheader.hxx"
75#include "lwplayout.hxx"
76#include "lwpbulletstylemgr.hxx"
77#include "lwpstory.hxx"
78#include "lwpsilverbullet.hxx"
79
80#include <lwpdropcapmgr.hxx>
81#include <memory>
83
85 : LwpDLVList(objHdr, pStrm)
86 , m_nOrdinal(0)
87 , m_nFlags(0)
88 , m_nLevel(0)
89 , m_FontID(0)
90 , m_AllText("")
91 , m_bHasBullet(false)
92 , m_pSilverBullet(nullptr)
93 , m_bBullContinue(false)
94 , m_SectionStyleName("")
95 , m_bHasDropcap(false)
96 , m_nLines(0)
97 , m_nChars(0)
98 , m_pDropcapLayout(nullptr)
99 , m_BelowSpacing(0)
100{
101}
102
104{
105}
106
108{
110
111 bool Simple;
112 bool Notify = false;
114 Simple = false;
115 else if(LwpFileHeader::m_nFileRevision<0x000B)
116 Simple = m_pObjStrm->QuickReaduInt8() != 0;
117 else
118 {
119 sal_uInt8 Flag = m_pObjStrm->QuickReaduInt8();
120
121 const int DISK_SIMPLE = 1;
122 const int DISK_NOTIFY = 2;
123
124 Simple = (Flag & DISK_SIMPLE) != 0;
125 Notify = (Flag & DISK_NOTIFY) != 0;
126 }
127
128 if(!Simple)
129 {
130 m_nOrdinal = m_pObjStrm->QuickReaduInt32();
132 {
133 assert(false);
134 }
135 else
136 {
137 if (Notify)
138 {
139 LwpForked3NotifyList aNotifyList;
140 aNotifyList.GetExtraList().Read(m_pObjStrm.get());
141 aNotifyList.Read(m_pObjStrm.get());
142 }
143 }
144 }
145 else
146 m_nOrdinal = 0x0001;
147
148 m_nFlags = m_pObjStrm->QuickReaduInt16();
150
151 if(!Simple)
152 {
153 m_Hint.Read(m_pObjStrm.get());
154 }
155
157 if(!Simple)
158 {
160 {
161 // TODO: to process
162 assert(false);
163 }
164 m_nLevel = m_pObjStrm->QuickReaduInt16();
165
166 if (m_nLevel > 9)
167 {
168 m_nLevel = 9;
169 }
170 }
171 else
172 m_nLevel = 0x0001;
173
174 m_Fribs.SetPara(this);// for silver bullet
176
178}
179
180void LwpPara::Parse(IXFStream* pOutputStream)
181{
184 if (!m_xXFContainer)
185 return;
186 m_xXFContainer->ToXml(pOutputStream);
187 m_xXFContainer->Reset();
188 m_xXFContainer.clear();
189}
190
192{
193 m_xXFContainer.set(pCont);
194
195 LwpStory *pStory = dynamic_cast<LwpStory*>(m_Story.obj().get());
196
197 if (pStory && pStory->GetDropcapFlag())
198 {
200 return;
201 }
202
203 //Add the break before para
204 if (m_pBreaks && m_nOrdinal!=0)
205 AddBreakBefore(pCont);
206
207 //Create an XFPara for this VO_PARA
209 xPara->SetStyleName(m_StyleName);
210
211 if(!m_SectionStyleName.isEmpty())
212 {
214 if (pStory)
215 pStory->AddXFContent(xSection.get());
216 m_xXFContainer = xSection;
217 }
218
220 {
222 if (xListItem)
223 {
224 xListItem->Add(xPara.get());
225 }
226 }
227 else if (m_xXFContainer)
228 {
229 LwpBulletStyleMgr* pBulletStyleMgr = GetBulletStyleMgr();
230 if (pBulletStyleMgr)
231 {
232 pBulletStyleMgr->SetCurrentSilverBullet(LwpObjectID());
233 pBulletStyleMgr->SetContinueFlag(false);
234 }
235 m_xXFContainer->Add(xPara.get());
236 }
237
238 m_Fribs.SetXFPara(xPara.get());
240
243}
244
246{
247 //get story
248 LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj().get());
249 //if pagelayout is modified, register the pagelayout
250 if(!(pStory && pStory->IsPMModified()))
251 return;
252
253 bool bNewSection = pStory->IsNeedSection();
254 LwpPageLayout* pLayout = pStory->GetCurrentLayout();
255 if(bNewSection)
256 {
258 }
259
260 //register master page style
261 std::unique_ptr<XFParaStyle> xOverStyle(new XFParaStyle);
262 *xOverStyle = *pBaseStyle;
263 xOverStyle->SetStyleName( "");
264 xOverStyle->SetMasterPage(pLayout->GetStyleName());
265 if (!m_ParentStyleName.isEmpty())
266 xOverStyle->SetParentStyleName(m_ParentStyleName);
268 m_StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
269}
274{ //1 reg autostyle
275// m_Fribs.SetPara(this);
276// m_Fribs.RegisterStyle();
277
278 //2 reg para style
279 if (!m_pFoundry)
280 return;
281 XFParaStyle* pBaseStyle = dynamic_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(m_ParaStyle));
282 if (pBaseStyle == nullptr) return;
283 m_StyleName = pBaseStyle->GetStyleName();//such intf to be added
286
287 LwpParaStyle* pParaStyle = GetParaStyle();
288 if (pParaStyle && pParaStyle->GetIndent())
289 {
290 std::unique_ptr<LwpIndentOverride> pIndentOverride(GetParaStyle()->GetIndent()->clone());
291 m_pIndentOverride = std::move(pIndentOverride);
292 }
293
294 std::unique_ptr<XFParaStyle> xOverStyle;
295 bool noSpacing = true;
296 LwpParaProperty* pBulletProps = nullptr, *pNumberingProps = nullptr;
297
298 if (!m_vProps.empty())
299 {
300 bool noIndent = true;
301 xOverStyle.reset(new XFParaStyle);
302 *xOverStyle = *pBaseStyle;
303 xOverStyle->SetStyleName("");
304 sal_uInt32 PropType;
305 LwpParaStyle& rParaStyle = dynamic_cast<LwpParaStyle&>(*m_ParaStyle.obj());
306 for (auto & pProps : m_vProps)
307 {
308 PropType = pProps->GetType();
309 switch(PropType)
310 {
311 case PP_LOCAL_ALIGN:
312 {
313 LwpAlignmentOverride *pAlignment = static_cast<LwpParaAlignProperty*>(pProps.get())->GetAlignment();
314 if (pAlignment)
315 {
316 if (!rParaStyle.GetAlignment())
317 OverrideAlignment(nullptr, pAlignment, xOverStyle.get());
318 else
319 {
320 std::unique_ptr<LwpAlignmentOverride> const pAlign(
321 rParaStyle.GetAlignment()->clone());
322 OverrideAlignment(pAlign.get(),
323 pAlignment,
324 xOverStyle.get());
325 }
326 }
327 break;
328 }
329 case PP_LOCAL_INDENT:
330 {
331 noIndent = false;
332 LwpIndentOverride *pIndent = static_cast<LwpParaIndentProperty*>(pProps.get())->GetIndent();
333 if (pIndent)
334 {
335 if (!rParaStyle.GetIndent())
336 OverrideIndent(nullptr, pIndent, xOverStyle.get());
337 else
338 OverrideIndent(m_pIndentOverride.get(), pIndent, xOverStyle.get());
339 }
340 break;
341 }
342 case PP_LOCAL_SPACING:
343 {
344 noSpacing = false;
345 LwpSpacingOverride *pSpacing = static_cast<LwpParaSpacingProperty*>(pProps.get())->GetSpacing();
346 if (pSpacing)
347 {
348 if (!rParaStyle.GetSpacing())
349 OverrideSpacing(nullptr, pSpacing, xOverStyle.get());
350 else
351 {
352 std::unique_ptr<LwpSpacingOverride> const
353 pNewSpacing(rParaStyle.GetSpacing()->clone());
354 OverrideSpacing(pNewSpacing.get(), pSpacing, xOverStyle.get());
355 }
356 }
357 break;
358 }
359 case PP_LOCAL_BORDER:
360 {
361 OverrideParaBorder(pProps.get(), xOverStyle.get());
362 break;
363 }
364 case PP_LOCAL_BREAKS:
365 {
366 OverrideParaBreaks(pProps.get(), xOverStyle.get());
367 break;
368 }
369 case PP_LOCAL_BULLET:
370 {
371 pBulletProps = pProps.get();
372 break;
373 }
375 {
376 pNumberingProps = pProps.get();
377 break;
378 }
379 case PP_LOCAL_TABRACK:
380 {
381 break;
382 }
384 {
385 LwpBackgroundOverride* pBGOver = static_cast<LwpParaBackGroundProperty*>(pProps.get())->GetBackground();
386 if (pBGOver)
387 {
388 LwpBackgroundStuff& rBGStuff = pBGOver->GetBGStuff();
389 if (!rBGStuff.IsTransparent() )
390 {
391 if (rBGStuff.IsPatternFill())
392 {
393 std::unique_ptr<XFBGImage> xXFBGImage(rBGStuff.GetFillPattern());
394 xOverStyle->SetBackImage(xXFBGImage);
395 }
396 else
397 {
398 LwpColor* pColor = rBGStuff.GetFillColor();
399 if (pColor && pColor->IsValidColor())
400 {
401 XFColor aXFColor( pColor->To24Color());
402 xOverStyle->SetBackColor( aXFColor );
403 }
404 }
405 }
406 }
407 break;
408 }
409 default:
410 break;
411 }
412 }
413
414 if (noIndent && m_pIndentOverride)
415 {
416 if (m_pIndentOverride->IsUseRelative() && GetParent())
417 {
418 OverrideIndent(nullptr,m_pIndentOverride.get(),xOverStyle.get());
419 }
420 }
421 if (!m_ParentStyleName.isEmpty())
422 xOverStyle->SetParentStyleName(m_ParentStyleName);
423 m_StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
424
425 }
426 else //use named style
427 {
429 {
430 if (m_pIndentOverride->IsUseRelative() && GetParent())
431 {
432 xOverStyle.reset(new XFParaStyle);
433 *xOverStyle = *pBaseStyle;
434 OverrideIndent(nullptr,m_pIndentOverride.get(),xOverStyle.get());
435 if (!m_ParentStyleName.isEmpty())
436 xOverStyle->SetParentStyleName(m_ParentStyleName);
437 m_StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
438 }
439 }
440 }
441
442 if (IsInCell())
443 {
444 XFParaStyle* pOldStyle = pXFStyleManager->FindParaStyle(m_StyleName);
445 if (pOldStyle->GetNumberRight())
446 {
447 xOverStyle.reset(new XFParaStyle);
448 *xOverStyle = *pOldStyle;
449 xOverStyle->SetAlignType(enumXFAlignStart);
450 if (!m_ParentStyleName.isEmpty())
451 xOverStyle->SetParentStyleName(m_ParentStyleName);
452 m_StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
453 }
454 }
455
456 // override bullet and numbering
457 OverrideParaBullet(pBulletProps);
458 OverrideParaNumbering(pNumberingProps);
459
460 //register bullet style
461 LwpBulletStyleMgr* pBulletStyleMgr = GetBulletStyleMgr();
462 if (pBulletStyleMgr)
463 {
464 // if has bullet or numbering
465 if (m_bHasBullet)
466 {
467 //if it's normal bullet
468 if (m_pSilverBullet)
469 {
471 {
473 }
474 else if (!m_xBullOver->IsEditable())
475 {
476 m_aBulletStyleName = pBulletStyleMgr->RegisterBulletStyle(this, m_xBullOver.get(), m_pIndentOverride.get());
477 }
478
479 // test codes
481 {
482 OUString aPreBullStyleName;
484 sal_uInt16 nPosition = pNumbering->GetPosition();
485 bool bLesser = m_pSilverBullet->IsLesserLevel(nPosition);
486 LwpPara* pPara = this;
487 LwpPara* pPrePara = nullptr;
488 sal_uInt16 nNum = 0, nLevel = 0, nFoundLevel = 0xffff, nFoundBound = 0;
489
490 nFoundBound = nLevel = pNumbering->GetLevel();
491 if (nPosition == pNumbering->GetPosition())
492 {
493 nFoundBound++;
494 }
495 bool bHeading = pNumbering->IsHeading();
496
498 while(true)
499 {
500 bool bAlreadySeen = !aSeen.insert(pPara).second;
501 if (bAlreadySeen)
502 throw std::runtime_error("loop in conversion");
503 LwpSilverBullet* pParaSilverBullet = pPara->GetSilverBullet();
504 pNumbering = pPara->GetParaNumbering();
505
506 if (pPara->GetObjectID() != GetObjectID())
507 {
508 if (!pParaSilverBullet)
509 {
510 break;
511 }
512
513 /* If lesser, stop when we hit an outline style whose level is
514 * higher than our current level.
515 */
516 // restart based on Outline level?
517 if (pNumbering && bLesser && (!bHeading || pNumbering->IsHeading()))
518 {
519 if (nFoundLevel != 0xffff)
520 {
521 if (pNumbering->GetLevel() < nFoundLevel)
522 {
523 break;
524 }
525 if ((pNumbering->GetLevel() == nFoundLevel)
526 && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID()
527 || pNumbering->GetPosition() != nPosition))
528 {
529 break;
530 }
531 }
532 else
533 {
534 if (pNumbering->GetLevel() < nFoundBound
535 && (pParaSilverBullet->GetObjectID() != m_pSilverBullet->GetObjectID()
536 || pNumbering->GetPosition() != nPosition))
537 {
538 nFoundBound = pNumbering->GetLevel();
539 }
540 }
541 }
542 }
543
544 // Don't bump the number if this bullet is skipped
545 if (m_xBullOver->IsSkip())
546 ;
547 else if ( pParaSilverBullet
548 && pParaSilverBullet->GetObjectID() == m_pSilverBullet->GetObjectID()
549 && pNumbering && nPosition == pNumbering->GetPosition())
550 {
551 if (bLesser)
552 {
553 if (nFoundLevel != 0xffff)
554 {
555 if (nFoundLevel == pNumbering->GetLevel())
556 {
557 aPreBullStyleName = pPara->GetBulletStyleName();
558 nNum++;
559 }
560 }
561 else if (pNumbering->GetLevel() <= nLevel)
562 {
563 if (pNumbering->GetLevel() >= nFoundBound)
564 {
565 break;
566 }
567 nFoundLevel = pNumbering->GetLevel();
568 aPreBullStyleName = pPara->GetBulletStyleName();
569 nNum++;
570 }
571 }
572 else
573 {
574 aPreBullStyleName = pPara->GetBulletStyleName();
575 nNum++;
576 }
577 }
578
579 pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj(VO_PARA).get());
580
581 if (!pPrePara)
582 {
583 LwpStory* pStory = pPara->GetStory();
584 pPrePara = pStory ? pStory->GetLastParaOfPreviousStory() : nullptr;
585
586 if (!pPrePara)
587 {
588 break;
589 }
590 }
591 pPara = pPrePara;
592 }
593 nNum = nNum ? nNum : 1;
594
595 if (nNum > 1)
596 {
597 m_aBulletStyleName = aPreBullStyleName;
598 m_bBullContinue = true;
599 }
600 else
601 {
602 m_bBullContinue = false;
603 if (IsInCell())
604 {
605 XFListStyle* pOldStyle = static_cast<XFListStyle*>(pXFStyleManager->FindStyle(m_aBulletStyleName));
606 if (pOldStyle)
607 {
608 std::unique_ptr<XFListStyle> xNewStyle(new XFListStyle(*pOldStyle));
609 m_aBulletStyleName = pXFStyleManager->AddStyle(std::move(xNewStyle)).m_pStyle->GetStyleName();
610 }
611 }
612 }
613
614 LwpStory* pMyStory = GetStory();
615 if (pMyStory)
616 {
617 if (pMyStory->IsBullStyleUsedBefore(m_aBulletStyleName, m_xParaNumbering->GetPosition()))
618 {
619 //m_bBullContinue = sal_True;
620 }
621 else
622 {
624 }
625 }
626
627 }
628 // end of test codes
629 }
630 }
631 }
632
633 if (noSpacing)
634 {
635 LwpPara* pPrePara = dynamic_cast<LwpPara*>(GetPrevious().obj().get());
636 if (pPrePara && pPrePara->GetBelowSpacing()!=0)
637 {
638 xOverStyle.reset(new XFParaStyle);
639 *xOverStyle = *GetXFParaStyle();
640 XFMargins* pMargin = &xOverStyle->GetMargins();
641 pMargin->SetTop(pMargin->GetTop()+pPrePara->GetBelowSpacing());
642 if (!m_ParentStyleName.isEmpty())
643 xOverStyle->SetParentStyleName(m_ParentStyleName);
644 m_StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
645 }
646 }
647
648 //register tab style
650 {
651 std::unique_ptr<XFParaStyle> xNewParaStyle(new XFParaStyle);
652 *xNewParaStyle = *GetXFParaStyle();
653 //xOverStyle->SetStyleName("");
654 RegisterTabStyle(xNewParaStyle.get());
655 if (!m_ParentStyleName.isEmpty())
656 xNewParaStyle->SetParentStyleName(m_ParentStyleName);
657 m_StyleName = pXFStyleManager->AddStyle(std::move(xNewParaStyle)).m_pStyle->GetStyleName();
658 }
659
660 //register master page;
662
663 // reg auto style,lay here for pagebreak need overridden para style
664 m_Fribs.SetPara(this);
666
667 if (m_bHasDropcap)
668 {
670 std::unique_ptr<XFParaStyle> xStyle(new XFParaStyle);
671 *xStyle = *GetXFParaStyle();
672 xStyle->SetDropCap(m_nChars-1,m_nLines);
673 if (!m_ParentStyleName.isEmpty())
674 xStyle->SetParentStyleName(m_ParentStyleName);
675 m_StyleName = pXFStyleManager->AddStyle(std::move(xStyle)).m_pStyle->GetStyleName();
676 }
677 // maybe useful for further version
678 // deleted because Leader of Table is not supported in this version
679 //AddTabStyleForTOC();
680}
681
683{
684 if( !pLayout )
685 return;
686
687 std::unique_ptr<XFSectionStyle> xSectStyle(new XFSectionStyle);
688 XFColumns* pColumns = pLayout->GetXFColumns();
689 if(pColumns)
690 {
691 xSectStyle->SetColumns(pColumns);
692 }
694 m_SectionStyleName = pXFStyleManager->AddStyle(std::move(xSectStyle)).m_pStyle->GetStyleName();
695}
696
698{
699 rtl::Reference<XFSection> xXFSection(new XFSection);
700 xXFSection->SetStyleName(m_SectionStyleName);
701 m_SectionStyleName.clear();
702 return xXFSection;
703}
704
705/**************************************************************************
706 * @descr: register tab style
707**************************************************************************/
709{
710 LwpTabOverride aFinaOverride;
711 LwpTabOverride* pBase = nullptr;
712 //get the tabrack from the current layout
713 LwpStory* pStory = dynamic_cast<LwpStory*>(m_Story.obj().get());
714 LwpMiddleLayout* pLayout = pStory ? pStory->GetTabLayout() : nullptr;
715 if(pLayout)
716 {
717 pBase = pLayout->GetTabOverride();
718 if(pBase)
719 {
720 pBase->Override(&aFinaOverride);
721 }
722 }
723
724 //get the tabrack from the base parastyle
725 LwpParaStyle* pParaStyle = GetParaStyle();
726 pBase = pParaStyle->GetTabOverride();
727 if(pBase)
728 {
729 pBase->Override(&aFinaOverride);
730 }
731 //get the tabrack from the local property
732 pBase = GetLocalTabOverride();
733 if(pBase)
734 {
735 pBase->Override(&aFinaOverride);
736 }
737
738 LwpParaStyle::ApplyTab(pXFParaStyle, &aFinaOverride);
739}
744{
745 if (!GetFoundry())
746 return;
748 if (pDropcap)
749 {
750 m_Fribs.SetXFPara(pDropcap);
752 }
753}
758{
759 if (!m_pBreaks || !pCont)
760 return;
761 if (m_pBreaks->IsPageBreakBefore())
762 {
764 xPara->SetStyleName(m_BefPageBreakName);
765 pCont->Add(xPara.get());
766 }
767 else if (m_pBreaks->IsColumnBreakBefore())
768 {
770 xPara->SetStyleName(m_BefColumnBreakName);
771 pCont->Add(xPara.get());
772 }
773}
774
776{
777 if (!m_pBreaks)
778 return;
779 if (m_pBreaks->IsPageBreakAfter())
780 {
782 xPara->SetStyleName(m_AftPageBreakName);
783 pCont->Add(xPara.get());
784 }
785 else if (m_pBreaks->IsColumnBreakAfter())
786 {
788 xPara->SetStyleName(m_AftColumnBreakName);
789 pCont->Add(xPara.get());
790 }
791}
792
794{
795 if (m_pFoundry)
796 {
798 }
799
800 return nullptr;
801}
802
804{
805 LwpBulletStyleMgr* pBulletStyleMgr = GetBulletStyleMgr();
806 if (!pBulletStyleMgr)
807 {
808 assert(false);
810 }
811
812 sal_uInt16 nLevel = m_nLevel;
813 bool bOrdered = false;
814 /*LwpStory* pMyStory =*/ GetStory();
815
816 pBulletStyleMgr->SetContinueFlag(m_bBullContinue);
817
819 {
820 bOrdered = true;
821 }
823 {
824 nLevel = m_xParaNumbering->GetPosition();
825 m_nLevel = nLevel;//for get para level
826 }
827
828 return pBulletStyleMgr->AddBulletList(pCont, bOrdered, m_aBulletStyleName,
829 nLevel, m_xBullOver->IsSkip());
830}
831
833{
834 return m_xParaNumbering.get();
835}
836
838{
839 m_PersistentList.Read(pObjStrm);
840}
841
843{
844 m_Head.ReadIndexed(pObjStrm);
845 pObjStrm->SkipExtra();
846}
847
848/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 m_nLevel
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
virtual OUString GetStyleName()=0
@descr: return the style name.
virtual LwpAlignmentOverride * clone() const override
LwpBackgroundStuff & GetBGStuff()
std::unique_ptr< XFBGImage > GetFillPattern()
void SetContinueFlag(bool bFlag)
void SetCurrentSilverBullet(const LwpObjectID &rNewID)
rtl::Reference< XFContentContainer > AddBulletList(XFContentContainer *pCont, bool bIsOrdered, const OUString &rStyleName, sal_Int16 nLevel, bool bIsBulletSkiped)
OUString RegisterBulletStyle(LwpPara *pPara, const LwpBulletOverride *pBullOver, LwpIndentOverride const *pIndent)
Register bullet style to style-list.
lwpcolor class (red, green, blue, extra)
Definition: lwpcolor.hxx:71
bool IsValidColor() const
Definition: lwpcolor.hxx:114
sal_uInt32 To24Color()
@descr return the BGR format
Definition: lwpcolor.cxx:66
Double Linked Virtual List.
Definition: lwpdlvlist.hxx:72
LwpObjectID & GetPrevious()
Definition: lwpdlvlist.hxx:76
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwpdlvlist.cxx:72
XFParagraph * GetXFPara()
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
void Read(LwpObjectStream *pObjStrm)
Definition: lwppara.cxx:837
LwpNotifyListPersistent & GetExtraList()
Definition: lwppara.hxx:100
LwpNotifyListPersistent m_PersistentList
Definition: lwppara.hxx:104
LwpDropcapMgr & GetDropcapMgr()
Definition: lwpfoundry.hxx:264
LwpBulletStyleMgr * GetBulletStyleMgr()
Definition: lwpfoundry.hxx:267
LwpStyleManager * GetStyleManager()
Definition: lwpfoundry.hxx:262
void ReadPara(LwpObjectStream *pObjStrm)
Definition: lwpfribptr.cxx:102
void SetPara(LwpPara *para)
Definition: lwpfribptr.hxx:87
LwpFrib * HasFrib(sal_uInt8 nType)
Definition: lwpfribptr.cxx:366
void XFConvert()
Definition: lwpfribptr.cxx:146
void RegisterStyle()
Definition: lwpfribptr.cxx:408
void SetXFPara(XFParagraph *Para)
Definition: lwpfribptr.hxx:85
XFStyleManager * GetXFStyleManager()
static LwpGlobalMgr * GetInstance(LwpSvStream *pSvStream=nullptr)
XFColumns * GetXFColumns()
@descr: Create and return XFColumns object
Definition: lwplayout.cxx:1570
LwpTabOverride * GetTabOverride()
@descr: Add back color settings into xfpagemaster.
Definition: lwplayout.cxx:911
void Read(LwpObjectStream *pObjStrm)
Definition: lwppara.cxx:842
LwpObjectID m_Head
Definition: lwppara.hxx:93
sal_uInt16 GetPosition() const
sal_uInt16 GetLevel() const
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
void ReadIndexed(LwpSvStream *pStrm)
@descr Read object id with indexed format from stream if index>0, lowid is get from time table per th...
Definition: lwpobjid.cxx:96
rtl::Reference< LwpObject > obj(VO_TYPE tag=VO_INVALID) const
@descr get object from object factory per the object id
Definition: lwpobjid.cxx:183
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
void SkipExtra()
@descr skip extra bytes
Definition: lwpobjstrm.cxx:258
LwpFoundry * m_pFoundry
Definition: lwpobj.hxx:91
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
LwpFoundry * GetFoundry()
Definition: lwpobj.hxx:136
LwpObjectID & GetObjectID()
Definition: lwpobj.hxx:138
LwpIndentOverride * GetIndent()
LwpSpacingOverride * GetSpacing()
LwpTabOverride * GetTabOverride() const
LwpAlignmentOverride * GetAlignment()
static void ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTab)
OUString m_BefColumnBreakName
Definition: lwppara.hxx:209
OUString m_StyleName
Definition: lwppara.hxx:202
OUString m_AftColumnBreakName
Definition: lwppara.hxx:207
OUString m_SectionStyleName
Definition: lwppara.hxx:224
void GatherDropcapInfo()
get drop cap info
Definition: lwppara1.cxx:126
rtl::Reference< XFSection > CreateXFSection()
Definition: lwppara.cxx:697
void OverrideIndent(LwpIndentOverride *base, LwpIndentOverride *over, XFParaStyle *pOverStyle)
override indent attribute
Definition: lwppara1.cxx:276
sal_uInt16 m_nFlags
Definition: lwppara.hxx:196
virtual ~LwpPara() override
Definition: lwppara.cxx:103
const OUString & GetBulletStyleName() const
Definition: lwppara.hxx:311
void RegisterNewSectionStyle(LwpPageLayout *pLayout)
Definition: lwppara.cxx:682
OUString m_aBulletStyleName
Definition: lwppara.hxx:220
double GetBelowSpacing() const
Definition: lwppara.hxx:351
sal_uInt32 m_nChars
Definition: lwppara.hxx:227
std::unique_ptr< LwpBulletOverride > m_xBullOver
Definition: lwppara.hxx:218
void OverrideParaBorder(LwpParaProperty *pProps, XFParaStyle *pOverStyle)
: Override paraborder style.
Definition: lwppara1.cxx:317
void RegisterStyle() override
register paragraph style
Definition: lwppara.cxx:273
bool IsInCell()
check paragraph in cell or not
Definition: lwppara1.cxx:564
std::unique_ptr< LwpBreaksOverride > m_pBreaks
Definition: lwppara.hxx:204
std::vector< std::unique_ptr< LwpParaProperty > > m_vProps
Definition: lwppara.hxx:199
OUString m_BefPageBreakName
Definition: lwppara.hxx:206
rtl::Reference< XFContentContainer > AddBulletList(XFContentContainer *pCont)
Definition: lwppara.cxx:803
bool m_bBullContinue
Definition: lwppara.hxx:221
void OverrideParaBreaks(LwpParaProperty *pProps, XFParaStyle *pOverStyle)
: Override parabreaks style.
Definition: lwppara1.cxx:349
bool m_bHasBullet
Definition: lwppara.hxx:215
void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
Definition: lwppara.cxx:191
LwpStory * GetStory()
Definition: lwppara.hxx:337
std::unique_ptr< LwpNumberingOverride > m_xParaNumbering
Definition: lwppara.hxx:219
void OverrideParaBullet(LwpParaProperty *pProps)
: Override bullet styles.
Definition: lwppara1.cxx:414
LwpPara * GetParent()
get parent paragraph
Definition: lwppara1.cxx:134
LwpFribPtr m_Fribs
Definition: lwppara.hxx:198
void ReadPropertyList(LwpObjectStream *pFile)
void AddBreakBefore(XFContentContainer *pCont)
add paragraph break attribute
Definition: lwppara.cxx:757
OUString m_ParentStyleName
Definition: lwppara.hxx:203
LwpObjectID m_ParaStyle
Definition: lwppara.hxx:192
LwpNumberingOverride * GetParaNumbering()
Definition: lwppara.cxx:832
LwpSilverBullet * m_pSilverBullet
Definition: lwppara.hxx:217
sal_uInt16 m_nLines
Definition: lwppara.hxx:226
LwpBulletStyleMgr * GetBulletStyleMgr()
Definition: lwppara.cxx:793
LwpParaStyle * GetParaStyle()
: Get parastyle object according to the objID.
Definition: lwppara1.cxx:307
rtl::Reference< XFContentContainer > m_xXFContainer
Definition: lwppara.hxx:231
std::unique_ptr< LwpIndentOverride > m_pIndentOverride
Definition: lwppara.hxx:210
LwpSilverBullet * GetSilverBullet()
Definition: lwppara.hxx:279
sal_uInt16 m_nLevel
Definition: lwppara.hxx:197
static void OverrideAlignment(LwpAlignmentOverride *base, LwpAlignmentOverride *over, XFParaStyle *pOverStyle)
override alignment
Definition: lwppara1.cxx:263
void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwppara.cxx:107
sal_uInt32 m_nOrdinal
Definition: lwppara.hxx:191
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwppara.cxx:180
void RegisterTabStyle(XFParaStyle *pXFParaStyle)
Definition: lwppara.cxx:708
OUString m_AftPageBreakName
Definition: lwppara.hxx:205
void AddBreakAfter(XFContentContainer *pCont)
Definition: lwppara.cxx:775
LwpTabOverride * GetLocalTabOverride()
Definition: lwppara1.cxx:532
LwpObjectID m_Story
Definition: lwppara.hxx:194
void OverrideParaNumbering(LwpParaProperty const *pProps)
: Override paranumbering properties.
Definition: lwppara1.cxx:480
void ParseDropcapContent()
parse dropcap text
Definition: lwppara.cxx:743
bool m_bHasDropcap
Definition: lwppara.hxx:225
XFParaStyle * GetXFParaStyle()
get paragraph xfstyle
Definition: lwppara1.cxx:118
LwpPoint m_Hint
Definition: lwppara.hxx:193
LwpPara(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwppara.cxx:84
void OverrideSpacing(LwpSpacingOverride *base, LwpSpacingOverride *over, XFParaStyle *pOverStyle)
override spacing
Definition: lwppara1.cxx:291
LwpIndentOverride * GetIndent()
Definition: lwppara.hxx:325
void RegisterMasterPage(XFParaStyle const *pBaseStyle)
Definition: lwppara.cxx:245
void Read(LwpObjectStream *pStrm)
@descr read point from object stream
Definition: lwpbasetype.cxx:79
const OUString & GetBulletStyleName() const
bool IsBulletOrdered()
: To judge the silverbullet list is ordered or not.
bool IsLesserLevel(sal_uInt16 nPos)
virtual LwpSpacingOverride * clone() const override
bool IsPMModified() const
Definition: lwpstory.hxx:119
bool IsBullStyleUsedBefore(const OUString &rStyleName, sal_uInt8 nPos)
Definition: lwpstory.cxx:470
bool GetDropcapFlag() const
Definition: lwpstory.hxx:113
bool IsNeedSection()
Definition: lwpstory.cxx:246
void AddXFContent(XFContent *pContent)
Definition: lwpstory.cxx:395
void AddBullStyleName2List(const OUString &rStyleName, sal_uInt8 nPos)
Definition: lwpstory.hxx:151
LwpMiddleLayout * GetTabLayout()
Definition: lwpstory.hxx:141
LwpPageLayout * GetCurrentLayout()
Definition: lwpstory.hxx:114
LwpPara * GetLastParaOfPreviousStory()
Definition: lwpstory.cxx:406
IXFStyle * GetStyle(const LwpObjectID &styleObjID)
Definition: lwpfoundry.cxx:522
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
void Override(LwpTabOverride *pOther)
const OUString & GetStyleName() const
Definition: lwplayout.hxx:171
Color object.
Definition: xfcolor.hxx:70
A container for content.
virtual void Add(XFContent *pContent)
@descr Add content.
void SetTop(double top)
Definition: xfmargins.hxx:108
double GetTop() const
Definition: xfmargins.hxx:125
Style object for aragraph.
Definition: xfparastyle.hxx:93
bool GetNumberRight() const
void SetAlignType(enumXFAlignType eAlign)
@descr Set alignment property of the paragraph.
Paragraph object for SODC.
Definition: xfparagraph.hxx:73
Section object.
Definition: xfsection.hxx:70
Style manager for the filter.
IXFStyle * FindStyle(std::u16string_view name)
IXFStyleRet AddStyle(std::unique_ptr< IXFStyle > pStyle)
XFParaStyle * FindParaStyle(std::u16string_view name)
virtual OUString GetStyleName() override
@descr get style name.
Definition: xfstyle.cxx:70
virtual void SetStyleName(const OUString &styleName) override
@descr set style name.
Definition: xfstyle.cxx:75
std::pair< const_iterator, bool > insert(Value &&x)
T * clone(T *const other)
Creates a new copy of the passed object.
Definition: clone.hxx:64
sal_Int32 m_nFlags
void Notify(SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldRect=nullptr)
@ VO_PARA
Definition: lwpdefs.hxx:70
@ FRIB_TAG_TAB
#define PP_LOCAL_INDENT
#define PP_LOCAL_BORDER
#define PP_LOCAL_BREAKS
#define PP_LOCAL_BACKGROUND
#define PP_LOCAL_SPACING
#define PP_LOCAL_NUMBERING
#define PP_LOCAL_ALIGN
#define PP_LOCAL_BULLET
#define PP_LOCAL_TABRACK
IXFStyle * m_pStyle
Definition: xfstylecont.hxx:71
unsigned char sal_uInt8
@ enumXFAlignStart
Definition: xfdefs.hxx:174