LibreOffice Module lotuswordpro (master) 1
lwplayout.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#include "lwplayout.hxx"
63#include "lwpusewhen.hxx"
64#include <lwptools.hxx>
65#include "lwplaypiece.hxx"
66#include <xfilter/xfcolumns.hxx>
67#include "lwpstory.hxx"
68#include "lwpparastyle.hxx"
69#include "lwpholder.hxx"
70#include "lwpdoc.hxx"
71#include "lwpgrfobj.hxx"
72#include <lwpfilehdr.hxx>
73#include <osl/thread.h>
74#include <sal/log.hxx>
76
78 : LwpDLNFPVList(objHdr, pStrm)
79 , m_bGettingHonorProtection(false)
80 , m_bGettingMarginsSameAsParent(false)
81 , m_bGettingHasProtection(false)
82 , m_bGettingIsProtected(false)
83 , m_bGettingIsAutoGrowDown(false)
84 , m_bGettingMarginsValue(false)
85 , m_bGettingExtMarginsValue(false)
86 , m_bGettingUsePrinterSettings(false)
87 , m_bGettingScaleCenter(false)
88 , m_bGettingBorderStuff(false)
89 , m_bGettingUseWhen(false)
90 , m_bGettingStyleLayout(false)
91 , m_bGettingAutoGrowUp(false)
92 , m_nAttributes(0)
93 , m_nAttributes2(0)
94 , m_nAttributes3(0)
95 , m_nOverrideFlag(0)
96 , m_nDirection(0)
97 , m_nEditorID(0)
98{
99}
100
102{
104
105 LwpObjectStream* pStrm = m_pObjStrm.get();
110 m_nDirection = pStrm->QuickReaduInt16();
111
112 //Note that two bytes is read into m_nEditorID instead of one byte.
113 m_nEditorID = pStrm->QuickReaduInt16();
114
117
118 pStrm->SkipExtra();
119}
120
122{
124}
125
130double LwpVirtualLayout::GetColGap(sal_uInt16 /*nIndex*/)
131{
132 //return DEFAULTGAPSIZE;
133 //return LwpTools::ConvertToMetric(0.17);//DEFAULTGAPSIZE=0.17
134 return LwpTools::ConvertToMetric(0.17);
135}
136
142{
144 return false;
145
147 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
148 if (xParent.is() && !xParent->IsHeader())
149 {
150 return xParent->GetHonorProtection();
151 }
152
153 if (m_pFoundry) //is null now
154 {
156 if (pDoc && pDoc->GetRootDocument())
157 return pDoc->GetRootDocument()->GetHonorProtection();
158 }
159
160 return true;
161}
162
168{
169 bool bProtected = (m_nAttributes & STYLE_PROTECTED) != 0;
170
172 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
173 if (xParent.is() && !xParent->IsHeader())
174 {
175 if (xParent->GetHonorProtection() && (xParent->GetHasProtection() || bProtected))
176 {
177 return true;
178 }
179 }
180 else if (m_pFoundry) //is null now
181 {
183 if (pDoc)
184 {
185 if (pDoc->GetHonorProtection() && bProtected)
186 {
187 return true;
188 }
189 }
190 }
191
192 return false;
193}
194
200{
202 return true;
203
205 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
206 if (xParent.is() && !xParent->IsHeader())
207 {
208 return xParent->GetHasProtection();
209 }
210
211 return false;
212}
213
219
225{
227 throw std::runtime_error("recursion in layout");
228 m_bGettingUseWhen = true;
229
230 LwpUseWhen* pRet = nullptr;
231
232 /*
233 If we have a parent, and I'm not a page layout,
234 use my parents information.
235 */
237 {
238 //get parent
240 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
241 if (xParent.is() && !xParent->IsHeader() && (xParent->GetLayoutType() != LWP_PAGE_LAYOUT))
242 pRet = xParent->GetUseWhen();
243 }
244
245 if (!pRet)
246 pRet = VirtualGetUseWhen();
247
248 m_bGettingUseWhen = false;
249
250 return pRet;
251}
268
273{
276}
289{
291}
296{
298
304}
309{
310 return ((m_nAttributes3 & STYLE3_MINHEIGHTVALID) != 0);
311}
312
318{
320 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
321}
322
328{
329 //Register all children styles
331 dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
332 while (xLayout.is())
333 {
334 xLayout->SetFoundry(m_pFoundry);
335 xLayout->DoRegisterStyle();
336 xLayout.set(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
337 }
338}
339
341{
343}
344
346{
348 throw std::runtime_error("recursion in layout");
350
351 bool bRet = false;
353 bRet = true;
354 else
355 {
357 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
358 if (xParent.is())
359 bRet = xParent->IsStyleLayout();
360 }
361
362 m_bGettingStyleLayout = false;
363 return bRet;
364}
365
371{
372 LwpObjectID* pID = &GetChildHead();
374
375 while (pID && !pID->IsNull())
376 {
377 LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(pID->obj().get());
378 if (!pLayout)
379 break;
380
381 bool bAlreadySeen = !aSeen.insert(pLayout).second;
382 if (bAlreadySeen)
383 {
384 SAL_WARN("lwp", "loop in layout");
385 break;
386 }
387
388 if (pLayout->GetLayoutType() == eType)
389 return pLayout;
390
391 pID = &pLayout->GetNext();
392 }
393
394 return nullptr;
395}
396
402{
404}
405
411
417{
419}
420
422{
424 m_Layouts.Read(pStrm);
425 pStrm->SkipExtra();
426}
427
434{
435 if (!pStartLayout && !m_OnlyLayout.IsNull())
436 /* Looking for the first layout and there's only one layout in the list.*/
438 dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get()));
439
441 dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead().obj().get()));
442 if (xObjHolder.is())
443 {
445 dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get()));
446 if (!pStartLayout)
447 return xLayout;
448
449 while (xObjHolder.is() && pStartLayout != xLayout.get())
450 {
451 xObjHolder.set(dynamic_cast<LwpObjectHolder*>(xObjHolder->GetNext().obj().get()));
452 if (xObjHolder.is())
453 {
454 xLayout.set(dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get()));
455 }
456 }
457
458 if (xObjHolder.is())
459 {
460 xObjHolder.set(dynamic_cast<LwpObjectHolder*>(xObjHolder->GetNext().obj().get()));
461 if (xObjHolder.is())
462 {
463 xLayout.set(dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get()));
464 return xLayout;
465 }
466 }
467 }
468
470}
471
473 : LwpVirtualLayout(objHdr, pStrm)
474{
475}
476
478{
480 //For PermissiveLayout
481 m_pObjStrm->SkipExtra();
482 //For me
483 m_pObjStrm->SkipExtra();
484}
485
487{
488 //Register all children styles
490 dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
492 while (xLayout.is())
493 {
494 bool bAlreadySeen = !aSeen.insert(xLayout.get()).second;
495 if (bAlreadySeen)
496 throw std::runtime_error("loop in conversion");
497 xLayout->SetFoundry(m_pFoundry);
498 //if the layout is relative to para, the layout will be registered in para
499 if (!xLayout->IsRelativeAnchored())
500 xLayout->DoRegisterStyle();
502 dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
503 xLayout = xNext;
504 }
505}
506
512{
514 dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
516 while (xLayout)
517 {
518 bool bAlreadySeen = !aSeen.insert(xLayout.get()).second;
519 if (bAlreadySeen)
520 throw std::runtime_error("loop in conversion");
521 if (xLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT)
522 {
523 return xLayout;
524 }
525 xLayout.set(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
526 }
528}
529
531 : m_nStyleDefinition(0)
532 , m_nKey(0)
533{
534}
535
537
539{
541 m_aDescription.Read(pStrm);
542 if (pStrm->CheckExtra())
543 {
544 m_nKey = pStrm->QuickReaduInt16();
545 pStrm->SkipExtra();
546 }
547}
548
550 : m_nGridDistance(0)
551 , m_nGridType(0)
552{
553}
554
556
558{
559 m_nGridType = pStrm->QuickReaduInt16();
561 m_aContentStyle.Read(pStrm);
562 pStrm->SkipExtra();
563}
564
566 : LwpVirtualLayout(objHdr, pStrm)
567 , m_bGettingGeometry(false)
568 , m_bGettingBackgroundStuff(false)
569{
570}
571
573
575{
576 LwpObjectStream* pStrm = m_pObjStrm.get();
577
579
580 //skip CLiteLayout data;
581 LwpAtomHolder ContentClass;
582 ContentClass.Read(pStrm);
583 pStrm->SkipExtra();
584
585 // before layout hierarchy rework
587 return;
588
589 m_Content.ReadIndexed(pStrm);
590
591 // 01/20/2005
593 m_TabPiece.ReadIndexed(pStrm);
594
595 sal_uInt8 nWhatsItGot = pStrm->QuickReaduInt8();
596
597 if (nWhatsItGot & DISK_GOT_STYLE_STUFF)
598 {
599 m_aStyleStuff.Read(pStrm);
600 }
601 if (nWhatsItGot & DISK_GOT_MISC_STUFF)
602 {
603 m_aMiscStuff.Read(pStrm);
604 }
605
607 m_LayScale.ReadIndexed(pStrm);
611
612 if (pStrm->CheckExtra())
613 {
615 pStrm->SkipExtra();
616 }
617}
618
620{
622 if (xRet.get() == this)
623 {
624 SAL_WARN("lwp", "style based on itself");
626 }
627 return xRet;
628}
629
635{
637 throw std::runtime_error("recursion in layout");
638 m_bGettingGeometry = true;
639
640 LwpLayoutGeometry* pRet = nullptr;
641 if (!m_LayGeometry.IsNull())
642 {
643 pRet = dynamic_cast<LwpLayoutGeometry*>(m_LayGeometry.obj().get());
644 }
645 else
646 {
648 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
649 {
650 pRet = pLay->GetGeometry();
651 }
652 }
653
654 m_bGettingGeometry = false;
655 return pRet;
656}
657
663{
665 if (pGeo)
666 {
668 }
669 else
670 return -1;
671}
672
678{
680 if (pGeo)
681 {
683 }
684 else
685 return -1;
686}
687
693{
695 {
697 }
699 if (LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(xBase.get()))
700 {
701 pLay->GetMarginsSameAsParent();
702 }
704}
705
711{
712 double fValue = 0;
713 if ((nWhichSide == MARGIN_LEFT) || (nWhichSide == MARGIN_RIGHT))
714 {
716 {
718 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
719 if (xParent.is() && !xParent->IsHeader())
720 {
721 fValue = xParent->GetMarginsValue(nWhichSide);
722 return fValue;
723 }
724 }
725 }
726
728 {
729 LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*>(m_LayMargins.obj().get());
730 if (pMar1)
731 {
732 fValue = pMar1->GetMargins().GetMarginsValue(nWhichSide);
733 return fValue;
734 }
735 }
737 LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*>(xBase.get());
738 if (pStyle)
739 {
740 fValue = pStyle->GetMarginsValue(nWhichSide);
741 return fValue;
742 }
743 return LwpVirtualLayout::MarginsValue(nWhichSide);
744}
752{
753 double fValue = 0;
755 {
756 LwpLayoutMargins* pMar1 = dynamic_cast<LwpLayoutMargins*>(m_LayMargins.obj().get());
757 if (pMar1)
758 {
759 fValue = pMar1->GetExtMargins().GetMarginsValue(nWhichSide);
760 return fValue;
761 }
762 }
763 LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*>(GetBasedOnStyle().get());
764 if (pStyle)
765 {
766 fValue = pStyle->GetExtMarginsValue(nWhichSide);
767 return fValue;
768 }
769 return LwpVirtualLayout::ExtMarginsValue(nWhichSide);
770}
775{
777 throw std::runtime_error("recursion in layout");
779
780 LwpBorderStuff* pRet = nullptr;
781
783 {
784 LwpLayoutBorder* pLayoutBorder
785 = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj().get());
786 pRet = pLayoutBorder ? &pLayoutBorder->GetBorderStuff() : nullptr;
787 }
788 else
789 {
791 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
792 {
793 pRet = pLay->GetBorderStuff();
794 }
795 }
796
797 m_bGettingBorderStuff = false;
798 return pRet;
799}
800
805{
807 throw std::runtime_error("recursion in layout");
809
810 LwpBackgroundStuff* pRet = nullptr;
811
813 {
814 LwpLayoutBackground* pLayoutBackground
815 = dynamic_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj().get());
816 pRet = pLayoutBackground ? &pLayoutBackground->GetBackgoudStuff() : nullptr;
817 }
818 else
819 {
821 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
822 {
823 pRet = pLay->GetBackgroundStuff();
824 }
825 }
826
828 return pRet;
829}
830
834std::unique_ptr<XFBorders> LwpMiddleLayout::GetXFBorders()
835{
836 LwpBorderStuff* pBorderStuff = GetBorderStuff();
837 if (pBorderStuff && pBorderStuff->GetSide() != 0)
838 {
839 //copy from lwpparastyle.
840 std::unique_ptr<XFBorders> xXFBorders(new XFBorders);
841 // apply 4 borders respectively
844
845 for (LwpBorderStuff::BorderType nC : pType)
846 {
847 if (pBorderStuff->HasSide(nC))
848 {
849 LwpParaStyle::ApplySubBorder(pBorderStuff, nC, xXFBorders.get());
850 }
851 }
852 return xXFBorders;
853 }
854 return nullptr;
855}
856
861{
863 sal_uInt8 nDirection = GetContentOrientation();
864 switch (nDirection)
865 {
866 case TEXT_ORIENT_LRTB:
867 {
868 eTextDir = enumXFTextDirLR_TB;
869 break;
870 }
871 case TEXT_ORIENT_TBRL:
872 {
873 eTextDir = enumXFTextDirTB_RL;
874 break;
875 }
876 case TEXT_ORIENT_RLBT: // not supported now
877 {
878 eTextDir = enumXFTextDirNone;
879 break;
880 }
881 case TEXT_ORIENT_BTLR: // not supported now
882 {
883 eTextDir = enumXFTextDirNone;
884 break;
885 }
886 default:
887 break;
888 }
889 return eTextDir;
890}
895{
896 LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
897 if (pBackgroundStuff && !pBackgroundStuff->IsTransparent())
898 {
899 LwpColor* pColor = pBackgroundStuff->GetFillColor();
900 if (pColor->IsValidColor())
901 {
902 return pColor;
903 }
904 }
905 return nullptr;
906}
907
912{
914 {
915 if (!m_TabPiece.IsNull())
916 {
917 LwpTabPiece* pPiece = dynamic_cast<LwpTabPiece*>(m_TabPiece.obj().get());
918 return static_cast<LwpTabOverride*>(pPiece ? pPiece->GetOverride() : nullptr);
919 }
920 return nullptr;
921 }
922 else
923 {
925 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
926 {
927 return pLay->GetTabOverride();
928 }
929 }
930 return nullptr;
931}
932
937{
939 return GetLayoutScale()->GetScaleMode();
941 if (xBase.is())
942 return dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleMode();
943 else
945}
946
948{
950 return (GetLayoutScale()->GetPlacement() & LwpLayoutScale::TILED) ? 1 : 0;
952 if (xBase.is())
953 return dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleTile();
954 else
955 return 0;
956}
957
959{
961 throw std::runtime_error("recursion in layout");
963
964 sal_uInt16 nRet = 0;
965
967 {
969 }
970 else
971 {
973 if (xBase.is())
974 nRet = dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleCenter();
975 }
976
977 m_bGettingScaleCenter = false;
978 return nRet;
979}
980
982{
983 sal_uInt8 RelType = GetRelativeType();
984
985 return !(RelType == LwpLayoutRelativityGuts::LAY_INLINE
988}
990{
991 if (((m_nAttributes3 & STYLE3_WIDTHVALID) != 0) && GetGeometry())
992 {
993 return GetGeometry()->GetWidth();
994 }
995 else if (m_nOverrideFlag & OVER_SIZE)
996 {
997 return DetermineWidth();
998 }
999 return 0;
1000}
1002{
1004 {
1005 assert(false);
1006 }
1007 else if (IsSizeRightToContainer())
1008 {
1009 assert(false);
1010 }
1011 else if (LwpLayoutGeometry* pGeo = GetGeometry())
1012 {
1014 return pGeo->GetWidth();
1015 }
1016 return 0;
1017}
1019{
1020 if (!CanSizeRight())
1021 return false;
1022
1024 {
1027 }
1029 if (xBase.is())
1030 {
1031 LwpMiddleLayout* pLayout = dynamic_cast<LwpMiddleLayout*>(xBase.get());
1032 return pLayout && pLayout->IsSizeRightToContainer();
1033 }
1034 else
1035 return false;
1036}
1038{
1039 if (!CanSizeRight())
1040 return false;
1041
1043 {
1046 }
1048 if (xBase.is())
1049 {
1050 LwpMiddleLayout* pLayout = dynamic_cast<LwpMiddleLayout*>(xBase.get());
1051 return pLayout && pLayout->IsSizeRightToContent();
1052 }
1053 else
1054 return false;
1055}
1056
1062
1073{
1075 if (pGeo)
1076 {
1080 {
1081 return pGeo->GetAbsoluteOrigin();
1082 }
1083 else
1084 return pGeo->GetOrigin();
1085 }
1086
1087 return LwpPoint();
1088}
1089
1095{
1096 LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
1097 if (pBackgroundStuff)
1098 {
1099 return pBackgroundStuff->IsPatternFill();
1100 }
1101
1102 return false;
1103}
1104
1109std::unique_ptr<XFBGImage> LwpMiddleLayout::GetFillPattern()
1110{
1111 LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
1112 if (pBackgroundStuff)
1113 {
1114 return pBackgroundStuff->GetFillPattern();
1115 }
1116
1117 return std::unique_ptr<XFBGImage>();
1118}
1119
1125{
1127 {
1128 return (m_nDirection
1131 != 0;
1132 }
1133 else
1134 {
1136 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1137 {
1138 return pLay->IsAutoGrow();
1139 }
1140 }
1142}
1143
1149{
1151 {
1152 return (m_nDirection & (LAY_AUTOGROW << SHIFT_DOWN)) != 0;
1153 }
1154 else
1155 {
1157 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1158 {
1159 return pLay->GetIsAutoGrowDown();
1160 }
1161 }
1163}
1164
1170{
1172 throw std::runtime_error("recursion in layout");
1173 m_bGettingAutoGrowUp = true;
1174
1175 bool bRet;
1176
1178 {
1179 bRet = (m_nDirection & (LAY_AUTOGROW << SHIFT_UP)) != 0;
1180 }
1181 else
1182 {
1184 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1185 bRet = pLay->IsAutoGrowUp();
1186 else
1188 }
1189
1190 m_bGettingAutoGrowUp = false;
1191 return bRet;
1192}
1193
1199{
1201 {
1202 return (m_nDirection & (LAY_AUTOGROW << SHIFT_LEFT)) != 0;
1203 }
1204 else
1205 {
1207 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1208 {
1209 return pLay->IsAutoGrowLeft();
1210 }
1211 }
1213}
1214
1220{
1222 {
1223 return (m_nDirection & (LAY_AUTOGROW << SHIFT_RIGHT)) != 0;
1224 }
1225 else
1226 {
1228 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1229 {
1230 return pLay->IsAutoGrowRight();
1231 }
1232 }
1234}
1235
1241{
1242 //content orientation in Graphic objects and OLE objects not supported now
1244 {
1245 LwpLayoutGeometry* pLayGeometry
1246 = dynamic_cast<LwpLayoutGeometry*>(m_LayGeometry.obj().get());
1247 if (pLayGeometry)
1248 return pLayGeometry->GetContentOrientation();
1249 }
1250 else
1251 {
1253 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1254 {
1255 return pLay->GetContentOrientation();
1256 }
1257 }
1259}
1260
1266{
1268 {
1270 return false;
1271
1273 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
1274 if (xParent.is() && !xParent->IsHeader())
1275 {
1276 return xParent->GetHonorProtection();
1277 }
1278
1279 if (m_pFoundry) //is null now
1280 {
1282 if (pDoc)
1283 {
1284 return pDoc->GetHonorProtection();
1285 }
1286 }
1287 }
1288 else
1289 {
1291 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1292 {
1293 return pLay->GetHonorProtection();
1294 }
1295 }
1296
1298}
1299
1305{
1306 bool bProtected = false;
1308 {
1309 bProtected = (m_nAttributes & STYLE_PROTECTED) != 0;
1310 }
1311 else
1312 {
1314 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1315 {
1316 bProtected = pLay->GetIsProtected();
1317 }
1318 else
1319 bProtected = LwpVirtualLayout::IsProtected();
1320 }
1321
1323 dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get()));
1324 if (xParent.is() && !xParent->IsHeader())
1325 {
1326 /* If a parent's protected then none of its children can be accessed. */
1327 if (xParent->GetIsProtected())
1328 return true;
1329
1330 if (xParent->GetHonorProtection())
1331 return bProtected;
1332
1333 /* If our parent isn't honoring protection then we aren't protected. */
1334 return false;
1335 }
1336 if (m_pFoundry) //is null now
1337 {
1339 if (pDoc)
1340 {
1341 if (pDoc->GetHonorProtection())
1342 return bProtected;
1343
1344 /* If the document isn't honoring protection then we aren't protected.*/
1345 return false;
1346 }
1347 }
1348
1349 return bProtected;
1350}
1351
1357{
1359 dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
1361 while (xLay.is())
1362 {
1363 bool bAlreadySeen = !aSeen.insert(xLay.get()).second;
1364 if (bAlreadySeen)
1365 throw std::runtime_error("loop in conversion");
1366 if (xLay->IsForWaterMark())
1367 {
1368 return xLay;
1369 }
1371 dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
1372 xLay = xNext;
1373 }
1375}
1376
1381std::unique_ptr<XFBGImage> LwpMiddleLayout::GetXFBGImage()
1382{
1383 std::unique_ptr<XFBGImage> xXFBGImage;
1384
1386 LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xWaterMarkLayout.get());
1387 if (pLay)
1388 {
1389 //test BGImage
1390 LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get());
1391 if (pGrfObj)
1392 {
1393 xXFBGImage.reset(new XFBGImage);
1394 if (pGrfObj->IsLinked())
1395 {
1396 //set file link
1397 OUString linkedfilepath = pGrfObj->GetLinkedFilePath();
1398 OUString fileURL = LwpTools::convertToFileUrl(
1399 OUStringToOString(linkedfilepath, osl_getThreadTextEncoding()));
1400 xXFBGImage->SetFileLink(fileURL);
1401 }
1402 else
1403 {
1404 std::vector<sal_uInt8> aGrafData = pGrfObj->GetRawGrafData();
1405 xXFBGImage->SetImageData(aGrafData.data(), aGrafData.size());
1406 }
1407
1408 //automatic, top left
1409 xXFBGImage->SetPosition(enumXFAlignStart, enumXFAlignTop);
1410 if (pLay->GetScaleCenter())
1411 {
1412 //center
1413 xXFBGImage->SetPosition();
1414 }
1415 else if (pLay->GetScaleTile())
1416 {
1417 //tile
1418 xXFBGImage->SetRepeate();
1419 }
1420 //fit type, area type
1421 if ((pLay->GetScaleMode() & LwpLayoutScale::FIT_IN_FRAME) != 0)
1422 {
1424 {
1425 xXFBGImage->SetStretch();
1426 }
1427 }
1428 }
1429 }
1430 return xXFBGImage;
1431}
1432
1438{
1440 throw std::runtime_error("recursion in layout");
1442
1443 bool bRet = false;
1444
1446 {
1448 }
1449 else
1450 {
1452 if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get()))
1453 {
1454 bRet = pLay->GetUsePrinterSettings();
1455 }
1456 }
1457
1459 return bRet;
1460}
1461
1462//Check whether there are contents in the layout
1464{
1466 return content.is();
1467}
1468
1470 : LwpMiddleLayout(objHdr, pStrm)
1471 , m_bGettingShadow(false)
1472 , m_bGettingNumCols(false)
1473{
1474}
1475
1477
1479{
1480 LwpObjectStream* pStrm = m_pObjStrm.get();
1481
1483 if (LwpFileHeader::m_nFileRevision < 0x000B)
1484 {
1485 // read PreRevBLayout...
1486 }
1487 else
1488 {
1489 sal_uInt16 nSimple = pStrm->QuickReaduInt16();
1490
1491 if (!nSimple)
1492 {
1493 m_aUseWhen.Read(pStrm);
1494
1495 sal_uInt8 nFlag = pStrm->QuickReaduInt8();
1496 if (nFlag)
1497 m_Position.ReadIndexed(pStrm);
1498 }
1499
1503 m_LayShadow.ReadIndexed(pStrm);
1504
1505 if (pStrm->CheckExtra())
1506 {
1508 pStrm->SkipExtra();
1509 }
1510 }
1511}
1512
1518{
1520 throw std::runtime_error("recursion in layout");
1521 m_bGettingNumCols = true;
1522
1523 sal_uInt16 nRet = 0;
1525 ? dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get())
1526 : nullptr;
1527 if (pLayColumns)
1528 {
1529 nRet = pLayColumns->GetNumCols();
1530 }
1531 else
1532 {
1534 LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*>(xBase.get());
1535 nRet = pStyle ? pStyle->GetNumCols() : LwpVirtualLayout::GetNumCols();
1536 }
1537 m_bGettingNumCols = false;
1538 return nRet;
1539}
1540
1545double LwpLayout::GetColGap(sal_uInt16 nIndex)
1546{
1548 {
1549 LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get());
1550 if (pLayColumns)
1551 {
1552 return pLayColumns->GetColGap(nIndex);
1553 }
1554 }
1555
1557 LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*>(xBase.get());
1558 if (pStyle)
1559 {
1560 return pStyle->GetColGap(nIndex);
1561 }
1562
1564}
1565
1571{
1572 //if there is only one column, do not need insert columns
1573 sal_uInt16 nCols = GetNumCols();
1574 if (nCols == 1)
1575 {
1576 return nullptr;
1577 }
1578
1579 std::unique_ptr<XFColumns> xColumns(new XFColumns);
1580 //set XFColumnSep
1581 std::unique_ptr<XFColumnSep> xColumnSep(GetColumnSep());
1582 if (xColumnSep)
1583 {
1584 xColumns->SetSeparator(*xColumnSep);
1585 }
1586
1587 //set column count and column gap
1588 xColumns->SetCount(nCols);
1589 double fGap = GetColGap(0);
1590 xColumns->SetGap(fGap);
1591
1592 //set xfcolumn
1593 for (sal_uInt16 nIndex = 0; nIndex < nCols; nIndex++)
1594 {
1595 XFColumn aColumn;
1596 sal_Int32 nWidth = 8305 / nCols; //relative width
1597 aColumn.SetRelWidth(nWidth);
1598
1599 //the left and right margins is 0;
1600 double nGap = GetColGap(nIndex) / 2;
1601 aColumn.SetMargins(nGap, nGap);
1602 if (nIndex == 0)
1603 {
1604 aColumn.SetMargins(0, nGap);
1605 }
1606 if (nIndex == (nCols - 1))
1607 {
1608 aColumn.SetMargins(nGap, 0);
1609 }
1610 xColumns->AddColumn(aColumn);
1611 }
1612
1613 return xColumns.release();
1614}
1615
1621{
1622 //Get LwpLayoutGutters
1623 LwpLayoutGutters* pLayoutGutters
1624 = dynamic_cast<LwpLayoutGutters*>(m_LayGutterStuff.obj().get());
1625 if (!pLayoutGutters)
1626 {
1627 return nullptr;
1628 }
1629
1630 LwpBorderStuff& rBorderStuff = pLayoutGutters->GetBorderStuff();
1631
1633 LwpColor aColor = rBorderStuff.GetSideColor(eType);
1634 double fWidth = rBorderStuff.GetSideWidth(eType);
1635 //sal_uInt16 nType = rBorderStuff->GetSideType(eType);
1636
1637 XFColumnSep* pColumnSep = new XFColumnSep();
1638 XFColor aXFColor(aColor.To24Color());
1639 pColumnSep->SetColor(aXFColor);
1640 pColumnSep->SetWidth(fWidth);
1641 pColumnSep->SetRelHeight(100);
1642 pColumnSep->SetVerticalAlign(enumXFAlignTop);
1643
1644 return pColumnSep;
1645}
1646
1652{
1654 LwpUseWhen* pUseWhen = GetUseWhen();
1655 if (pUseWhen)
1656 {
1657 if (pUseWhen->IsStartOnThisHF())
1658 {
1660 }
1661 else if (pUseWhen->IsStartOnThisPage())
1662 {
1664 }
1665 else if (pUseWhen->IsStartOnNextPage())
1666 {
1668 }
1669 else if (pUseWhen->IsStartOnNextOddPage())
1670 {
1672 }
1673 else if (pUseWhen->IsStartOnNextEvenPage())
1674 {
1676 }
1677 }
1678 else
1679 {
1681 }
1682 return eType;
1683}
1684
1690{
1692 {
1693 LwpUseWhen* pUseWhen = GetUseWhen();
1694 if (pUseWhen)
1695 return pUseWhen->GetUsePage();
1696 else
1697 return 0;
1698 }
1699 else
1700 {
1702 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1703 {
1704 return pLay->GetUsePage();
1705 }
1706 }
1707 return 0;
1708}
1709
1715{
1717 {
1718 return &m_aUseWhen;
1719 }
1720 else
1721 {
1723 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1724 {
1725 return pLay->VirtualGetUseWhen();
1726 }
1727 }
1729}
1730
1736{
1738 {
1739 LwpUseWhen* pUseWhen = GetUseWhen();
1740 if (pUseWhen)
1741 return pUseWhen->IsUseOnAllPages();
1742 else
1743 return false;
1744 }
1745 else
1746 {
1748 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1749 {
1750 return pLay->IsUseOnAllPages();
1751 }
1752 }
1754}
1755
1761{
1763 {
1764 LwpUseWhen* pUseWhen = GetUseWhen();
1765 if (pUseWhen)
1766 return pUseWhen->IsUseOnAllEvenPages();
1767 else
1768 return false;
1769 }
1770 else
1771 {
1773 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1774 {
1775 return pLay->IsUseOnAllEvenPages();
1776 }
1777 }
1779}
1780
1786{
1788 {
1789 LwpUseWhen* pUseWhen = GetUseWhen();
1790 if (pUseWhen)
1791 return pUseWhen->IsUseOnAllOddPages();
1792 else
1793 return false;
1794 }
1795 else
1796 {
1798 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1799 {
1800 return pLay->IsUseOnAllOddPages();
1801 }
1802 }
1804}
1805
1811{
1813 {
1814 LwpUseWhen* pUseWhen = GetUseWhen();
1815 if (pUseWhen)
1816 return pUseWhen->IsUseOnPage();
1817 else
1818 return false;
1819 }
1820 else
1821 {
1823 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1824 {
1825 return pLay->IsUseOnPage();
1826 }
1827 }
1829}
1830
1835{
1836 if (m_bGettingShadow)
1837 throw std::runtime_error("recursion in layout");
1838 m_bGettingShadow = true;
1839 LwpShadow* pRet = nullptr;
1841 {
1842 LwpLayoutShadow* pLayoutShadow = dynamic_cast<LwpLayoutShadow*>(m_LayShadow.obj().get());
1843 pRet = pLayoutShadow ? &pLayoutShadow->GetShadow() : nullptr;
1844 }
1845 else
1846 {
1848 if (LwpLayout* pLay = dynamic_cast<LwpLayout*>(xBase.get()))
1849 {
1850 pRet = pLay->GetShadow();
1851 }
1852 }
1853 m_bGettingShadow = false;
1854 return pRet;
1855}
1856
1861{
1862 LwpShadow* pShadow = GetShadow();
1863 if (!pShadow)
1864 return nullptr;
1865 LwpColor color = pShadow->GetColor();
1866 double offsetX = pShadow->GetOffsetX();
1867 double offsetY = pShadow->GetOffsetY();
1868
1869 if (!offsetX || !offsetY || !color.IsValidColor())
1870 return nullptr;
1871 XFShadow* pXFShadow = new XFShadow();
1872 enumXFShadowPos eXFShadowPos = enumXFShadowLeftTop;
1873 double fOffset = 0;
1874
1875 bool left = false;
1876 bool top = false;
1877 if (offsetX < 0)
1878 left = true;
1879 if (offsetY < 0)
1880 top = true;
1881 if (left)
1882 {
1883 fOffset = -offsetX;
1884 if (top)
1885 eXFShadowPos = enumXFShadowLeftTop;
1886 else
1887 eXFShadowPos = enumXFShadowLeftBottom;
1888 }
1889 else
1890 {
1891 fOffset = offsetX;
1892 if (top)
1893 eXFShadowPos = enumXFShadowRightTop;
1894 else
1895 eXFShadowPos = enumXFShadowRightBottom;
1896 }
1897
1898 pXFShadow->SetPosition(eXFShadowPos);
1899 pXFShadow->SetOffset(fOffset);
1900 pXFShadow->SetColor(XFColor(color.To24Color()));
1901
1902 return pXFShadow;
1903}
1904
1910{
1911 if (IsRelativeAnchored())
1912 {
1913 //get position
1914 LwpPara* pPara = dynamic_cast<LwpPara*>(GetPosition().obj().get());
1915 if (pPara)
1916 {
1917 LwpStory* pStory = pPara->GetStory();
1918 return pStory ? pStory->GetTabLayout() : nullptr;
1919 }
1920 }
1921 return GetParentLayout();
1922}
1923
1925 : LwpLayout(objHdr, pStrm)
1926 , m_bGettingWrapType(false)
1927 , m_bGettingLayoutRelativity(false)
1928 , m_nWrapType(0)
1929 , m_nBuoyancy(0)
1930 , m_nBaseLineOffset(0)
1931{
1932}
1933
1935
1937{
1938 LwpObjectStream* pStrm = m_pObjStrm.get();
1940 if (LwpFileHeader::m_nFileRevision < 0x000B)
1941 {
1942 assert(false);
1943 }
1944 else
1945 {
1946 sal_uInt16 simple = pStrm->QuickReaduInt16();
1947 if (!simple)
1948 {
1949 m_nWrapType = pStrm->QuickReaduInt8();
1950 m_nBuoyancy = pStrm->QuickReaduInt8();
1952 m_Script.Read(pStrm);
1953 }
1954 else
1955 {
1959 }
1961 if (pStrm->CheckExtra())
1962 {
1963 sal_uInt16 count = pStrm->QuickReaduInt16();
1964 if (count)
1965 {
1966 // temporarily added by to avoid assertion
1967 while (count)
1968 {
1969 LwpPoint aPoint;
1970 aPoint.Read(pStrm);
1971 count--;
1972 }
1973 }
1974 pStrm->SkipExtra();
1975 }
1976 }
1977}
1982{
1984 throw std::runtime_error("recursion in layout");
1985 m_bGettingWrapType = true;
1986 sal_uInt8 nWrapType = LAY_WRAP_AROUND;
1988 {
1989 nWrapType = m_nWrapType;
1990 }
1991 else
1992 {
1994 if (LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*>(xBase.get()))
1995 {
1996 nWrapType = pLay->GetWrapType();
1997 }
1998 }
1999 m_bGettingWrapType = false;
2000 return nWrapType;
2001}
2006{
2008 throw std::runtime_error("recursion in layout");
2010 LwpLayoutRelativity* pRet = nullptr;
2011 if (!m_LayRelativity.IsNull())
2012 {
2014 {
2015 pRet = dynamic_cast<LwpLayoutRelativity*>(m_LayRelativity.obj().get());
2016 }
2017 }
2018 else
2019 {
2021 if (LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*>(xBase.get()))
2022 {
2023 pRet = pLay->GetRelativityPiece();
2024 }
2025 }
2027 return pRet;
2028}
2034{
2036 if (pLayRel)
2037 {
2038 return pLayRel->GetRelGuts().GetRelativeType();
2039 }
2041}
2047{
2048 /* The baseline is only valid if this is flow-with-text */
2050 {
2051 return 0;
2052 }
2053
2054 // First, ask our content if it has a baseline, ignore now
2055 /*
2056 if (Content && Content->GetBaseLineOffset(&Baseline))
2057 return Baseline;
2058 */
2059
2061 {
2062 return m_nBaseLineOffset;
2063 }
2064 else
2065 {
2067 if (LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*>(xBase.get()))
2068 {
2069 return pLay->GetBaseLineOffset();
2070 }
2071 }
2072 return 0;
2073}
2079{
2080 if (IsRelativeAnchored())
2081 return false;
2082
2084 return xLayout.is() && (xLayout->IsPage() || xLayout->IsHeader() || xLayout->IsFooter());
2085}
2091{
2092 if (IsRelativeAnchored())
2093 return false;
2094
2096 return xLayout.is() && (xLayout->IsFrame() || xLayout->IsGroupHead());
2097}
2103{
2104 if (IsRelativeAnchored())
2105 return false;
2106
2108 return xLayout.is() && xLayout->IsCell();
2109}
2110
2116
2117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< LwpVirtualLayout > GetLayout(LwpVirtualLayout const *pStartLayout)
@descr: Looking for the layout which follows the pStartLayout
Definition: lwplayout.cxx:433
LwpDLVListHeadTail m_Layouts
Definition: lwplayout.hxx:304
LwpObjectID m_OnlyLayout
Definition: lwplayout.hxx:303
void Read(LwpObjectStream *pStrm)
Definition: lwplayout.cxx:421
AtomHolder class of Word Pro to hold a string.
void Read(LwpObjectStream *pStrm)
@descr read atomholder from object stream the default encoding used in Word Pro is 1252
std::unique_ptr< XFBGImage > GetFillPattern()
sal_uInt16 GetSide() const
float GetSideWidth(sal_uInt16 side)
LwpColor GetSideColor(sal_uInt16 side)
bool HasSide(sal_uInt16 side)
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 Named Family Properties Virtual List.
Definition: lwpdlvlist.hxx:119
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwpdlvlist.cxx:129
LwpObjectID & GetParent()
Definition: lwpdlvlist.hxx:111
LwpObjectID & GetChildHead()
Definition: lwpdlvlist.hxx:109
LwpObjectID & GetHead()
Definition: lwpdlvlist.hxx:148
void Read(LwpObjectStream *pObjStrm)
@descr Read head id and tail id
Definition: lwpdlvlist.cxx:160
LwpObjectID & GetNext()
Definition: lwpdlvlist.hxx:75
Document object, represent document and division.
Definition: lwpdoc.hxx:76
bool GetHonorProtection() const
Definition: lwpdoc.hxx:177
LwpDocument * GetRootDocument()
@descr Get root document
Definition: lwpdoc.cxx:637
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
LwpDocument * GetDocument()
Definition: lwpfoundry.hxx:254
const OUString & GetLinkedFilePath() const
Definition: lwpgrfobj.hxx:126
sal_Int16 IsLinked() const
Definition: lwpgrfobj.hxx:125
std::vector< sal_uInt8 > GetRawGrafData()
@descr get the image data read from bento stream according to the VO_GRAPHIC ID.
Definition: lwpgrfobj.cxx:326
void RegisterStyle() override
@descr default register style function
Definition: lwplayout.cxx:486
rtl::Reference< LwpVirtualLayout > FindEnSuperTableLayout()
@descr find endnote supertable layout from the child layout list.
Definition: lwplayout.cxx:511
LwpHeadLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplayout.cxx:472
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:477
LwpBackgroundStuff & GetBackgoudStuff()
LwpBorderStuff & GetBorderStuff()
double GetColGap(sal_uInt16 nIndex)
sal_uInt16 GetNumCols() const
const LwpPoint & GetOrigin() const
Definition: lwplaypiece.hxx:87
sal_Int32 GetHeight() const
Definition: lwplaypiece.hxx:86
const LwpPoint & GetAbsoluteOrigin() const
Definition: lwplaypiece.hxx:88
sal_Int32 GetWidth() const
Definition: lwplaypiece.hxx:85
sal_uInt8 GetContentOrientation() const
Definition: lwplaypiece.hxx:89
LwpBorderStuff & GetBorderStuff()
LwpMargins & GetMargins()
LwpMargins & GetExtMargins()
void Read(LwpObjectStream *pStrm)
Definition: lwplayout.cxx:557
sal_Int32 m_nGridDistance
Definition: lwplayout.hxx:337
sal_uInt16 m_nGridType
Definition: lwplayout.hxx:338
LwpAtomHolder m_aContentStyle
Definition: lwplayout.hxx:339
sal_uInt8 GetRelativeType() const
LwpLayoutRelativityGuts & GetRelGuts()
sal_uInt16 GetPlacement() const
sal_uInt16 GetScaleMode() const
LwpShadow & GetShadow()
sal_uInt16 m_nKey
Definition: lwplayout.hxx:327
void Read(LwpObjectStream *pStrm)
Definition: lwplayout.cxx:538
LwpAtomHolder m_aDescription
Definition: lwplayout.hxx:326
sal_uInt32 m_nStyleDefinition
Definition: lwplayout.hxx:325
LwpObjectID m_LayGutterStuff
Definition: lwplayout.hxx:458
LwpUseWhen m_aUseWhen
Definition: lwplayout.hxx:455
UseWhenType GetUseWhenType()
@descr: Get use when type
Definition: lwplayout.cxx:1651
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:1478
LwpObjectID m_LayJoinStuff
Definition: lwplayout.hxx:459
LwpObjectID m_LayShadow
Definition: lwplayout.hxx:460
LwpLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplayout.cxx:1469
virtual bool IsUseOnPage() override
@descr: Whether it is use on current page
Definition: lwplayout.cxx:1810
virtual bool IsUseOnAllOddPages() override
@descr: Whether it is use on all odd pages
Definition: lwplayout.cxx:1785
bool m_bGettingShadow
Definition: lwplayout.hxx:453
LwpObjectID m_LayExtJoinStuff
Definition: lwplayout.hxx:461
virtual bool IsUseOnAllEvenPages() override
@descr: Whether it is use on all even pages
Definition: lwplayout.cxx:1760
XFShadow * GetXFShadow()
@descr: create xfshadow
Definition: lwplayout.cxx:1860
bool m_bGettingNumCols
Definition: lwplayout.hxx:454
virtual rtl::Reference< LwpVirtualLayout > GetContainerLayout() override
@descr get the layout that containers the current frame layout
Definition: lwplayout.cxx:1909
LwpObjectID & GetPosition()
Definition: lwplayout.hxx:449
virtual sal_uInt16 GetNumCols() override
@descr: Get columns number
Definition: lwplayout.cxx:1517
LwpObjectID m_LayColumns
Definition: lwplayout.hxx:457
LwpUseWhen * VirtualGetUseWhen() override
@descr: Get usewhen pointer
Definition: lwplayout.cxx:1714
@ StartWithinPage
Definition: lwplayout.hxx:439
@ StartWithinColume
Definition: lwplayout.hxx:438
@ StartOnNextPage
Definition: lwplayout.hxx:440
@ StartOnEvenPage
Definition: lwplayout.hxx:442
@ StartOnOddPage
Definition: lwplayout.hxx:441
virtual bool IsUseOnAllPages() override
@descr: Whether it is use on all pages
Definition: lwplayout.cxx:1735
XFColumns * GetXFColumns()
@descr: Create and return XFColumns object
Definition: lwplayout.cxx:1570
virtual ~LwpLayout() override
Definition: lwplayout.cxx:1476
LwpShadow * GetShadow()
@descr: Get the LwpShadow object according to m_LayShadow id.
Definition: lwplayout.cxx:1834
XFColumnSep * GetColumnSep()
@descr: Create and return XFColumnSep object
Definition: lwplayout.cxx:1620
sal_uInt16 GetUsePage()
@descr: Get use page
Definition: lwplayout.cxx:1689
LwpObjectID m_Position
Definition: lwplayout.hxx:456
virtual double GetColGap(sal_uInt16 nIndex) override
@descr: Get gap between columns
Definition: lwplayout.cxx:1545
double GetMarginsValue(sal_uInt8 nWhichSide)
Definition: lwpmargins.hxx:89
sal_Int32 GetMinimumWidth()
Definition: lwplayout.cxx:989
LwpObjectID m_LayMargins
Definition: lwplayout.hxx:408
LwpObjectID & GetContent()
Definition: lwplayout.hxx:415
LwpObjectID m_LayScale
Definition: lwplayout.hxx:407
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:574
virtual bool IsAutoGrow() override
@descr: Whether the height and width of layout is auto grow
Definition: lwplayout.cxx:1124
virtual double MarginsValue(sal_uInt8 nWhichSide) override
@descr: Get margin
Definition: lwplayout.cxx:710
LwpLayoutStyle m_aStyleStuff
Definition: lwplayout.hxx:404
rtl::Reference< LwpVirtualLayout > GetWaterMarkLayout()
@descr: Get watermark layout
Definition: lwplayout.cxx:1356
LwpTabOverride * GetTabOverride()
@descr: Add back color settings into xfpagemaster.
Definition: lwplayout.cxx:911
std::unique_ptr< XFBorders > GetXFBorders()
@descr: create xfborder.
Definition: lwplayout.cxx:834
LwpObjectID m_LayExtBorderStuff
Definition: lwplayout.hxx:411
std::unique_ptr< XFBGImage > GetXFBGImage()
@descr: Create and return xfbgimage object for watermark
Definition: lwplayout.cxx:1381
LwpObjectID m_LayBorderStuff
Definition: lwplayout.hxx:409
sal_uInt16 GetScaleMode()
@descr: Layscale for graphic & watermark
Definition: lwplayout.cxx:936
LwpObjectID m_TabPiece
Definition: lwplayout.hxx:403
sal_uInt16 GetScaleCenter()
Definition: lwplayout.cxx:958
bool m_bGettingBackgroundStuff
Definition: lwplayout.hxx:413
bool CanSizeRight()
Definition: lwplayout.cxx:981
virtual ~LwpMiddleLayout() override
Definition: lwplayout.cxx:572
LwpBorderStuff * GetBorderStuff()
@descr: Get the LwpBorderStuff object according to m_LayBorderStuff id.
Definition: lwplayout.cxx:774
LwpMiddleLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplayout.cxx:565
LwpLayoutScale * GetLayoutScale()
Definition: lwplayout.hxx:366
virtual double ExtMarginsValue(sal_uInt8 nWhichSide) override
@descr: Get extmargin value
Definition: lwplayout.cxx:751
virtual bool IsAutoGrowUp() override
@descr: Whether the height of layout is auto grow up
Definition: lwplayout.cxx:1169
enumXFTextDir GetTextDirection()
@descr: Get text direction settings.
Definition: lwplayout.cxx:860
virtual bool MarginsSameAsParent() override
@descr: Whether the margins is same as parent layout
Definition: lwplayout.cxx:692
virtual bool IsAutoGrowLeft() override
@descr: Whether the height of layout is auto grow down
Definition: lwplayout.cxx:1198
sal_uInt16 GetScaleTile()
Definition: lwplayout.cxx:947
LwpLayoutMisc m_aMiscStuff
Definition: lwplayout.hxx:405
virtual sal_uInt8 GetContentOrientation() override
@descr: Get contents orientation
Definition: lwplayout.cxx:1240
virtual double GetWidth() override
@descr: Get layout height
Definition: lwplayout.cxx:1067
virtual bool HasContent() override
Definition: lwplayout.cxx:1463
LwpObjectID m_Content
Definition: lwplayout.hxx:401
LwpObjectID m_LayGeometry
Definition: lwplayout.hxx:406
sal_Int32 DetermineWidth()
Definition: lwplayout.cxx:1001
virtual bool IsAutoGrowDown() override
@descr: Whether the height of layout is auto grow down
Definition: lwplayout.cxx:1148
std::unique_ptr< XFBGImage > GetFillPattern()
@descr: Get the fill pattern style.
Definition: lwplayout.cxx:1109
LwpPoint GetOrigin()
@descr: Get layout origin point
Definition: lwplayout.cxx:1072
virtual bool IsAutoGrowRight() override
@descr: Whether the height of layout is auto grow down
Definition: lwplayout.cxx:1219
double GetGeometryWidth()
@descr: Get layout width, measured by "cm"
Definition: lwplayout.cxx:677
virtual bool HonorProtection() override
@descr: Whether it is honoring protection
Definition: lwplayout.cxx:1265
bool m_bGettingGeometry
Definition: lwplayout.hxx:412
bool IsPatternFill()
@descr: Whether the fill is pattern fill or not
Definition: lwplayout.cxx:1094
LwpObjectID m_BasedOnStyle
Definition: lwplayout.hxx:393
LwpBackgroundStuff * GetBackgroundStuff()
@descr: Get LwpBackgroundStuff object according to m_LayBackgroundStuff id;
Definition: lwplayout.cxx:804
virtual bool IsProtected() override
@descr: Whether it is protected
Definition: lwplayout.cxx:1304
LwpObjectID m_LayBackgroundStuff
Definition: lwplayout.hxx:410
bool IsSizeRightToContainer()
Definition: lwplayout.cxx:1018
LwpColor * GetBackColor()
@descr: Get background color.
Definition: lwplayout.cxx:894
LwpLayoutGeometry * GetGeometry()
@descr: Get the geometry of current layout
Definition: lwplayout.cxx:634
bool GetUsePrinterSettings()
@descr: Whether the page uses the printer setting
Definition: lwplayout.cxx:1437
double GetGeometryHeight()
@descr: Get layout height, measured by "cm"
Definition: lwplayout.cxx:662
virtual double GetHeight()
@descr: Get layout height
Definition: lwplayout.cxx:1061
bool IsSizeRightToContent()
Definition: lwplayout.cxx:1037
rtl::Reference< LwpObject > GetBasedOnStyle() const
Definition: lwplayout.cxx:619
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
LwpObjectHolder, which is LwpDLVList, contains an id to an object VO_OBJECTHOLDER.
Definition: lwpholder.hxx:104
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
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
Definition: lwpobjstrm.cxx:200
sal_uInt16 CheckExtra()
@descr check if extra bytes
Definition: lwpobjstrm.cxx:267
void SkipExtra()
@descr skip extra bytes
Definition: lwpobjstrm.cxx:258
sal_uInt8 QuickReaduInt8(bool *pFailure=nullptr)
@descr Quick read sal_uInt8
Definition: lwpobjstrm.cxx:230
sal_uInt32 QuickReaduInt32(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
Definition: lwpobjstrm.cxx:189
sal_Int32 QuickReadInt32()
@descr Quick read sal_Int32
Definition: lwpobjstrm.cxx:211
LwpFoundry * m_pFoundry
Definition: lwpobj.hxx:91
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
static void ApplySubBorder(LwpBorderStuff *pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders *pXFBorders)
LwpStory * GetStory()
Definition: lwppara.hxx:337
virtual sal_uInt8 GetRelativeType() override
@descr: Get relative type
Definition: lwplayout.cxx:2033
LwpLayoutRelativity * GetRelativityPiece()
@descr: get LayoutRelativity
Definition: lwplayout.cxx:2005
void SetFont(rtl::Reference< XFFont > const &pFont)
@descr: Set font style for setting position of frame
Definition: lwplayout.cxx:2115
virtual ~LwpPlacableLayout() override
Definition: lwplayout.cxx:1934
virtual bool IsAnchorFrame() override
@descr: whether the parent layout is frame layout
Definition: lwplayout.cxx:2090
virtual bool IsAnchorPage() override
@descr: whether the parent layout is page layout
Definition: lwplayout.cxx:2078
sal_Int32 m_nBaseLineOffset
Definition: lwplayout.hxx:503
sal_Int32 GetBaseLineOffset()
@descr: Get offset from the baseline
Definition: lwplayout.cxx:2046
LwpAtomHolder m_Script
Definition: lwplayout.hxx:504
LwpObjectID m_LayRelativity
Definition: lwplayout.hxx:505
sal_uInt8 m_nWrapType
Definition: lwplayout.hxx:501
virtual bool IsAnchorCell() override
@descr: whether the parent layout is cell layout
Definition: lwplayout.cxx:2102
sal_uInt8 m_nBuoyancy
Definition: lwplayout.hxx:502
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:1936
sal_uInt8 GetWrapType()
@descr: get wrap type
Definition: lwplayout.cxx:1981
LwpPlacableLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplayout.cxx:1924
rtl::Reference< XFFont > m_pFont
Definition: lwplayout.hxx:506
bool m_bGettingLayoutRelativity
Definition: lwplayout.hxx:500
point class
void Read(LwpObjectStream *pStrm)
@descr read point from object stream
Definition: lwpbasetype.cxx:79
double GetOffsetY()
Definition: lwpshadow.hxx:97
double GetOffsetX()
Definition: lwpshadow.hxx:91
const LwpColor & GetColor() const
Definition: lwpshadow.hxx:102
LwpMiddleLayout * GetTabLayout()
Definition: lwpstory.hxx:141
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
static double ConvertToMetric(double fInch)
Definition: lwptools.hxx:113
static double ConvertFromUnitsToMetric(sal_Int32 nUnits)
Definition: lwptools.hxx:117
static OUString convertToFileUrl(const OString &fileName)
Definition: lwptools.cxx:204
bool IsUseOnAllEvenPages() const
Definition: lwpusewhen.hxx:123
void Read(LwpObjectStream *pStrm)
Definition: lwpusewhen.hxx:113
bool IsUseOnAllOddPages() const
Definition: lwpusewhen.hxx:127
sal_uInt16 GetUsePage() const
Definition: lwpusewhen.hxx:162
bool IsStartOnThisPage() const
Definition: lwpusewhen.hxx:137
bool IsStartOnNextOddPage() const
Definition: lwpusewhen.hxx:147
bool IsUseOnPage() const
Definition: lwpusewhen.hxx:132
bool IsStartOnThisHF() const
Definition: lwpusewhen.hxx:157
bool IsUseOnAllPages() const
Definition: lwpusewhen.hxx:119
bool IsStartOnNextPage() const
Definition: lwpusewhen.hxx:142
bool IsStartOnNextEvenPage() const
Definition: lwpusewhen.hxx:152
virtual sal_uInt8 GetRelativeType()
@descr: get the relative type
Definition: lwplayout.cxx:288
LwpUseWhen * GetUseWhen()
@descr: Get usewhen pointer
Definition: lwplayout.cxx:224
bool IsStyleLayout()
Definition: lwplayout.cxx:345
sal_uInt16 m_nEditorID
Definition: lwplayout.hxx:246
virtual bool MarginsSameAsParent()
Definition: lwplayout.cxx:121
bool IsFrame()
@descr: Whether this layout is frame layout or not
Definition: lwplayout.cxx:267
bool IsInlineToMargin() const
@descr: Determine whether the layout width is to margin
Definition: lwplayout.cxx:416
bool IsFooter()
@descr: Whether this layout is footer layout or not
Definition: lwplayout.cxx:263
bool IsHeader()
@descr: Whether this layout is header layout or not
Definition: lwplayout.cxx:259
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:101
virtual double ExtMarginsValue(sal_uInt8)
Definition: lwplayout.hxx:225
LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplayout.cxx:77
virtual double GetColGap(sal_uInt16 nIndex)
@descr: Get the gap between columns
Definition: lwplayout.cxx:130
virtual bool IsUseOnPage()
Definition: lwplayout.hxx:190
bool GetMarginsSameAsParent()
Definition: lwplayout.hxx:117
sal_uInt32 m_nOverrideFlag
Definition: lwplayout.hxx:244
virtual bool IsAutoGrow()
Definition: lwplayout.hxx:100
bool IsRelativeAnchored()
@descr: whether it is relative anchored layout
Definition: lwplayout.cxx:295
rtl::Reference< LwpVirtualLayout > GetParentLayout()
@descr: Get parent layout
Definition: lwplayout.cxx:317
virtual double MarginsValue(sal_uInt8)
Definition: lwplayout.hxx:224
bool IsComplex() const
@descr: Whether it is a mirror layout
Definition: lwplayout.cxx:218
virtual sal_uInt8 GetContentOrientation()
Definition: lwplayout.hxx:107
virtual bool HonorProtection()
@descr: Whether it is honoring protection
Definition: lwplayout.cxx:141
bool m_bGettingScaleCenter
Definition: lwplayout.hxx:236
virtual bool IsUseOnAllEvenPages()
Definition: lwplayout.hxx:188
virtual bool IsProtected()
@descr: Whether it is protected
Definition: lwplayout.cxx:167
sal_uInt32 m_nAttributes3
Definition: lwplayout.hxx:243
virtual bool IsAutoGrowUp()
Definition: lwplayout.hxx:101
virtual bool IsAutoGrowDown()
Definition: lwplayout.hxx:223
bool m_bGettingAutoGrowUp
Definition: lwplayout.hxx:240
bool m_bGettingUsePrinterSettings
Definition: lwplayout.hxx:235
bool IsMinimumHeight() const
@descr: whether it is MinimumHeight layout
Definition: lwplayout.cxx:308
virtual bool IsUseOnAllPages()
Definition: lwplayout.hxx:187
sal_uInt32 m_nAttributes
Definition: lwplayout.hxx:241
bool IsFitGraphic()
@descr: Whether the size of layout is fit the graphic
Definition: lwplayout.cxx:401
bool HasProtection()
@descr: Whether it has protection
Definition: lwplayout.cxx:199
sal_uInt16 m_nDirection
Definition: lwplayout.hxx:245
bool IsSuperTable()
@descr: Whether this layout is supertable layout or not
Definition: lwplayout.cxx:280
double GetExtMarginsValue(sal_uInt8 nWhichSide)
Definition: lwplayout.hxx:162
bool IsGroupHead()
@descr: Whether this layout is group layout or not
Definition: lwplayout.cxx:284
bool NoContentReference()
Definition: lwplayout.cxx:340
bool IsAutoGrowWidth()
@descr: Whether the width of layout is auto grow
Definition: lwplayout.cxx:410
LwpObjectID m_NextEnumerated
Definition: lwplayout.hxx:247
bool GetIsAutoGrowDown()
Definition: lwplayout.hxx:135
void RegisterChildStyle()
@descr: Register child layout style
Definition: lwplayout.cxx:327
LwpVirtualLayout * FindChildByType(LWP_LAYOUT_TYPE eType)
@descr: Find child layout by layout type
Definition: lwplayout.cxx:370
bool IsPage()
@descr: Whether this layout is page layout or not
Definition: lwplayout.cxx:255
double GetMarginsValue(sal_uInt8 nWhichSide)
Definition: lwplayout.hxx:153
bool m_bGettingBorderStuff
Definition: lwplayout.hxx:237
virtual bool IsAutoGrowRight()
Definition: lwplayout.hxx:103
bool IsCell()
@descr: Whether this layout is cell layout or not
Definition: lwplayout.cxx:272
virtual bool IsAutoGrowLeft()
Definition: lwplayout.hxx:102
virtual sal_uInt16 GetNumCols()
Definition: lwplayout.hxx:98
bool m_bGettingStyleLayout
Definition: lwplayout.hxx:239
virtual bool IsUseOnAllOddPages()
Definition: lwplayout.hxx:189
virtual LwpUseWhen * VirtualGetUseWhen()
Definition: lwplayout.hxx:186
sal_uInt32 m_nAttributes2
Definition: lwplayout.hxx:242
LwpObjectID m_PreviousEnumerated
Definition: lwplayout.hxx:248
virtual LWP_LAYOUT_TYPE GetLayoutType()
Definition: lwplayout.hxx:291
@ LWP_ENDNOTE_SUPERTABLE_LAYOUT
Definition: lwplayout.hxx:274
LwpOverride * GetOverride()
Definition: lwppiece.hxx:90
Background image object.
Definition: xfbgimage.hxx:70
Borders for object with borders.
Definition: xfborders.hxx:134
Color object.
Definition: xfcolor.hxx:70
void SetColor(XFColor const &color)
Definition: xfcolumns.cxx:96
void SetRelHeight(sal_Int32 height)
Definition: xfcolumns.cxx:87
void SetWidth(double width)
Definition: xfcolumns.cxx:92
void SetVerticalAlign(enumXFAlignType align)
Definition: xfcolumns.cxx:100
@descr Columns object for page or section.
Definition: xfcolumns.hxx:75
void SetRelWidth(sal_Int32 width)
@descr Set column relative width.
Definition: xfcolumns.cxx:63
void SetMargins(double left, double right)
@descr Set column margin left and margin right.
Definition: xfcolumns.cxx:68
Shadow object.
Definition: xfshadow.hxx:72
void SetPosition(enumXFShadowPos pos)
@descr set shadow position.
Definition: xfshadow.hxx:119
void SetOffset(double offset)
@descr Set shadow offset from owner object.
Definition: xfshadow.hxx:129
void SetColor(const XFColor &color)
@descr Set shadow color.
Definition: xfshadow.hxx:139
std::pair< const_iterator, bool > insert(Value &&x)
OString top
DocumentType eType
sal_Int32 nIndex
#define SAL_WARN(area, stream)
#define LAY_BUOYNEUTRAL
Definition: lwplayout.hxx:90
#define STYLE3_INLINETOMARGIN
#define OVER_TABS
#define TEXT_ORIENT_LRTB
#define STYLE3_MINHEIGHTVALID
#define STYLE3_WIDTHVALID
#define TEXT_ORIENT_RLBT
#define STYLE_PROTECTED
#define OVER_COLUMNS
#define STYLE2_NOCONTENTREFERENCE
#define OVER_MISC
#define STYLE3_STYLELAYOUT
#define OVER_MARGINS
#define OVER_BORDERS
#define STYLE_COMPLEX
#define OVER_SIZE
#define STYLE2_HONORPROTECTION
#define OVER_SHADOW
#define OVER_BACKGROUND
#define TEXT_ORIENT_BTLR
#define OVER_SCALING
#define STYLE3_USEPRINTERSETTINGS
#define OVER_ROTATION
#define OVER_PLACEMENT
#define STYLE2_MARGINSSAMEASPARENT
#define TEXT_ORIENT_TBRL
#define STYLE2_LOCALCOLUMNINFO
const sal_uInt8 MARGIN_RIGHT
Definition: lwpmargins.hxx:64
const sal_uInt8 MARGIN_LEFT
Definition: lwpmargins.hxx:63
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
QPRO_FUNC_TYPE nType
unsigned char sal_uInt8
sal_uInt64 left
enumXFShadowPos
Definition: xfdefs.hxx:185
@ enumXFShadowLeftTop
Definition: xfdefs.hxx:190
@ enumXFShadowLeftBottom
Definition: xfdefs.hxx:189
@ enumXFShadowRightTop
Definition: xfdefs.hxx:188
@ enumXFShadowRightBottom
Definition: xfdefs.hxx:187
@ enumXFAlignStart
Definition: xfdefs.hxx:174
@ enumXFAlignTop
Definition: xfdefs.hxx:178
enumXFTextDir
Definition: xfdefs.hxx:277
@ enumXFTextDirTB_RL
Definition: xfdefs.hxx:286
@ enumXFTextDirNone
Definition: xfdefs.hxx:278
@ enumXFTextDirLR_TB
Definition: xfdefs.hxx:280
sal_Int32 const m_nAttributes