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 <boost/scoped_ptr.hpp>
67 #include "lwpparastyle.hxx"
68 #include "lwpfilehdr.hxx"
69 #include "lwpoverride.hxx"
70 #include "lwpparaborderoverride.hxx"
71 #include "lwpbreaksoverride.hxx"
72 #include "lwpnumberingoverride.hxx"
73 #include "lwptaboverride.hxx"
74 #include "lwpbackgroundoverride.hxx"
75 #include "xfilter/xfdefs.hxx"
76 #include "xfilter/xfparastyle.hxx"
77 #include "xfilter/xfborders.hxx"
78 #include "lwpfont.hxx"
79 #include "lwpfoundry.hxx"
80 #include "lwppiece.hxx"
81 #include "lwpshadow.hxx"
82 #include "lwpborderstuff.hxx"
83 #include "lwpmargins.hxx"
84 #include "lwptabrack.hxx"
86 #include "lwpsilverbullet.hxx"
88 LwpParaStyle::LwpParaStyle(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
) :
89 LwpTextStyle(objHdr
, pStrm
), m_pKinsokuOptsOverride(new LwpKinsokuOptsOverride
),
90 m_pBulletOverride(new LwpBulletOverride
)
94 LwpParaStyle::~LwpParaStyle()
96 if (m_pKinsokuOptsOverride
)
98 delete m_pKinsokuOptsOverride
;
101 if (m_pBulletOverride
)
103 delete m_pBulletOverride
;
107 void LwpParaStyle::Read()
109 LwpTextStyle::Read();
111 if (LwpFileHeader::m_nFileRevision
< 0x000B)
113 // read many overrides
114 LwpAlignmentOverride aAlignOverride
;
115 aAlignOverride
.Read(m_pObjStrm
);
117 LwpSpacingOverride aSpacingOverride
;
118 aSpacingOverride
.Read(m_pObjStrm
);
120 LwpIndentOverride aIndentOverride
;
121 aIndentOverride
.Read(m_pObjStrm
);
123 LwpParaBorderOverride aPBOverride
;
124 aPBOverride
.Read(m_pObjStrm
);
126 LwpBreaksOverride aBreaksOverride
;
127 aBreaksOverride
.Read(m_pObjStrm
);
129 LwpNumberingOverride aNumberingOverride
;
130 aNumberingOverride
.Read(m_pObjStrm
);
132 LwpTabOverride aTabOverride
;
133 aTabOverride
.Read(m_pObjStrm
);
138 m_AlignmentStyle
.ReadIndexed(m_pObjStrm
);
139 m_SpacingStyle
.ReadIndexed(m_pObjStrm
);
140 m_IndentStyle
.ReadIndexed(m_pObjStrm
);
141 m_BorderStyle
.ReadIndexed(m_pObjStrm
);
142 m_BreaksStyle
.ReadIndexed(m_pObjStrm
);
143 m_NumberingStyle
.ReadIndexed(m_pObjStrm
);
144 m_TabStyle
.ReadIndexed(m_pObjStrm
);
146 m_pKinsokuOptsOverride
->Read(m_pObjStrm
);
147 m_pBulletOverride
->Read(m_pObjStrm
);
149 if (m_pObjStrm
->CheckExtra())
151 m_BackgroundStyle
.ReadIndexed(m_pObjStrm
);
152 m_pObjStrm
->SkipExtra();
158 void LwpParaStyle::Apply(XFParaStyle
*pParaStyle
)
162 LwpVirtualPiece
*pPiece
= NULL
;
164 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_AlignmentStyle
.obj().get());
167 LwpAlignmentOverride
*pAlign
= dynamic_cast<LwpAlignmentOverride
*>(pPiece
->GetOverride());
169 ApplyAlignment(pParaStyle
,pAlign
);
172 //don't known top and bottom indent now.
173 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_IndentStyle
.obj().get());
176 LwpIndentOverride
*pIndent
= dynamic_cast<LwpIndentOverride
*>(pPiece
->GetOverride());
179 if (!m_pBulletOverride
->IsInValid())//Add by ,for remove bullet indent in named bullet style
181 boost::scoped_ptr
<LwpIndentOverride
> pNewIndent(pIndent
->clone());
182 pNewIndent
->SetMFirst(0);
183 pNewIndent
->SetMRest(0);
184 ApplyIndent(NULL
, pParaStyle
, pNewIndent
.get());
187 ApplyIndent(NULL
,pParaStyle
,pIndent
);
191 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BorderStyle
.obj().get());
194 LwpParaBorderOverride
*pBorder
= dynamic_cast<LwpParaBorderOverride
*>(pPiece
->GetOverride());
197 ApplyParaBorder(pParaStyle
, pBorder
);
201 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_SpacingStyle
.obj().get());
204 LwpSpacingOverride
*pSpacing
= dynamic_cast<LwpSpacingOverride
*>(pPiece
->GetOverride());
206 ApplySpacing(NULL
,pParaStyle
,pSpacing
);
209 //paragraph background.
210 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BackgroundStyle
.obj().get());
213 LwpBackgroundOverride
*pBack
= dynamic_cast<LwpBackgroundOverride
*>(pPiece
->GetOverride());
216 LwpColor color
= pBack
->GetBackColor();
217 XFColor
aXFColor( color
.To24Color() );
218 pParaStyle
->SetBackColor( aXFColor
);
223 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_TabStyle
.obj().get());
226 LwpTabOverride
*pTab
= dynamic_cast<LwpTabOverride
*>(pPiece
->GetOverride());
229 ApplyTab(pParaStyle
,pTab
);
232 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BreaksStyle
.obj().get());
235 LwpBreaksOverride
*pBreak
= dynamic_cast<LwpBreaksOverride
*>(pPiece
->GetOverride());
238 ApplyBreaks(pParaStyle
,pBreak
);
244 void LwpParaStyle::ApplySubBorder(LwpBorderStuff
* pBorderStuff
, LwpBorderStuff::BorderType eType
, XFBorders
* pXFBorders
)
246 enumXFBorder eXFBorderSide
= enumXFBorderNone
;
249 case LwpBorderStuff::LEFT
:
250 eXFBorderSide
= enumXFBorderLeft
;
252 case LwpBorderStuff::RIGHT
:
253 eXFBorderSide
= enumXFBorderRight
;
255 case LwpBorderStuff::TOP
:
256 eXFBorderSide
= enumXFBorderTop
;
258 case LwpBorderStuff::BOTTOM
:
259 eXFBorderSide
= enumXFBorderBottom
;
265 LwpColor aColor
= pBorderStuff
->GetSideColor(eType
);
266 float fWidth
= pBorderStuff
->GetSideWidth(eType
);
267 sal_uInt16 nType
= pBorderStuff
->GetSideType(eType
);
271 default://fall through!
272 case 0x14: //single fall through!
274 pXFBorders
->SetWidth(eXFBorderSide
, fWidth
);
276 case 0x15: //double , fall through!
277 case 0x16: //thick double
278 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
279 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
280 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.334));
281 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
282 // pXFBorders->SetWidth(eXFBorderSide, fWidth);
284 case 0x18: //thick-thin
285 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
286 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.5));
287 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
288 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
290 case 0x19: //thin-thick
291 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
292 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.7));
293 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
294 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
298 if (aColor
.IsValidColor())
300 XFColor
aXFColor(aColor
.To24Color());
301 pXFBorders
->SetColor(eXFBorderSide
, aXFColor
);
305 void LwpParaStyle::ApplyParaBorder(XFParaStyle
* pParaStyle
, LwpParaBorderOverride
* pBorder
)
308 LwpShadow
*pShadow
= pBorder
->GetShadow();
311 LwpColor color
= pShadow
->GetColor();
312 float offsetX
= pShadow
->GetOffsetX();
313 float offsetY
= pShadow
->GetOffsetY();
315 if( offsetX
&& offsetY
&& color
.IsValidColor() )
317 XFColor
aXFColor(color
.To24Color());
327 pParaStyle
->SetShadow(enumXFShadowLeftTop
,-offsetX
,aXFColor
);
329 pParaStyle
->SetShadow(enumXFShadowLeftBottom
,-offsetX
,aXFColor
);
334 pParaStyle
->SetShadow(enumXFShadowRightTop
,offsetX
,aXFColor
);
336 pParaStyle
->SetShadow(enumXFShadowRightBottom
,offsetX
,aXFColor
);
341 //convert to XFBorders object:
342 LwpBorderStuff
*pBorderStuff
= pBorder
->GetBorderStuff();
343 if( pBorderStuff
&& pBorderStuff
->GetSide() != 0 )
345 XFBorders
*pXFBorders
= new XFBorders();
346 pParaStyle
->SetBorders(pXFBorders
);
348 LwpMargins
* pMargins
= pBorder
->GetMargins();
350 // apply 4 borders respectively
351 LwpBorderStuff::BorderType pType
[] = { LwpBorderStuff::LEFT
, LwpBorderStuff::RIGHT
,
352 LwpBorderStuff::TOP
, LwpBorderStuff::BOTTOM
};
353 float pMarginValue
[4];
355 for (sal_uInt8 nC
= 0; nC
< 4; nC
++)
357 if (pBorderStuff
->HasSide(pType
[nC
]))
359 ApplySubBorder(pBorderStuff
, pType
[nC
], pXFBorders
);
361 //get border spacing to text content
364 pMarginValue
[nC
] = static_cast<float>(pMargins
->GetMarginsValue(nC
));
370 //apply border spacing to text content
371 pParaStyle
->SetPadding(pMarginValue
[0], pMarginValue
[1], pMarginValue
[2], pMarginValue
[3]);
376 void LwpParaStyle::ApplyBreaks(XFParaStyle
* pParaStyle
, LwpBreaksOverride
* pBreaks
)
378 if (pBreaks
->IsKeepWithNext())
380 pParaStyle
->SetBreaks(enumXFBreakKeepWithNext
);
382 if (pBreaks
->IsPageBreakBefore())
384 pParaStyle
->SetBreaks(enumXFBreakBefPage
);
386 if (pBreaks
->IsPageBreakAfter())
388 pParaStyle
->SetBreaks(enumXFBreakAftPage
);
390 if (pBreaks
->IsColumnBreakBefore())
392 pParaStyle
->SetBreaks(enumXFBreakBefColumn
);
394 if (pBreaks
->IsColumnBreakAfter())
396 pParaStyle
->SetBreaks(enumXFBreakAftColumn
);
400 void LwpParaStyle::ApplyAlignment(XFParaStyle
* pParaStyle
, LwpAlignmentOverride
* pAlign
)
402 enumXFAlignType alignType
= enumXFAlignStart
;
403 LwpAlignmentOverride::AlignType type
;
405 type
= pAlign
->GetAlignType();
406 pParaStyle
->SetNumberRight(false);//to identify its align attribute
409 case LwpAlignmentOverride::ALIGN_LEFT
:
410 alignType
= enumXFAlignStart
;
412 case LwpAlignmentOverride::ALIGN_RIGHT
:
413 alignType
= enumXFAlignEnd
;
415 case LwpAlignmentOverride::ALIGN_CENTER
:
416 alignType
= enumXFAlignCenter
;
418 case LwpAlignmentOverride::ALIGN_NUMERICLEFT
://if non-number in table,ALIGN_NUMERICLEFT/RIGHT are useless
419 alignType
= enumXFAlignStart
; //note by 1/28
421 case LwpAlignmentOverride::ALIGN_JUSTIFY
:
422 case LwpAlignmentOverride::ALIGN_JUSTIFYALL
:
423 alignType
= enumXFAlignJustify
;
425 case LwpAlignmentOverride::ALIGN_NUMERICRIGHT
:
426 pParaStyle
->SetNumberRight(true);//to identify its align attribute
427 alignType
= enumXFAlignEnd
;
432 pParaStyle
->SetAlignType(alignType
);
435 void LwpParaStyle::ApplyIndent(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpIndentOverride
* pIndent
)
437 LwpPara
* pParentPara
;
439 pParentPara
= pPara
->GetParent();
443 std::unique_ptr
<LwpIndentOverride
> pTotalIndent(new LwpIndentOverride
);
444 if (pIndent
->IsUseRelative() && pParentPara
)
446 LwpIndentOverride
* pParentIndent
= pParentPara
->GetIndent();
449 pTotalIndent
.reset(pIndent
->clone());
451 //add by ,for bullet only
454 if (pPara
->GetBulletFlag())
456 pTotalIndent
->SetMAll(pParentIndent
->GetMAll() + pTotalIndent
->GetMAll());
457 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
458 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
459 pTotalIndent
->GetMAll())), pTotalIndent
->GetRight());
460 pPara
->SetIndent(pTotalIndent
.release());
465 sal_uInt16 relative
= pParentIndent
->GetRelative();
467 sal_Int32 Amount
= pParentIndent
->GetMAll();
469 if (relative
== LwpIndentOverride::RELATIVE_FIRST
)
470 Amount
+= pParentIndent
->GetMFirst();
471 else if (relative
== LwpIndentOverride::RELATIVE_REST
)
472 Amount
+= pParentIndent
->GetMRest();
473 pTotalIndent
->SetMAll(Amount
+ pTotalIndent
->GetMAll());
474 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
476 pParaStyle
->SetIndent(pTotalIndent
->GetFirst());
477 pParaStyle
->SetMargins(pTotalIndent
->GetLeft(), pTotalIndent
->GetRight());
478 pPara
->SetIndent(pTotalIndent
.release());
483 pTotalIndent
.reset(pIndent
->clone());
487 if (pPara
->GetBulletFlag())
489 // pParaStyle->SetIndent(LwpTools::ConvertFromUnits(pIndent->GetMAll()));
490 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(
491 LwpTools::ConvertFromUnits(pIndent
->GetMAll())), pIndent
->GetRight());
492 pPara
->SetIndent(pTotalIndent
.release());
498 pParaStyle
->SetIndent(pIndent
->GetFirst());
499 pParaStyle
->SetMargins(pIndent
->GetLeft(), pIndent
->GetRight());
502 pPara
->SetIndent(pTotalIndent
.release());
507 void LwpParaStyle::ApplySpacing(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpSpacingOverride
* pSpacing
)
509 LwpSpacingCommonOverride
* spacing
= pSpacing
->GetSpacing();
510 LwpSpacingCommonOverride
* abovepara
= pSpacing
->GetAboveSpacing();
511 LwpSpacingCommonOverride
* belowpara
= pSpacing
->GetBelowSpacing();
513 LwpSpacingCommonOverride::SpacingType type
= spacing
->GetType();
514 sal_Int32 amount
= spacing
->GetAmount();
515 sal_Int32 multiple
= spacing
->GetMultiple();
521 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
523 xftype
= enumLHPercent
;
524 height
= double(multiple
)/65536L*100;
525 pParaStyle
->SetLineHeight(xftype
,height
);
528 case LwpSpacingCommonOverride::SPACING_LEADING
:
530 xftype
= enumLHSpace
;
531 height
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(amount
));
532 pParaStyle
->SetLineHeight(xftype
,height
);
535 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
537 xftype
= enumLHHeight
;
538 height
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
539 pParaStyle
->SetLineHeight(xftype
,height
);
542 case LwpSpacingCommonOverride::SPACING_NONE
:
546 //TO DO: Above Line need to be processed!!!!!!! what it means?????? 1-26
548 type
= abovepara
->GetType();
549 amount
= abovepara
->GetAmount();
550 multiple
= abovepara
->GetMultiple();
551 double above_val
=-1;
554 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
555 // above_val = LINE_HEIGHT*float(multiple)/65536L*100; //TO DO: 1-26
557 case LwpSpacingCommonOverride::SPACING_LEADING
:
559 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
560 above_val
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
562 case LwpSpacingCommonOverride::SPACING_NONE
:
566 type
= belowpara
->GetType();
567 amount
= belowpara
->GetAmount();
568 multiple
= belowpara
->GetMultiple();
572 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
573 // below_val = LINE_HEIGHT*float(multiple)/65536L*100;//TO DO: 1-26
575 case LwpSpacingCommonOverride::SPACING_LEADING
:
577 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
578 below_val
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
580 case LwpSpacingCommonOverride::SPACING_NONE
:
587 pPara
->SetBelowSpacing(below_val
);
588 LwpPara
* pPrePara
= dynamic_cast<LwpPara
*>(pPara
->GetPrevious().obj().get());
589 if (pPrePara
&& above_val
!= -1)
591 above_val
+= pPrePara
->GetBelowSpacing();
596 pParaStyle
->SetMargins(-1,-1,above_val
,below_val
);
598 /**************************************************************************
604 **************************************************************************/
605 void LwpParaStyle::ApplyTab(XFParaStyle
*pParaStyle
, LwpTabOverride
*pTabOverRide
)
607 LwpObjectID
& rTabRackID
= pTabOverRide
->GetTabRackID();
608 if(rTabRackID
.IsNull())
613 LwpTabRack
* pTabRack
= dynamic_cast<LwpTabRack
*>(rTabRackID
.obj().get());
619 pParaStyle
->ClearTabStyles();
620 //Get margin left value
621 double dMarginLeft
= pParaStyle
->GetMargins().GetLeft();
623 sal_uInt16 nNumTabs
= pTabRack
->GetNumTabs();
624 for(sal_uInt16 nIndex
=0; nIndex
<nNumTabs
; nIndex
++)
627 LwpTab
* pTab
= pTabRack
->Lookup(nIndex
);
631 enumXFTab eType
= enumXFTabNone
;
632 LwpTab::TabType type
= pTab
->GetTabType();
635 case LwpTab::TT_LEFT
:
636 eType
= enumXFTabLeft
;
638 case LwpTab::TT_CENTER
:
639 eType
= enumXFTabCenter
;
641 case LwpTab::TT_RIGHT
:
642 eType
= enumXFTabRight
;
644 case LwpTab::TT_NUMERIC
:
645 eType
= enumXFTabChar
;
650 sal_uInt32 nPos
= pTab
->GetPosition();
651 //different feature between SODC and lwp, the tab length must minus the margin left of para.
652 double fLen
= LwpTools::ConvertFromUnitsToMetric(nPos
) - dMarginLeft
;
655 sal_Unicode cLeader
= 0x00;
656 LwpTab::LeaderType leader
= pTab
->GetLeaderType();
659 case LwpTab::TL_NONE
:
660 cLeader
= 0x20; //space
662 case LwpTab::TL_HYPHEN
: //'-'
665 case LwpTab::TL_DOT
: //'.'
668 case LwpTab::TL_LINE
: //'_'
673 sal_Unicode cAlignChar
= static_cast<sal_Unicode
>(pTab
->GetAlignChar());
675 pParaStyle
->AddTabStyle(eType
,fLen
,cLeader
,cAlignChar
);
680 void LwpParaStyle::RegisterStyle()
682 XFParaStyle
* pStyle
= new XFParaStyle();
685 OUString styleName
= GetName().str();
686 pStyle
->SetStyleName(styleName
);
689 LwpFontManager
& rFontMgr
= m_pFoundry
->GetFontManger();
690 rtl::Reference
<XFFont
> pFont
= rFontMgr
.CreateFont(m_nFinalFontID
);
691 pStyle
->SetFont(pFont
);
693 //Set other paragraph properties...
697 LwpStyleManager
* pStyleMgr
= m_pFoundry
->GetStyleManager();
698 pStyleMgr
->AddStyle(GetObjectID(), pStyle
);
701 LwpAlignmentOverride
* LwpParaStyle::GetAlignment()
703 if (m_AlignmentStyle
.obj() == NULL
)
706 LwpAlignmentPiece
*pPiece
= dynamic_cast<LwpAlignmentPiece
*>(m_AlignmentStyle
.obj().get());
708 return dynamic_cast<LwpAlignmentOverride
*>(pPiece
->GetOverride());
712 LwpIndentOverride
* LwpParaStyle::GetIndent()
714 if (m_IndentStyle
.obj() == NULL
)
717 LwpIndentPiece
*pPiece
= dynamic_cast<LwpIndentPiece
*>(m_IndentStyle
.obj().get());
719 return dynamic_cast<LwpIndentOverride
*>(pPiece
->GetOverride());
723 LwpSpacingOverride
* LwpParaStyle::GetSpacing()
725 if (m_SpacingStyle
.obj() == NULL
)
728 LwpSpacingPiece
*pPiece
= dynamic_cast<LwpSpacingPiece
*>(m_SpacingStyle
.obj().get());
730 return dynamic_cast<LwpSpacingOverride
*>(pPiece
->GetOverride());
734 LwpParaBorderOverride
* LwpParaStyle::GetParaBorder() const
736 if(m_BorderStyle
.IsNull())
739 LwpParaBorderPiece
*pPiece
= dynamic_cast<LwpParaBorderPiece
*>(m_BorderStyle
.obj(VO_PARABORDERPIECE
).get());
741 return dynamic_cast<LwpParaBorderOverride
*>(pPiece
->GetOverride());
745 LwpBreaksOverride
* LwpParaStyle::GetBreaks() const
747 if(m_BreaksStyle
.IsNull())
750 LwpBreaksPiece
*pPiece
= dynamic_cast<LwpBreaksPiece
*>(m_BreaksStyle
.obj(VO_BREAKSPIECE
).get());
752 return dynamic_cast<LwpBreaksOverride
*>(pPiece
->GetOverride());
757 LwpNumberingOverride
* LwpParaStyle::GetNumberingOverride() const
759 if(m_NumberingStyle
.IsNull())
762 LwpNumberingPiece
*pPiece
= dynamic_cast<LwpNumberingPiece
*>(m_NumberingStyle
.obj(VO_NUMBERINGPIECE
).get());
764 return dynamic_cast<LwpNumberingOverride
*>(pPiece
->GetOverride());
768 /**************************************************************************
774 **************************************************************************/
775 LwpTabOverride
* LwpParaStyle::GetTabOverride() const
777 if(m_TabStyle
.obj() == NULL
)
779 LwpTabPiece
*pPiece
= dynamic_cast<LwpTabPiece
*>(m_TabStyle
.obj().get());
781 return dynamic_cast<LwpTabOverride
*>(pPiece
->GetOverride());
785 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */