20#include <config_wasm_strip.h>
40#include <objectformatter.hxx>
70#include <osl/diagnose.h>
105 bool bVertPageFrame = rFrameFormat.GetVertOrient().GetRelationOrient() == text::RelOrientation::PAGE_FRAME;
117 if (nFlyTop < nBodyTop)
121 nFlyHeight -= nBodyTop - nFlyTop;
124 if (nFlyHeight <= nPageHeight)
129 if (nDeadline - nFlyTop > nBodyHeight)
133 nDeadline = nFlyTop + nBodyHeight;
140 return aRectFnSet.GetPrtBottom(*pBody);
149 m_pPrevLink( nullptr ),
150 m_pNextLink( nullptr ),
154 m_bAutoPosition( false ),
156 m_nAuthor(
std::string::npos ),
157 m_bValidContentPos( false )
168 if( SvxFrameDirection::Environment == nDir )
178 if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
195 if ( SvxFrameDirection::Vertical_LR_TB == nDir )
197 else if (nDir == SvxFrameDirection::Vertical_LR_BT)
208 if( SvxFrameDirection::Horizontal_RL_TB == nDir )
261 OSL_ENSURE( !pFollow->
GetPrevLink(),
"wrong chain detected" );
271 OSL_ENSURE( !pMaster->
GetNextLink(),
"wrong chain detected" );
284 OSL_ENSURE( rContent.
GetContentIdx(),
":-( no content prepared." );
304 OSL_ENSURE( rContent.
GetContentIdx(),
"<SwFlyFrame::InsertColumns()> - no content prepared." );
333#if !ENABLE_WASM_STRIP_ACCESSIBILITY
340 if( pVSh && pVSh->
Imp() )
403 if (
auto pDrawVirtObj =
dynamic_cast<SwDrawVirtObj*
>( pObj) )
405 pDrawVirtObj->RemoveFromWriterLayout();
406 pDrawVirtObj->RemoveFromDrawingPage();
481 if (rCurrentShell.HasDrawView() &&
482 rCurrentShell.Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount())
485 if (pOldSelFly ==
this)
487 assert(rCurrentShell.Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1);
490 rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
494 pFEShell->SetSelection(temp);
501 rCurrentShell.Imp()->GetDrawView()->UnmarkAll();
520 OSL_ENSURE( pMaster && pFollow,
"incomplete chain" );
521 OSL_ENSURE( !pMaster->
GetNextLink(),
"link can not be changed" );
522 OSL_ENSURE( !pFollow->
GetPrevLink(),
"link can not be changed" );
551 OSL_ENSURE( !pFrame->
IsTabFrame() && !pFrame->
FindNext(),
"follow in chain contains content" );
557#if !ENABLE_WASM_STRIP_ACCESSIBILITY
581 OSL_ENSURE( pUpper && pUpper->
IsColBodyFrame(),
"Missing ColumnBody" );
597 OSL_ENSURE( rContent.
GetContentIdx(),
":-( No content prepared." );
605#if !ENABLE_WASM_STRIP_ACCESSIBILITY
657 OSL_ENSURE( !aIter.
Next(),
"chain with more than one instance" );
767 if (rHint.
GetId() == SfxHintId::SwLegacyModify)
771 if(pLegacy->m_pNew && pLegacy->m_pOld &&
RES_ATTRSET_CHG == pLegacy->m_pNew->Which())
781 UpdateAttr_(pOItem, pNItem, eInvFlags, &aOldSet, &aNewSet);
789 UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, eInvFlags);
828 else if (rHint.
GetId() == SfxHintId::SwGetZOrder)
831 const auto& rFormat(
dynamic_cast<const SwFrameFormat&
>(rMod));
832 if (rFormat.Which() ==
RES_FLYFRMFMT && rFormat.getIDocumentLayoutAccess().GetCurrentViewShell())
835 else if (rHint.
GetId() == SfxHintId::SwGetObjectConnected)
838 const auto& rFormat(
dynamic_cast<const SwFrameFormat&
>(rMod));
839 if (!pConnectedHint->m_risConnected && rFormat.Which() ==
RES_FLYFRMFMT && (!pConnectedHint->m_pRoot || pConnectedHint->m_pRoot ==
getRootFrame()))
840 pConnectedHint->m_risConnected =
true;
849 const sal_uInt16 nWhich = pOld ? pOld->
Which() : pNew ? pNew->
Which() : 0;
880 if( RndStdIds::FLY_AT_FLY ==
GetFormat()->GetAnchor().GetAnchorId() )
885 !
GetFormat()->GetSurround().IsContour() )
903#if !ENABLE_WASM_STRIP_ACCESSIBILITY
963 aCol.
Init( nCol, 0, 1000 );
986 if (
aURL.GetMap() && (pNewFormatFrameSize || pOldFormatChg))
989 *pNewFormatFrameSize :
997 aURL.GetMap()->Scale( aScaleX, aScaleY );
999 pFormat->LockModify();
1001 pFormat->UnlockModify();
1020 !
GetFormat()->GetSurround().IsContour() )
1098#if !ENABLE_WASM_STRIP_ACCESSIBILITY
1128 aURL.GetMap()->Scale( aScaleX, aScaleY );
1130 pFormat->LockModify();
1132 pFormat->UnlockModify();
1184 if ( pOldSet || pNewSet )
1228 if ( pSectFrame && pSectFrame->
GetSection() ==
nullptr )
1247 const SwTwips nNewY = bVert ? rNewPos.
X() : rNewPos.
Y();
1258 if ( eAnchorType == RndStdIds::FLY_AT_PAGE )
1263 else if ( eAnchorType == RndStdIds::FLY_AT_FLY )
1305 const SwTwips nNewX = bVert ? rNewPos.
Y() : rNewPos.
X();
1310 if ( eAnchorType == RndStdIds::FLY_AT_PAGE )
1316 else if ( eAnchorType == RndStdIds::FLY_AT_FLY )
1360 OSL_ENSURE( pAttrs,
"FlyFrame::Format, pAttrs is 0." );
1401 if(
IsMinHeight() && (nRemaining + nUL) < nMinHeight )
1402 nRemaining = nMinHeight - nUL;
1410 if ( nRemaining <
MINFLY )
1418 pAnchor = pAnchorChar;
1424 SwTwips nDeadline = GetFlyAnchorBottom(
this, *pAnchor);
1427 if (nBottom > nDeadline)
1429 nRemaining = nDeadline - nTop;
1435 aRectFnSet.
SetHeight( aPrt, nRemaining );
1442 aRectFnSet.
AddBottom( aFrm, nRemaining + nUL );
1446 if ( nRemaining + nUL != 0 )
1456 SdrObject* pShape = pShapeFormat->FindSdrObject();
1461 pCustomShape->SuggestTextFrameSize(aSize);
1463 pCustomShape->NbcSetOutlinerParaObjectForText(std::nullopt,
nullptr);
1491 if ( nNewSize != 0 )
1499 OSL_ENSURE( aRelSize ==
CalcRel( rFrameSz ),
"SwFlyFrame::Format CalcRel problem" );
1509 nNewSize = std::max( nNewSize - nLR, nAutoWidth );
1511 nNewSize = nAutoWidth;
1522 aRectFnSet.
SetWidth( aPrt, nNewSize );
1529 aRectFnSet.
AddRight( aFrm, nNewSize );
1533 if ( nNewSize != 0 )
1554 bool bCollect =
false;
1572 if( pSect->HasFollow() )
1580 InsertEndnotes( pSect );
1603 int nLoopControlRuns = 0;
1605 int nLoopControlRunsInMultiCol = 0;
1606 const int nLoopControlMax = 20;
1607 const SwFrame* pLoopControlCond =
nullptr;
1613 bool const wasFrameLowerOfLay(pLay->
IsAnLower(pFrame));
1624 static_cast<SwTabFrame*
>(pFrame)->m_bCalcLowers =
true;
1628 if (
static_cast<SwTabFrame*
>(pFrame)->IsFollow() &&
1631 static_cast<SwTabFrame*
>(pFrame)->m_bLockBackMove =
true;
1638 pFrame->
Calc(pRenderContext);
1644 static_cast<SwTextFrame*
>(pFrame)->AllowFollowFormat();
1656 SwFlowFrame* pTmpPrevFlowFrame = pTmpPrev && pTmpPrev->
IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pTmpPrev) :
nullptr;
1657 SwFlowFrame* pTmpFlowFrame = pFrame->
IsFlowFrame() ? SwFlowFrame::CastFlowFrame(pFrame) :
nullptr;
1659 bool bPrevInvalid = pTmpPrevFlowFrame && pTmpFlowFrame &&
1660 !pTmpFlowFrame->IsFollow() &&
1662 !pTmpFlowFrame->IsJoinLocked() &&
1666 pTmpPrevFlowFrame->IsKeepFwdMoveAllowed();
1671 bool bAgain =
false;
1672 bool bRestartLayoutProcess =
false;
1682 assert(pAnchoredObj);
1694 SwFrame* pAnchorFrame = pFrame;
1698 if (pFlyFrame->IsFlySplitAllowed())
1702 SwTextFrame* pAnchorCharFrame = pFlyFrame->FindAnchorCharFrame();
1703 if (pAnchorCharFrame)
1707 pAnchorFrame = pAnchorCharFrame;
1715 bRestartLayoutProcess =
true;
1722 bRestartLayoutProcess =
true;
1729 if ( pAgainObj2 == pAnchoredObj )
1731 OSL_FAIL(
"::CalcContent(..) - loop detected, perform attribute changes to avoid the loop" );
1735 if( css::text::WrapTextMode_THROUGH != aAttr.
GetSurround() )
1740 RndStdIds::FLY_AT_CHAR) &&
1741 (css::text::WrapTextMode_PARALLEL ==
1744 aAttr.
SetSurround( css::text::WrapTextMode_THROUGH );
1748 aAttr.
SetSurround( css::text::WrapTextMode_PARALLEL );
1750 rFormat.LockModify();
1752 rFormat.UnlockModify();
1757 if ( pAgainObj1 == pAnchoredObj )
1758 pAgainObj2 = pAnchoredObj;
1759 pAgainObj1 = pAnchoredObj;
1777 if (bRestartLayoutProcess
1779 && nLoopControlRunsInMultiCol < nLoopControlMax
1782 && (wasFrameLowerOfLay || pLay->
IsAnLower(pFrame)))
1784 bool bIsMultiColumn = pSect && pSect->
GetSection() && pSect->
Lower() &&
1786 if ( bIsMultiColumn )
1787 ++nLoopControlRunsInMultiCol;
1789 pAgainObj1 =
nullptr;
1790 pAgainObj2 =
nullptr;
1798 pFrame->
Calc(pRenderContext);
1804 if ( pFrame && pFrame->
IsInTab() )
1806 if( pFrame && pFrame->
IsInSct() )
1809 if( pTmp != pLay && pLay->
IsAnLower( pTmp ) )
1813 if ( pFrame == pLoopControlCond )
1817 nLoopControlRuns = 0;
1818 pLoopControlCond = pFrame;
1821 if ( nLoopControlRuns < nLoopControlMax )
1824 OSL_FAIL(
"LoopControl in CalcContent" );
1829 if (
static_cast<SwTabFrame*
>(pFrame)->m_bLockBackMove)
1831 assert(
static_cast<SwTabFrame*
>(pFrame)->IsFollow());
1832 static_cast<SwTabFrame*
>(pFrame)->m_bLockBackMove =
false;
1837 pFrame = bPrevInvalid ? pTmpPrev : pFrame->
FindNext();
1838 if( !bPrevInvalid && pFrame && pFrame->
IsSctFrame() && pSect )
1861 ( ( pSect->HasFollow() &&
1875 if( pSect->HasFollow() )
1963 if( nContentHeight != 0)
1971 aNewContentPos.
setX(aNewContentPos.
getX() + nDiff/2);
1972 else if( aRectFnSet.
IsVert() )
1973 aNewContentPos.
setX(aNewContentPos.
getX() - nDiff/2);
1975 aNewContentPos.
setY(aNewContentPos.
getY() + nDiff/2);
1980 aNewContentPos.
setX(aNewContentPos.
getX() + nDiff);
1981 else if( aRectFnSet.
IsVert() )
1982 aNewContentPos.
setX(aNewContentPos.
getX() - nDiff);
1984 aNewContentPos.
setY(aNewContentPos.
getY() + nDiff);
1993 pFrame->InvalidatePos();
2008 if (pWrtSh ==
nullptr)
2016 if (pWrtSh ==
nullptr)
2024 if (pObj ==
nullptr)
2033 if (pView ==
nullptr)
2044 int nTableCount = 0;
2051 pTable =
static_cast<const SwTabFrame*
>(pLower);
2053 if (nTableCount > 1 || pTable ==
nullptr)
2066 if (nTableCount != 1 || pTable ==
nullptr)
2071 if (pBody ==
nullptr)
2078 return nBodyHeight < nTableHeight + nFrameOffset;
2086 if (pControl && pControl->GetWindow())
2088 pControl->GetWindow()->MouseButtonDown(
MouseEvent());
2094 if (pWrtSh ==
nullptr)
2109 if( nSize > 0 && nDist > (
LONG_MAX - nSize ) )
2157 static_cast<SwFlyFreeFrame*
>(
this)->SetNoMoveOnCheckClip(
true );
2159 static_cast<SwFlyFreeFrame*
>(
this)->SetNoMoveOnCheckClip(
false );
2180 pAnchor = pAnchorChar;
2184 SwTwips nDeadline = GetFlyAnchorBottom(
this, *pAnchor);
2187 SwTwips nMaxGrow = nDeadline - nBottom;
2188 if (nDist > nMaxGrow)
2204 aRectFnSet.
AddBottom(aPrt, nRemaining );
2220 pAnchor = pAnchorChar;
2224 SwTwips nDeadline = GetFlyAnchorBottom(
this, *pAnchor);
2229 SwTwips nMaxGrow = nDeadline - nBottom;
2230 if (nDist > nMaxGrow)
2247 if ( nDist > nHeight )
2256 nVal =
std::min( nDist, nHeight - nFormatHeight );
2271 aRectFnSet.
SetHeight( aFrm, nHeight - nVal );
2275 if ( nHeight - nVal != 0 )
2284 aRectFnSet.
SetHeight( aPrt, nHeight - nVal );
2323 static_cast<SwFlyFreeFrame*
>(
this)->SetNoMoveOnCheckClip(
true );
2325 static_cast<SwFlyFreeFrame*
>(
this)->SetNoMoveOnCheckClip(
false );
2359 Size aAdjustedNewSize( aNewSize );
2367 if ( aAdjustedNewSize.
Width() > aClipRect.
Width() )
2398 if ( pFrame == pUpperFrame )
2423 if ( pPage !=
nullptr )
2439#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2450 if( pVSh && pVSh->
Imp() )
2477 OSL_FAIL(
"SwFrame::AppendDrawObj(..) - anchored object of unexpected type -> object not appended" );
2488 DisconnectFromLayout(
false );
2511 if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
2539#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2557#if !ENABLE_WASM_STRIP_ACCESSIBILITY
2594 if ( _bNoInvaOfAsCharAnchoredObjs &&
2595 (pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId()
2596 == RndStdIds::FLY_AS_CHAR) )
2603 if ( pAnchoredObj->GetPageFrame() &&
2604 pAnchoredObj->GetPageFrame() != pPageFrame )
2606 SwTextFrame* pAnchorCharFrame = pAnchoredObj->FindAnchorCharFrame();
2607 if ( pAnchorCharFrame &&
2608 pAnchoredObj->GetPageFrame() == pAnchorCharFrame->
FindPageFrame() )
2618 pAnchoredObj->UnlockPosition();
2624 if ( pAnchoredObj->ClearedEnvironment() &&
2625 pAnchoredObj->GetPageFrame() &&
2626 pAnchoredObj->GetPageFrame() == pPageFrame )
2628 pAnchoredObj->UnlockPosition();
2629 pAnchoredObj->SetClearedEnvironment(
false );
2639 pAnchoredObj->InvalidateObjPos();
2665 const SwFrame* pAnchorFrame = pObj->GetAnchorFrameContainingAnchPos();
2677 const bool bLow =
IsAnLower( pAnchorFrame );
2684 if ( _bUnlockPosOfObjs )
2697 "<SwLayoutFrame::NotifyFlys() - anchored object of unexpected type" );
2705 if ( _bUnlockPosOfObjs )
2707 pObj->UnlockPosition();
2709 pObj->InvalidateObjPos();
2723 if (
GetFormat()->GetSurround().IsContour() )
2753 nRelHeight -= 2*aBorder.
Height();
2816 int nParagraphCount = 0;
2827 auto const& rParaSet(
static_cast<const SwTextFrame*
>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet());
2831 if (!
static_cast<const SwTextFrame*
>(pFrame)->IsLocked())
2867 if (nParagraphCount > 1 || nRet > nParentWidth)
2869 return nParentWidth;
2879 const bool _bForPaint )
const
2887 if(
GetFormat()->GetSurround().IsContour())
2893 std::unique_ptr<GraphicObject> xTmpGrfObj;
2896 if ( pGrfNd && _bForPaint )
2903 pGrfObj = xTmpGrfObj.get();
2905 assert(pGrfObj &&
"SwFlyFrame::GetContour() - No Graphic/GraphicObject found at <SwNoTextNode>.");
2906 if (pGrfObj->
GetType() != GraphicType::NONE)
2912 if ( pGrfNd && _bForPaint )
2914 OSL_FAIL(
"SwFlyFrame::GetContour() - No Contour found at <SwNoTextNode> during paint." );
2931 const MapMode aDispMap( MapUnit::MapTwip );
2936 bool bPixelMap = aGrfMap.
GetMapUnit() == MapUnit::MapPixel;
2939 aOrgSize = pOutDev->
PixelToLogic( aGrfSize, aDispMap );
2945 double fScaleX =
static_cast<double>(aOrig.
Width()) / aOrgSize.
Width();
2946 double fScaleY =
static_cast<double>(aOrig.
Height()) / aOrgSize.
Height();
2948 for ( sal_uInt16 j = 0, nPolyCount = rContour.
Count(); j < nPolyCount; j++ )
2967 if( !aClip.
Width() )
2972 rContour.
Optimize(PolyOptimizeFlags::CLOSE);
2980 if(
nullptr != pSwFlyFreeFrame &&
2991 bRet = (0 != rContour.
Count());
2995 if(bRet && 0 != rContour.
Count())
2998 static_cast< const SwFlyFreeFrame*
>(
this)->isTransformableSwFrame())
3002 double fRotate, fShearX;
3047 "<SwFlyFrame::GetFrameFormat()> - missing frame format -> crash." );
3053 "<SwFlyFrame::GetFrameFormat()> - missing frame format -> crash." );
3074 aFrm.
Pos().setY(_nTop);
3082 aFrm.
Pos().setX(_nLeft);
3116 aVector.push_back( pFlyFrame );
3131 (void)xmlTextWriterStartElement(writer,
reinterpret_cast<const xmlChar*
>(
"fly"));
3134 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"infos"));
3136 (void)xmlTextWriterEndElement(writer);
3138 if (pAnchored && pAnchored->
size() > 0)
3140 (void)xmlTextWriterStartElement(writer, BAD_CAST(
"anchored"));
3147 (void)xmlTextWriterEndElement(writer);
3153 (void)xmlTextWriterEndElement(writer);
3183 nHeight +=
static_cast<SwTextFrame*
>(pFrame)->GetParHeight()
3196 for (
size_t i = 0;
i < nCnt; ++
i )
3207 if( nDist >
nBorder + nHeight )
3219 switch(rItem.
Which())
std::shared_ptr< SwFrameControl > SwFrameControlPtr
@ CONSIDER_WRAP_ON_OBJECT_POSITION
@ FRAME_AUTOWIDTH_WITH_MORE_PARA
@ DO_NOT_BREAK_WRAPPED_TABLES
static OutputDevice * GetDefaultDevice()
MapMode GetPrefMapMode() const
GraphicType GetType() const
virtual SdrLayerID GetInvisibleControlsId() const =0
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetInvisibleHellId() const =0
virtual SdrLayerID GetHeavenId() const =0
virtual SdrLayerID GetControlsId() const =0
virtual SdrLayerID GetInvisibleHeavenId() const =0
virtual SwLayouter * GetLayouter()=0
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
size_t GetMarkCount() const
bool IsObjMarked(SdrObject const *pObj) const
const SdrMarkList & GetMarkedObjectList() const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
void BroadcastObjectChange() const
void SetUserCall(SdrObjUserCall *pUser)
sal_uInt32 GetOrdNum() const
void SetResizeProtect(bool bProt)
void SetMoveProtect(bool bProt)
virtual void SetChanged()
SdrPage * getSdrPageFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
T & StaticWhichCast(TypedWhichId< T > nId)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetLeft() const
bool IsPosProtected() const
bool IsSizeProtected() const
tools::Long GetRight() const
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetHeight(tools::Long n)
const Size & GetSize() const
void SetWidth(tools::Long n)
tools::Long GetTextLeft() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
class for the positioning of drawing objects
wrapper class for the positioning of Writer fly frames and drawing objects
void ClearTmpConsiderWrapInfluence()
const SwFrame * GetAnchorFrame() const
bool PositionLocked() const
SwTwips GetRelCharY(const SwFrame *pFrame) const
void ChgAnchorFrame(SwFrame *_pNewAnchorFrame)
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
virtual void NotifyBackground(SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
method to trigger notification of 'background'
virtual void dumpAsXml(xmlTextWriterPtr pWriter=nullptr) const
Dump a bunch of useful data to an XML representation to ease layout understanding,...
void ResetLayoutProcessBools()
const SwLayoutFrame * GetVertPosOrientFrame() const
void SetCurrRelPos(Point _aRelPos)
void SetDrawObj(SdrObject &_rDrawObj)
virtual SwFrameFormat & GetFrameFormat()=0
SwTwips GetRelCharX(const SwFrame *pFrame) const
SwPageFrame * GetPageFrame()
void ClearVertPosOrientFrame()
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
virtual const SwFlyFrame * DynCastFlyFrame() const
void InvalidateObjRectWithSpaces() const
const SdrObject * GetDrawObj() const
virtual SwRect GetObjRect() const =0
virtual bool IsFormatPossible() const
method to determine, if a format on the anchored object is possible
void UpdateObjInSortedList()
method to update anchored object in the <SwSortedObjs> lists
const Point & GetCurrRelPos() const
void ClearItem(sal_uInt16 nWhichL)
const SwAttrSet * GetChgSet() const
What has changed.
const SvxFormatKeepItem & GetKeep(bool=true) const
Container of body content (i.e.
sal_uInt16 CalcRightLine() const
const Size & GetSize() const
sal_uInt16 CalcTopLine() const
sal_uInt16 CalcLeftLine() const
sal_uInt16 CalcBottomLine() const
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
const SwAttrPool & GetAttrPool() const
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
SwFrameControlsManager & GetFrameControlsManager()
static ObjCntType GetObjCntType(const SdrObject &rObj)
Flys that are anchored to content (at-para, at-char) but not in content (as-char).
general base class for all free-flowing frames
const SwVirtFlyDrawObj * GetVirtDrawObj() const
SwFlyFrame * GetPrevLink() const
virtual void DestroyImpl() override
SwTwips Shrink_(SwTwips, bool bTst)
void MakeContentPos(const SwBorderAttrs &rAttrs)
virtual bool IsFormatPossible() const override
method to determine if a format on the Writer fly frame is possible
virtual const SwFlyFrameFormat * GetFormat() const override
bool IsFlyAtContentFrame() const
static const SwFormatAnchor * GetAnchorFromPoolItem(const SfxPoolItem &rItem)
bool IsFlySplitAllowed() const
Is this fly allowed to split across pages? (Disabled by default.)
virtual bool SetObjLeft_(const SwTwips _nLeft) override
SwFlyFrame * FindChainNeighbour(SwFrameFormat const &rFormat, SwFrame *pAnch=nullptr)
virtual void InvalidateObjPos() override
method to invalidate position of the anchored object
bool IsLowerOf(const SwLayoutFrame *pUpper) const
void ActiveUnfloatButton(SwWrtShell *pWrtSh)
virtual const SwFlyFrame * DynCastFlyFrame() const override
void SelectionHasChanged(SwFEShell *pShell)
Size CalcRel(const SwFormatFrameSize &rSz) const
virtual SwFrameFormat & GetFrameFormat() override
void Invalidate_(SwPageFrame const *pPage=nullptr)
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
virtual SwRect GetObjBoundRect() const override
virtual void MakeObjPos() override
method to determine position for the object and set the position at the object
void UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, SwFlyFrameInvFlags &, SwAttrSetChg *pa=nullptr, SwAttrSetChg *pb=nullptr)
SwTwips Grow_(SwTwips, bool bTst)
SwFlyFrame * GetNextLink() const
bool GetContour(tools::PolyPolygon &rContour, const bool _bForPaint=false) const
#i13147# - If called for paint and the <SwNoTextFrame> contains a graphic, load of intrinsic graphic ...
static void ChainFrames(SwFlyFrame *pMaster, SwFlyFrame *pFollow)
bool IsFlyInContentFrame() const
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
bool IsFlyLayFrame() const
SwTwips CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL)
virtual Size ChgSize(const Size &aNewSize) override
void MakePrtArea(const SwBorderAttrs &rAttrs)
void Chain(SwFrame *_pAnchor)
virtual bool SetObjTop_(const SwTwips _nTop) override
friend void Notify(SwFlyFrame *, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldPrt)
Notify the background based on the difference between old and new rectangle.
virtual void RegisterAtPage(SwPageFrame &) override
void InitDrawObj(SwFrame const &)
virtual void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Dump a bunch of useful data to an XML representation to ease layout understanding,...
virtual void RegisterAtCorrectPage() override
method to assure that anchored object is registered at the correct page frame
bool IsShowUnfloatButton(SwWrtShell *pWrtSh) const
SwFrame * FindLastLower()
void UpdateUnfloatButton(SwWrtShell *pWrtSh, bool bShow) const
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() override
virtual bool GetInfo(SfxPoolItem &) const override
Gets information from the Modify.
bool FrameSizeChg(const SwFormatFrameSize &)
const Point & ContentPos() const
virtual void Calc(vcl::RenderContext *pRenderContext) const override
virtual void Cut() override
static void UnchainFrames(SwFlyFrame *pMaster, SwFlyFrame *pFollow)
bool IsFlyFreeFrame() const
SwFlyFrame(SwFlyFrameFormat *, SwFrame *, SwFrame *pAnchor, bool bFollow=false)
virtual ~SwFlyFrame() override
static void GetAnchoredObjects(std::vector< SwAnchoredObject * > &, const SwFormat &rFormat)
virtual SwRect GetObjRect() const override
void ChgRelPos(const Point &rAbsPos)
Change the relative position.
void InvalidateContentPos()
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
bool isTransformableSwFrame() const
bool supportsAutoContour() const
TransformableSwFrame * getTransformableSwFrame()
Content, content of frame (header, footer, fly).
const SwNodeIndex * GetContentIdx() const
const SwRect & getFrameArea() const
virtual basegfx::B2DHomMatrix getFrameAreaTransformation() const
bool isFrameAreaPositionValid() const
const SwRect & getFramePrintArea() const
void setFramePrintAreaValid(bool bNew)
void setFrameAreaPositionValid(bool bNew)
bool isFramePrintAreaValid() const
bool isFrameAreaSizeValid() const
void setFrameAreaSizeValid(bool bNew)
A container for the Header/Footer, PageBreak, and Outline Content Visibility controls.
void SetUnfloatTableButton(const SwFlyFrame *pFlyFrame, bool bShow, Point aTopRightPixel=Point())
SwFrameControlPtr GetControl(FrameControlType eType, const SwFrame *pFrame)
Base class of the Writer layout elements.
const SwBodyFrame * FindBodyFrame() const
std::unique_ptr< SwSortedObjs > m_pDrawObjs
void RemoveFly(SwFlyFrame *pToRemove)
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
void SetDerivedR2L(bool bNew)
void CheckDirChange()
checks the layout direction and invalidates the lower frames recursively, if necessary.
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
SwFlyFrame * FindFlyFrame()
bool IsAccessibleFrame() const
SwSectionFrame * FindSctFrame()
SwTabFrame * FindTabFrame()
bool IsColumnFrame() const
void PrepareMake(vcl::RenderContext *pRenderContext)
Prepares the Frame for "formatting" (MakeAll()).
SwFrameType GetType() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
void InvalidateObjs(const bool _bNoInvaOfAsCharAnchoredObjs=true)
const SwSortedObjs * GetDrawObjs() const
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
void AppendFly(SwFlyFrame *pNew)
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame,...
void dumpInfosAsXml(xmlTextWriterPtr writer) const
SwLayoutFrame * GetUpper()
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const
void InvalidatePage(const SwPageFrame *pPage=nullptr) const
Invalidates the page in which the Frame is currently placed.
SwRootFrame * getRootFrame()
bool IsNoTextFrame() const
void SetCompletePaint() const
virtual const SvxFormatBreakItem & GetBreakItem() const
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
SwPageFrame * FindPageFrame()
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
void AppendDrawObj(SwAnchoredObject &_rNewObj)
SwFrame * FindFooterOrHeader()
virtual const IDocumentDrawModelAccess & getIDocumentDrawModelAccess()
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
void dumpChildrenAsXml(xmlTextWriterPtr writer) const
void SetDerivedVert(bool bNew)
bool IsLayoutFrame() const
bool IsColBodyFrame() const
These SwFrame inlines are here, so that frame.hxx does not need to include layfrm....
const GraphicObject & GetGrfObj(bool bWait=false) const
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
void ChgLowersProp(const Size &rOldSize)
Change size of lowers proportionally.
void AdjustColumns(const SwFormatCol *pCol, bool bAdjustAttributes)
bool IsAnLower(const SwFrame *) const
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
virtual const SwFrameFormat * GetFormat() const
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method <ContainsAny()> doesn't investigate content of footnotes by default.
virtual void DestroyImpl() override
friend void RestoreContent(SwFrame *, SwLayoutFrame *, SwFrame *pSibling)
const SwFrame * GetLastLower() const
void NotifyLowerObjs(const bool _bUnlockPosOfObjs=false)
force an unlockposition call for the lower objects.
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
friend SwFrame * SaveContent(SwLayoutFrame *, SwFrame *)
void ChgColumns(const SwFormatCol &rOld, const SwFormatCol &rNew, const bool bChgFootnote=false)
add or remove columns from a layoutframe.
const SwFrame * Lower() const
void FormatWidthCols(const SwBorderAttrs &, const SwTwips nBorder, const SwTwips nMinHeight)
Called by Format for Frames and Areas with columns.
void InsertEndnotes(SwSectionFrame const *pSect)
static void CollectEndnotes(SwDoc *pDoc, SwSectionFrame *pSect)
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
void GetContour(tools::PolyPolygon &rPoly) const
const tools::PolyPolygon * HasContour() const
Graphic GetGraphic() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
bool IsNoTextNode() const
SwContentNode * GetContentNode()
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
PaM is Point and Mark: a selection of the document model.
A page of the document layout.
void AppendFlyToPage(SwFlyFrame *pNew)
void RemoveFlyFromPage(SwFlyFrame *pToRemove)
const SwSortedObjs * GetSortedObjs() const
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
tools::Long GetHeight(const SwRect &rRect) const
void SetWidth(SwRect &rRect, tools::Long nNew) const
tools::Long GetWidth(const SwRect &rRect) const
void SetYMargins(SwFrame &rFrame, tools::Long nTop, tools::Long nBottom) const
void SetHeight(SwRect &rRect, tools::Long nNew) const
tools::Long GetTop(const SwRect &rRect) const
Point GetPos(const SwRect &rRect) const
void SetXMargins(SwFrame &rFrame, tools::Long nLeft, tools::Long nRight) const
void AddBottom(SwRect &rRect, tools::Long nNew) const
void AddRight(SwRect &rRect, tools::Long nNew) const
tools::Long BottomDist(const SwRect &rRect, tools::Long nPos) const
tools::Long GetPrtBottom(const SwFrame &rFrame) const
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
SwRect & Union(const SwRect &rRect)
void Top(const tools::Long nTop)
void Pos(const Point &rNew)
void SSize(const Size &rNew)
void AddHeight(const tools::Long nAdd)
void AddWidth(const tools::Long nAdd)
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
void Width(tools::Long nNew)
The root element of a Writer document layout.
SwViewShell * GetCurrShell() const
bool IsAnyShellAccessible() const
void InvalidateBrowseWidth()
void CalcFootnoteContent()
void SetFootnoteLock(bool bNew)
SwTwips Undersize()
Returns the size delta that the section would like to be greater if it has undersized TextFrames in i...
bool IsFootnoteLock() const
const SwSectionFrame * GetFollow() const
class for collecting anchored objects
SwTabFrame is one table in the document layout, containing rows (which contain cells).
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, const SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
TextFrameIndex GetOffset() const
SwTwips CalcFitToContent()
Simulates a formatting as if there were not right margin or Flys or other obstacles and returns the w...
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
bool getBrowseMode() const
void DisposeAccessibleFrame(const SwFrame *pFrame, bool bRecursive=false)
void InvalidateAccessibleEditableState(bool bAllShells, const SwFrame *pFrame=nullptr)
Invalidate editable state for all accessible frames.
void AddAccessibleObj(const SdrObject *pObj)
void AddAccessibleFrame(const SwFrame *pFrame)
Add a frame in the accessible view.
void InvalidateAccessibleRelationSet(const SwFlyFrame *pMaster, const SwFlyFrame *pFollow)
Invalidate frame's relation set (for chained frames)
void DisposeAccessibleObj(const SdrObject *pObj, bool bCanSkipInvisible)
SwDrawView * GetDrawView()
vcl::RenderContext * GetOut() const
const SwViewOption * GetViewOptions() const
const SwRect & VisArea() const
sal_Int32 GetBrowseWidth() const
void InvalidateWindows(const SwRect &rRect)
const Size & GetBrowseBorder() const
Used by the UI to modify the document model.
const SwView & GetView() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
const Point & GetRelPos() const
calculated relative position for object
virtual void CalcPosition() override
calculate position for object
ring_container GetRingContainer()
Point LogicToPixel(const Point &rLogicPt) const
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString GetURL() const override
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
EmbeddedObjectRef * pObject
SwFlyFrame * GetFlyFromMarked(const SdrMarkList *pLst, SwViewShell *pSh)
void CalcContent(SwLayoutFrame *pLay, bool bNoColl)
static SwTwips lcl_CalcAutoWidth(const SwLayoutFrame &rFrame)
static SwPosition ResolveFlyAnchor(SwFrameFormat const &rFlyFrame)
bool CalcClipRect(const SdrObject *pSdrObj, SwRect &rRect, bool bMove=true)
calculate rectangle in that the object can be moved or rather be resized
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
tools::Long FRound(double fVal)
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(132)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SdrTextVertAdjustItem > RES_TEXT_VERT_ADJUST(137)
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(120)
constexpr TypedWhichId< SwFormatFlySplit > RES_FLY_SPLIT(129)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(130)
constexpr TypedWhichId< SwAutoFormatGetDocNode > RES_AUTOFMT_DOCNODE(176)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(168)
tools::Long const nBorder
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Marks a position in the document model.
const SwContentNode * GetContentNode() const
@ FlyFrameAttributesChanged
@ AdjustSizeWithoutFormatting
void ClrContourCache(const SdrObject *pObj)