30#include <osl/diagnose.h>
61 if ( pPageFrameOfAnchor )
71 if ( pAnchorCharFrame )
89 return maObjList[_nIndex].mnPageNumOfAnchor;
95 return maObjList[_nIndex].mbAnchoredAtMaster;
106 const bool _bCollectPgNumOfAnchors )
107 : mrPageFrame( _rPageFrame ),
109 mpLayAction( _pLayAction ),
124 std::unique_ptr<SwObjectFormatter> pObjFormatter;
129 _rPageFrame, _pLayAction );
135 _rPageFrame, _pLayAction );
139 OSL_FAIL(
"<SwObjectFormatter::CreateObjFormatter(..)> - unexpected type of anchor frame" );
142 return pObjFormatter;
151 bool bSuccess(
true );
154 std::unique_ptr<SwObjectFormatter> pObjFormatter =
160 bSuccess = pObjFormatter->DoFormatObjs();
172 bool bSuccess(
true );
175 "<SwObjectFormatter::FormatObj(..)> - missing anchor frame" );
176 SwFrame& rAnchorFrame = _pAnchorFrame ? *_pAnchorFrame : *(_rAnchoredObj.
AnchorFrame());
179 "<SwObjectFormatter::FormatObj(..)> - missing page frame" );
183 std::unique_ptr<SwObjectFormatter> pObjFormatter =
190 bSuccess = pObjFormatter->DoFormatObj( _rAnchoredObj,
true );
210 while ( pLowerFrame )
216 pLowerFrame = pLowerFrame->
GetNext();
274 if ( pFlyFrame->IsFlyLayFrame() )
276 static_cast<SwFlyLayFrame*
>(pFlyFrame)->SetNoMakePos(
false );
280 int nLoopControlRuns = 0;
281 const int nLoopControlMax = 15;
300 if ( pFlyFrame->IsFlyLayFrame() && pFlyFrame->IsClipped() )
302 static_cast<SwFlyLayFrame*
>(pFlyFrame)->SetNoMakePos(
true );
307 *(pFlyFrame->FindPageFrame()),
324 if ( ++nLoopControlRuns >= nLoopControlMax )
326 OSL_FAIL(
"LoopControl in SwObjectFormatter::FormatObj_: Stage 3!!!" );
327 pFlyFrame->ValidateThisAndAllLowers( 2 );
328 nLoopControlRuns = 0;
333 }
while ( !pFlyFrame->isFrameAreaDefinitionValid() &&
355 SwFrame* pAnchorFrame(
nullptr );
360 pAnchorFrame = _pMasterTextFrame;
372 bool bSuccess(
true );
388 const bool bAnchoredAtFollowInSameBodyAsMaster =
389 pAnchorCharFrame && pAnchorCharFrame->IsFollow() &&
393 if ( bAnchoredAtFollowInSameBodyAsMaster )
401 OSL_ENSURE( pPageFrameOfAnchor,
402 "<SwObjectFormatter::FormatObjsAtFrame_()> - missing page frame." );
404 if ( pPageFrameOfAnchor && pPageFrameOfAnchor == &
mrPageFrame )
423 const size_t nActPosOfObj =
430 else if ( nActPosOfObj <
i )
@ CONSIDER_WRAP_ON_OBJECT_POSITION
class for the positioning of drawing objects
wrapper class for the positioning of Writer fly frames and drawing objects
const SwFrame * GetAnchorFrame() const
SwTextFrame * FindAnchorCharFrame()
get frame, which contains the anchor character, if the object is anchored at-character or as-characte...
bool RestartLayoutProcess() const
virtual void MakeObjPos()=0
method to determine position for the object and set the position at the object
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is.
virtual const SwFlyFrame * DynCastFlyFrame() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * GetNextContentFrame() const
general base class for all free-flowing frames
Flys that are bound to layout frames (to-frame) and not to/as content.
Base class of the Writer layout elements.
const SwBodyFrame * FindBodyFrame() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
const SwSortedObjs * GetDrawObjs() const
SwRootFrame * getRootFrame()
SwPageFrame * FindPageFrame()
bool IsLayoutFrame() const
The usage of LayAction is always the same:
void FormatLayoutFly(SwFlyFrame *)
void FormatFlyContent(const SwFlyFrame *)
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
const SwFrame * Lower() const
static std::unique_ptr< SwObjectFormatterTextFrame > CreateObjFormatter(SwTextFrame &_rAnchorTextFrame, const SwPageFrame &_rPageFrame, SwLayAction *_pLayAction)
method to create an instance of <SwObjectFormatterTextFrame> is necessary.
A page of the document layout.
sal_uInt16 GetPhyPageNum() const
std::vector< tEntry > maObjList
sal_uInt32 GetPageNum(sal_uInt32 _nIndex) const
SwAnchoredObject * operator[](sal_uInt32 _nIndex)
void Collect(SwAnchoredObject &_rAnchoredObj)
bool AnchoredAtMaster(sal_uInt32 _nIndex)
SwPageNumAndTypeOfAnchors()
SwViewShell * GetCurrShell() const
size_t ListPosOf(const SwAnchoredObject &_rAnchoredObj) const
Position of object <_rAnchoredObj> in sorted list.
Represents the visualization of a paragraph.
vcl::RenderContext * GetOut() const
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_uInt32 mnPageNumOfAnchor
SwAnchoredObject * mpAnchoredObj