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 <dcontact.hxx>
38 #include <unoframe.hxx>
39 #include <docary.hxx>
40 #include <textboxhelper.hxx>
41 #include <ndindex.hxx>
42 #include <pam.hxx>
43 #include <com/sun/star/embed/EmbedStates.hpp>
44 
45 using namespace ::com::sun::star;
46 
47 namespace sw
48 {
49 
51  m_rDoc( i_rSwdoc ),
52  mpCurrentView( nullptr )
53 {
54 }
55 
57 {
58  return mpCurrentView;
59 }
60 
62 {
63  return mpCurrentView;
64 }
65 
67 {
68  mpCurrentView = pNew;
69 }
70 
71 // It must be able to communicate to a SwViewShell. This is going to be removed later.
73 {
75  return GetCurrentViewShell()->GetLayout();
76  return nullptr;
77 }
78 
80 {
82  return GetCurrentViewShell()->GetLayout();
83  return nullptr;
84 }
85 
87 {
88  // if there is a view, there is always a layout
89  return (mpCurrentView != nullptr);
90 }
91 
93 {
94  return mpLayouter.get();
95 }
96 
98 {
99  return mpLayouter.get();
100 }
101 
103 {
104  mpLayouter.reset( pNew );
105 }
106 
112 {
113  SwFrameFormat *pFormat = nullptr;
114  const bool bMod = m_rDoc.getIDocumentState().IsModified();
115  bool bHeader = false;
116 
117  switch ( eRequest )
118  {
119  case RndStdIds::HEADER:
120  case RndStdIds::HEADERL:
121  case RndStdIds::HEADERR:
122  {
123  bHeader = true;
124  [[fallthrough]];
125  }
126  case RndStdIds::FOOTER:
127  {
128  pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(),
129  (bHeader ? "Right header" : "Right footer"),
131 
133  SwStartNode* pSttNd =
135  ( aTmpIdx,
137  m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(static_cast<sal_uInt16>( bHeader
138  ? ( eRequest == RndStdIds::HEADERL
140  : eRequest == RndStdIds::HEADERR
144  ) ) );
145  pFormat->SetFormatAttr( SwFormatContent( pSttNd ));
146 
147  if( pSet ) // Set a few more attributes
148  pFormat->SetFormatAttr( *pSet );
149 
150  // Why set it back? Doc has changed, or not?
151  // In any case, wrong for the FlyFrames!
152  if ( !bMod )
154  }
155  break;
156 
157  case RndStdIds::DRAW_OBJECT:
158  {
159  pFormat = m_rDoc.MakeDrawFrameFormat( OUString(), m_rDoc.GetDfltFrameFormat() );
160  if( pSet ) // Set a few more attributes
161  pFormat->SetFormatAttr( *pSet );
162 
164  {
166  std::make_unique<SwUndoInsLayFormat>(pFormat, 0, 0));
167  }
168  }
169  break;
170 
171 #if OSL_DEBUG_LEVEL > 0
172  case RndStdIds::FLY_AT_PAGE:
173  case RndStdIds::FLY_AT_CHAR:
174  case RndStdIds::FLY_AT_FLY:
175  case RndStdIds::FLY_AT_PARA:
176  case RndStdIds::FLY_AS_CHAR:
177  OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" );
178  break;
179 #endif
180 
181  default:
182  OSL_ENSURE( false,
183  "LayoutFormat was requested with an invalid Request." );
184 
185  }
186  return pFormat;
187 }
188 
191 {
192  // A chain of frames needs to be merged, if necessary,
193  // so that the Frame's contents are adjusted accordingly before we destroy the Frames.
194  const SwFormatChain &rChain = pFormat->GetChain();
195  if ( rChain.GetPrev() )
196  {
197  SwFormatChain aChain( rChain.GetPrev()->GetChain() );
198  aChain.SetNext( rChain.GetNext() );
199  m_rDoc.SetAttr( aChain, *rChain.GetPrev() );
200  }
201  if ( rChain.GetNext() )
202  {
203  SwFormatChain aChain( rChain.GetNext()->GetChain() );
204  aChain.SetPrev( rChain.GetPrev() );
205  m_rDoc.SetAttr( aChain, *rChain.GetNext() );
206  }
207 
208  const SwNodeIndex* pCntIdx = nullptr;
209  // The draw format doesn't own its content, it just has a pointer to it.
210  if (pFormat->Which() != RES_DRAWFRMFMT)
211  pCntIdx = pFormat->GetContent().GetContentIdx();
212  if (pCntIdx && !m_rDoc.GetIDocumentUndoRedo().DoesUndo())
213  {
214  // Disconnect if it's an OLE object
215  SwOLENode* pOLENd = m_rDoc.GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
216  if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
217  {
218  try
219  {
220  pOLENd->GetOLEObj().GetOleRef()->changeState( embed::EmbedStates::LOADED );
221  }
222  catch ( uno::Exception& )
223  {
224  }
225  }
226  }
227 
228  // Destroy Frames
229  pFormat->DelFrames();
230 
231  // Only FlyFrames are undoable at first
232  const sal_uInt16 nWh = pFormat->Which();
234  (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
235  {
236  m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDelLayFormat>( pFormat ));
237  }
238  else
239  {
240  // #i32089# - delete at-frame anchored objects
241  if ( nWh == RES_FLYFRMFMT )
242  {
243  // determine frame formats of at-frame anchored objects
244  const SwNodeIndex* pContentIdx = nullptr;
245  if (pFormat->Which() != RES_DRAWFRMFMT)
246  pContentIdx = pFormat->GetContent().GetContentIdx();
247  if (pContentIdx)
248  {
249  const SwFrameFormats* pTable = pFormat->GetDoc()->GetSpzFrameFormats();
250  if ( pTable )
251  {
252  std::vector<SwFrameFormat*> aToDeleteFrameFormats;
253  const sal_uLong nNodeIdxOfFlyFormat( pContentIdx->GetIndex() );
254 
255  for ( size_t i = 0; i < pTable->size(); ++i )
256  {
257  SwFrameFormat* pTmpFormat = (*pTable)[i];
258  const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor();
259  if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY &&
260  rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat )
261  {
262  aToDeleteFrameFormats.push_back( pTmpFormat );
263  }
264  }
265 
266  // delete found frame formats
267  while ( !aToDeleteFrameFormats.empty() )
268  {
269  SwFrameFormat* pTmpFormat = aToDeleteFrameFormats.back();
270  pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat( pTmpFormat );
271 
272  aToDeleteFrameFormats.pop_back();
273  }
274  }
275  }
276  }
277 
278  // Delete content
279  if( pCntIdx )
280  {
281  SwNode *pNode = &pCntIdx->GetNode();
282  const_cast<SwFormatContent&>(pFormat->GetFormatAttr( RES_CNTNT )).SetNewContentIdx( nullptr );
284  }
285 
286  // Delete the character for FlyFrames anchored as char (if necessary)
287  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
288  if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor())
289  {
290  const SwPosition* pPos = rAnchor.GetContentAnchor();
291  SwTextNode *pTextNd = pPos->nNode.GetNode().GetTextNode();
292 
293  // attribute is still in text node, delete it
294  if ( pTextNd )
295  {
296  SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>(
297  pTextNd->GetTextAttrForCharAt( pPos->nContent.GetIndex(),
299  if ( pAttr && (pAttr->GetFlyCnt().GetFrameFormat() == pFormat) )
300  {
301  // don't delete, set pointer to 0
302  const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
303  SwIndex aIdx( pPos->nContent );
304  pTextNd->EraseText( aIdx, 1 );
305  }
306  }
307  }
308 
309  m_rDoc.DelFrameFormat( pFormat );
310  }
312 }
313 
321  const SwFrameFormat& rSource,
322  const SwFormatAnchor& rNewAnchor,
323  bool bSetTextFlyAtt,
324  bool bMakeFrames )
325 {
326  const bool bFly = RES_FLYFRMFMT == rSource.Which();
327  const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
328  OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
329 
330  SwDoc* pSrcDoc = const_cast<SwDoc*>(rSource.GetDoc());
331 
332  // May we copy this object?
333  // We may, unless it's 1) it's a control (and therefore a draw)
334  // 2) anchored in a header/footer
335  // 3) anchored (to paragraph?)
336  bool bMayNotCopy = false;
337  if(bDraw)
338  {
339  const auto pCAnchor = rNewAnchor.GetContentAnchor();
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  pCAnchor && m_rDoc.IsInHeaderFooter(pCAnchor->nNode);
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 
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, 1, *rCSttNd.EndOfSectionNode() );
382 
385 
386  // Set the Anchor/ContentIndex first.
387  // Within the copying part, we can access the values (DrawFormat in Headers and Footers)
388  aIdx = *pSttNd;
389  SwFormatContent aAttr( rSource.GetContent() );
390  aAttr.SetNewContentIdx( &aIdx );
391  pDest->SetFormatAttr( aAttr );
392  pDest->SetFormatAttr( rNewAnchor );
393 
394  if( !m_rDoc.IsCopyIsMove() || &m_rDoc != pSrcDoc )
395  {
397  pDest->SetName( OUString() );
398  else
399  {
400  // Test first if the name is already taken, if so generate a new one.
401  SwNodeType nNdTyp = aRg.aStart.GetNode().GetNodeType();
402 
403  OUString sOld( pDest->GetName() );
404  pDest->SetName( OUString() );
405  if( m_rDoc.FindFlyByName( sOld, nNdTyp ) ) // found one
406  switch( nNdTyp )
407  {
408  case SwNodeType::Grf: sOld = m_rDoc.GetUniqueGrfName(); break;
409  case SwNodeType::Ole: sOld = m_rDoc.GetUniqueOLEName(); break;
410  default: sOld = m_rDoc.GetUniqueFrameName(); break;
411  }
412 
413  pDest->SetName( sOld );
414  }
415  }
416 
418  {
419  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
420  }
421 
422  // Make sure that FlyFrames in FlyFrames are copied
423  aIdx = *pSttNd->EndOfSectionNode();
424 
425  //fdo#36631 disable (scoped) any undo operations associated with the
426  //contact object itself. They should be managed by SwUndoInsLayFormat.
427  const ::sw::DrawUndoGuard drawUndoGuard(m_rDoc.GetIDocumentUndoRedo());
428 
429  pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly( aRg, 0, aIdx, nullptr, false, true, true );
430  }
431  else
432  {
433  OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Neither Fly nor Draw." );
434  // #i52780# - Note: moving object to visible layer not needed.
435  rSource.CallSwClientNotify(sw::DrawFormatLayoutCopyHint(static_cast<SwDrawFrameFormat&>(*pDest), m_rDoc));
436 
437  if(pDest->GetAnchor() == rNewAnchor)
438  {
439  // Do *not* connect to layout, if a <MakeFrames> will not be called.
440  if(bMakeFrames)
442 
443  }
444  else
445  pDest->SetFormatAttr( rNewAnchor );
446 
448  {
449  m_rDoc.GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoInsLayFormat>(pDest,0,0));
450  }
451  }
452 
453  if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId()))
454  {
455  const SwPosition* pPos = rNewAnchor.GetContentAnchor();
456  SwFormatFlyCnt aFormat( pDest );
457  pPos->nNode.GetNode().GetTextNode()->InsertItem(
458  aFormat, pPos->nContent.GetIndex(), 0 );
459  }
460 
461  if( bMakeFrames )
462  pDest->MakeFrames();
463 
464  // If the draw format has a TextBox, then copy its fly format as well.
466  {
467  SwFormatAnchor boxAnchor(rNewAnchor);
468  if (RndStdIds::FLY_AS_CHAR == boxAnchor.GetAnchorId())
469  {
470  // AS_CHAR *must not* be set on textbox fly-frame
471  boxAnchor.SetType(RndStdIds::FLY_AT_CHAR);
472  }
473  // presumably these anchors are supported though not sure
474  assert(RndStdIds::FLY_AT_CHAR == boxAnchor.GetAnchorId() || RndStdIds::FLY_AT_PARA == boxAnchor.GetAnchorId());
475  SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox,
476  boxAnchor, bSetTextFlyAtt, bMakeFrames);
477  SwAttrSet aSet(pDest->GetAttrSet());
478  SwFormatContent aContent(pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
479  aSet.Put(aContent);
480  pDest->SetFormatAttr(aSet);
481 
482  // Link FLY and DRAW formats, so it becomes a text box
483  pDest->SetOtherTextBoxFormat(pDestTextBox);
484  pDestTextBox->SetOtherTextBoxFormat(pDest);
485  }
486 
487  return pDest;
488 }
489 
490 //Load document from fdo#42534 under valgrind, drag the scrollbar down so full
491 //document layout is triggered. Close document before layout has completed, and
492 //SwAnchoredObject objects deleted by the deletion of layout remain referenced
493 //by the SwLayouter
495 {
498  // #i65250#
500 }
501 
503 {
504 }
505 
506 }
507 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
508 
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:1377
bool IsInMailMerge() const
Definition: doc.hxx:951
virtual bool HasLayout() const override
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:157
OUString GetUniqueOLEName() const
Definition: doclay.cxx:1382
Marks a position in the document model.
Definition: pam.hxx:35
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:110
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:900
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:382
Definition: doc.hxx:185
OUString GetUniqueFrameName() const
Definition: doclay.cxx:1387
SwFrameFormat * CopyFrameFormat(const SwFrameFormat &)
copy the frame format
Definition: docfmt.cxx:1173
SwNode & GetNode() const
Definition: ndindex.hxx:118
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
Dialog to specify the properties of drop-down form field.
Definition: accframe.hxx:34
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
SwDrawFrameFormat * MakeDrawFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Definition: docfmt.cxx:773
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2033
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
#define RES_CNTNT
Definition: hintids.hxx:200
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:738
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:557
bool IsInHeaderFooter(const SwNodeIndex &rIdx) const
Definition: doclay.cxx:1555
SwFlyFrameFormat * MakeFlyFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
Create the formats.
Definition: docfmt.cxx:764
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:3060
#define RES_CHAIN
Definition: hintids.hxx:219
SwIndex nContent
Definition: pam.hxx:38
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
virtual ~DocumentLayoutManager() override
virtual void DelLayoutFormat(SwFrameFormat *pFormat) override
Deletes the denoted format and its content.
void SetOtherTextBoxFormat(SwFrameFormat *pFormat)
Definition: atrfrm.cxx:2487
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:478
const OUString & GetName() const
Definition: format.hxx:111
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2464
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:1219
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:200
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:1900
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
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:1397
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:357
int i
FlyAnchors.
Definition: fmtanchr.hxx:34
static SW_DLLPUBLIC SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1370
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
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:426
void CopyWithFlyInFly(const SwNodeRange &rRg, const sal_Int32 nEndContentIndex, const SwNodeIndex &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false) const
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:948
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:741
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
bool IsOleRef() const
To avoid unnecessary loading of object.
Definition: ndole.cxx:895
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:2669
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:652
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:180
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
bool IsCopyIsMove() const
Definition: doc.hxx:1360
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:2628
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: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:379
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:151
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:715
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2041
RndStdIds
size_t size() const
Definition: docary.hxx:224
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:2072
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
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:200
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1892
Base class of the Writer document model elements.
Definition: node.hxx:79