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 <docary.hxx>
39 #include <textboxhelper.hxx>
40 #include <ndindex.hxx>
41 #include <pam.hxx>
42 #include <frameformats.hxx>
43 #include <com/sun/star/embed/EmbedStates.hpp>
44 #include <svx/svdobj.hxx>
45 
46 using namespace ::com::sun::star;
47 
48 namespace sw
49 {
50 
52  m_rDoc( i_rSwdoc ),
53  mpCurrentView( nullptr )
54 {
55 }
56 
58 {
59  return mpCurrentView;
60 }
61 
63 {
64  return mpCurrentView;
65 }
66 
68 {
69  mpCurrentView = pNew;
70 }
71 
72 // It must be able to communicate to a SwViewShell. This is going to be removed later.
74 {
76  return GetCurrentViewShell()->GetLayout();
77  return nullptr;
78 }
79 
81 {
83  return GetCurrentViewShell()->GetLayout();
84  return nullptr;
85 }
86 
88 {
89  // if there is a view, there is always a layout
90  return (mpCurrentView != nullptr);
91 }
92 
94 {
95  return mpLayouter.get();
96 }
97 
99 {
100  return mpLayouter.get();
101 }
102 
104 {
105  mpLayouter.reset( pNew );
106 }
107 
113 {
114  SwFrameFormat *pFormat = nullptr;
115  const bool bMod = m_rDoc.getIDocumentState().IsModified();
116  bool bHeader = false;
117 
118  switch ( eRequest )
119  {
120  case RndStdIds::HEADER:
121  case RndStdIds::HEADERL:
122  case RndStdIds::HEADERR:
123  {
124  bHeader = true;
125  [[fallthrough]];
126  }
127  case RndStdIds::FOOTER:
128  {
129  pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(),
130  (bHeader ? "Right header" : "Right footer"),
132 
134  SwStartNode* pSttNd =
136  ( aTmpIdx,
138  m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(static_cast<sal_uInt16>( bHeader
139  ? ( eRequest == RndStdIds::HEADERL
141  : eRequest == RndStdIds::HEADERR
145  ) ) );
146  pFormat->SetFormatAttr( SwFormatContent( pSttNd ));
147 
148  if( pSet ) // Set a few more attributes
149  pFormat->SetFormatAttr( *pSet );
150 
151  // Why set it back? Doc has changed, or not?
152  // In any case, wrong for the FlyFrames!
153  if ( !bMod )
155  }
156  break;
157 
158  case RndStdIds::DRAW_OBJECT:
159  {
160  pFormat = m_rDoc.MakeDrawFrameFormat( OUString(), m_rDoc.GetDfltFrameFormat() );
161  if( pSet ) // Set a few more attributes
162  pFormat->SetFormatAttr( *pSet );
163 
165  {
167  std::make_unique<SwUndoInsLayFormat>(pFormat, 0, 0));
168  }
169  }
170  break;
171 
172 #if OSL_DEBUG_LEVEL > 0
173  case RndStdIds::FLY_AT_PAGE:
174  case RndStdIds::FLY_AT_CHAR:
175  case RndStdIds::FLY_AT_FLY:
176  case RndStdIds::FLY_AT_PARA:
177  case RndStdIds::FLY_AS_CHAR:
178  OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" );
179  break;
180 #endif
181 
182  default:
183  OSL_ENSURE( false,
184  "LayoutFormat was requested with an invalid Request." );
185 
186  }
187  return pFormat;
188 }
189 
192 {
193  // A chain of frames needs to be merged, if necessary,
194  // so that the Frame's contents are adjusted accordingly before we destroy the Frames.
195  const SwFormatChain &rChain = pFormat->GetChain();
196  if ( rChain.GetPrev() )
197  {
198  SwFormatChain aChain( rChain.GetPrev()->GetChain() );
199  aChain.SetNext( rChain.GetNext() );
200  m_rDoc.SetAttr( aChain, *rChain.GetPrev() );
201  }
202  if ( rChain.GetNext() )
203  {
204  SwFormatChain aChain( rChain.GetNext()->GetChain() );
205  aChain.SetPrev( rChain.GetPrev() );
206  m_rDoc.SetAttr( aChain, *rChain.GetNext() );
207  }
208 
209  const SwNodeIndex* pCntIdx = nullptr;
210  // The draw format doesn't own its content, it just has a pointer to it.
211  if (pFormat->Which() != RES_DRAWFRMFMT)
212  pCntIdx = pFormat->GetContent().GetContentIdx();
213  if (pCntIdx && !m_rDoc.GetIDocumentUndoRedo().DoesUndo())
214  {
215  // Disconnect if it's an OLE object
216  SwOLENode* pOLENd = m_rDoc.GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
217  if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
218  {
219  try
220  {
221  pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
222  }
223  catch ( uno::Exception& )
224  {
225  }
226  }
227  }
228 
229  // Destroy Frames
230  pFormat->DelFrames();
231 
232  // Only FlyFrames are undoable at first
233  const sal_uInt16 nWh = pFormat->Which();
235  (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
236  {
237  m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDelLayFormat>( pFormat ));
238  }
239  else
240  {
241  // #i32089# - delete at-frame anchored objects
242  if ( nWh == RES_FLYFRMFMT )
243  {
244  // determine frame formats of at-frame anchored objects
245  const SwNodeIndex* pContentIdx = nullptr;
246  if (pFormat->Which() != RES_DRAWFRMFMT)
247  pContentIdx = pFormat->GetContent().GetContentIdx();
248  if (pContentIdx)
249  {
250  const SwFrameFormats* pTable = pFormat->GetDoc()->GetSpzFrameFormats();
251  if ( pTable )
252  {
253  std::vector<SwFrameFormat*> aToDeleteFrameFormats;
254  const sal_uLong nNodeIdxOfFlyFormat( pContentIdx->GetIndex() );
255 
256  for ( size_t i = 0; i < pTable->size(); ++i )
257  {
258  SwFrameFormat* pTmpFormat = (*pTable)[i];
259  const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor();
260  if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY &&
261  rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat )
262  {
263  aToDeleteFrameFormats.push_back( pTmpFormat );
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.GetContentAnchor())
290  {
291  const SwPosition* pPos = rAnchor.GetContentAnchor();
292  SwTextNode *pTextNd = pPos->nNode.GetNode().GetTextNode();
293 
294  // attribute is still in text node, delete it
295  if ( pTextNd )
296  {
297  SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>(
298  pTextNd->GetTextAttrForCharAt( pPos->nContent.GetIndex(),
300  if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) )
301  {
302  // don't delete, set pointer to 0
303  const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
304  SwIndex aIdx( pPos->nContent );
305  pTextNd->EraseText( aIdx, 1 );
306  }
307  }
308  }
309 
310  m_rDoc.DelFrameFormat( pFormat );
311  }
313 }
314 
322  const SwFrameFormat& rSource,
323  const SwFormatAnchor& rNewAnchor,
324  bool bSetTextFlyAtt,
325  bool bMakeFrames )
326 {
327  const bool bFly = RES_FLYFRMFMT == rSource.Which();
328  const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
329  OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
330 
331  SwDoc* pSrcDoc = const_cast<SwDoc*>(rSource.GetDoc());
332 
333  // May we copy this object?
334  // We may, unless it's 1) it's a control (and therefore a draw)
335  // 2) anchored in a header/footer
336  // 3) anchored (to paragraph?)
337  bool bMayNotCopy = false;
338  if(bDraw)
339  {
340  const auto pCAnchor = rNewAnchor.GetContentAnchor();
341  bool bCheckControlLayer = false;
342  rSource.CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer));
343  bMayNotCopy =
344  bCheckControlLayer &&
345  ((RndStdIds::FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == rNewAnchor.GetAnchorId())) &&
346  pCAnchor && m_rDoc.IsInHeaderFooter(pCAnchor->nNode);
347  }
348 
349  // just return if we can't copy this
350  if( bMayNotCopy )
351  return nullptr;
352 
354  if( rSource.GetRegisteredIn() != pSrcDoc->GetDfltFrameFormat() )
355  pDest = m_rDoc.CopyFrameFormat( *static_cast<const SwFrameFormat*>(rSource.GetRegisteredIn()) );
356  if( bFly )
357  {
358  // #i11176#
359  // To do a correct cloning concerning the ZOrder for all objects
360  // it is necessary to actually create a draw object for fly frames, too.
361  // These are then added to the DrawingLayer (which needs to exist).
362  // Together with correct sorting of all drawinglayer based objects
363  // before cloning ZOrder transfer works correctly then.
364  SwFlyFrameFormat *pFormat = m_rDoc.MakeFlyFrameFormat( rSource.GetName(), pDest );
365  pDest = pFormat;
366 
368  }
369  else
370  pDest = m_rDoc.MakeDrawFrameFormat( OUString(), pDest );
371 
372  // Copy all other or new attributes
373  pDest->CopyAttrs( rSource );
374 
375  // Do not copy chains
376  pDest->ResetFormatAttr( RES_CHAIN );
377 
378  if( bFly )
379  {
380  // Duplicate the content.
381  const SwNode& rCSttNd = rSource.GetContent().GetContentIdx()->GetNode();
382  SwNodeRange aRg( rCSttNd, 1, *rCSttNd.EndOfSectionNode() );
383 
386 
387  // Set the Anchor/ContentIndex first.
388  // Within the copying part, we can access the values (DrawFormat in Headers and Footers)
389  aIdx = *pSttNd;
390  SwFormatContent aAttr( rSource.GetContent() );
391  aAttr.SetNewContentIdx( &aIdx );
392  pDest->SetFormatAttr( aAttr );
393  pDest->SetFormatAttr( rNewAnchor );
394 
395  if( !m_rDoc.IsCopyIsMove() || &m_rDoc != pSrcDoc )
396  {
398  pDest->SetName( OUString() );
399  else
400  {
401  // Test first if the name is already taken, if so generate a new one.
402  SwNodeType nNdTyp = aRg.aStart.GetNode().GetNodeType();
403 
404  OUString sOld( pDest->GetName() );
405  pDest->SetName( OUString() );
406  if( m_rDoc.FindFlyByName( sOld, nNdTyp ) ) // found one
407  switch( nNdTyp )
408  {
409  case SwNodeType::Grf: sOld = m_rDoc.GetUniqueGrfName(); break;
410  case SwNodeType::Ole: sOld = m_rDoc.GetUniqueOLEName(); break;
411  default: sOld = m_rDoc.GetUniqueFrameName(); break;
412  }
413 
414  pDest->SetName( sOld );
415  }
416  }
417 
419  {
420  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
421  }
422 
423  // Make sure that FlyFrames in FlyFrames are copied
424  aIdx = *pSttNd->EndOfSectionNode();
425 
426  //fdo#36631 disable (scoped) any undo operations associated with the
427  //contact object itself. They should be managed by SwUndoInsLayFormat.
428  const ::sw::DrawUndoGuard drawUndoGuard(m_rDoc.GetIDocumentUndoRedo());
429 
430  pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aIdx, nullptr, false, true, true);
431  }
432  else
433  {
434  OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Neither Fly nor Draw." );
435  // #i52780# - Note: moving object to visible layer not needed.
436  rSource.CallSwClientNotify(sw::DrawFormatLayoutCopyHint(static_cast<SwDrawFrameFormat&>(*pDest), m_rDoc));
437 
438  if(pDest->GetAnchor() == rNewAnchor)
439  {
440  // Do *not* connect to layout, if a <MakeFrames> will not be called.
441  if(bMakeFrames)
443 
444  }
445  else
446  pDest->SetFormatAttr( rNewAnchor );
447 
449  {
450  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
451  }
452  }
453 
454  if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId()))
455  {
456  const SwPosition* pPos = rNewAnchor.GetContentAnchor();
457  SwFormatFlyCnt aFormat( pDest );
458  pPos->nNode.GetNode().GetTextNode()->InsertItem(
459  aFormat, pPos->nContent.GetIndex(), 0 );
460  }
461 
462  if( bMakeFrames )
463  pDest->MakeFrames();
464 
465  // If the draw format has a TextBox, then copy its fly format as well.
467  {
468  SwFormatAnchor boxAnchor(rNewAnchor);
469  if (RndStdIds::FLY_AS_CHAR == boxAnchor.GetAnchorId())
470  {
471  // AS_CHAR *must not* be set on textbox fly-frame
472  boxAnchor.SetType(RndStdIds::FLY_AT_CHAR);
473  }
474  // presumably these anchors are supported though not sure
475  assert(RndStdIds::FLY_AT_CHAR == boxAnchor.GetAnchorId() || RndStdIds::FLY_AT_PARA == boxAnchor.GetAnchorId()
476  || boxAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE);
477  SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox,
478  boxAnchor, bSetTextFlyAtt, bMakeFrames);
479  SwAttrSet aSet(pDest->GetAttrSet());
480  SwFormatContent aContent(pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
481  aSet.Put(aContent);
482  pDest->SetFormatAttr(aSet);
483 
484  // Link FLY and DRAW formats, so it becomes a text box
485  pDest->SetOtherTextBoxFormat(pDestTextBox);
486  pDestTextBox->SetOtherTextBoxFormat(pDest);
487  }
488 
489  if (pDest->GetName().isEmpty())
490  {
491  // Format name should have unique name. Let's use object name as a fallback
492  SdrObject *pObj = pDest->FindSdrObject();
493  if (pObj)
494  pDest->SetName(pObj->GetName());
495  }
496 
497  return pDest;
498 }
499 
500 //Load document from fdo#42534 under valgrind, drag the scrollbar down so full
501 //document layout is triggered. Close document before layout has completed, and
502 //SwAnchoredObject objects deleted by the deletion of layout remain referenced
503 //by the SwLayouter
505 {
508  // #i65250#
510 }
511 
513 {
514 }
515 
516 }
517 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
518 
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:690
Starts a section of nodes in the document model.
Definition: node.hxx:311
OUString GetUniqueGrfName() const
Definition: doclay.cxx:1366
bool IsInMailMerge() const
Definition: doc.hxx:957
virtual bool HasLayout() const override
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:156
OUString GetUniqueOLEName() const
Definition: doclay.cxx:1371
Marks a position in the document model.
Definition: pam.hxx:35
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
SwNodeIndex nNode
Definition: pam.hxx:37
Header Left.
Definition: poolfmt.hxx:331
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:913
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:382
Definition: doc.hxx:184
OUString GetUniqueFrameName() const
Definition: doclay.cxx:1376
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(57)
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1149
SwNode & GetNode() const
Definition: ndindex.hxx:119
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:749
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2063
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:315
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
virtual const SwRootFrame * GetCurrentLayout() const override
static SwFrameFormat * getOtherTextBoxFormat(const SwFrameFormat *pFormat, sal_uInt16 nType)
If we have an associated TextFrame, then return that.
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:739
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:589
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1550
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:740
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:3025
SwDoc & m_rDoc
Definition: docbm.cxx:1190
SwIndex nContent
Definition: pam.hxx:38
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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 SetOtherTextBoxFormat(SwFrameFormat *pFormat)
Definition: atrfrm.cxx:2516
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:450
const OUString & GetName() const
Definition: format.hxx:111
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:2493
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:1255
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).
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:1884
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:1391
Style of a layout element.
Definition: frmfmt.hxx:57
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:335
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:1358
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2670
Marks a character position inside a document model node.
Definition: index.hxx:33
Header Left&Right.
Definition: poolfmt.hxx:330
Header Right.
Definition: poolfmt.hxx:332
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:119
virtual void SetLayouter(SwLayouter *pNew) override
bool IsInReading() const
Definition: doc.hxx:951
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:742
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
bool IsOleRef() const
To avoid unnecessary loading of object.
Definition: ndole.cxx:908
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
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:2634
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:652
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:178
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:1368
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:476
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:2681
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:159
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:379
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(157)
Format of a fly content.
Definition: fmtflcnt.hxx:32
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:376
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:686
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2071
RndStdIds
size_t size() const
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2073
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:137
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1315
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:844
static void ClearMovedFwdFrames(const SwDoc &_rDoc)
Definition: layouter.cxx:302
virtual void ResetModified()=0
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:206
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1876
Base class of the Writer document model elements.
Definition: node.hxx:79