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
)
164 LwpVirtualPiece
*pPiece
= NULL
;
166 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_AlignmentStyle
.obj());
169 LwpAlignmentOverride
*pAlign
= dynamic_cast<LwpAlignmentOverride
*>(pPiece
->GetOverride());
171 ApplyAlignment(pParaStyle
,pAlign
);
174 //don't known top and bottom indent now.
175 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_IndentStyle
.obj());
178 LwpIndentOverride
*pIndent
= dynamic_cast<LwpIndentOverride
*>(pPiece
->GetOverride());
181 if (!m_pBulletOverride
->IsInValid())//Add by ,for remove bullet indent in named bullet style
183 boost::scoped_ptr
<LwpIndentOverride
> pNewIndent(pIndent
->clone());
184 pNewIndent
->SetMFirst(0);
185 pNewIndent
->SetMRest(0);
186 ApplyIndent(NULL
, pParaStyle
, pNewIndent
.get());
189 ApplyIndent(NULL
,pParaStyle
,pIndent
);
193 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BorderStyle
.obj());
196 LwpParaBorderOverride
*pBorder
= dynamic_cast<LwpParaBorderOverride
*>(pPiece
->GetOverride());
199 this->ApplyParaBorder(pParaStyle
, pBorder
);
203 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_SpacingStyle
.obj());
206 LwpSpacingOverride
*pSpacing
= dynamic_cast<LwpSpacingOverride
*>(pPiece
->GetOverride());
208 ApplySpacing(NULL
,pParaStyle
,pSpacing
);
211 //paragraph background.
212 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BackgroundStyle
.obj());
215 LwpBackgroundOverride
*pBack
= dynamic_cast<LwpBackgroundOverride
*>(pPiece
->GetOverride());
218 LwpColor color
= pBack
->GetBackColor();
219 XFColor
aXFColor( color
.To24Color() );
220 pParaStyle
->SetBackColor( aXFColor
);
225 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_TabStyle
.obj());
228 LwpTabOverride
*pTab
= dynamic_cast<LwpTabOverride
*>(pPiece
->GetOverride());
231 ApplyTab(pParaStyle
,pTab
);
234 pPiece
= dynamic_cast<LwpVirtualPiece
*>(m_BreaksStyle
.obj());
237 LwpBreaksOverride
*pBreak
= dynamic_cast<LwpBreaksOverride
*>(pPiece
->GetOverride());
240 ApplyBreaks(pParaStyle
,pBreak
);
246 void LwpParaStyle::ApplySubBorder(LwpBorderStuff
* pBorderStuff
, LwpBorderStuff::BorderType eType
, XFBorders
* pXFBorders
)
248 enumXFBorder eXFBorderSide
= enumXFBorderNone
;
251 case LwpBorderStuff::LEFT
:
252 eXFBorderSide
= enumXFBorderLeft
;
254 case LwpBorderStuff::RIGHT
:
255 eXFBorderSide
= enumXFBorderRight
;
257 case LwpBorderStuff::TOP
:
258 eXFBorderSide
= enumXFBorderTop
;
260 case LwpBorderStuff::BOTTOM
:
261 eXFBorderSide
= enumXFBorderBottom
;
267 LwpColor aColor
= pBorderStuff
->GetSideColor(eType
);
268 float fWidth
= pBorderStuff
->GetSideWidth(eType
);
269 sal_uInt16 nType
= pBorderStuff
->GetSideType(eType
);
273 default://fall through!
274 case 0x14: //single fall through!
276 pXFBorders
->SetWidth(eXFBorderSide
, fWidth
);
278 case 0x15: //double , fall through!
279 case 0x16: //thick double
280 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
281 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
282 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.334));
283 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
284 // pXFBorders->SetWidth(eXFBorderSide, fWidth);
286 case 0x18: //thick-thin
287 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
288 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.5));
289 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
290 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
292 case 0x19: //thin-thick
293 pXFBorders
->SetDoubleLine(eXFBorderSide
, true, false);
294 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.7));
295 pXFBorders
->SetWidthOuter(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
296 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
300 if (aColor
.IsValidColor())
302 XFColor
aXFColor(aColor
.To24Color());
303 pXFBorders
->SetColor(eXFBorderSide
, aXFColor
);
307 void LwpParaStyle::ApplyParaBorder(XFParaStyle
* pParaStyle
, LwpParaBorderOverride
* pBorder
)
310 LwpShadow
*pShadow
= pBorder
->GetShadow();
313 LwpColor color
= pShadow
->GetColor();
314 float offsetX
= pShadow
->GetOffsetX();
315 float offsetY
= pShadow
->GetOffsetY();
317 if( offsetX
&& offsetY
&& color
.IsValidColor() )
319 XFColor
aXFColor(color
.To24Color());
329 pParaStyle
->SetShadow(enumXFShadowLeftTop
,-offsetX
,aXFColor
);
331 pParaStyle
->SetShadow(enumXFShadowLeftBottom
,-offsetX
,aXFColor
);
336 pParaStyle
->SetShadow(enumXFShadowRightTop
,offsetX
,aXFColor
);
338 pParaStyle
->SetShadow(enumXFShadowRightBottom
,offsetX
,aXFColor
);
343 //convert to XFBorders object:
344 LwpBorderStuff
*pBorderStuff
= pBorder
->GetBorderStuff();
345 if( pBorderStuff
&& pBorderStuff
->GetSide() != 0 )
347 XFBorders
*pXFBorders
= new XFBorders();
348 pParaStyle
->SetBorders(pXFBorders
);
350 LwpMargins
* pMargins
= pBorder
->GetMargins();
352 // apply 4 borders respectively
353 LwpBorderStuff::BorderType pType
[] = { LwpBorderStuff::LEFT
, LwpBorderStuff::RIGHT
,
354 LwpBorderStuff::TOP
, LwpBorderStuff::BOTTOM
};
355 float pMarginValue
[4];
357 for (sal_uInt8 nC
= 0; nC
< 4; nC
++)
359 if (pBorderStuff
->HasSide(pType
[nC
]))
361 this->ApplySubBorder(pBorderStuff
, pType
[nC
], pXFBorders
);
363 //get border spacing to text content
366 pMarginValue
[nC
] = static_cast<float>(pMargins
->GetMarginsValue(nC
));
372 //apply border spacing to text content
373 pParaStyle
->SetPadding(pMarginValue
[0], pMarginValue
[1], pMarginValue
[2], pMarginValue
[3]);
378 void LwpParaStyle::ApplyBreaks(XFParaStyle
* pParaStyle
, LwpBreaksOverride
* pBreaks
)
380 if (pBreaks
->IsKeepWithNext())
382 pParaStyle
->SetBreaks(enumXFBreakKeepWithNext
);
384 if (pBreaks
->IsPageBreakBefore())
386 pParaStyle
->SetBreaks(enumXFBreakBefPage
);
388 if (pBreaks
->IsPageBreakAfter())
390 pParaStyle
->SetBreaks(enumXFBreakAftPage
);
392 if (pBreaks
->IsColumnBreakBefore())
394 pParaStyle
->SetBreaks(enumXFBreakBefColumn
);
396 if (pBreaks
->IsColumnBreakAfter())
398 pParaStyle
->SetBreaks(enumXFBreakAftColumn
);
402 void LwpParaStyle::ApplyAlignment(XFParaStyle
* pParaStyle
, LwpAlignmentOverride
* pAlign
)
404 enumXFAlignType alignType
= enumXFAlignStart
;
405 LwpAlignmentOverride::AlignType type
;
407 type
= pAlign
->GetAlignType();
408 pParaStyle
->SetNumberRight(false);//to identify its align attribute
411 case LwpAlignmentOverride::ALIGN_LEFT
:
412 alignType
= enumXFAlignStart
;
414 case LwpAlignmentOverride::ALIGN_RIGHT
:
415 alignType
= enumXFAlignEnd
;
417 case LwpAlignmentOverride::ALIGN_CENTER
:
418 alignType
= enumXFAlignCenter
;
420 case LwpAlignmentOverride::ALIGN_NUMERICLEFT
://if non-number in table,ALIGN_NUMERICLEFT/RIGHT are useless
421 alignType
= enumXFAlignStart
; //note by 1/28
423 case LwpAlignmentOverride::ALIGN_JUSTIFY
:
424 case LwpAlignmentOverride::ALIGN_JUSTIFYALL
:
425 alignType
= enumXFAlignJustify
;
427 case LwpAlignmentOverride::ALIGN_NUMERICRIGHT
:
428 pParaStyle
->SetNumberRight(true);//to identify its align attribute
429 alignType
= enumXFAlignEnd
;
434 pParaStyle
->SetAlignType(alignType
);
437 void LwpParaStyle::ApplyIndent(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpIndentOverride
* pIndent
)
439 LwpPara
* pParentPara
;
441 pParentPara
= pPara
->GetParent();
445 SAL_WNODEPRECATED_DECLARATIONS_PUSH
446 std::auto_ptr
<LwpIndentOverride
> pTotalIndent(new LwpIndentOverride
);
447 SAL_WNODEPRECATED_DECLARATIONS_POP
448 if (pIndent
->IsUseRelative() && pParentPara
)
450 LwpIndentOverride
* pParentIndent
= pParentPara
->GetIndent();
453 pTotalIndent
.reset(pIndent
->clone());
455 //add by ,for bullet only
458 if (pPara
->GetBulletFlag())
460 pTotalIndent
->SetMAll(pParentIndent
->GetMAll() + pTotalIndent
->GetMAll());
461 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
462 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
463 pTotalIndent
->GetMAll())), pTotalIndent
->GetRight());
464 pPara
->SetIndent(pTotalIndent
.release());
469 sal_uInt16 relative
= pParentIndent
->GetRelative();
471 sal_Int32 Amount
= pParentIndent
->GetMAll();
473 if (relative
== LwpIndentOverride::RELATIVE_FIRST
)
474 Amount
+= pParentIndent
->GetMFirst();
475 else if (relative
== LwpIndentOverride::RELATIVE_REST
)
476 Amount
+= pParentIndent
->GetMRest();
477 pTotalIndent
->SetMAll(Amount
+ pTotalIndent
->GetMAll());
478 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
480 pParaStyle
->SetIndent(pTotalIndent
->GetFirst());
481 pParaStyle
->SetMargins(pTotalIndent
->GetLeft(), pTotalIndent
->GetRight());
482 pPara
->SetIndent(pTotalIndent
.release());
487 pTotalIndent
.reset(pIndent
->clone());
491 if (pPara
->GetBulletFlag())
493 // pParaStyle->SetIndent(LwpTools::ConvertFromUnits(pIndent->GetMAll()));
494 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(
495 LwpTools::ConvertFromUnits(pIndent
->GetMAll())), pIndent
->GetRight());
496 pPara
->SetIndent(pTotalIndent
.release());
502 pParaStyle
->SetIndent(pIndent
->GetFirst());
503 pParaStyle
->SetMargins(pIndent
->GetLeft(), pIndent
->GetRight());
506 pPara
->SetIndent(pTotalIndent
.release());
511 void LwpParaStyle::ApplySpacing(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpSpacingOverride
* pSpacing
)
513 LwpSpacingCommonOverride
* spacing
= pSpacing
->GetSpacing();
514 LwpSpacingCommonOverride
* abovepara
= pSpacing
->GetAboveSpacing();
515 LwpSpacingCommonOverride
* belowpara
= pSpacing
->GetBelowSpacing();
517 LwpSpacingCommonOverride::SpacingType type
= spacing
->GetType();
518 sal_Int32 amount
= spacing
->GetAmount();
519 sal_Int32 multiple
= spacing
->GetMultiple();
525 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
527 xftype
= enumLHPercent
;
528 height
= double(multiple
)/65536L*100;
529 pParaStyle
->SetLineHeight(xftype
,height
);
532 case LwpSpacingCommonOverride::SPACING_LEADING
:
534 xftype
= enumLHSpace
;
535 height
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(amount
));
536 pParaStyle
->SetLineHeight(xftype
,height
);
539 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
541 xftype
= enumLHHeight
;
542 height
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
543 pParaStyle
->SetLineHeight(xftype
,height
);
546 case LwpSpacingCommonOverride::SPACING_NONE
:
550 //TO DO: Above Line need to be processed!!!!!!! what it means?????? 1-26
552 type
= abovepara
->GetType();
553 amount
= abovepara
->GetAmount();
554 multiple
= abovepara
->GetMultiple();
555 double above_val
=-1;
558 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
559 // above_val = LINE_HEIGHT*float(multiple)/65536L*100; //TO DO: 1-26
561 case LwpSpacingCommonOverride::SPACING_LEADING
:
563 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
564 above_val
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
566 case LwpSpacingCommonOverride::SPACING_NONE
:
570 type
= belowpara
->GetType();
571 amount
= belowpara
->GetAmount();
572 multiple
= belowpara
->GetMultiple();
576 case LwpSpacingCommonOverride::SPACING_DYNAMIC
:
577 // below_val = LINE_HEIGHT*float(multiple)/65536L*100;//TO DO: 1-26
579 case LwpSpacingCommonOverride::SPACING_LEADING
:
581 case LwpSpacingCommonOverride::SPACING_CUSTOM
:
582 below_val
= LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple
)/65536L*amount
)));
584 case LwpSpacingCommonOverride::SPACING_NONE
:
591 pPara
->SetBelowSpacing(below_val
);
592 LwpPara
* pPrePara
= dynamic_cast<LwpPara
*>(pPara
->GetPrevious()->obj());
593 if (pPrePara
&& above_val
!= -1)
595 above_val
+= pPrePara
->GetBelowSpacing();
600 pParaStyle
->SetMargins(-1,-1,above_val
,below_val
);
602 /**************************************************************************
608 **************************************************************************/
609 void LwpParaStyle::ApplyTab(XFParaStyle
*pParaStyle
, LwpTabOverride
*pTabOverRide
)
611 LwpObjectID
* pTabRackID
= pTabOverRide
->GetTabRackID();
612 if(pTabRackID
->IsNull())
618 LwpTabRack
* pTabRack
= dynamic_cast<LwpTabRack
*>(pTabRackID
->obj());
625 pParaStyle
->ClearTabStyles();
626 //Get margin left value
627 double dMarginLeft
= pParaStyle
->GetMargins().GetLeft();
629 sal_uInt16 nNumTabs
= pTabRack
->GetNumTabs();
630 for(sal_uInt16 nIndex
=0; nIndex
<nNumTabs
; nIndex
++)
633 LwpTab
* pTab
= pTabRack
->Lookup(nIndex
);
637 enumXFTab eType
= enumXFTabNone
;
638 LwpTab::TabType type
= pTab
->GetTabType();
641 case LwpTab::TT_LEFT
:
642 eType
= enumXFTabLeft
;
644 case LwpTab::TT_CENTER
:
645 eType
= enumXFTabCenter
;
647 case LwpTab::TT_RIGHT
:
648 eType
= enumXFTabRight
;
650 case LwpTab::TT_NUMERIC
:
651 eType
= enumXFTabChar
;
656 sal_uInt32 nPos
= pTab
->GetPosition();
657 //different feature between SODC and lwp, the tab length must minus the margin left of para.
658 double fLen
= LwpTools::ConvertFromUnitsToMetric(nPos
) - dMarginLeft
;
661 sal_Unicode cLeader
= 0x00;
662 LwpTab::LeaderType leader
= pTab
->GetLeaderType();
665 case LwpTab::TL_NONE
:
666 cLeader
= 0x20; //space
668 case LwpTab::TL_HYPHEN
: //'-'
671 case LwpTab::TL_DOT
: //'.'
674 case LwpTab::TL_LINE
: //'_'
679 sal_Unicode cAlignChar
= static_cast<sal_Unicode
>(pTab
->GetAlignChar());
681 pParaStyle
->AddTabStyle(eType
,fLen
,cLeader
,cAlignChar
);
686 void LwpParaStyle::RegisterStyle()
688 XFParaStyle
* pStyle
= new XFParaStyle();
691 OUString styleName
= GetName()->str();
692 pStyle
->SetStyleName(styleName
);
695 LwpFontManager
* pFontMgr
= m_pFoundry
->GetFontManger();
696 XFFont
* pFont
= pFontMgr
->CreateFont(m_nFinalFontID
);
697 pStyle
->SetFont(pFont
);
699 //Set other paragraph properties...
703 LwpStyleManager
* pStyleMgr
= m_pFoundry
->GetStyleManager();
704 pStyleMgr
->AddStyle(*GetObjectID(), pStyle
);
707 LwpAlignmentOverride
* LwpParaStyle::GetAlignment()
709 if (m_AlignmentStyle
.obj() == NULL
)
712 LwpAlignmentPiece
*pPiece
= dynamic_cast<LwpAlignmentPiece
*>(m_AlignmentStyle
.obj());
714 return dynamic_cast<LwpAlignmentOverride
*>(pPiece
->GetOverride());
718 LwpIndentOverride
* LwpParaStyle::GetIndent()
720 if (m_IndentStyle
.obj() == NULL
)
723 LwpIndentPiece
*pPiece
= dynamic_cast<LwpIndentPiece
*>(m_IndentStyle
.obj());
725 return dynamic_cast<LwpIndentOverride
*>(pPiece
->GetOverride());
729 LwpSpacingOverride
* LwpParaStyle::GetSpacing()
731 if (m_SpacingStyle
.obj() == NULL
)
734 LwpSpacingPiece
*pPiece
= dynamic_cast<LwpSpacingPiece
*>(m_SpacingStyle
.obj());
736 return dynamic_cast<LwpSpacingOverride
*>(pPiece
->GetOverride());
740 LwpParaBorderOverride
* LwpParaStyle::GetParaBorder() const
742 if(m_BorderStyle
.IsNull())
745 LwpParaBorderPiece
*pPiece
= dynamic_cast<LwpParaBorderPiece
*>(m_BorderStyle
.obj(VO_PARABORDERPIECE
));
747 return dynamic_cast<LwpParaBorderOverride
*>(pPiece
->GetOverride());
751 LwpBreaksOverride
* LwpParaStyle::GetBreaks() const
753 if(m_BreaksStyle
.IsNull())
756 LwpBreaksPiece
*pPiece
= dynamic_cast<LwpBreaksPiece
*>(m_BreaksStyle
.obj(VO_BREAKSPIECE
));
758 return dynamic_cast<LwpBreaksOverride
*>(pPiece
->GetOverride());
762 LwpBulletOverride
* LwpParaStyle::GetBulletOverride() const
764 return m_pBulletOverride
;
767 LwpNumberingOverride
* LwpParaStyle::GetNumberingOverride() const
769 if(m_NumberingStyle
.IsNull())
772 LwpNumberingPiece
*pPiece
= dynamic_cast<LwpNumberingPiece
*>(m_NumberingStyle
.obj(VO_NUMBERINGPIECE
));
774 return dynamic_cast<LwpNumberingOverride
*>(pPiece
->GetOverride());
778 /**************************************************************************
784 **************************************************************************/
785 LwpTabOverride
* LwpParaStyle::GetTabOverride() const
787 if(m_TabStyle
.obj() == NULL
)
789 LwpTabPiece
*pPiece
= dynamic_cast<LwpTabPiece
*>(m_TabStyle
.obj());
791 return dynamic_cast<LwpTabOverride
*>(pPiece
->GetOverride());
795 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */