1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
62 ************************************************************************/
65 #include "lwpparastyle.hxx"
66 #include "lwpfilehdr.hxx"
67 #include "lwpoverride.hxx"
68 #include "lwpparaborderoverride.hxx"
69 #include "lwpbreaksoverride.hxx"
70 #include "lwpnumberingoverride.hxx"
71 #include "lwptaboverride.hxx"
72 #include "lwpbackgroundoverride.hxx"
73 #include "xfilter/xfdefs.hxx"
74 #include "xfilter/xfparastyle.hxx"
75 #include "xfilter/xfborders.hxx"
76 #include "lwpfont.hxx"
77 #include "lwpfoundry.hxx"
78 #include "lwppiece.hxx"
79 #include "lwpshadow.hxx"
80 #include "lwpborderstuff.hxx"
81 #include "lwpmargins.hxx"
82 #include "lwptabrack.hxx"
84 #include "lwpsilverbullet.hxx"
87 LwpParaStyle::LwpParaStyle(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
) :
88 LwpTextStyle(objHdr
, pStrm
), m_pKinsokuOptsOverride(new LwpKinsokuOptsOverride
),
89 m_pBulletOverride(new LwpBulletOverride
)
93 LwpParaStyle::~LwpParaStyle()
95 if (m_pKinsokuOptsOverride
)
97 delete m_pKinsokuOptsOverride
;
100 if (m_pBulletOverride
)
102 delete m_pBulletOverride
;
106 void LwpParaStyle::Read()
108 LwpTextStyle::Read();
110 if (LwpFileHeader::m_nFileRevision
< 0x000B)
112 // read many overrides
113 LwpAlignmentOverride aAlignOverride
;
114 aAlignOverride
.Read(m_pObjStrm
);
116 LwpSpacingOverride aSpacingOverride
;
117 aSpacingOverride
.Read(m_pObjStrm
);
119 LwpIndentOverride aIndentOverride
;
120 aIndentOverride
.Read(m_pObjStrm
);
122 LwpParaBorderOverride aPBOverride
;
123 aPBOverride
.Read(m_pObjStrm
);
125 LwpBreaksOverride aBreaksOverride
;
126 aBreaksOverride
.Read(m_pObjStrm
);
128 LwpNumberingOverride aNumberingOverride
;
129 aNumberingOverride
.Read(m_pObjStrm
);
131 LwpTabOverride aTabOverride
;
132 aTabOverride
.Read(m_pObjStrm
);
137 m_AlignmentStyle
.ReadIndexed(m_pObjStrm
);
138 m_SpacingStyle
.ReadIndexed(m_pObjStrm
);
139 m_IndentStyle
.ReadIndexed(m_pObjStrm
);
140 m_BorderStyle
.ReadIndexed(m_pObjStrm
);
141 m_BreaksStyle
.ReadIndexed(m_pObjStrm
);
142 m_NumberingStyle
.ReadIndexed(m_pObjStrm
);
143 m_TabStyle
.ReadIndexed(m_pObjStrm
);
145 m_pKinsokuOptsOverride
->Read(m_pObjStrm
);
146 m_pBulletOverride
->Read(m_pObjStrm
);
148 if (m_pObjStrm
->CheckExtra())
150 m_BackgroundStyle
.ReadIndexed(m_pObjStrm
);
151 m_pObjStrm
->SkipExtra();
158 void LwpParaStyle::Apply(XFParaStyle
*pParaStyle
)
161 LwpVirtualPiece
*pPiece
= NULL
;
163 pPiece
= (LwpVirtualPiece
*)m_AlignmentStyle
.obj();
166 LwpAlignmentOverride
*pAlign
= (LwpAlignmentOverride
*)pPiece
->GetOverride();
168 ApplyAlignment(pParaStyle
,pAlign
);
171 //don't known top and bottom indent now.
172 pPiece
= (LwpVirtualPiece
*)m_IndentStyle
.obj();
175 LwpIndentOverride
*pIndent
= (LwpIndentOverride
*)pPiece
->GetOverride();
178 if (!m_pBulletOverride
->IsInValid())//Add by ,for remove bullet indent in named bullet style
180 LwpIndentOverride
* pNewIndent
= new LwpIndentOverride
;
181 *pNewIndent
= *pIndent
;
182 pNewIndent
->SetMFirst(0);
183 pNewIndent
->SetMRest(0);
184 ApplyIndent(NULL
,pParaStyle
,pNewIndent
);
188 ApplyIndent(NULL
,pParaStyle
,pIndent
);
192 pPiece
= (LwpVirtualPiece
*)m_BorderStyle
.obj();
195 LwpParaBorderOverride
*pBorder
= (LwpParaBorderOverride
*)pPiece
->GetOverride();
198 this->ApplyParaBorder(pParaStyle
, pBorder
);
202 pPiece
= (LwpVirtualPiece
*)m_SpacingStyle
.obj();
205 LwpSpacingOverride
*pSpacing
= (LwpSpacingOverride
*)pPiece
->GetOverride();
207 ApplySpacing(NULL
,pParaStyle
,pSpacing
);
210 //paragraph background.
211 pPiece
= (LwpVirtualPiece
*)m_BackgroundStyle
.obj();
214 LwpBackgroundOverride
*pBack
= (LwpBackgroundOverride
*)pPiece
->GetOverride();
217 LwpColor color
= pBack
->GetBackColor();
218 XFColor
aXFColor( color
.To24Color() );
219 pParaStyle
->SetBackColor( aXFColor
);
225 pPiece
= (LwpVirtualPiece
*)m_TabStyle
.obj();
228 LwpTabOverride
*pTab
=(LwpTabOverride
*)pPiece
->GetOverride();
231 ApplyTab(pParaStyle
,pTab
);
235 pPiece
= (LwpVirtualPiece
*)m_BreaksStyle
.obj();
238 LwpBreaksOverride
*pBreak
=(LwpBreaksOverride
*)pPiece
->GetOverride();
241 ApplyBreaks(pParaStyle
,pBreak
);
247 void LwpParaStyle::ApplySubBorder(LwpBorderStuff
* pBorderStuff
, LwpBorderStuff::BorderType eType
, XFBorders
* pXFBorders
)
249 enumXFBorder eXFBorderSide
= enumXFBorderNone
;
252 case LwpBorderStuff::LEFT
:
253 eXFBorderSide
= enumXFBorderLeft
;
255 case LwpBorderStuff::RIGHT
:
256 eXFBorderSide
= enumXFBorderRight
;
258 case LwpBorderStuff::TOP
:
259 eXFBorderSide
= enumXFBorderTop
;
261 case LwpBorderStuff::BOTTOM
:
262 eXFBorderSide
= enumXFBorderBottom
;
266 LwpColor aColor
= pBorderStuff
->GetSideColor(eType
);
267 float fWidth
= pBorderStuff
->GetSideWidth(eType
);
268 sal_uInt16 nType
= pBorderStuff
->GetSideType(eType
);
272 default://fall through!
273 case 0x14: //single fall through!
275 pXFBorders
->SetWidth(eXFBorderSide
, fWidth
);
277 case 0x15: //double , fall through!
278 case 0x16: //thick double
279 pXFBorders
->SetDoubleLine(eXFBorderSide
, sal_True
, sal_False
);
280 pXFBorders
->SetWidthOutter(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
281 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.334));
282 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.333));
283 // pXFBorders->SetWidth(eXFBorderSide, fWidth);
285 case 0x18: //thick-thin
286 pXFBorders
->SetDoubleLine(eXFBorderSide
, sal_True
, sal_False
);
287 pXFBorders
->SetWidthOutter(eXFBorderSide
, static_cast<float>(fWidth
*0.5));
288 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
289 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.25));
291 case 0x19: //thin-thick
292 pXFBorders
->SetDoubleLine(eXFBorderSide
, sal_True
, sal_False
);
293 pXFBorders
->SetWidthInner(eXFBorderSide
, static_cast<float>(fWidth
*0.7));
294 pXFBorders
->SetWidthOutter(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
295 pXFBorders
->SetWidthSpace(eXFBorderSide
, static_cast<float>(fWidth
*0.15));
299 if (aColor
.IsValidColor())
301 XFColor
aXFColor(aColor
.To24Color());
302 pXFBorders
->SetColor(eXFBorderSide
, aXFColor
);
306 void LwpParaStyle::ApplyParaBorder(XFParaStyle
* pParaStyle
, LwpParaBorderOverride
* pBorder
)
309 LwpShadow
*pShadow
= pBorder
->GetShadow();
312 LwpColor color
= pShadow
->GetColor();
313 float offsetX
= pShadow
->GetOffsetX();
314 float offsetY
= pShadow
->GetOffsetY();
316 if( offsetX
&& offsetY
&& color
.IsValidColor() )
318 XFColor
aXFColor(color
.To24Color());
319 sal_Bool left
= sal_False
;
320 sal_Bool top
= sal_False
;
328 pParaStyle
->SetShadow(enumXFShadowLeftTop
,-offsetX
,aXFColor
);
330 pParaStyle
->SetShadow(enumXFShadowLeftBottom
,-offsetX
,aXFColor
);
335 pParaStyle
->SetShadow(enumXFShadowRightTop
,offsetX
,aXFColor
);
337 pParaStyle
->SetShadow(enumXFShadowRightBottom
,offsetX
,aXFColor
);
342 //convert to XFBorders obejct:
343 LwpBorderStuff
*pBorderStuff
= pBorder
->GetBorderStuff();
344 if( pBorderStuff
&& pBorderStuff
->GetSide() != 0 )
346 XFBorders
*pXFBorders
= new XFBorders();
347 pParaStyle
->SetBorders(pXFBorders
);
349 LwpMargins
* pMargins
= pBorder
->GetMargins();
351 // apply 4 borders respectively
352 LwpBorderStuff::BorderType pType
[] = { LwpBorderStuff::LEFT
, LwpBorderStuff::RIGHT
,
353 LwpBorderStuff::TOP
, LwpBorderStuff::BOTTOM
};
354 float pMarginValue
[4];
356 for (sal_uInt8 nC
= 0; nC
< 4; nC
++)
358 if (pBorderStuff
->HasSide(pType
[nC
]))
360 this->ApplySubBorder(pBorderStuff
, pType
[nC
], pXFBorders
);
362 //get border spacing to text content
365 pMarginValue
[nC
] = static_cast<float>(pMargins
->GetMarginsValue(nC
));
371 //apply border spacing to text content
372 pParaStyle
->SetPadding(pMarginValue
[0], pMarginValue
[1], pMarginValue
[2], pMarginValue
[3]);
377 void LwpParaStyle::ApplyBreaks(XFParaStyle
* pParaStyle
, LwpBreaksOverride
* pBreaks
)
379 if (pBreaks
->IsKeepWithNext())
381 pParaStyle
->SetBreaks(enumXFBreakKeepWithNext
);
383 if (pBreaks
->IsPageBreakBefore())
385 pParaStyle
->SetBreaks(enumXFBreakBefPage
);
387 if (pBreaks
->IsPageBreakAfter())
389 pParaStyle
->SetBreaks(enumXFBreakAftPage
);
391 if (pBreaks
->IsColumnBreakBefore())
393 pParaStyle
->SetBreaks(enumXFBreakBefColumn
);
395 if (pBreaks
->IsColumnBreakAfter())
397 pParaStyle
->SetBreaks(enumXFBreakAftColumn
);
401 void LwpParaStyle::ApplyAlignment(XFParaStyle
* pParaStyle
, LwpAlignmentOverride
* pAlign
)
403 enumXFAlignType alignType
= enumXFAlignStart
;
404 LwpAlignmentOverride::AlignType type
;
406 type
= pAlign
->GetAlignType();
407 pParaStyle
->SetNumberRight(sal_False
);//to identify its align attribute
410 case LwpAlignmentOverride::ALIGN_LEFT
:
411 alignType
= enumXFAlignStart
;
413 case LwpAlignmentOverride::ALIGN_RIGHT
:
414 alignType
= enumXFAlignEnd
;
416 case LwpAlignmentOverride::ALIGN_CENTER
:
417 alignType
= enumXFAlignCenter
;
419 case LwpAlignmentOverride::ALIGN_NUMERICLEFT
://if non-number in table,ALIGN_NUMERICLEFT/RIGHT are useless
420 alignType
= enumXFAlignStart
; //note by 1/28
422 case LwpAlignmentOverride::ALIGN_JUSTIFY
:
423 case LwpAlignmentOverride::ALIGN_JUSTIFYALL
:
424 alignType
= enumXFAlignJustify
;
426 case LwpAlignmentOverride::ALIGN_NUMERICRIGHT
:
427 pParaStyle
->SetNumberRight(sal_True
);//to identify its align attribute
428 alignType
= enumXFAlignEnd
;
431 pParaStyle
->SetAlignType(alignType
);
434 void LwpParaStyle::ApplyIndent(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpIndentOverride
* pIndent
)
436 LwpPara
* pParentPara
;
438 pParentPara
= pPara
->GetParent();
442 LwpIndentOverride
* pTotalIndent
= new LwpIndentOverride
;
443 if (pIndent
->IsUseRelative() && pParentPara
)
445 LwpIndentOverride
* pParentIndent
= pParentPara
->GetIndent();
448 *pTotalIndent
= *pIndent
;
450 //add by ,for bullet only
453 if (pPara
->GetBulletFlag())
455 pTotalIndent
->SetMAll(pParentIndent
->GetMAll() + pTotalIndent
->GetMAll());
456 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
457 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
458 pTotalIndent
->GetMAll())), pTotalIndent
->GetRight());
459 pPara
->SetIndent(pTotalIndent
);
464 sal_uInt16 relative
= pParentIndent
->GetRelative();
466 sal_Int32 Amount
= pParentIndent
->GetMAll();
468 if (relative
== LwpIndentOverride::RELATIVE_FIRST
)
469 Amount
+= pParentIndent
->GetMFirst();
470 else if (relative
== LwpIndentOverride::RELATIVE_REST
)
471 Amount
+= pParentIndent
->GetMRest();
472 pTotalIndent
->SetMAll(Amount
+ pTotalIndent
->GetMAll());
473 pTotalIndent
->SetMRight(pParentIndent
->GetMRight()+ pTotalIndent
->GetMRight());
475 pParaStyle
->SetIndent(pTotalIndent
->GetFirst());
476 pParaStyle
->SetMargins(pTotalIndent
->GetLeft(), pTotalIndent
->GetRight());
477 pPara
->SetIndent(pTotalIndent
);
482 *pTotalIndent
= *pIndent
;
486 if (pPara
->GetBulletFlag())
488 // pParaStyle->SetIndent(LwpTools::ConvertFromUnits(pIndent->GetMAll()));
489 pParaStyle
->SetMargins(LwpTools::ConvertToMetric(
490 LwpTools::ConvertFromUnits(pIndent
->GetMAll())), pIndent
->GetRight());
491 pPara
->SetIndent(pTotalIndent
);
497 pParaStyle
->SetIndent(pIndent
->GetFirst());
498 pParaStyle
->SetMargins(pIndent
->GetLeft(), pIndent
->GetRight());
501 pPara
->SetIndent(pTotalIndent
);
506 void LwpParaStyle::ApplySpacing(LwpPara
* pPara
, XFParaStyle
* pParaStyle
, LwpSpacingOverride
* pSpacing
)
508 LwpSpacingCommonOverride
* spacing
= pSpacing
->GetSpacing();
509 LwpSpacingCommonOverride
* aboveline
= pSpacing
->GetAboveLineSpacing();
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
= static_cast<LwpPara
*>(pPara
->GetPrevious()->obj());
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
*pTab
)
607 LwpObjectID
* pTabRackID
= pTab
->GetTabRackID();
608 if(pTabRackID
->IsNull())
614 LwpTabRack
* pTabRack
= static_cast<LwpTabRack
*>(pTabRackID
->obj());
621 pParaStyle
->ClearTabStyles();
622 //Get margin left value
623 double dMarginLeft
= pParaStyle
->GetMargins().GetLeft();
625 sal_uInt16 nNumTabs
= pTabRack
->GetNumTabs();
626 for(sal_uInt16 nIndex
=0; nIndex
<nNumTabs
; nIndex
++)
629 LwpTab
* pTab
= pTabRack
->Lookup(nIndex
);
634 LwpTab::TabType type
= pTab
->GetTabType();
637 case LwpTab::TT_LEFT
:
638 eType
= enumXFTabLeft
;
640 case LwpTab::TT_CENTER
:
641 eType
= enumXFTabCenter
;
643 case LwpTab::TT_RIGHT
:
644 eType
= enumXFTabRight
;
646 case LwpTab::TT_NUMERIC
:
647 eType
= enumXFTabChar
;
652 sal_uInt32 nPos
= pTab
->GetPosition();
653 //different feature between SODC and lwp, the tab length must minus the margin left of para.
654 double fLen
= LwpTools::ConvertFromUnitsToMetric(nPos
) - dMarginLeft
;
658 LwpTab::LeaderType leader
= pTab
->GetLeaderType();
661 case LwpTab::TL_NONE
:
662 cLeader
= 0x20; //space
664 case LwpTab::TL_HYPHEN
: //'-'
667 case LwpTab::TL_DOT
: //'.'
670 case LwpTab::TL_LINE
: //'_'
675 sal_Unicode cAlignChar
= static_cast<sal_Unicode
>(pTab
->GetAlignChar());
677 pParaStyle
->AddTabStyle(eType
,fLen
,cLeader
,cAlignChar
);
683 void LwpParaStyle::RegisterStyle()
685 XFParaStyle
* pStyle
= new XFParaStyle();
688 OUString styleName
= GetName()->str();
689 pStyle
->SetStyleName(styleName
);
692 LwpFontManager
* pFontMgr
= m_pFoundry
->GetFontManger();
693 XFFont
* pFont
= pFontMgr
->CreateFont(m_nFinalFontID
);
694 pStyle
->SetFont(pFont
);
696 //Set other paragraph properties...
700 LwpStyleManager
* pStyleMgr
= m_pFoundry
->GetStyleManager();
701 pStyleMgr
->AddStyle(*GetObjectID(), pStyle
);
703 /* // add list style for bullet
704 if (!m_pBulletOverride)
708 LwpSilverBullet* pSilverBullet = static_cast<LwpSilverBullet*>(m_pBulletOverride->GetSilverBullet().obj());
714 pSilverBullet->SetFoundry(m_pFoundry);
715 pSilverBullet->RegisterStyle();*/
718 LwpAlignmentOverride
* LwpParaStyle::GetAlignment()
720 if (m_AlignmentStyle
.obj()!= NULL
)
721 return static_cast<LwpAlignmentOverride
*>(static_cast<LwpAlignmentPiece
*>(m_AlignmentStyle
.obj())->GetOverride());
726 LwpIndentOverride
* LwpParaStyle::GetIndent()
728 if (m_IndentStyle
.obj() != NULL
)
729 return static_cast<LwpIndentOverride
*>(static_cast<LwpIndentPiece
*>(m_IndentStyle
.obj())->GetOverride());
734 LwpSpacingOverride
* LwpParaStyle::GetSpacing()
736 if (m_SpacingStyle
.obj() != NULL
)
737 return static_cast<LwpSpacingOverride
*>(static_cast<LwpSpacingPiece
*>(m_SpacingStyle
.obj())->GetOverride());
742 LwpParaBorderOverride
* LwpParaStyle::GetParaBorder() const
744 if(m_BorderStyle
.IsNull()) return NULL
;
745 return static_cast<LwpParaBorderOverride
*>
746 (static_cast<LwpParaBorderPiece
*>(m_BorderStyle
.obj(VO_PARABORDERPIECE
))->GetOverride());
749 LwpBreaksOverride
* LwpParaStyle::GetBreaks() const
751 if(m_BreaksStyle
.IsNull()) return NULL
;
752 return static_cast<LwpBreaksOverride
*>
753 (static_cast<LwpBreaksPiece
*>(m_BreaksStyle
.obj(VO_BREAKSPIECE
))->GetOverride());
756 LwpBulletOverride
* LwpParaStyle::GetBulletOverride() const
758 return m_pBulletOverride
;
761 LwpNumberingOverride
* LwpParaStyle::GetNumberingOverride() const
763 if(m_NumberingStyle
.IsNull()) return NULL
;
764 return static_cast<LwpNumberingOverride
*>
765 (static_cast<LwpNumberingPiece
*>(m_NumberingStyle
.obj(VO_NUMBERINGPIECE
))->GetOverride());
769 /**************************************************************************
775 **************************************************************************/
776 LwpTabOverride
* LwpParaStyle::GetTabOverride() const
778 if(m_TabStyle
.obj() != NULL
)
779 return (LwpTabOverride
*)static_cast<LwpTabPiece
*>(m_TabStyle
.obj())->GetOverride();
784 sal_Bool
LwpParaStyle::IsNumberRight()
786 LwpAlignmentOverride
* pAlign
= GetAlignment();
789 LwpAlignmentOverride::AlignType type
;
790 type
= pAlign
->GetAlignType();
791 if (type
== LwpAlignmentOverride::ALIGN_NUMERICRIGHT
)