73#include <osl/thread.h>
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)
148 if (xParent.is() && !xParent->IsHeader())
150 return xParent->GetHonorProtection();
173 if (xParent.is() && !xParent->IsHeader())
175 if (xParent->GetHonorProtection() && (xParent->GetHasProtection() || bProtected))
206 if (xParent.is() && !xParent->IsHeader())
208 return xParent->GetHasProtection();
227 throw std::runtime_error(
"recursion in layout");
241 if (xParent.is() && !xParent->IsHeader() && (xParent->GetLayoutType() !=
LWP_PAGE_LAYOUT))
242 pRet = xParent->GetUseWhen();
335 xLayout->DoRegisterStyle();
336 xLayout.set(
dynamic_cast<LwpVirtualLayout*
>(xLayout->GetNext().obj().get()));
348 throw std::runtime_error(
"recursion in layout");
359 bRet = xParent->IsStyleLayout();
375 while (pID && !pID->
IsNull())
381 bool bAlreadySeen = !aSeen.
insert(pLayout).second;
449 while (xObjHolder.is() && pStartLayout != xLayout.get())
451 xObjHolder.set(
dynamic_cast<LwpObjectHolder*
>(xObjHolder->GetNext().obj().get()));
454 xLayout.set(
dynamic_cast<LwpVirtualLayout*
>(xObjHolder->GetObject().obj().get()));
460 xObjHolder.set(
dynamic_cast<LwpObjectHolder*
>(xObjHolder->GetNext().obj().get()));
463 xLayout.set(
dynamic_cast<LwpVirtualLayout*
>(xObjHolder->GetObject().obj().get()));
494 bool bAlreadySeen = !aSeen.
insert(xLayout.get()).second;
496 throw std::runtime_error(
"loop in conversion");
499 if (!xLayout->IsRelativeAnchored())
500 xLayout->DoRegisterStyle();
518 bool bAlreadySeen = !aSeen.
insert(xLayout.get()).second;
520 throw std::runtime_error(
"loop in conversion");
525 xLayout.set(
dynamic_cast<LwpVirtualLayout*
>(xLayout->GetNext().obj().get()));
531 : m_nStyleDefinition(0)
567 , m_bGettingGeometry(false)
568 , m_bGettingBackgroundStuff(false)
582 ContentClass.
Read(pStrm);
622 if (xRet.get() ==
this)
624 SAL_WARN(
"lwp",
"style based on itself");
637 throw std::runtime_error(
"recursion in layout");
650 pRet = pLay->GetGeometry();
701 pLay->GetMarginsSameAsParent();
719 if (xParent.is() && !xParent->IsHeader())
721 fValue = xParent->GetMarginsValue(nWhichSide);
777 throw std::runtime_error(
"recursion in layout");
786 pRet = pLayoutBorder ? &pLayoutBorder->
GetBorderStuff() :
nullptr;
793 pRet = pLay->GetBorderStuff();
807 throw std::runtime_error(
"recursion in layout");
816 pRet = pLayoutBackground ? &pLayoutBackground->
GetBackgoudStuff() :
nullptr;
823 pRet = pLay->GetBackgroundStuff();
837 if (pBorderStuff && pBorderStuff->
GetSide() != 0)
840 std::unique_ptr<XFBorders> xXFBorders(
new XFBorders);
927 return pLay->GetTabOverride();
961 throw std::runtime_error(
"recursion in layout");
1014 return pGeo->GetWidth();
1097 if (pBackgroundStuff)
1112 if (pBackgroundStuff)
1117 return std::unique_ptr<XFBGImage>();
1138 return pLay->IsAutoGrow();
1159 return pLay->GetIsAutoGrowDown();
1172 throw std::runtime_error(
"recursion in layout");
1185 bRet = pLay->IsAutoGrowUp();
1209 return pLay->IsAutoGrowLeft();
1230 return pLay->IsAutoGrowRight();
1255 return pLay->GetContentOrientation();
1274 if (xParent.is() && !xParent->IsHeader())
1276 return xParent->GetHonorProtection();
1293 return pLay->GetHonorProtection();
1306 bool bProtected =
false;
1316 bProtected = pLay->GetIsProtected();
1324 if (xParent.is() && !xParent->IsHeader())
1327 if (xParent->GetIsProtected())
1330 if (xParent->GetHonorProtection())
1363 bool bAlreadySeen = !aSeen.
insert(xLay.get()).second;
1365 throw std::runtime_error(
"loop in conversion");
1366 if (xLay->IsForWaterMark())
1383 std::unique_ptr<XFBGImage> xXFBGImage;
1400 xXFBGImage->SetFileLink(fileURL);
1405 xXFBGImage->SetImageData(aGrafData.data(), aGrafData.size());
1413 xXFBGImage->SetPosition();
1418 xXFBGImage->SetRepeate();
1425 xXFBGImage->SetStretch();
1440 throw std::runtime_error(
"recursion in layout");
1454 bRet = pLay->GetUsePrinterSettings();
1466 return content.is();
1471 , m_bGettingShadow(false)
1472 , m_bGettingNumCols(false)
1520 throw std::runtime_error(
"recursion in layout");
1523 sal_uInt16 nRet = 0;
1579 std::unique_ptr<XFColumns> xColumns(
new XFColumns);
1581 std::unique_ptr<XFColumnSep> xColumnSep(
GetColumnSep());
1584 xColumns->SetSeparator(*xColumnSep);
1588 xColumns->SetCount(nCols);
1590 xColumns->SetGap(fGap);
1596 sal_Int32 nWidth = 8305 / nCols;
1606 if (
nIndex == (nCols - 1))
1610 xColumns->AddColumn(aColumn);
1613 return xColumns.release();
1625 if (!pLayoutGutters)
1704 return pLay->GetUsePage();
1725 return pLay->VirtualGetUseWhen();
1750 return pLay->IsUseOnAllPages();
1775 return pLay->IsUseOnAllEvenPages();
1800 return pLay->IsUseOnAllOddPages();
1825 return pLay->IsUseOnPage();
1837 throw std::runtime_error(
"recursion in layout");
1843 pRet = pLayoutShadow ? &pLayoutShadow->
GetShadow() :
nullptr;
1850 pRet = pLay->GetShadow();
1869 if (!offsetX || !offsetY || !
color.IsValidColor())
1926 , m_bGettingWrapType(false)
1927 , m_bGettingLayoutRelativity(false)
1930 , m_nBaseLineOffset(0)
1984 throw std::runtime_error(
"recursion in layout");
1996 nWrapType = pLay->GetWrapType();
2008 throw std::runtime_error(
"recursion in layout");
2023 pRet = pLay->GetRelativityPiece();
2069 return pLay->GetBaseLineOffset();
2084 return xLayout.is() && (xLayout->IsPage() || xLayout->IsHeader() || xLayout->IsFooter());
2096 return xLayout.is() && (xLayout->IsFrame() || xLayout->IsGroupHead());
2108 return xLayout.is() && xLayout->IsCell();
rtl::Reference< LwpVirtualLayout > GetLayout(LwpVirtualLayout const *pStartLayout)
@descr: Looking for the layout which follows the pStartLayout
LwpDLVListHeadTail m_Layouts
void Read(LwpObjectStream *pStrm)
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()
LwpColor * GetFillColor()
bool IsPatternFill() const
bool IsTransparent() const
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)
bool IsValidColor() const
sal_uInt32 To24Color()
@descr return the BGR format
Double Linked Named Family Properties Virtual List.
void Read() override
@descr Read name of LwpDLNFVList from object stream
LwpObjectID & GetParent()
LwpObjectID & GetChildHead()
void Read(LwpObjectStream *pObjStrm)
@descr Read head id and tail id
Document object, represent document and division.
bool GetHonorProtection() const
LwpDocument * GetRootDocument()
@descr Get root document
LwpDocument * GetDocument()
const OUString & GetLinkedFilePath() const
sal_Int16 IsLinked() const
std::vector< sal_uInt8 > GetRawGrafData()
@descr get the image data read from bento stream according to the VO_GRAPHIC ID.
void RegisterStyle() override
@descr default register style function
rtl::Reference< LwpVirtualLayout > FindEnSuperTableLayout()
@descr find endnote supertable layout from the child layout list.
LwpHeadLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read() override
@descr Read name of LwpDLNFVList from object stream
LwpBackgroundStuff & GetBackgoudStuff()
LwpBorderStuff & GetBorderStuff()
double GetColGap(sal_uInt16 nIndex)
sal_uInt16 GetNumCols() const
const LwpPoint & GetOrigin() const
sal_Int32 GetHeight() const
const LwpPoint & GetAbsoluteOrigin() const
sal_Int32 GetWidth() const
sal_uInt8 GetContentOrientation() const
LwpBorderStuff & GetBorderStuff()
LwpMargins & GetMargins()
LwpMargins & GetExtMargins()
void Read(LwpObjectStream *pStrm)
sal_Int32 m_nGridDistance
LwpAtomHolder m_aContentStyle
sal_uInt8 GetRelativeType() const
LwpLayoutRelativityGuts & GetRelGuts()
sal_uInt16 GetPlacement() const
sal_uInt16 GetScaleMode() const
void Read(LwpObjectStream *pStrm)
LwpAtomHolder m_aDescription
sal_uInt32 m_nStyleDefinition
LwpObjectID m_LayGutterStuff
UseWhenType GetUseWhenType()
@descr: Get use when type
void Read() override
@descr Read name of LwpDLNFVList from object stream
LwpObjectID m_LayJoinStuff
LwpLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual bool IsUseOnPage() override
@descr: Whether it is use on current page
virtual bool IsUseOnAllOddPages() override
@descr: Whether it is use on all odd pages
LwpObjectID m_LayExtJoinStuff
virtual bool IsUseOnAllEvenPages() override
@descr: Whether it is use on all even pages
XFShadow * GetXFShadow()
@descr: create xfshadow
virtual rtl::Reference< LwpVirtualLayout > GetContainerLayout() override
@descr get the layout that containers the current frame layout
LwpObjectID & GetPosition()
virtual sal_uInt16 GetNumCols() override
@descr: Get columns number
LwpUseWhen * VirtualGetUseWhen() override
@descr: Get usewhen pointer
virtual bool IsUseOnAllPages() override
@descr: Whether it is use on all pages
XFColumns * GetXFColumns()
@descr: Create and return XFColumns object
virtual ~LwpLayout() override
LwpShadow * GetShadow()
@descr: Get the LwpShadow object according to m_LayShadow id.
XFColumnSep * GetColumnSep()
@descr: Create and return XFColumnSep object
sal_uInt16 GetUsePage()
@descr: Get use page
virtual double GetColGap(sal_uInt16 nIndex) override
@descr: Get gap between columns
double GetMarginsValue(sal_uInt8 nWhichSide)
sal_Int32 GetMinimumWidth()
LwpObjectID & GetContent()
void Read() override
@descr Read name of LwpDLNFVList from object stream
virtual bool IsAutoGrow() override
@descr: Whether the height and width of layout is auto grow
virtual double MarginsValue(sal_uInt8 nWhichSide) override
@descr: Get margin
LwpLayoutStyle m_aStyleStuff
rtl::Reference< LwpVirtualLayout > GetWaterMarkLayout()
@descr: Get watermark layout
LwpTabOverride * GetTabOverride()
@descr: Add back color settings into xfpagemaster.
std::unique_ptr< XFBorders > GetXFBorders()
@descr: create xfborder.
LwpObjectID m_LayExtBorderStuff
std::unique_ptr< XFBGImage > GetXFBGImage()
@descr: Create and return xfbgimage object for watermark
LwpObjectID m_LayBorderStuff
sal_uInt16 GetScaleMode()
@descr: Layscale for graphic & watermark
sal_uInt16 GetScaleCenter()
bool m_bGettingBackgroundStuff
virtual ~LwpMiddleLayout() override
LwpBorderStuff * GetBorderStuff()
@descr: Get the LwpBorderStuff object according to m_LayBorderStuff id.
LwpMiddleLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpLayoutScale * GetLayoutScale()
virtual double ExtMarginsValue(sal_uInt8 nWhichSide) override
@descr: Get extmargin value
virtual bool IsAutoGrowUp() override
@descr: Whether the height of layout is auto grow up
enumXFTextDir GetTextDirection()
@descr: Get text direction settings.
virtual bool MarginsSameAsParent() override
@descr: Whether the margins is same as parent layout
virtual bool IsAutoGrowLeft() override
@descr: Whether the height of layout is auto grow down
sal_uInt16 GetScaleTile()
LwpLayoutMisc m_aMiscStuff
virtual sal_uInt8 GetContentOrientation() override
@descr: Get contents orientation
virtual double GetWidth() override
@descr: Get layout height
virtual bool HasContent() override
LwpObjectID m_LayGeometry
sal_Int32 DetermineWidth()
virtual bool IsAutoGrowDown() override
@descr: Whether the height of layout is auto grow down
std::unique_ptr< XFBGImage > GetFillPattern()
@descr: Get the fill pattern style.
LwpPoint GetOrigin()
@descr: Get layout origin point
virtual bool IsAutoGrowRight() override
@descr: Whether the height of layout is auto grow down
double GetGeometryWidth()
@descr: Get layout width, measured by "cm"
virtual bool HonorProtection() override
@descr: Whether it is honoring protection
bool IsPatternFill()
@descr: Whether the fill is pattern fill or not
LwpObjectID m_BasedOnStyle
LwpBackgroundStuff * GetBackgroundStuff()
@descr: Get LwpBackgroundStuff object according to m_LayBackgroundStuff id;
virtual bool IsProtected() override
@descr: Whether it is protected
LwpObjectID m_LayBackgroundStuff
bool IsSizeRightToContainer()
LwpColor * GetBackColor()
@descr: Get background color.
LwpLayoutGeometry * GetGeometry()
@descr: Get the geometry of current layout
bool GetUsePrinterSettings()
@descr: Whether the page uses the printer setting
double GetGeometryHeight()
@descr: Get layout height, measured by "cm"
virtual double GetHeight()
@descr: Get layout height
bool IsSizeRightToContent()
rtl::Reference< LwpObject > GetBasedOnStyle() const
LwpObjectHolder, which is LwpDLVList, contains an id to an object VO_OBJECTHOLDER.
void ReadIndexed(LwpSvStream *pStrm)
@descr Read object id with indexed format from stream if index>0, lowid is get from time table per th...
rtl::Reference< LwpObject > obj(VO_TYPE tag=VO_INVALID) const
@descr get object from object factory per the object id
stream class for LwpObject body data provide stream like interface to read object data
sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
sal_uInt16 CheckExtra()
@descr check if extra bytes
void SkipExtra()
@descr skip extra bytes
sal_uInt8 QuickReaduInt8(bool *pFailure=nullptr)
@descr Quick read sal_uInt8
sal_uInt32 QuickReaduInt32(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
sal_Int32 QuickReadInt32()
@descr Quick read sal_Int32
std::unique_ptr< LwpObjectStream > m_pObjStrm
static void ApplySubBorder(LwpBorderStuff *pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders *pXFBorders)
virtual sal_uInt8 GetRelativeType() override
@descr: Get relative type
LwpLayoutRelativity * GetRelativityPiece()
@descr: get LayoutRelativity
void SetFont(rtl::Reference< XFFont > const &pFont)
@descr: Set font style for setting position of frame
virtual ~LwpPlacableLayout() override
virtual bool IsAnchorFrame() override
@descr: whether the parent layout is frame layout
virtual bool IsAnchorPage() override
@descr: whether the parent layout is page layout
sal_Int32 m_nBaseLineOffset
sal_Int32 GetBaseLineOffset()
@descr: Get offset from the baseline
LwpObjectID m_LayRelativity
virtual bool IsAnchorCell() override
@descr: whether the parent layout is cell layout
void Read() override
@descr Read name of LwpDLNFVList from object stream
sal_uInt8 GetWrapType()
@descr: get wrap type
LwpPlacableLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
rtl::Reference< XFFont > m_pFont
bool m_bGettingLayoutRelativity
void Read(LwpObjectStream *pStrm)
@descr read point from object stream
const LwpColor & GetColor() const
LwpMiddleLayout * GetTabLayout()
encapsulate XInputStream to provide SvStream like interfaces
bool IsUseOnAllEvenPages() const
void Read(LwpObjectStream *pStrm)
bool IsUseOnAllOddPages() const
sal_uInt16 GetUsePage() const
bool IsStartOnThisPage() const
bool IsStartOnNextOddPage() const
bool IsStartOnThisHF() const
bool IsUseOnAllPages() const
bool IsStartOnNextPage() const
bool IsStartOnNextEvenPage() const
virtual sal_uInt8 GetRelativeType()
@descr: get the relative type
LwpUseWhen * GetUseWhen()
@descr: Get usewhen pointer
virtual bool MarginsSameAsParent()
bool IsFrame()
@descr: Whether this layout is frame layout or not
bool IsInlineToMargin() const
@descr: Determine whether the layout width is to margin
bool IsFooter()
@descr: Whether this layout is footer layout or not
bool IsHeader()
@descr: Whether this layout is header layout or not
void Read() override
@descr Read name of LwpDLNFVList from object stream
virtual double ExtMarginsValue(sal_uInt8)
LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual double GetColGap(sal_uInt16 nIndex)
@descr: Get the gap between columns
virtual bool IsUseOnPage()
bool GetMarginsSameAsParent()
sal_uInt32 m_nOverrideFlag
virtual bool IsAutoGrow()
bool IsRelativeAnchored()
@descr: whether it is relative anchored layout
rtl::Reference< LwpVirtualLayout > GetParentLayout()
@descr: Get parent layout
virtual double MarginsValue(sal_uInt8)
bool IsComplex() const
@descr: Whether it is a mirror layout
virtual sal_uInt8 GetContentOrientation()
virtual bool HonorProtection()
@descr: Whether it is honoring protection
bool m_bGettingScaleCenter
virtual bool IsUseOnAllEvenPages()
virtual bool IsProtected()
@descr: Whether it is protected
sal_uInt32 m_nAttributes3
virtual bool IsAutoGrowUp()
virtual bool IsAutoGrowDown()
bool m_bGettingAutoGrowUp
bool m_bGettingUsePrinterSettings
bool IsMinimumHeight() const
@descr: whether it is MinimumHeight layout
virtual bool IsUseOnAllPages()
bool IsFitGraphic()
@descr: Whether the size of layout is fit the graphic
bool HasProtection()
@descr: Whether it has protection
bool IsSuperTable()
@descr: Whether this layout is supertable layout or not
double GetExtMarginsValue(sal_uInt8 nWhichSide)
bool IsGroupHead()
@descr: Whether this layout is group layout or not
bool NoContentReference()
bool IsAutoGrowWidth()
@descr: Whether the width of layout is auto grow
LwpObjectID m_NextEnumerated
void RegisterChildStyle()
@descr: Register child layout style
LwpVirtualLayout * FindChildByType(LWP_LAYOUT_TYPE eType)
@descr: Find child layout by layout type
bool IsPage()
@descr: Whether this layout is page layout or not
double GetMarginsValue(sal_uInt8 nWhichSide)
bool m_bGettingBorderStuff
virtual bool IsAutoGrowRight()
bool IsCell()
@descr: Whether this layout is cell layout or not
virtual bool IsAutoGrowLeft()
virtual sal_uInt16 GetNumCols()
bool m_bGettingStyleLayout
virtual bool IsUseOnAllOddPages()
virtual LwpUseWhen * VirtualGetUseWhen()
sal_uInt32 m_nAttributes2
LwpObjectID m_PreviousEnumerated
virtual LWP_LAYOUT_TYPE GetLayoutType()
@ LWP_CONNECTED_CELL_LAYOUT
@ LWP_ENDNOTE_SUPERTABLE_LAYOUT
LwpOverride * GetOverride()
Borders for object with borders.
void SetColor(XFColor const &color)
void SetRelHeight(sal_Int32 height)
void SetWidth(double width)
void SetVerticalAlign(enumXFAlignType align)
@descr Columns object for page or section.
void SetRelWidth(sal_Int32 width)
@descr Set column relative width.
void SetMargins(double left, double right)
@descr Set column margin left and margin right.
void SetPosition(enumXFShadowPos pos)
@descr set shadow position.
void SetOffset(double offset)
@descr Set shadow offset from owner object.
void SetColor(const XFColor &color)
@descr Set shadow color.
std::pair< const_iterator, bool > insert(Value &&x)
#define SAL_WARN(area, stream)
#define STYLE3_INLINETOMARGIN
#define STYLE3_MINHEIGHTVALID
#define STYLE3_WIDTHVALID
#define STYLE2_NOCONTENTREFERENCE
#define STYLE3_STYLELAYOUT
#define STYLE2_HONORPROTECTION
#define STYLE3_USEPRINTERSETTINGS
#define STYLE2_MARGINSSAMEASPARENT
#define STYLE2_LOCALCOLUMNINFO
const sal_uInt8 MARGIN_RIGHT
const sal_uInt8 MARGIN_LEFT
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
@ enumXFShadowRightBottom
sal_Int32 const m_nAttributes