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 <com/sun/star/embed/EmbedStates.hpp>
43 
44 using namespace ::com::sun::star;
45 
46 namespace sw
47 {
48 
50  m_rDoc( i_rSwdoc ),
51  mpCurrentView( nullptr )
52 {
53 }
54 
56 {
57  return mpCurrentView;
58 }
59 
61 {
62  return mpCurrentView;
63 }
64 
66 {
67  mpCurrentView = pNew;
68 }
69 
70 // It must be able to communicate to a SwViewShell. This is going to be removed later.
72 {
74  return GetCurrentViewShell()->GetLayout();
75  return nullptr;
76 }
77 
79 {
81  return GetCurrentViewShell()->GetLayout();
82  return nullptr;
83 }
84 
86 {
87  // if there is a view, there is always a layout
88  return (mpCurrentView != nullptr);
89 }
90 
92 {
93  return mpLayouter.get();
94 }
95 
97 {
98  return mpLayouter.get();
99 }
100 
102 {
103  mpLayouter.reset( pNew );
104 }
105 
111 {
112  SwFrameFormat *pFormat = nullptr;
113  const bool bMod = m_rDoc.getIDocumentState().IsModified();
114  bool bHeader = false;
115 
116  switch ( eRequest )
117  {
118  case RndStdIds::HEADER:
119  case RndStdIds::HEADERL:
120  case RndStdIds::HEADERR:
121  {
122  bHeader = true;
123  [[fallthrough]];
124  }
125  case RndStdIds::FOOTER:
126  {
127  pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(),
128  (bHeader ? "Right header" : "Right footer"),
130 
132  SwStartNode* pSttNd =
134  ( aTmpIdx,
136  m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(static_cast<sal_uInt16>( bHeader
137  ? ( eRequest == RndStdIds::HEADERL
139  : eRequest == RndStdIds::HEADERR
143  ) ) );
144  pFormat->SetFormatAttr( SwFormatContent( pSttNd ));
145 
146  if( pSet ) // Set a few more attributes
147  pFormat->SetFormatAttr( *pSet );
148 
149  // Why set it back? Doc has changed, or not?
150  // In any case, wrong for the FlyFrames!
151  if ( !bMod )
153  }
154  break;
155 
156  case RndStdIds::DRAW_OBJECT:
157  {
158  pFormat = m_rDoc.MakeDrawFrameFormat( OUString(), m_rDoc.GetDfltFrameFormat() );
159  if( pSet ) // Set a few more attributes
160  pFormat->SetFormatAttr( *pSet );
161 
163  {
165  std::make_unique<SwUndoInsLayFormat>(pFormat, 0, 0));
166  }
167  }
168  break;
169 
170 #if OSL_DEBUG_LEVEL > 0
171  case RndStdIds::FLY_AT_PAGE:
172  case RndStdIds::FLY_AT_CHAR:
173  case RndStdIds::FLY_AT_FLY:
174  case RndStdIds::FLY_AT_PARA:
175  case RndStdIds::FLY_AS_CHAR:
176  OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" );
177  break;
178 #endif
179 
180  default:
181  OSL_ENSURE( false,
182  "LayoutFormat was requested with an invalid Request." );
183 
184  }
185  return pFormat;
186 }
187 
190 {
191  // A chain of frames needs to be merged, if necessary,
192  // so that the Frame's contents are adjusted accordingly before we destroy the Frames.
193  const SwFormatChain &rChain = pFormat->GetChain();
194  if ( rChain.GetPrev() )
195  {
196  SwFormatChain aChain( rChain.GetPrev()->GetChain() );
197  aChain.SetNext( rChain.GetNext() );
198  m_rDoc.SetAttr( aChain, *rChain.GetPrev() );
199  }
200  if ( rChain.GetNext() )
201  {
202  SwFormatChain aChain( rChain.GetNext()->GetChain() );
203  aChain.SetPrev( rChain.GetPrev() );
204  m_rDoc.SetAttr( aChain, *rChain.GetNext() );
205  }
206 
207  const SwNodeIndex* pCntIdx = nullptr;
208  // The draw format doesn't own its content, it just has a pointer to it.
209  if (pFormat->Which() != RES_DRAWFRMFMT)
210  pCntIdx = pFormat->GetContent().GetContentIdx();
211  if (pCntIdx && !m_rDoc.GetIDocumentUndoRedo().DoesUndo())
212  {
213  // Disconnect if it's an OLE object
214  SwOLENode* pOLENd = m_rDoc.GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
215  if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
216  {
217  try
218  {
219  pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
220  }
221  catch ( uno::Exception& )
222  {
223  }
224  }
225  }
226 
227  // Destroy Frames
228  pFormat->DelFrames();
229 
230  // Only FlyFrames are undoable at first
231  const sal_uInt16 nWh = pFormat->Which();
233  (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
234  {
235  m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDelLayFormat>( pFormat ));
236  }
237  else
238  {
239  // #i32089# - delete at-frame anchored objects
240  if ( nWh == RES_FLYFRMFMT )
241  {
242  // determine frame formats of at-frame anchored objects
243  const SwNodeIndex* pContentIdx = nullptr;
244  if (pFormat->Which() != RES_DRAWFRMFMT)
245  pContentIdx = pFormat->GetContent().GetContentIdx();
246  if (pContentIdx)
247  {
248  const SwFrameFormats* pTable = pFormat->GetDoc()->GetSpzFrameFormats();
249  if ( pTable )
250  {
251  std::vector<SwFrameFormat*> aToDeleteFrameFormats;
252  const sal_uLong nNodeIdxOfFlyFormat( pContentIdx->GetIndex() );
253 
254  for ( size_t i = 0; i < pTable->size(); ++i )
255  {
256  SwFrameFormat* pTmpFormat = (*pTable)[i];
257  const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor();
258  if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY &&
259  rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat )
260  {
261  aToDeleteFrameFormats.push_back( pTmpFormat );
262  }
263  }
264 
265  // delete found frame formats
266  while ( !aToDeleteFrameFormats.empty() )
267  {
268  SwFrameFormat* pTmpFormat = aToDeleteFrameFormats.back();
269  pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pTmpFormat );
270 
271  aToDeleteFrameFormats.pop_back();
272  }
273  }
274  }
275  }
276 
277  // Delete content
278  if( pCntIdx )
279  {
280  SwNode *pNode = &pCntIdx->GetNode();
281  const_cast<SwFormatContent&>(pFormat->GetFormatAttr( RES_CNTNT )).SetNewContentIdx( nullptr );
283  }
284 
285  // Delete the character for FlyFrames anchored as char (if necessary)
286  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
287  if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor())
288  {
289  const SwPosition* pPos = rAnchor.GetContentAnchor();
290  SwTextNode *pTextNd = pPos->nNode.GetNode().GetTextNode();
291 
292  // attribute is still in text node, delete it
293  if ( pTextNd )
294  {
295  SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>(
296  pTextNd->GetTextAttrForCharAt( pPos->nContent.GetIndex(),
298  if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) )
299  {
300  // don't delete, set pointer to 0
301  const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
302  SwIndex aIdx( pPos->nContent );
303  pTextNd->EraseText( aIdx, 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  if(bDraw)
337  {
338  const auto pCAnchor = rNewAnchor.GetContentAnchor();
339  bool bCheckControlLayer = false;
340  rSource.CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer));
341  bMayNotCopy =
342  bCheckControlLayer &&
343  ((RndStdIds::FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == rNewAnchor.GetAnchorId())) &&
344  pCAnchor && m_rDoc.IsInHeaderFooter(pCAnchor->nNode);
345  }
346 
347  // just return if we can't copy this
348  if( bMayNotCopy )
349  return nullptr;
350 
352  if( rSource.GetRegisteredIn() != pSrcDoc->GetDfltFrameFormat() )
353  pDest = m_rDoc.CopyFrameFormat( *static_cast<const SwFrameFormat*>(rSource.GetRegisteredIn()) );
354  if( bFly )
355  {
356  // #i11176#
357  // To do a correct cloning concerning the ZOrder for all objects
358  // it is necessary to actually create a draw object for fly frames, too.
359  // These are then added to the DrawingLayer (which needs to exist).
360  // Together with correct sorting of all drawinglayer based objects
361  // before cloning ZOrder transfer works correctly then.
362  SwFlyFrameFormat *pFormat = m_rDoc.MakeFlyFrameFormat( rSource.GetName(), pDest );
363  pDest = pFormat;
364 
366  }
367  else
368  pDest = m_rDoc.MakeDrawFrameFormat( OUString(), pDest );
369 
370  // Copy all other or new attributes
371  pDest->CopyAttrs( rSource );
372 
373  // Do not copy chains
374  pDest->ResetFormatAttr( RES_CHAIN );
375 
376  if( bFly )
377  {
378  // Duplicate the content.
379  const SwNode& rCSttNd = rSource.GetContent().GetContentIdx()->GetNode();
380  SwNodeRange aRg( rCSttNd, 1, *rCSttNd.EndOfSectionNode() );
381 
384 
385  // Set the Anchor/ContentIndex first.
386  // Within the copying part, we can access the values (DrawFormat in Headers and Footers)
387  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  {
396  pDest->SetName( 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->SetName( OUString() );
404  if( m_rDoc.FindFlyByName( sOld, nNdTyp ) ) // found one
405  switch( nNdTyp )
406  {
407  case SwNodeType::Grf: sOld = m_rDoc.GetUniqueGrfName(); break;
408  case SwNodeType::Ole: sOld = m_rDoc.GetUniqueOLEName(); break;
409  default: sOld = m_rDoc.GetUniqueFrameName(); break;
410  }
411 
412  pDest->SetName( sOld );
413  }
414  }
415 
417  {
418  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,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, 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 
447  {
448  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
449  }
450  }
451 
452  if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId()))
453  {
454  const SwPosition* pPos = rNewAnchor.GetContentAnchor();
455  SwFormatFlyCnt aFormat( pDest );
456  pPos->nNode.GetNode().GetTextNode()->InsertItem(
457  aFormat, pPos->nContent.GetIndex(), 0 );
458  }
459 
460  if( bMakeFrames )
461  pDest->MakeFrames();
462 
463  // If the draw format has a TextBox, then copy its fly format as well.
465  {
466  SwFormatAnchor boxAnchor(rNewAnchor);
467  if (RndStdIds::FLY_AS_CHAR == boxAnchor.GetAnchorId())
468  {
469  // AS_CHAR *must not* be set on textbox fly-frame
470  boxAnchor.SetType(RndStdIds::FLY_AT_CHAR);
471  }
472  // presumably these anchors are supported though not sure
473  assert(RndStdIds::FLY_AT_CHAR == boxAnchor.GetAnchorId() || RndStdIds::FLY_AT_PARA == boxAnchor.GetAnchorId());
474  SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox,
475  boxAnchor, bSetTextFlyAtt, bMakeFrames);
476  SwAttrSet aSet(pDest->GetAttrSet());
477  SwFormatContent aContent(pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
478  aSet.Put(aContent);
479  pDest->SetFormatAttr(aSet);
480 
481  // Link FLY and DRAW formats, so it becomes a text box
482  pDest->SetOtherTextBoxFormat(pDestTextBox);
483  pDestTextBox->SetOtherTextBoxFormat(pDest);
484  }
485 
486  return pDest;
487 }
488 
489 //Load document from fdo#42534 under valgrind, drag the scrollbar down so full
490 //document layout is triggered. Close document before layout has completed, and
491 //SwAnchoredObject objects deleted by the deletion of layout remain referenced
492 //by the SwLayouter
494 {
497  // #i65250#
499 }
500 
502 {
503 }
504 
505 }
506 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
507 
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
OUString GetUniqueGrfName() const
Definition: doclay.cxx:1364
bool IsInMailMerge() const
Definition: doc.hxx:953
virtual bool HasLayout() const override
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:157
OUString GetUniqueOLEName() const
Definition: doclay.cxx:1369
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: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:913
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:382
Definition: doc.hxx:185
OUString GetUniqueFrameName() const
Definition: doclay.cxx:1374
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1141
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:143
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:741
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2026
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:314
#define RES_CNTNT
Definition: hintids.hxx:202
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
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:737
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:557
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1542
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:732
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:3056
#define RES_CHAIN
Definition: hintids.hxx:221
SwIndex nContent
Definition: pam.hxx:38
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
virtual ~DocumentLayoutManager() override
virtual void DelLayoutFormat(SwFrameFormat *pFormat) override
Deletes the denoted format and its content.
void SetOtherTextBoxFormat(SwFrameFormat *pFormat)
Definition: atrfrm.cxx:2480
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:448
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:2457
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:1221
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).
Definition: docary.hxx:201
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:1898
#define RES_FLYFRMFMT
Definition: hintids.hxx:276
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:1384
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
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:324
int i
FlyAnchors.
Definition: fmtanchr.hxx:34
static SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1366
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2634
Marks a character position inside a document model node.
Definition: index.hxx:37
Header Left&Right.
Definition: poolfmt.hxx:331
Header Right.
Definition: poolfmt.hxx:333
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:393
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:950
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:740
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
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:2665
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:650
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
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) const
note: rRg/rInsPos exclude a partially selected start text node; pCopiedPaM includes a partially selec...
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:178
#define RES_DRAWFRMFMT
Definition: hintids.hxx:279
bool IsCopyIsMove() const
Definition: doc.hxx:1362
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:476
sal_Int32 GetIndex() const
Definition: index.hxx:95
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:2645
SwNodes & GetNodes()
Definition: doc.hxx:402
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:152
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:376
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:683
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2034
RndStdIds
size_t size() const
Definition: docary.hxx:225
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:2075
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
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:1890
Base class of the Writer document model elements.
Definition: node.hxx:79