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 
47 using namespace ::com::sun::star;
48 
49 namespace 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 {
77  return GetCurrentViewShell()->GetLayout();
78  return nullptr;
79 }
80 
82 {
84  return GetCurrentViewShell()->GetLayout();
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 
135  SwStartNode* pSttNd =
137  ( aTmpIdx,
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 
166  {
168  std::make_unique<SwUndoInsLayFormat>(pFormat, 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();
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  const SwFrameFormats* pTable = pFormat->GetDoc()->GetSpzFrameFormats();
252  if ( pTable )
253  {
254  std::vector<SwFrameFormat*> aToDeleteFrameFormats;
255  const sal_uLong nNodeIdxOfFlyFormat( pContentIdx->GetIndex() );
256 
257  for ( size_t i = 0; i < pTable->size(); ++i )
258  {
259  SwFrameFormat* pTmpFormat = (*pTable)[i];
260  const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor();
261  if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY &&
262  rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat )
263  {
264  aToDeleteFrameFormats.push_back( pTmpFormat );
265  }
266  }
267 
268  // delete found frame formats
269  while ( !aToDeleteFrameFormats.empty() )
270  {
271  SwFrameFormat* pTmpFormat = aToDeleteFrameFormats.back();
272  pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pTmpFormat );
273 
274  aToDeleteFrameFormats.pop_back();
275  }
276  }
277  }
278  }
279 
280  // Delete content
281  if( pCntIdx )
282  {
283  SwNode *pNode = &pCntIdx->GetNode();
284  const_cast<SwFormatContent&>(pFormat->GetFormatAttr( RES_CNTNT )).SetNewContentIdx( nullptr );
286  }
287 
288  // Delete the character for FlyFrames anchored as char (if necessary)
289  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
290  if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor())
291  {
292  const SwPosition* pPos = rAnchor.GetContentAnchor();
293  SwTextNode *pTextNd = pPos->nNode.GetNode().GetTextNode();
294 
295  // attribute is still in text node, delete it
296  if ( pTextNd )
297  {
298  SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>(
299  pTextNd->GetTextAttrForCharAt( pPos->nContent.GetIndex(),
301  if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) )
302  {
303  // don't delete, set pointer to 0
304  const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
305  SwIndex aIdx( pPos->nContent );
306  pTextNd->EraseText( aIdx, 1 );
307  }
308  }
309  }
310 
311  m_rDoc.DelFrameFormat( pFormat );
312  }
314 }
315 
323  const SwFrameFormat& rSource,
324  const SwFormatAnchor& rNewAnchor,
325  bool bSetTextFlyAtt,
326  bool bMakeFrames )
327 {
328  const bool bFly = RES_FLYFRMFMT == rSource.Which();
329  const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
330  OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
331 
332  SwDoc* pSrcDoc = const_cast<SwDoc*>(rSource.GetDoc());
333 
334  // May we copy this object?
335  // We may, unless it's 1) it's a control (and therefore a draw)
336  // 2) anchored in a header/footer
337  // 3) anchored (to paragraph?)
338  bool bMayNotCopy = false;
339  if(bDraw)
340  {
341  const auto pCAnchor = rNewAnchor.GetContentAnchor();
342  bool bCheckControlLayer = false;
343  rSource.CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer));
344  bMayNotCopy =
345  bCheckControlLayer &&
346  ((RndStdIds::FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == rNewAnchor.GetAnchorId())) &&
347  pCAnchor && m_rDoc.IsInHeaderFooter(pCAnchor->nNode);
348  }
349 
350  // just return if we can't copy this
351  if( bMayNotCopy )
352  return nullptr;
353 
355  if( rSource.GetRegisteredIn() != pSrcDoc->GetDfltFrameFormat() )
356  pDest = m_rDoc.CopyFrameFormat( *static_cast<const SwFrameFormat*>(rSource.GetRegisteredIn()) );
357  if( bFly )
358  {
359  // #i11176#
360  // To do a correct cloning concerning the ZOrder for all objects
361  // it is necessary to actually create a draw object for fly frames, too.
362  // These are then added to the DrawingLayer (which needs to exist).
363  // Together with correct sorting of all drawinglayer based objects
364  // before cloning ZOrder transfer works correctly then.
365  SwFlyFrameFormat *pFormat = m_rDoc.MakeFlyFrameFormat( rSource.GetName(), pDest );
366  pDest = pFormat;
367 
369  }
370  else
371  pDest = m_rDoc.MakeDrawFrameFormat( OUString(), pDest );
372 
373  // Copy all other or new attributes
374  pDest->CopyAttrs( rSource );
375 
376  // Do not copy chains
377  pDest->ResetFormatAttr( RES_CHAIN );
378 
379  if( bFly )
380  {
381  // Duplicate the content.
382  const SwNode& rCSttNd = rSource.GetContent().GetContentIdx()->GetNode();
383  SwNodeRange aRg( rCSttNd, 1, *rCSttNd.EndOfSectionNode() );
384 
387 
388  // Set the Anchor/ContentIndex first.
389  // Within the copying part, we can access the values (DrawFormat in Headers and Footers)
390  aIdx = *pSttNd;
391  SwFormatContent aAttr( rSource.GetContent() );
392  aAttr.SetNewContentIdx( &aIdx );
393  pDest->SetFormatAttr( aAttr );
394  pDest->SetFormatAttr( rNewAnchor );
395 
396  if( !m_rDoc.IsCopyIsMove() || &m_rDoc != pSrcDoc )
397  {
399  pDest->SetName( OUString() );
400  else
401  {
402  // Test first if the name is already taken, if so generate a new one.
403  SwNodeType nNdTyp = aRg.aStart.GetNode().GetNodeType();
404 
405  OUString sOld( pDest->GetName() );
406  pDest->SetName( OUString() );
407  if( m_rDoc.FindFlyByName( sOld, nNdTyp ) ) // found one
408  switch( nNdTyp )
409  {
410  case SwNodeType::Grf: sOld = m_rDoc.GetUniqueGrfName(); break;
411  case SwNodeType::Ole: sOld = m_rDoc.GetUniqueOLEName(); break;
412  default: sOld = m_rDoc.GetUniqueFrameName(); break;
413  }
414 
415  pDest->SetName( sOld );
416  }
417  }
418 
420  {
421  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
422  }
423 
424  // Make sure that FlyFrames in FlyFrames are copied
425  aIdx = *pSttNd->EndOfSectionNode();
426 
427  //fdo#36631 disable (scoped) any undo operations associated with the
428  //contact object itself. They should be managed by SwUndoInsLayFormat.
429  const ::sw::DrawUndoGuard drawUndoGuard(m_rDoc.GetIDocumentUndoRedo());
430 
431  pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aIdx, nullptr, false, true, true);
432  }
433  else
434  {
435  OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Neither Fly nor Draw." );
436  // #i52780# - Note: moving object to visible layer not needed.
437  rSource.CallSwClientNotify(sw::DrawFormatLayoutCopyHint(static_cast<SwDrawFrameFormat&>(*pDest), m_rDoc));
438 
439  if(pDest->GetAnchor() == rNewAnchor)
440  {
441  // Do *not* connect to layout, if a <MakeFrames> will not be called.
442  if(bMakeFrames)
444 
445  }
446  else
447  pDest->SetFormatAttr( rNewAnchor );
448 
450  {
451  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
452  }
453  }
454 
455  if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId()))
456  {
457  const SwPosition* pPos = rNewAnchor.GetContentAnchor();
458  SwFormatFlyCnt aFormat( pDest );
459  pPos->nNode.GetNode().GetTextNode()->InsertItem(
460  aFormat, pPos->nContent.GetIndex(), 0 );
461  }
462 
463  if( bMakeFrames )
464  pDest->MakeFrames();
465 
466  // If the draw format has a TextBox, then copy its fly format as well.
467  if (rSource.Which() == RES_DRAWFRMFMT && rSource.GetOtherTextBoxFormat())
468  {
469  auto pObj = rSource.FindRealSdrObject();
470  auto pTextBoxNd = new SwTextBoxNode(pDest);
471  pDest->SetOtherTextBoxFormat(pTextBoxNd);
472 
473  if (pObj)
474  {
475  const bool bIsGroupObj = pObj->getChildrenOfSdrObject();
476  for (size_t it = 0;
477  it < (bIsGroupObj ? pObj->getChildrenOfSdrObject()->GetObjCount() : 1); it++)
478  {
479  auto pChild = bIsGroupObj ? pObj->getChildrenOfSdrObject()->GetObj(it)
480  : const_cast<SdrObject*>(pObj);
481  if (auto pSourceTextBox
483  {
484  SwFormatAnchor boxAnchor(rNewAnchor);
485  if (RndStdIds::FLY_AS_CHAR == boxAnchor.GetAnchorId())
486  {
487  // AS_CHAR *must not* be set on textbox fly-frame
488  boxAnchor.SetType(RndStdIds::FLY_AT_CHAR);
489  }
490  // presumably these anchors are supported though not sure
491  assert(RndStdIds::FLY_AT_CHAR == boxAnchor.GetAnchorId()
492  || RndStdIds::FLY_AT_PARA == boxAnchor.GetAnchorId()
493  || boxAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE);
494 
495  if (!bMakeFrames && rNewAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR)
496  {
497  // If the draw format is as-char, then it will be copied with bMakeFrames=false, but
498  // doing the same for the fly format would result in not making fly frames at all.
499  bMakeFrames = true;
500  }
501  SwFrameFormat* pDestTextBox
502  = CopyLayoutFormat(*pSourceTextBox, boxAnchor, bSetTextFlyAtt, bMakeFrames);
503 
504  SwAttrSet aSet(pDest->GetAttrSet());
505  SwFormatContent aContent(
506  pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
507  aSet.Put(aContent);
508  pDest->SetFormatAttr(aSet);
509 
510  // Link FLY and DRAW formats, so it becomes a text box
511  SdrObject* pNewObj = pDest->FindRealSdrObject();
512  if (bIsGroupObj && pDest && pDest->FindRealSdrObject()
514  && (pDest->FindRealSdrObject()->getChildrenOfSdrObject()->GetObjCount() > it)
515  && pDest->FindRealSdrObject()->getChildrenOfSdrObject()->GetObj(it))
516  pNewObj = pDest->FindRealSdrObject()->getChildrenOfSdrObject()->GetObj(it);
517  pTextBoxNd->AddTextBox(pNewObj, pDestTextBox);
518  pDestTextBox->SetOtherTextBoxFormat(pTextBoxNd);
519  }
520 
521  if (!bIsGroupObj)
522  break;
523  }
524  }
525  }
526 
527  if (pDest->GetName().isEmpty())
528  {
529  // Format name should have unique name. Let's use object name as a fallback
530  SdrObject *pObj = pDest->FindSdrObject();
531  if (pObj)
532  pDest->SetName(pObj->GetName());
533  }
534 
535  return pDest;
536 }
537 
538 //Load document from fdo#42534 under valgrind, drag the scrollbar down so full
539 //document layout is triggered. Close document before layout has completed, and
540 //SwAnchoredObject objects deleted by the deletion of layout remain referenced
541 //by the SwLayouter
543 {
546  // #i65250#
548 }
549 
551 {
552 }
553 
554 }
555 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
556 
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:683
Starts a section of nodes in the document model.
Definition: node.hxx:312
OUString GetUniqueGrfName() const
Definition: doclay.cxx:1369
bool IsInMailMerge() const
Definition: doc.hxx:960
virtual bool HasLayout() const override
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:156
OUString GetUniqueOLEName() const
Definition: doclay.cxx:1374
Marks a position in the document model.
Definition: pam.hxx:35
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
virtual SdrObjList * getChildrenOfSdrObject() const
SwNodeIndex nNode
Definition: pam.hxx:37
Header Left.
Definition: poolfmt.hxx:332
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uIntPtr sal_uLong
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:909
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:383
SdrObject * GetObj(size_t nNum) const
Definition: doc.hxx:188
size_t GetObjCount() const
OUString GetUniqueFrameName() const
Definition: doclay.cxx:1379
Textboxes are basically textframe + shape pairs.
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1163
SwNode & GetNode() const
Definition: ndindex.hxx:119
void SetOtherTextBoxFormat(SwTextBoxNode *pNew)
Definition: frmfmt.hxx:106
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:144
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:763
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2131
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual const SwRootFrame * GetCurrentLayout() const override
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:744
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:595
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1552
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:754
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:3044
SwDoc & m_rDoc
Definition: docbm.cxx:1204
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
SwIndex nContent
Definition: pam.hxx:38
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
virtual ~DocumentLayoutManager() override
virtual void DelLayoutFormat(SwFrameFormat *pFormat) override
Deletes the denoted format and its content.
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:453
const OUString & GetName() const
Definition: format.hxx:115
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2570
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
Definition: thints.cxx:1271
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
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 DoesUndo() const =0
Is Undo enabled?
Specific frame formats (frames, DrawObjects).
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType, SdrObject *pObject=nullptr)
If we have an associated TextFrame, then return that.
virtual const SwViewShell * GetCurrentViewShell() const override
Returns the layout set at the document.
SwStartNode * MakeTextSection(const SwNodeIndex &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1893
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
Definition: doclay.cxx:1394
Style of a layout element.
Definition: frmfmt.hxx:59
std::unique_ptr< SwLayouter > mpLayouter
css::frame::Controller for complex layout formatting like footnote/endnote in sections ...
SwNodeType
Definition: ndtyp.hxx:28
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
virtual const SwLayouter * GetLayouter() const override
Subgroup footer.
Definition: poolfmt.hxx:336
virtual bool IsModified() const =0
Changes of document?
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:325
FlyAnchors.
Definition: fmtanchr.hxx:34
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1349
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2704
Marks a character position inside a document model node.
Definition: index.hxx:33
Header Left&Right.
Definition: poolfmt.hxx:331
Header Right.
Definition: poolfmt.hxx:333
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:394
virtual void SetCurrentViewShell(SwViewShell *pNew) override
!!!The old layout must be deleted!!!
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
SwStartNode * GetStartNode()
Definition: node.hxx:592
virtual void SetLayouter(SwLayouter *pNew) override
bool IsInReading() const
Definition: doc.hxx:954
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
OUString GetName() const
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:747
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
bool IsOleRef() const
To avoid unnecessary loading of object.
Definition: ndole.cxx:904
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
void EraseText(const SwIndex &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:2662
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:624
constexpr TypedWhichId< SwFormatChain > RES_CHAIN(114)
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:174
void CopyWithFlyInFly(const SwNodeRange &rRg, const SwNodeIndex &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...
bool IsCopyIsMove() const
Definition: doc.hxx:1372
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:477
sal_Int32 GetIndex() const
Definition: index.hxx:91
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet) override
Create a new format whose settings fit to the Request by default.
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2715
SwNodes & GetNodes()
Definition: doc.hxx:409
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:165
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:369
Format of a fly content.
Definition: fmtflcnt.hxx:32
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:326
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:700
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2139
RndStdIds
size_t size() const
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2074
SwTextBoxNode * GetOtherTextBoxFormat() const
Definition: frmfmt.hxx:105
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:140
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2773
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1319
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850
static void ClearMovedFwdFrames(const SwDoc &_rDoc)
Definition: layouter.cxx:303
virtual void ResetModified()=0
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:210
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1885
Base class of the Writer document model elements.
Definition: node.hxx:80