33 #include <objectformatter.hxx>
37 #include <osl/diagnose.h>
41 m_pTextAttr( nullptr ),
42 m_pFormat( pFrameFormat )
48 assert(SfxPoolItem::operator==(rAttr));
103 if ((RndStdIds::FLY_AT_PAGE != aAnchor.GetAnchorId()) &&
104 (&rDoc != pFormat->
GetDoc()))
115 if (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())
124 aAnchor.SetAnchor( &pos );
146 SwNode *
const pOldNode(aAnchor.GetContentAnchor()
147 ? &aAnchor.GetContentAnchor()->nNode.GetNode()
150 if (!pOldNode || !pOldNode->GetNodes().IsDocNodes() ||
151 pOldNode !=
static_cast<SwNode const *
>(pNode))
157 aPos.nNode = *pOldNode;
160 aAnchor.SetType( RndStdIds::FLY_AS_CHAR );
161 aAnchor.SetAnchor( &aPos );
171 if( &rDoc != pFormat->GetDoc() )
178 pFormat->GetDoc()->GetIDocumentUndoRedo());
179 pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
186 pFormat->LockModify();
187 pFormat->SetFormatAttr( aAnchor );
190 pOldNode->RemoveAnchoredFly(pFormat);
191 aPos.nNode.GetNode().AddAnchoredFly(pFormat);
192 pFormat->UnlockModify();
196 assert(!pFormat->IsModifyLocked());
199 if (
SdrObject const*
const pObj = pFormat->FindSdrObject())
204 pFormat->SetFormatAttr( aAnchor );
211 aTextBoxAnchor.
SetAnchor(aAnchor.GetContentAnchor());
219 pTextBox->LockModify();
222 pTextBox->SetFormatAttr(aTextBoxAnchor);
226 pOldNode->RemoveAnchoredFly(pTextBox);
227 aPos.nNode.GetNode().AddAnchoredFly(pTextBox);
228 pTextBox->UnlockModify();
247 OSL_ENSURE(
false,
"SwTextFlyCnt::GetFlyFrame_: DrawInCnt-under construction!" );
263 {
if( static_cast<SwFlyFrame*>(pFrame)->GetAnchorFrame() == static_cast<SwFrame*>(pTmp) )
265 if ( pTmp != pCurrFrame )
267 pTmp->
RemoveFly( static_cast<SwFlyFrame*>(pFrame) );
275 pFrame = aIter.
Next();
void SetAnchor(const SwTextNode *pNode)
SetAnchor() is called by SwTextNode::InsertHint() and sets the anchor position in the SwFlyFrameForma...
Base class of the Writer layout elements.
Represents the visualization of a paragraph.
Marks a position in the document model.
SwpHints * GetpSwpHints()
void SetHasDummyChar(const bool bFlag)
SwFlyInContentFrame * GetFlyFrame_(const SwFrame *pCurrFrame)
GetFlyFrame_() is called during text formatting by SwTextFormatter and searches for the SwFlyFrame fo...
virtual SwFrameFormat * CopyLayoutFormat(const SwFrameFormat &rSrc, const SwFormatAnchor &rNewAnchor, bool bSetTextFlyAtt, bool bMakeFrames)=0
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
IDocumentUndoRedo & GetIDocumentUndoRedo()
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
void CopyFlyFormat(SwDoc &rDoc)
An overview of how a new SwTextFlyCnt is created: MakeTextAttr() is called e.g.
void AppendFly(SwFlyFrame *pNew)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_Int32 GetStart() const
SwTextFrame * GetFollow()
SwTextFlyCnt(SwFormatFlyCnt &rAttr, sal_Int32 nStart)
bool IsInSplitNode() const
void RemoveFly(SwFlyFrame *pToRemove)
const SwStartNode * StartOfSectionNode() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
SwPageFrame * FindPageFrame()
SwContentNode * GetContentNode()
void DelFrames(SwRootFrame const *pLayout)
Method deletes all views of document for the node.
Marks a character position inside a document model node.
Marks a node in the document model.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTextNode is a paragraph in the document model.
SwTextFrame * FindMaster() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwContentNode * GoNext(SwNodeIndex *) const
const SwFormatFlyCnt & GetFlyCnt() const
Base class of the Writer document model elements.