LibreOffice Module sw (master) 1
DocumentLayoutManager.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
20#include <doc.hxx>
21#include <IDocumentState.hxx>
22#include <IDocumentUndoRedo.hxx>
25#include <undobj.hxx>
26#include <viewsh.hxx>
27#include <layouter.hxx>
28#include <poolfmt.hxx>
29#include <frmfmt.hxx>
30#include <fmtcntnt.hxx>
31#include <fmtcnct.hxx>
32#include <ndole.hxx>
33#include <fmtanchr.hxx>
34#include <txtflcnt.hxx>
35#include <fmtflcnt.hxx>
36#include <ndtxt.hxx>
37#include <unoframe.hxx>
38#include <textboxhelper.hxx>
39#include <ndindex.hxx>
40#include <pam.hxx>
41#include <frameformats.hxx>
42#include <com/sun/star/embed/EmbedStates.hpp>
43#include <svx/svdobj.hxx>
44#include <svx/svdpage.hxx>
45#include <osl/diagnose.h>
46
47using namespace ::com::sun::star;
48
49namespace sw
50{
51
53 m_rDoc( i_rSwdoc ),
54 mpCurrentView( nullptr )
55{
56}
57
59{
60 return mpCurrentView;
61}
62
64{
65 return mpCurrentView;
66}
67
69{
70 mpCurrentView = pNew;
71}
72
73// It must be able to communicate to a SwViewShell. This is going to be removed later.
75{
78 return nullptr;
79}
80
82{
85 return nullptr;
86}
87
89{
90 // if there is a view, there is always a layout
91 return (mpCurrentView != nullptr);
92}
93
95{
96 return mpLayouter.get();
97}
98
100{
101 return mpLayouter.get();
102}
103
105{
106 mpLayouter.reset( pNew );
107}
108
114{
115 SwFrameFormat *pFormat = nullptr;
116 const bool bMod = m_rDoc.getIDocumentState().IsModified();
117 bool bHeader = false;
118
119 switch ( eRequest )
120 {
121 case RndStdIds::HEADER:
122 case RndStdIds::HEADERL:
123 case RndStdIds::HEADERR:
124 {
125 bHeader = true;
126 [[fallthrough]];
127 }
128 case RndStdIds::FOOTER:
129 {
130 pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(),
131 (bHeader ? "Right header" : "Right footer"),
133
134 const SwNode& rEndOfAutotext( m_rDoc.GetNodes().GetEndOfAutotext() );
135 SwStartNode* pSttNd =
137 ( rEndOfAutotext,
139 m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(o3tl::narrowing<sal_uInt16>( bHeader
140 ? ( eRequest == RndStdIds::HEADERL
142 : eRequest == RndStdIds::HEADERR
146 ) ) );
147 pFormat->SetFormatAttr( SwFormatContent( pSttNd ));
148
149 if( pSet ) // Set a few more attributes
150 pFormat->SetFormatAttr( *pSet );
151
152 // Why set it back? Doc has changed, or not?
153 // In any case, wrong for the FlyFrames!
154 if ( !bMod )
156 }
157 break;
158
159 case RndStdIds::DRAW_OBJECT:
160 {
161 pFormat = m_rDoc.MakeDrawFrameFormat( OUString(), m_rDoc.GetDfltFrameFormat() );
162 if( pSet ) // Set a few more attributes
163 pFormat->SetFormatAttr( *pSet );
164
165 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
166 {
167 m_rDoc.GetIDocumentUndoRedo().AppendUndo(
168 std::make_unique<SwUndoInsLayFormat>(pFormat, SwNodeOffset(0), 0));
169 }
170 }
171 break;
172
173#if OSL_DEBUG_LEVEL > 0
174 case RndStdIds::FLY_AT_PAGE:
175 case RndStdIds::FLY_AT_CHAR:
176 case RndStdIds::FLY_AT_FLY:
177 case RndStdIds::FLY_AT_PARA:
178 case RndStdIds::FLY_AS_CHAR:
179 OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" );
180 break;
181#endif
182
183 default:
184 OSL_ENSURE( false,
185 "LayoutFormat was requested with an invalid Request." );
186
187 }
188 return pFormat;
189}
190
193{
194 // A chain of frames needs to be merged, if necessary,
195 // so that the Frame's contents are adjusted accordingly before we destroy the Frames.
196 const SwFormatChain &rChain = pFormat->GetChain();
197 if ( rChain.GetPrev() )
198 {
199 SwFormatChain aChain( rChain.GetPrev()->GetChain() );
200 aChain.SetNext( rChain.GetNext() );
201 m_rDoc.SetAttr( aChain, *rChain.GetPrev() );
202 }
203 if ( rChain.GetNext() )
204 {
205 SwFormatChain aChain( rChain.GetNext()->GetChain() );
206 aChain.SetPrev( rChain.GetPrev() );
207 m_rDoc.SetAttr( aChain, *rChain.GetNext() );
208 }
209
210 const SwNodeIndex* pCntIdx = nullptr;
211 // The draw format doesn't own its content, it just has a pointer to it.
212 if (pFormat->Which() != RES_DRAWFRMFMT)
213 pCntIdx = pFormat->GetContent().GetContentIdx();
214 if (pCntIdx && !m_rDoc.GetIDocumentUndoRedo().DoesUndo())
215 {
216 // Disconnect if it's an OLE object
217 SwOLENode* pOLENd = m_rDoc.GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
218 if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
219 {
220 try
221 {
222 pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
223 }
224 catch ( uno::Exception& )
225 {
226 }
227 }
228 }
229
230 // Destroy Frames
231 pFormat->DelFrames();
232
233 // Only FlyFrames are undoable at first
234 const sal_uInt16 nWh = pFormat->Which();
235 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo() &&
236 (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
237 {
238 m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDelLayFormat>( pFormat ));
239 }
240 else
241 {
242 // #i32089# - delete at-frame anchored objects
243 if ( nWh == RES_FLYFRMFMT )
244 {
245 // determine frame formats of at-frame anchored objects
246 const SwNodeIndex* pContentIdx = nullptr;
247 if (pFormat->Which() != RES_DRAWFRMFMT)
248 pContentIdx = pFormat->GetContent().GetContentIdx();
249 if (pContentIdx)
250 {
251 sw::SpzFrameFormats* pSpzs = pFormat->GetDoc()->GetSpzFrameFormats();
252 if ( pSpzs )
253 {
254 std::vector<SwFrameFormat*> aToDeleteFrameFormats;
255 const SwNodeOffset nNodeIdxOfFlyFormat( pContentIdx->GetIndex() );
256
257 for(sw::SpzFrameFormat* pSpz: *pSpzs)
258 {
259 const SwFormatAnchor &rAnch = pSpz->GetAnchor();
260 if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY &&
261 rAnch.GetAnchorNode()->GetIndex() == nNodeIdxOfFlyFormat )
262 {
263 aToDeleteFrameFormats.push_back(pSpz);
264 }
265 }
266
267 // delete found frame formats
268 while ( !aToDeleteFrameFormats.empty() )
269 {
270 SwFrameFormat* pTmpFormat = aToDeleteFrameFormats.back();
271 pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pTmpFormat );
272
273 aToDeleteFrameFormats.pop_back();
274 }
275 }
276 }
277 }
278
279 // Delete content
280 if( pCntIdx )
281 {
282 SwNode *pNode = &pCntIdx->GetNode();
283 const_cast<SwFormatContent&>(pFormat->GetFormatAttr( RES_CNTNT )).SetNewContentIdx( nullptr );
285 }
286
287 // Delete the character for FlyFrames anchored as char (if necessary)
288 const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
289 if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetAnchorNode())
290 {
291 SwTextNode *pTextNd = rAnchor.GetAnchorNode()->GetTextNode();
292
293 // attribute is still in text node, delete it
294 if ( pTextNd )
295 {
296 SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>(
299 if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) )
300 {
301 // don't delete, set pointer to 0
302 const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
303 pTextNd->EraseText( *rAnchor.GetContentAnchor(), 1 );
304 }
305 }
306 }
307
308 m_rDoc.DelFrameFormat( pFormat );
309 }
311}
312
320 const SwFrameFormat& rSource,
321 const SwFormatAnchor& rNewAnchor,
322 bool bSetTextFlyAtt,
323 bool bMakeFrames )
324{
325 const bool bFly = RES_FLYFRMFMT == rSource.Which();
326 const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
327 OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
328
329 SwDoc* pSrcDoc = const_cast<SwDoc*>(rSource.GetDoc());
330
331 // May we copy this object?
332 // We may, unless it's 1) it's a control (and therefore a draw)
333 // 2) anchored in a header/footer
334 // 3) anchored (to paragraph?)
335 bool bMayNotCopy = false;
336 const SwNode* pCAnchor = rNewAnchor.GetAnchorNode();
337 bool bInHeaderFooter = pCAnchor && m_rDoc.IsInHeaderFooter(*pCAnchor);
338 if(bDraw)
339 {
340 bool bCheckControlLayer = false;
341 rSource.CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer));
342 bMayNotCopy =
343 bCheckControlLayer &&
344 ((RndStdIds::FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == rNewAnchor.GetAnchorId())) &&
345 bInHeaderFooter;
346 }
347
348 // just return if we can't copy this
349 if( bMayNotCopy )
350 return nullptr;
351
353 if( rSource.GetRegisteredIn() != pSrcDoc->GetDfltFrameFormat() )
354 pDest = m_rDoc.CopyFrameFormat( *static_cast<const SwFrameFormat*>(rSource.GetRegisteredIn()) );
355 if( bFly )
356 {
357 // #i11176#
358 // To do a correct cloning concerning the ZOrder for all objects
359 // it is necessary to actually create a draw object for fly frames, too.
360 // These are then added to the DrawingLayer (which needs to exist).
361 // Together with correct sorting of all drawinglayer based objects
362 // before cloning ZOrder transfer works correctly then.
363 SwFlyFrameFormat *pFormat = m_rDoc.MakeFlyFrameFormat( rSource.GetName(), pDest );
364 pDest = pFormat;
365
366 SwXFrame::GetOrCreateSdrObject(*pFormat);
367 }
368 else
369 pDest = m_rDoc.MakeDrawFrameFormat( OUString(), pDest );
370
371 // Copy all other or new attributes
372 pDest->CopyAttrs( rSource );
373
374 // Do not copy chains
375 pDest->ResetFormatAttr( RES_CHAIN );
376
377 if( bFly )
378 {
379 // Duplicate the content.
380 const SwNode& rCSttNd = rSource.GetContent().GetContentIdx()->GetNode();
381 SwNodeRange aRg( rCSttNd, SwNodeOffset(1), *rCSttNd.EndOfSectionNode() );
382
384
385 // Set the Anchor/ContentIndex first.
386 // Within the copying part, we can access the values (DrawFormat in Headers and Footers)
387 SwNodeIndex aIdx( *pSttNd );
388 SwFormatContent aAttr( rSource.GetContent() );
389 aAttr.SetNewContentIdx( &aIdx );
390 pDest->SetFormatAttr( aAttr );
391 pDest->SetFormatAttr( rNewAnchor );
392
393 if( !m_rDoc.IsCopyIsMove() || &m_rDoc != pSrcDoc )
394 {
395 if( (m_rDoc.IsInReading() && !bInHeaderFooter) || m_rDoc.IsInMailMerge() )
396 pDest->SetFormatName( OUString() );
397 else
398 {
399 // Test first if the name is already taken, if so generate a new one.
400 SwNodeType nNdTyp = aRg.aStart.GetNode().GetNodeType();
401
402 OUString sOld( pDest->GetName() );
403 pDest->SetFormatName( OUString() );
404 if( m_rDoc.FindFlyByName( sOld, nNdTyp ) ) // found one
405 switch( nNdTyp )
406 {
407 case SwNodeType::Grf: sOld = m_rDoc.GetUniqueGrfName(sOld); break;
408 case SwNodeType::Ole: sOld = m_rDoc.GetUniqueOLEName(); break;
409 default: sOld = m_rDoc.GetUniqueFrameName(); break;
410 }
411
412 pDest->SetFormatName( sOld );
413 }
414 }
415
416 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
417 {
418 m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,SwNodeOffset(0),0));
419 }
420
421 // Make sure that FlyFrames in FlyFrames are copied
422 aIdx = *pSttNd->EndOfSectionNode();
423
424 //fdo#36631 disable (scoped) any undo operations associated with the
425 //contact object itself. They should be managed by SwUndoInsLayFormat.
426 const ::sw::DrawUndoGuard drawUndoGuard(m_rDoc.GetIDocumentUndoRedo());
427
428 pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aIdx.GetNode(), nullptr, false, true, true);
429 }
430 else
431 {
432 OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Neither Fly nor Draw." );
433 // #i52780# - Note: moving object to visible layer not needed.
434 rSource.CallSwClientNotify(sw::DrawFormatLayoutCopyHint(static_cast<SwDrawFrameFormat&>(*pDest), m_rDoc));
435
436 if(pDest->GetAnchor() == rNewAnchor)
437 {
438 // Do *not* connect to layout, if a <MakeFrames> will not be called.
439 if(bMakeFrames)
441
442 }
443 else
444 pDest->SetFormatAttr( rNewAnchor );
445
446 if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
447 {
448 m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,SwNodeOffset(0),0));
449 }
450 }
451
452 if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId()))
453 {
454 SwNode* pAnchorNode = rNewAnchor.GetAnchorNode();
455 SwFormatFlyCnt aFormat( pDest );
456 assert(pAnchorNode->GetTextNode() && "sw.core: text node expected");
457 if (SwTextNode *pTextNd = pAnchorNode->GetTextNode())
458 pTextNd->InsertItem( aFormat, rNewAnchor.GetAnchorContentOffset(), 0 );
459 }
460
461 if( bMakeFrames )
462 pDest->MakeFrames();
463
464 if (pDest->GetName().isEmpty())
465 {
466 // Format name should have unique name. Let's use object name as a fallback
467 SdrObject *pObj = pDest->FindSdrObject();
468 if (pObj)
469 pDest->SetFormatName(pObj->GetName());
470 }
471
472 // If the draw format has a TextBox, then copy its fly format as well.
473 if (const auto& pTextBoxes = rSource.GetOtherTextBoxFormats())
474 pTextBoxes->Clone(&m_rDoc, rNewAnchor, pDest, bSetTextFlyAtt, bMakeFrames);
475
476 return pDest;
477}
478
479//Load document from fdo#42534 under valgrind, drag the scrollbar down so full
480//document layout is triggered. Close document before layout has completed, and
481//SwAnchoredObject objects deleted by the deletion of layout remain referenced
482//by the SwLayouter
484{
487 // #i65250#
489}
490
492{
493}
494
495}
496/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
497
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual void ResetModified()=0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual bool IsModified() const =0
Changes of document?
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
virtual const OUString & GetName() const
Definition: doc.hxx:197
bool IsInReading() const
Definition: doc.hxx:969
bool IsCopyIsMove() const
Definition: doc.hxx:1390
OUString GetUniqueOLEName() const
Definition: doclay.cxx:1400
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:760
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:408
OUString GetUniqueGrfName(std::u16string_view rPrefix=std::u16string_view()) const
Definition: doclay.cxx:1395
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
Definition: docfmt.cxx:458
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:329
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:158
SwNodes & GetNodes()
Definition: doc.hxx:422
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
Definition: doclay.cxx:1420
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1177
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:339
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:705
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
OUString GetUniqueFrameName() const
Definition: doclay.cxx:1405
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:762
bool IsInMailMerge() const
Definition: doc.hxx:975
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:769
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
Definition: doc.hxx:759
bool IsInHeaderFooter(const SwNode &) const
Definition: doclay.cxx:1582
FlyAnchors.
Definition: fmtanchr.hxx:37
sal_Int32 GetAnchorContentOffset() const
Definition: atrfrm.cxx:1631
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:74
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:32
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2179
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2171
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:596
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
Format of a fly content.
Definition: fmtflcnt.hxx:33
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:618
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:171
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
Style of a layout element.
Definition: frmfmt.hxx:72
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2733
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2744
const std::shared_ptr< SwTextBoxNode > & GetOtherTextBoxFormats() const
Definition: frmfmt.hxx:118
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2608
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:153
static void ClearMovedFwdFrames(const SwDoc &_rDoc)
Definition: layouter.cxx:299
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:473
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:379
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:123
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
SwNodeIndex aStart
Definition: ndindex.hxx:136
Base class of the Writer document model elements.
Definition: node.hxx:98
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwNodeType GetNodeType() const
Definition: node.hxx:166
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:695
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:158
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1917
SwStartNode * MakeTextSection(const SwNode &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1925
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
bool IsOleRef() const
To avoid unnecessary loading of object.
Definition: ndole.cxx:977
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:1012
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
Starts a section of nodes in the document model.
Definition: node.hxx:348
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:226
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
void EraseText(const SwContentIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
Definition: ndtxt.cxx:2777
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
Definition: ndtxt.cxx:3155
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2163
void CopyWithFlyInFly(const SwNodeRange &rRg, SwNode &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
std::unique_ptr< SwLayouter > mpLayouter
css::frame::Controller for complex layout formatting like footnote/endnote in sections
virtual const SwLayouter * GetLayouter() const override
virtual void SetCurrentViewShell(SwViewShell *pNew) override
!!!The old layout must be deleted!!!
virtual void DelLayoutFormat(SwFrameFormat *pFormat) override
Deletes the denoted format and its content.
virtual void SetLayouter(SwLayouter *pNew) override
virtual SwFrameFormat * CopyLayoutFormat(const SwFrameFormat &rSrc, const SwFormatAnchor &rNewAnchor, bool bSetTextFlyAtt, bool bMakeFrames) override
Copies the stated format (pSrc) to pDest and returns pDest.
virtual bool HasLayout() const override
virtual const SwRootFrame * GetCurrentLayout() const override
virtual ~DocumentLayoutManager() override
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet) override
Create a new format whose settings fit to the Request by default.
virtual const SwViewShell * GetCurrentViewShell() const override
Returns the layout set at the document.
SwDoc & m_rDoc
Definition: docbm.cxx:1228
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(120)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
Dialog to specify the properties of date form field.
@ SwHeaderStartNode
Definition: ndtyp.hxx:56
@ SwFooterStartNode
Definition: ndtyp.hxx:57
@ SwFlyStartNode
Definition: ndtyp.hxx:54
SwNodeType
Definition: ndtyp.hxx:28
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
@ RES_POOLCOLL_HEADER
Header Left&Right.
Definition: poolfmt.hxx:331
@ RES_POOLCOLL_HEADERL
Header Left.
Definition: poolfmt.hxx:332
@ RES_POOLCOLL_HEADERR
Header Right.
Definition: poolfmt.hxx:333
@ RES_POOLCOLL_FOOTER
Subgroup footer.
Definition: poolfmt.hxx:336
RndStdIds