LibreOffice Module lotuswordpro (master) 1
lwpparastyle.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 <memory>
62
63#include "lwpparastyle.hxx"
64#include <lwpfilehdr.hxx>
65#include <lwpoverride.hxx>
67#include "lwpbreaksoverride.hxx"
69#include "lwptaboverride.hxx"
71#include <o3tl/safeint.hxx>
72#include <xfilter/xfdefs.hxx>
74#include <xfilter/xfborders.hxx>
75#include <lwpfont.hxx>
76#include <lwpfoundry.hxx>
77#include "lwppiece.hxx"
78#include "lwpshadow.hxx"
79#include "lwpborderstuff.hxx"
80#include "lwpmargins.hxx"
81#include "lwptabrack.hxx"
82
84LwpTextStyle(objHdr, pStrm)
85{
86}
87
89{
90}
91
93{
95
97 {
98 // read many overrides
99 LwpAlignmentOverride aAlignOverride;
100 aAlignOverride.Read(m_pObjStrm.get());
101
102 LwpSpacingOverride aSpacingOverride;
103 aSpacingOverride.Read(m_pObjStrm.get());
104
105 LwpIndentOverride aIndentOverride;
106 aIndentOverride.Read(m_pObjStrm.get());
107
108 LwpParaBorderOverride aPBOverride;
109 aPBOverride.Read(m_pObjStrm.get());
110
111 LwpBreaksOverride aBreaksOverride;
112 aBreaksOverride.Read(m_pObjStrm.get());
113
114 LwpNumberingOverride aNumberingOverride;
115 aNumberingOverride.Read(m_pObjStrm.get());
116
117 LwpTabOverride aTabOverride;
118 aTabOverride.Read(m_pObjStrm.get());
119
120 }
121 else
122 {
130
133
134 if (m_pObjStrm->CheckExtra())
135 {
137 m_pObjStrm->SkipExtra();
138 }
139
140 }
141}
142
144{
145 assert(pParaStyle);
146
147 //alignment:
148 LwpVirtualPiece *pPiece = dynamic_cast<LwpVirtualPiece*>(m_AlignmentStyle.obj().get());
149 if( pPiece )
150 {
151 LwpAlignmentOverride *pAlign = dynamic_cast<LwpAlignmentOverride*>(pPiece->GetOverride());
152 if( pAlign )
153 ApplyAlignment(pParaStyle,pAlign);
154 }
155
156 //don't known top and bottom indent now.
157 pPiece = dynamic_cast<LwpVirtualPiece*>(m_IndentStyle.obj().get());
158 if( pPiece )
159 {
160 LwpIndentOverride *pIndent = dynamic_cast<LwpIndentOverride*>(pPiece->GetOverride());
161 if( pIndent )
162 {
163 if (!m_BulletOverride.IsInValid())// for remove bullet indent in named bullet style
164 {
165 std::unique_ptr<LwpIndentOverride> pNewIndent(pIndent->clone());
166 pNewIndent->SetMFirst(0);
167 pNewIndent->SetMRest(0);
168 ApplyIndent(nullptr, pParaStyle, pNewIndent.get());
169 }
170 else
171 ApplyIndent(nullptr,pParaStyle,pIndent);
172 }
173 }
174 //shadow & borders.
175 pPiece = dynamic_cast<LwpVirtualPiece*>(m_BorderStyle.obj().get());
176 if( pPiece )
177 {
178 LwpParaBorderOverride *pBorder = dynamic_cast<LwpParaBorderOverride*>(pPiece->GetOverride());
179 if( pBorder )
180 {
181 ApplyParaBorder(pParaStyle, pBorder);
182 }
183 }
184
185 pPiece = dynamic_cast<LwpVirtualPiece*>(m_SpacingStyle.obj().get());
186 if (pPiece)
187 {
188 LwpSpacingOverride *pSpacing = dynamic_cast<LwpSpacingOverride*>(pPiece->GetOverride());
189 if( pSpacing)
190 ApplySpacing(nullptr,pParaStyle,pSpacing);
191 }
192
193 //paragraph background.
194 pPiece = dynamic_cast<LwpVirtualPiece*>(m_BackgroundStyle.obj().get());
195 if( pPiece )
196 {
197 LwpBackgroundOverride *pBack = dynamic_cast<LwpBackgroundOverride*>(pPiece->GetOverride());
198 if( pBack )
199 {
200 LwpColor color = pBack->GetBackColor();
201 XFColor aXFColor( color.To24Color() );
202 pParaStyle->SetBackColor( aXFColor );
203 }
204 }
205
206 //add tab style
207 pPiece = dynamic_cast<LwpVirtualPiece*>(m_TabStyle.obj().get());
208 if( pPiece )
209 {
210 LwpTabOverride *pTab = dynamic_cast<LwpTabOverride*>(pPiece->GetOverride());
211 if(pTab)
212 {
213 ApplyTab(pParaStyle,pTab);
214 }
215 }
216 pPiece = dynamic_cast<LwpVirtualPiece*>(m_BreaksStyle.obj().get());
217 if( pPiece )
218 {
219 LwpBreaksOverride *pBreak = dynamic_cast<LwpBreaksOverride*>(pPiece->GetOverride());
220 if(pBreak)
221 {
222 ApplyBreaks(pParaStyle,pBreak);
223 }
224 }
225
226}
227
229{
230 enumXFBorder eXFBorderSide = enumXFBorderNone;
231 switch (eType)
232 {
234 eXFBorderSide = enumXFBorderLeft;
235 break;
237 eXFBorderSide = enumXFBorderRight;
238 break;
240 eXFBorderSide = enumXFBorderTop;
241 break;
243 eXFBorderSide = enumXFBorderBottom;
244 break;
245 default:
246 break;
247 }
248
249 LwpColor aColor = pBorderStuff->GetSideColor(eType);
250 float fWidth = pBorderStuff->GetSideWidth(eType);
251 sal_uInt16 nType = pBorderStuff->GetSideType(eType);
252
253 switch (nType)
254 {
255 default://fall through!
256 case 0x14: //single fall through!
257 case 0x17: //treble
258 pXFBorders->SetWidth(eXFBorderSide, fWidth);
259 break;
260 case 0x15: //double , fall through!
261 case 0x16: //thick double
262 pXFBorders->SetDoubleLine(eXFBorderSide);
263 pXFBorders->SetWidthOuter(eXFBorderSide, static_cast<float>(fWidth*0.333));
264 pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.334));
265 pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.333));
266// pXFBorders->SetWidth(eXFBorderSide, fWidth);
267 break;
268 case 0x18: //thick-thin
269 pXFBorders->SetDoubleLine(eXFBorderSide);
270 pXFBorders->SetWidthOuter(eXFBorderSide, static_cast<float>(fWidth*0.5));
271 pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.25));
272 pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.25));
273 break;
274 case 0x19: //thin-thick
275 pXFBorders->SetDoubleLine(eXFBorderSide);
276 pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.7));
277 pXFBorders->SetWidthOuter(eXFBorderSide, static_cast<float>(fWidth*0.15));
278 pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.15));
279 break;
280 }
281
282 if (aColor.IsValidColor())
283 {
284 XFColor aXFColor(aColor.To24Color());
285 pXFBorders->SetColor(eXFBorderSide, aXFColor );
286 }
287}
288
290{
291 //convert LwpShadow:
292 LwpShadow *pShadow = pBorder->GetShadow();
293 if( pShadow )
294 {
295 LwpColor color = pShadow->GetColor();
296 float offsetX = pShadow->GetOffsetX();
297 float offsetY = pShadow->GetOffsetY();
298
299 if( offsetX && offsetY && color.IsValidColor() )
300 {
301 XFColor aXFColor(color.To24Color());
302 bool left = false;
303 bool top = false;
304 if( offsetX < 0 )
305 left = true;
306 if( offsetY < 0 )
307 top = true;
308 if( left )
309 {
310 if( top )
311 pParaStyle->SetShadow(enumXFShadowLeftTop,-offsetX,aXFColor);
312 else
313 pParaStyle->SetShadow(enumXFShadowLeftBottom,-offsetX,aXFColor);
314 }
315 else
316 {
317 if( top )
318 pParaStyle->SetShadow(enumXFShadowRightTop,offsetX,aXFColor);
319 else
320 pParaStyle->SetShadow(enumXFShadowRightBottom,offsetX,aXFColor);
321 }
322 }
323 }
324
325 //convert to XFBorders object:
326 LwpBorderStuff *pBorderStuff = pBorder->GetBorderStuff();
327 if( !(pBorderStuff && pBorderStuff->GetSide() != 0) )
328 return;
329
330 XFBorders *pXFBorders = new XFBorders();
331 pParaStyle->SetBorders(pXFBorders);
332
333 LwpMargins* pMargins = pBorder->GetMargins();
334
335 // apply 4 borders respectively
338 float pMarginValue[4] = { 0.0, 0.0, 0.0, 0.0 };
339
340 for (sal_uInt8 nC = 0; nC < 4; nC++)
341 {
342 if (pBorderStuff->HasSide(pType[nC]))
343 {
344 ApplySubBorder(pBorderStuff, pType[nC], pXFBorders);
345
346 //get border spacing to text content
347 if (pMargins)
348 {
349 pMarginValue[nC] = static_cast<float>(pMargins->GetMarginsValue(nC));
350 }
351 }
352
353 }
354
355 //apply border spacing to text content
356 pParaStyle->SetPadding(pMarginValue[0], pMarginValue[1], pMarginValue[2], pMarginValue[3]);
357}
358
360{
361 if (pBreaks->IsKeepWithNext())
362 {
364 }
365 if (pBreaks->IsPageBreakBefore())
366 {
367 pParaStyle->SetBreaks(enumXFBreakBefPage);
368 }
369 if (pBreaks->IsPageBreakAfter())
370 {
371 pParaStyle->SetBreaks(enumXFBreakAftPage);
372 }
373 if (pBreaks->IsColumnBreakBefore())
374 {
375 pParaStyle->SetBreaks(enumXFBreakBefColumn);
376 }
377 if (pBreaks->IsColumnBreakAfter())
378 {
379 pParaStyle->SetBreaks(enumXFBreakAftColumn);
380 }
381}
382
384{
386 auto type = pAlign->GetAlignType();
387
388 pParaStyle->SetNumberRight(false);//to identify its align attribute
389 switch(type)
390 {
392 alignType = enumXFAlignStart;
393 break;
395 alignType = enumXFAlignEnd;
396 break;
398 alignType = enumXFAlignCenter;
399 break;
400 case LwpAlignmentOverride::ALIGN_NUMERICLEFT://if non-number in table,ALIGN_NUMERICLEFT/RIGHT are useless
401 alignType = enumXFAlignStart; //note by 1/28
402 break;
405 alignType = enumXFAlignJustify;
406 break;
408 pParaStyle->SetNumberRight(true);//to identify its align attribute
409 alignType = enumXFAlignEnd;
410 break;
411 default:
412 break;
413 }
414 pParaStyle->SetAlignType(alignType);
415}
416
417void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, const LwpIndentOverride* pIndent)
418{
419 LwpPara* pParentPara;
420 if (pPara)
421 pParentPara = pPara->GetParent();
422 else
423 pParentPara = nullptr;
424
425 std::unique_ptr<LwpIndentOverride> pTotalIndent(new LwpIndentOverride);
426 if (pIndent->IsUseRelative() && pParentPara)
427 {
428 LwpIndentOverride* pParentIndent = pParentPara->GetIndent();
429 if (!pParentIndent)
430 return;
431 pTotalIndent.reset(pIndent->clone());
432
433 //for bullet only
434 if (pPara && pPara->GetBulletFlag())
435 {
436 pTotalIndent->SetMAll(o3tl::saturating_add(pParentIndent->GetMAll(), pTotalIndent->GetMAll()));
437 pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight()));
439 pTotalIndent->GetMAll())), pTotalIndent->GetRight());
440 pPara->SetIndent(pTotalIndent.release());
441 return;
442 }
443 sal_uInt16 relative = pParentIndent->GetRelative();
444
445 sal_Int32 Amount = pParentIndent->GetMAll();
446
447 if (relative == LwpIndentOverride::RELATIVE_FIRST)
448 Amount = o3tl::saturating_add(Amount, pParentIndent->GetMFirst());
449 else if (relative == LwpIndentOverride::RELATIVE_REST)
450 Amount = o3tl::saturating_add(Amount, pParentIndent->GetMRest());
451 pTotalIndent->SetMAll(o3tl::saturating_add(Amount, pTotalIndent->GetMAll()));
452 pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight()));
453
454 pParaStyle->SetIndent(pTotalIndent->GetFirst());
455 pParaStyle->SetMargins(pTotalIndent->GetLeft(), pTotalIndent->GetRight());
456 pPara->SetIndent(pTotalIndent.release());
457
458 }
459 else
460 {
461 pTotalIndent.reset(pIndent->clone());
462 if (pPara && pPara->GetBulletFlag())
463 {
465 LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight());
466 pPara->SetIndent(pTotalIndent.release());
467 return;
468 }
469
470 pParaStyle->SetIndent(pIndent->GetFirst());
471 pParaStyle->SetMargins(pIndent->GetLeft(), pIndent->GetRight());
472 if (pPara)
473 {
474 pPara->SetIndent(pTotalIndent.release());
475 }
476 }
477}
478
480{
481 LwpSpacingCommonOverride* spacing = pSpacing->GetSpacing();
482 LwpSpacingCommonOverride* abovepara = pSpacing->GetAboveSpacing();
483 LwpSpacingCommonOverride* belowpara = pSpacing->GetBelowSpacing();
484
486 sal_Int32 amount = spacing->GetAmount();
487 sal_Int32 multiple = spacing->GetMultiple();
488 enumLHType xftype;
489 double height;
490
491 switch(type)
492 {
494 {
495 xftype = enumLHPercent;
496 height = double(multiple)/65536L*100;
497 pParaStyle->SetLineHeight(xftype,height);
498 }
499 break;
501 {
502 xftype = enumLHSpace;
504 pParaStyle->SetLineHeight(xftype,height);
505 }
506 break;
508 {
509 xftype = enumLHHeight;
510 height = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
511 pParaStyle->SetLineHeight(xftype,height);
512 }
513 break;
515 break;
516 }
517
518//TO DO: Above Line need to be processed!!!!!!! what it means?????? 1-26
519
520 type = abovepara->GetType();
521 amount = abovepara->GetAmount();
522 multiple = abovepara->GetMultiple();
523 double above_val =-1;
524 switch(type)
525 {
527 break;
529 break;
531 above_val = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
532 break;
534 break;
535 }
536
537 type = belowpara->GetType();
538 amount = belowpara->GetAmount();
539 multiple = belowpara->GetMultiple();
540 double below_val=-1;
541 switch(type)
542 {
544 break;
546 break;
548 below_val = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
549 break;
551 break;
552 }
553
554 if (pPara)
555 {
556 if (below_val != -1)
557 pPara->SetBelowSpacing(below_val);
558 LwpPara* pPrePara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get());
559 if (pPrePara && above_val != -1)
560 {
561 above_val += pPrePara->GetBelowSpacing();
562
563 }
564
565 }
566 pParaStyle->SetMargins(-1,-1,above_val,below_val);
567}
568
569void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTabOverRide)
570{
571 LwpObjectID& rTabRackID = pTabOverRide->GetTabRackID();
572 if(rTabRackID.IsNull())
573 {
574 return;
575 }
576
577 LwpTabRack* pTabRack = dynamic_cast<LwpTabRack*>(rTabRackID.obj().get());
578 if(!pTabRack)
579 {
580 return;
581 }
582
583 pParaStyle->ClearTabStyles();
584 //Get margin left value
585 double dMarginLeft = pParaStyle->GetMargins().GetLeft();
586
587 sal_uInt16 nNumTabs = pTabRack->GetNumTabs();
588 for(sal_uInt16 nIndex=0; nIndex<nNumTabs; nIndex++)
589 {
590 //get tab type
591 LwpTab* pTab = pTabRack->Lookup(nIndex);
592 if(!pTab)
593 return;
594
596 sal_uInt32 type = pTab->GetTabType();
597 switch(type)
598 {
599 case LwpTab::TT_LEFT:
601 break;
604 break;
605 case LwpTab::TT_RIGHT:
607 break;
610 break;
611 }
612
613 //get position
614 sal_uInt32 nPos = pTab->GetPosition();
615 //different feature between SODC and lwp, the tab length must minus the margin left of para.
616 double fLen = LwpTools::ConvertFromUnitsToMetric(nPos) - dMarginLeft;
617
618 //get leader type
619 sal_Unicode cLeader = 0x00;
620 auto leader= pTab->GetLeaderType();
621 switch(leader)
622 {
623 case LwpTab::TL_NONE:
624 cLeader = 0x20; //space
625 break;
626 case LwpTab::TL_HYPHEN: //'-'
627 cLeader = 0xAD;
628 break;
629 case LwpTab::TL_DOT: //'.'
630 cLeader = 0x2E;
631 break;
632 case LwpTab::TL_LINE: //'_'
633 cLeader = 0x5F;
634 break;
635 }
636
637 sal_Unicode cAlignChar = static_cast<sal_Unicode>(pTab->GetAlignChar());
638
639 pParaStyle->AddTabStyle(eType,fLen,cLeader,cAlignChar);
640 }
641
642}
643
645{
646 if (!m_pFoundry)
647 throw std::runtime_error("missing Foundry");
648
649 std::unique_ptr<XFParaStyle> xStyle(new XFParaStyle());
650
651 //Set name
652 OUString styleName = GetName().str();
653 xStyle->SetStyleName(styleName);
654
655 //Create font
658 xStyle->SetFont(pFont);
659
660 //Set other paragraph properties...
661
662 Apply(xStyle.get());
663 //Add style
665 pStyleMgr->AddStyle(GetObjectID(), std::move(xStyle));
666}
667
669{
670 if (m_AlignmentStyle.obj() == nullptr)
671 return nullptr;
672
673 LwpAlignmentPiece *pPiece = dynamic_cast<LwpAlignmentPiece*>(m_AlignmentStyle.obj().get());
674 if (pPiece)
675 return dynamic_cast<LwpAlignmentOverride*>(pPiece->GetOverride());
676 return nullptr;
677}
678
680{
681 if (m_IndentStyle.obj() == nullptr)
682 return nullptr;
683
684 LwpIndentPiece *pPiece = dynamic_cast<LwpIndentPiece*>(m_IndentStyle.obj().get());
685 if (pPiece)
686 return dynamic_cast<LwpIndentOverride*>(pPiece->GetOverride());
687 return nullptr;
688}
689
691{
692 if (m_SpacingStyle.obj() == nullptr)
693 return nullptr;
694
695 LwpSpacingPiece *pPiece = dynamic_cast<LwpSpacingPiece*>(m_SpacingStyle.obj().get());
696 if (pPiece)
697 return dynamic_cast<LwpSpacingOverride*>(pPiece->GetOverride());
698 return nullptr;
699}
700
702{
704 return nullptr;
705
707 if (pPiece)
708 return dynamic_cast<LwpParaBorderOverride*>(pPiece->GetOverride());
709 return nullptr;
710}
711
713{
715 return nullptr;
716
717 LwpBreaksPiece *pPiece = dynamic_cast<LwpBreaksPiece*>(m_BreaksStyle.obj(VO_BREAKSPIECE).get());
718 if (pPiece)
719 return dynamic_cast<LwpBreaksOverride*>(pPiece->GetOverride());
720 return nullptr;
721}
722
723
725{
727 return nullptr;
728
730 if (pPiece)
731 return dynamic_cast<LwpNumberingOverride*>(pPiece->GetOverride());
732 return nullptr;
733}
734
736{
737 if(m_TabStyle.obj() == nullptr)
738 return nullptr;
739 LwpTabPiece *pPiece = dynamic_cast<LwpTabPiece*>(m_TabStyle.obj().get());
740 if (pPiece)
741 return dynamic_cast<LwpTabOverride*>(pPiece->GetOverride());
742 return nullptr;
743}
744
745/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void Read(LwpObjectStream *pStrm) override
AlignType GetAlignType() const
const OUString & str() const
const LwpColor & GetBackColor() const
sal_uInt16 GetSide() const
float GetSideWidth(sal_uInt16 side)
sal_uInt16 GetSideType(sal_uInt16 side)
LwpColor GetSideColor(sal_uInt16 side)
bool HasSide(sal_uInt16 side)
bool IsPageBreakAfter() const
bool IsKeepWithNext() const
bool IsColumnBreakBefore() const
bool IsColumnBreakAfter() const
bool IsPageBreakBefore() const
virtual void Read(LwpObjectStream *pStrm) override
bool IsInValid() const
void Read(LwpObjectStream *pStrm) override
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
LwpAtomHolder & GetName()
Definition: lwpdlvlist.hxx:108
LwpObjectID & GetPrevious()
Definition: lwpdlvlist.hxx:76
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
rtl::Reference< XFFont > CreateFont(sal_uInt32 fontID)
Definition: lwpfont.cxx:471
LwpFontManager & GetFontManager()
Definition: lwpfoundry.hxx:250
LwpStyleManager * GetStyleManager()
Definition: lwpfoundry.hxx:262
double GetFirst() const
void SetMAll(sal_Int32 val)
sal_Int32 GetMFirst() const
virtual LwpIndentOverride * clone() const override
sal_Int32 GetMAll() const
bool IsUseRelative() const
sal_Int32 GetMRight() const
double GetLeft() const
double GetRight() const
sal_uInt16 GetRelative() const
void Read(LwpObjectStream *pStrm) override
sal_Int32 GetMRest() const
void Read(LwpObjectStream *pStrm) override
double GetMarginsValue(sal_uInt8 nWhichSide)
Definition: lwpmargins.hxx:89
virtual void Read(LwpObjectStream *pStrm) override
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
bool IsNull() const
Definition: lwpobjid.hxx:110
LwpFoundry * m_pFoundry
Definition: lwpobj.hxx:91
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
LwpObjectID & GetObjectID()
Definition: lwpobj.hxx:138
virtual void Read(LwpObjectStream *pStrm) override
LwpBorderStuff * GetBorderStuff()
static void ApplyBreaks(XFParaStyle *pParaStyle, const LwpBreaksOverride *pBreaks)
LwpIndentOverride * GetIndent()
LwpSpacingOverride * GetSpacing()
LwpParaBorderOverride * GetParaBorder() const
static void ApplySubBorder(LwpBorderStuff *pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders *pXFBorders)
LwpObjectID m_SpacingStyle
static void ApplyParaBorder(XFParaStyle *pParaStyle, LwpParaBorderOverride *pBorder)
LwpBulletOverride m_BulletOverride
LwpObjectID m_BorderStyle
LwpKinsokuOptsOverride m_KinsokuOptsOverride
LwpNumberingOverride * GetNumberingOverride() const
static void ApplyAlignment(XFParaStyle *pParaStyle, const LwpAlignmentOverride *pAlign)
LwpObjectID m_AlignmentStyle
LwpTabOverride * GetTabOverride() const
LwpObjectID m_IndentStyle
static void ApplySpacing(LwpPara *pPara, XFParaStyle *pParaStyle, LwpSpacingOverride *pSpacing)
LwpObjectID m_NumberingStyle
LwpBreaksOverride * GetBreaks() const
void RegisterStyle() override
@descr default register style function
LwpObjectID m_TabStyle
LwpObjectID m_BreaksStyle
LwpParaStyle(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read() override
@descr default read function
static void ApplyIndent(LwpPara *pPara, XFParaStyle *pParaStyle, const LwpIndentOverride *pIndent)
LwpAlignmentOverride * GetAlignment()
virtual ~LwpParaStyle() override
LwpObjectID m_BackgroundStyle
void Apply(XFParaStyle *pStrm)
static void ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTab)
void SetIndent(LwpIndentOverride *pIndentOverride)
Definition: lwppara.hxx:329
void SetBelowSpacing(double value)
Definition: lwppara.hxx:355
double GetBelowSpacing() const
Definition: lwppara.hxx:351
bool GetBulletFlag() const
Definition: lwppara.hxx:299
LwpPara * GetParent()
get parent paragraph
Definition: lwppara1.cxx:134
LwpIndentOverride * GetIndent()
Definition: lwppara.hxx:325
double GetOffsetY()
Definition: lwpshadow.hxx:97
double GetOffsetX()
Definition: lwpshadow.hxx:91
const LwpColor & GetColor() const
Definition: lwpshadow.hxx:102
SpacingType GetType() const
sal_Int32 GetMultiple() const
sal_Int32 GetAmount() const
void Read(LwpObjectStream *pStrm) override
LwpSpacingCommonOverride * GetSpacing()
LwpSpacingCommonOverride * GetAboveSpacing()
LwpSpacingCommonOverride * GetBelowSpacing()
void AddStyle(LwpObjectID styleObjID, std::unique_ptr< IXFStyle > pStyle)
Definition: lwpfoundry.cxx:507
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
LwpObjectID & GetTabRackID()
virtual void Read(LwpObjectStream *pStrm) override
sal_uInt16 GetNumTabs()
Definition: lwptabrack.cxx:124
LwpTab * Lookup(sal_uInt16 nIndex)
Definition: lwptabrack.cxx:104
sal_uInt8 GetLeaderType() const
Definition: lwptabrack.hxx:103
sal_uInt32 GetPosition() const
Definition: lwptabrack.hxx:119
sal_uInt8 GetTabType() const
Definition: lwptabrack.hxx:99
@ TL_HYPHEN
Definition: lwptabrack.hxx:85
@ TT_RIGHT
Definition: lwptabrack.hxx:78
@ TT_CENTER
Definition: lwptabrack.hxx:77
@ TT_NUMERIC
Definition: lwptabrack.hxx:79
sal_uInt16 GetAlignChar() const
Definition: lwptabrack.hxx:107
void Read() override
@descr default read function
sal_uInt32 m_nFinalFontID
static double ConvertToMetric(double fInch)
Definition: lwptools.hxx:113
static double ConvertFromUnitsToMetric(sal_Int32 nUnits)
Definition: lwptools.hxx:117
static double ConvertFromUnits(sal_Int32 nUnits)
Definition: lwptools.hxx:109
LwpOverride * GetOverride()
Definition: lwppiece.hxx:90
Borders for object with borders.
Definition: xfborders.hxx:134
void SetWidthSpace(enumXFBorder side, double space)
@descr Set space between two borders of border side.
Definition: xfborders.cxx:271
void SetColor(enumXFBorder side, XFColor const &color)
@descr Set color of border side.
Definition: xfborders.cxx:187
void SetWidthOuter(enumXFBorder side, double outer)
@descr Set outer border width of border side.
Definition: xfborders.cxx:292
void SetDoubleLine(enumXFBorder side)
@descr Set border side as double line.
Definition: xfborders.cxx:229
void SetWidth(enumXFBorder side, double width)
@descr Set width or border side.
Definition: xfborders.cxx:208
void SetWidthInner(enumXFBorder side, double inner)
@descr Set inner border with of border side.
Definition: xfborders.cxx:250
Color object.
Definition: xfcolor.hxx:70
double GetLeft() const
Definition: xfmargins.hxx:120
Style object for aragraph.
Definition: xfparastyle.hxx:93
void SetPadding(double left, double right, double top, double bottom)
@descr Set the padding of the paragraph.
XFMargins & GetMargins()
void SetIndent(double indent)
@descr Set the indent of the paragraph.
void SetBreaks(enumXFBreaks breaks)
descr You can only set one break property for every para style object.
void SetMargins(double left, double right, double top=-1, double bottom=-1)
@descr Set the Margins of the paragraph.
void SetLineHeight(enumLHType type, double value)
@descr Set line height of the paragraph.
void SetShadow(enumXFShadowPos pos, double offset, XFColor const &color)
@descr Set the shadow of the paragraph.
void AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter)
@descr Add a tab style.
void SetNumberRight(bool bFlag)
void ClearTabStyles()
@descr for para style copy operator, sometimes you may need to override tab styles.
void SetBorders(XFBorders *pBorders)
@descr The borders is complex, so you have to create one before use.
void SetAlignType(enumXFAlignType eAlign)
@descr Set alignment property of the paragraph.
void SetBackColor(XFColor const &color)
@descr Set background color of the paragraph.
OString top
DocumentType eType
sal_Int32 nIndex
sal_uInt16 nPos
@ VO_BREAKSPIECE
Definition: lwpdefs.hxx:113
@ VO_PARABORDERPIECE
Definition: lwpdefs.hxx:112
@ VO_NUMBERINGPIECE
Definition: lwpdefs.hxx:114
constexpr T saturating_add(T a, T b)
QPRO_FUNC_TYPE nType
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
ResultType type
sal_uInt64 left
@ enumXFShadowLeftTop
Definition: xfdefs.hxx:190
@ enumXFShadowLeftBottom
Definition: xfdefs.hxx:189
@ enumXFShadowRightTop
Definition: xfdefs.hxx:188
@ enumXFShadowRightBottom
Definition: xfdefs.hxx:187
@ enumXFBreakBefPage
Definition: xfdefs.hxx:222
@ enumXFBreakAftColumn
Definition: xfdefs.hxx:225
@ enumXFBreakKeepWithNext
Definition: xfdefs.hxx:226
@ enumXFBreakBefColumn
Definition: xfdefs.hxx:223
@ enumXFBreakAftPage
Definition: xfdefs.hxx:224
enumLHType
Definition: xfdefs.hxx:211
@ enumLHHeight
Definition: xfdefs.hxx:213
@ enumLHSpace
Definition: xfdefs.hxx:216
@ enumLHPercent
Definition: xfdefs.hxx:215
enumXFAlignType
Definition: xfdefs.hxx:172
@ enumXFAlignJustify
Definition: xfdefs.hxx:177
@ enumXFAlignStart
Definition: xfdefs.hxx:174
@ enumXFAlignEnd
Definition: xfdefs.hxx:176
@ enumXFAlignCenter
Definition: xfdefs.hxx:175
enumXFBorder
Definition: xfdefs.hxx:194
@ enumXFBorderLeft
Definition: xfdefs.hxx:196
@ enumXFBorderRight
Definition: xfdefs.hxx:197
@ enumXFBorderBottom
Definition: xfdefs.hxx:199
@ enumXFBorderNone
Definition: xfdefs.hxx:195
@ enumXFBorderTop
Definition: xfdefs.hxx:198
enumXFTab
Definition: xfdefs.hxx:230
@ enumXFTabChar
Definition: xfdefs.hxx:235
@ enumXFTabNone
Definition: xfdefs.hxx:231
@ enumXFTabRight
Definition: xfdefs.hxx:234
@ enumXFTabCenter
Definition: xfdefs.hxx:233
@ enumXFTabLeft
Definition: xfdefs.hxx:232