LibreOffice Module sw (master)  1
CntntIdxStore.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  */
19 
20 #include <bookmrk.hxx>
21 #include <cntfrm.hxx>
22 #include <doc.hxx>
25 #include <MarkManager.hxx>
26 #include <docary.hxx>
27 #include <editsh.hxx>
28 #include <fmtanchr.hxx>
29 #include <frmfmt.hxx>
30 #include <functional>
31 #include <mvsave.hxx>
32 #include <ndtxt.hxx>
33 #include <node.hxx>
34 #include <pam.hxx>
35 #include <redline.hxx>
36 #include <rtl/ustrbuf.hxx>
37 #include <rtl/ustring.hxx>
38 #include <sal/log.hxx>
39 #include <sal/types.h>
40 #include <unocrsr.hxx>
41 #include <edimp.hxx>
42 #include <txtfrm.hxx>
43 #include <memory>
44 
45 using namespace ::boost;
46 using namespace ::sw::mark;
47 
48 namespace
49 {
50  // #i59534: If a paragraph will be splitted we have to restore some redline positions
51  // This help function checks a position compared with a node and an content index
52 
53  static const int BEFORE_NODE = 0; // Position before the given node index
54  static const int BEFORE_SAME_NODE = 1; // Same node index but content index before given content index
55  static const int SAME_POSITION = 2; // Same node index and samecontent index
56  static const int BEHIND_SAME_NODE = 3; // Same node index but content index behind given content index
57  static const int BEHIND_NODE = 4; // Position behind the given node index
58 
59  int lcl_RelativePosition( const SwPosition& rPos, sal_uLong nNode, sal_Int32 nContent )
60  {
61  sal_uLong nIndex = rPos.nNode.GetIndex();
62  int nReturn = BEFORE_NODE;
63  if( nIndex == nNode )
64  {
65  const sal_Int32 nCntIdx = rPos.nContent.GetIndex();
66  if( nCntIdx < nContent )
67  nReturn = BEFORE_SAME_NODE;
68  else if( nCntIdx == nContent )
69  nReturn = SAME_POSITION;
70  else
71  nReturn = BEHIND_SAME_NODE;
72  }
73  else if( nIndex > nNode )
74  nReturn = BEHIND_NODE;
75  return nReturn;
76  }
77  struct MarkEntry
78  {
79  long int m_nIdx;
80  bool m_bOther;
81  sal_Int32 m_nContent;
82 #if 0
83  void Dump()
84  {
85  SAL_INFO("sw.core", "Index: " << m_nIdx << "\tOther: " << m_bOther << "\tContent: " << m_nContent);
86  }
87 #endif
88  };
89  struct PaMEntry
90  {
91  SwPaM* m_pPaM;
92  bool const m_isMark;
93  sal_Int32 const m_nContent;
94  };
95  struct OffsetUpdater
96  {
97  const SwContentNode* m_pNewContentNode;
98  const sal_Int32 m_nOffset;
99  OffsetUpdater(SwContentNode const * pNewContentNode, sal_Int32 nOffset)
100  : m_pNewContentNode(pNewContentNode), m_nOffset(nOffset) {};
101  void operator()(SwPosition& rPos, sal_Int32 nContent) const
102  {
103  rPos.nNode = *m_pNewContentNode;
104  rPos.nContent.Assign(const_cast<SwContentNode*>(m_pNewContentNode), nContent + m_nOffset);
105  };
106  };
107  struct LimitUpdater
108  {
109  const SwContentNode* m_pNewContentNode;
110  const sal_uLong m_nLen;
111  const sal_Int32 m_nCorrLen;
112  LimitUpdater(SwContentNode const * pNewContentNode, sal_uLong nLen, sal_Int32 nCorrLen)
113  : m_pNewContentNode(pNewContentNode), m_nLen(nLen), m_nCorrLen(nCorrLen) {};
114  void operator()(SwPosition& rPos, sal_Int32 nContent) const
115  {
116  rPos.nNode = *m_pNewContentNode;
117  if( nContent < m_nCorrLen )
118  {
119  rPos.nContent.Assign(const_cast<SwContentNode*>(m_pNewContentNode), std::min( nContent, static_cast<sal_Int32>(m_nLen) ) );
120  }
121  else
122  {
123  rPos.nContent -= m_nCorrLen;
124  }
125  };
126  };
127  struct ContentIdxStoreImpl : sw::mark::ContentIdxStore
128  {
129  std::vector<MarkEntry> m_aBkmkEntries;
130  std::vector<MarkEntry> m_aRedlineEntries;
131  std::vector<MarkEntry> m_aFlyEntries;
132  std::vector<PaMEntry> m_aUnoCursorEntries;
133  std::vector<PaMEntry> m_aShellCursorEntries;
134  typedef std::function<void (SwPosition& rPos, sal_Int32 nContent)> updater_t;
135  virtual void Clear() override
136  {
137  m_aBkmkEntries.clear();
138  m_aRedlineEntries.clear();
139  m_aFlyEntries.clear();
140  m_aUnoCursorEntries.clear();
141  m_aShellCursorEntries.clear();
142  }
143  virtual bool Empty() override
144  {
145  return m_aBkmkEntries.empty() && m_aRedlineEntries.empty() && m_aFlyEntries.empty() && m_aUnoCursorEntries.empty() && m_aShellCursorEntries.empty();
146  }
147  virtual void Save(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent, bool bSaveFlySplit=false) override
148  {
149  SaveBkmks(pDoc, nNode, nContent);
150  SaveRedlines(pDoc, nNode, nContent);
151  SaveFlys(pDoc, nNode, nContent, bSaveFlySplit);
152  SaveUnoCursors(pDoc, nNode, nContent);
153  SaveShellCursors(pDoc, nNode, nContent);
154  }
155  virtual void Restore(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nOffset=0, bool bAuto = false, RestoreMode eMode = RestoreMode::All) override
156  {
157  SwContentNode* pCNd = pDoc->GetNodes()[ nNode ]->GetContentNode();
158  updater_t aUpdater = OffsetUpdater(pCNd, nOffset);
159  if (eMode & RestoreMode::NonFlys)
160  {
161  RestoreBkmks(pDoc, aUpdater);
162  RestoreRedlines(pDoc, aUpdater);
163  RestoreUnoCursors(aUpdater);
164  RestoreShellCursors(aUpdater);
165  }
166  if (eMode & RestoreMode::Flys)
167  {
168  RestoreFlys(pDoc, aUpdater, bAuto);
169  }
170  }
171  virtual void Restore(SwNode& rNd, sal_Int32 nLen, sal_Int32 nCorrLen, RestoreMode eMode = RestoreMode::All) override
172  {
173  SwContentNode* pCNd = rNd.GetContentNode();
174  SwDoc* pDoc = rNd.GetDoc();
175  updater_t aUpdater = LimitUpdater(pCNd, nLen, nCorrLen);
176  if (eMode & RestoreMode::NonFlys)
177  {
178  RestoreBkmks(pDoc, aUpdater);
179  RestoreRedlines(pDoc, aUpdater);
180  RestoreUnoCursors(aUpdater);
181  RestoreShellCursors(aUpdater);
182  }
183  if (eMode & RestoreMode::Flys)
184  {
185  RestoreFlys(pDoc, aUpdater, false);
186  }
187  }
188 
189  private:
190  void SaveBkmks(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent);
191  void RestoreBkmks(SwDoc* pDoc, updater_t const & rUpdater);
192  void SaveRedlines(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent);
193  void RestoreRedlines(SwDoc* pDoc, updater_t const & rUpdater);
194  void SaveFlys(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent, bool bSaveFlySplit);
195  void RestoreFlys(SwDoc* pDoc, updater_t const & rUpdater, bool bAuto);
196  void SaveUnoCursors(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent);
197  void RestoreUnoCursors(updater_t const & rUpdater);
198  void SaveShellCursors(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent);
199  void RestoreShellCursors(updater_t const & rUpdater);
200  static const SwPosition& GetRightMarkPos(::sw::mark::IMark const * pMark, bool bOther)
201  { return bOther ? pMark->GetOtherMarkPos() : pMark->GetMarkPos(); };
202  static void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos)
203  { bOther ? pMark->SetOtherMarkPos(*pPos) : pMark->SetMarkPos(*pPos); };
204  };
205  void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, bool bSetMark)
206  {
207  const SwPosition* pPos = &rPaM.GetBound(bGetPoint);
208  if( pPos->nNode.GetIndex() == nNode && pPos->nContent.GetIndex() < nContent )
209  {
210  const PaMEntry aEntry = { &rPaM, bSetMark, pPos->nContent.GetIndex() };
211  rPaMEntries.push_back(aEntry);
212  }
213  }
214  void lcl_ChkPaMBoth( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
215  {
216  lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, true);
217  lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, false);
218  }
219  void lcl_ChkUnoCrsrPaMBoth(std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nContent, SwPaM& rPaM)
220  {
221  lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, true, false);
222  lcl_ChkPaM(rPaMEntries, nNode, nContent, rPaM, false, true);
223  }
224 
225 #if 0
226  static void DumpEntries(std::vector<MarkEntry>* pEntries)
227  {
228  for (MarkEntry& aEntry : *pEntries)
229  aEntry.Dump();
230  }
231 #endif
232 }
233 
234 void ContentIdxStoreImpl::SaveBkmks(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
235 {
236  IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
237  const IDocumentMarkAccess::const_iterator_t ppBkmkEnd = pMarkAccess->getAllMarksEnd();
238  for(
240  ppBkmk != ppBkmkEnd;
241  ++ppBkmk)
242  {
243  const ::sw::mark::IMark* pBkmk = *ppBkmk;
244  bool bMarkPosEqual = false;
245  if(pBkmk->GetMarkPos().nNode.GetIndex() == nNode
246  && pBkmk->GetMarkPos().nContent.GetIndex() <= nContent)
247  {
248  if(pBkmk->GetMarkPos().nContent.GetIndex() < nContent)
249  {
250  const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
251  m_aBkmkEntries.push_back(aEntry);
252  }
253  else // if a bookmark position is equal nContent, the other position
254  bMarkPosEqual = true; // has to decide if it is added to the array
255  }
256  if(pBkmk->IsExpanded()
257  && pBkmk->GetOtherMarkPos().nNode.GetIndex() == nNode
258  && pBkmk->GetOtherMarkPos().nContent.GetIndex() <= nContent)
259  {
260  if(bMarkPosEqual)
261  { // the other position is before, the (main) position is equal
262  const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() };
263  m_aBkmkEntries.push_back(aEntry);
264  }
265  const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().nContent.GetIndex() };
266  m_aBkmkEntries.push_back(aEntry);
267  }
268  }
269 }
270 
271 void ContentIdxStoreImpl::RestoreBkmks(SwDoc* pDoc, updater_t const & rUpdater)
272 {
273  IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
274  for (const MarkEntry& aEntry : m_aBkmkEntries)
275  {
276  if (MarkBase *const pMark = pMarkAccess->getAllMarksBegin().get()[aEntry.m_nIdx])
277  {
278  SwPosition aNewPos(GetRightMarkPos(pMark, aEntry.m_bOther));
279  rUpdater(aNewPos, aEntry.m_nContent);
280  SetRightMarkPos(pMark, aEntry.m_bOther, &aNewPos);
281  }
282  }
283  if (!m_aBkmkEntries.empty())
284  { // tdf#105705 sort bookmarks because SaveBkmks special handling of
285  // "bMarkPosEqual" may destroy sort order
286  dynamic_cast<sw::mark::MarkManager&>(*pMarkAccess).sortMarks();
287  }
288 }
289 
290 void ContentIdxStoreImpl::SaveRedlines(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
291 {
292  SwRedlineTable const & rRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
293  long int nIdx = 0;
294  for (const SwRangeRedline* pRdl : rRedlineTable)
295  {
296  int nPointPos = lcl_RelativePosition( *pRdl->GetPoint(), nNode, nContent );
297  int nMarkPos = pRdl->HasMark() ? lcl_RelativePosition( *pRdl->GetMark(), nNode, nContent ) :
298  nPointPos;
299  // #i59534: We have to store the positions inside the same node before the insert position
300  // and the one at the insert position if the corresponding Point/Mark position is before
301  // the insert position.
302  if( nPointPos == BEFORE_SAME_NODE ||
303  ( nPointPos == SAME_POSITION && nMarkPos < SAME_POSITION ) )
304  {
305  const MarkEntry aEntry = { nIdx, false, pRdl->GetPoint()->nContent.GetIndex() };
306  m_aRedlineEntries.push_back(aEntry);
307  }
308  if( pRdl->HasMark() && ( nMarkPos == BEFORE_SAME_NODE ||
309  ( nMarkPos == SAME_POSITION && nPointPos < SAME_POSITION ) ) )
310  {
311  const MarkEntry aEntry = { nIdx, true, pRdl->GetMark()->nContent.GetIndex() };
312  m_aRedlineEntries.push_back(aEntry);
313  }
314  ++nIdx;
315  }
316 }
317 
318 void ContentIdxStoreImpl::RestoreRedlines(SwDoc* pDoc, updater_t const & rUpdater)
319 {
320  const SwRedlineTable& rRedlTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable();
321  for (const MarkEntry& aEntry : m_aRedlineEntries)
322  {
323  SwPosition* const pPos = aEntry.m_bOther
324  ? rRedlTable[ aEntry.m_nIdx ]->GetMark()
325  : rRedlTable[ aEntry.m_nIdx ]->GetPoint();
326  rUpdater(*pPos, aEntry.m_nContent);
327  }
328 }
329 
330 void ContentIdxStoreImpl::SaveFlys(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent, bool bSaveFlySplit)
331 {
332  SwContentNode *pNode = pDoc->GetNodes()[nNode]->GetContentNode();
333  if( !pNode )
334  return;
335  SwFrame* pFrame = pNode->getLayoutFrame( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
336  if( pFrame )
337  {
338  // sw_redlinehide: this looks like an invalid optimisation if merged,
339  // assuming that flys in deleted redlines should be saved here too.
340  if ((!pFrame->IsTextFrame() || !static_cast<SwTextFrame const*>(pFrame)->GetMergedPara())
341  && !pFrame->GetDrawObjs())
342  return; // if we have a layout and no DrawObjs, we can skip this
343  }
344  MarkEntry aSave = { 0, false, 0 };
345  for (const SwFrameFormat* pFrameFormat : *pDoc->GetSpzFrameFormats())
346  {
347  if ( RES_FLYFRMFMT == pFrameFormat->Which() || RES_DRAWFRMFMT == pFrameFormat->Which() )
348  {
349  const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
350  SwPosition const*const pAPos = rAnchor.GetContentAnchor();
351  if ( pAPos && ( nNode == pAPos->nNode.GetIndex() ) &&
352  ( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() ||
353  RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) )
354  {
355  bool bSkip = false;
356  aSave.m_bOther = false;
357  aSave.m_nContent = pAPos->nContent.GetIndex();
358  if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() )
359  {
360  if( nContent <= aSave.m_nContent )
361  {
362  if( bSaveFlySplit )
363  aSave.m_bOther = true;
364  else
365  bSkip = true;
366  }
367  }
368  if(!bSkip)
369  m_aFlyEntries.push_back(aSave);
370  }
371  }
372  ++aSave.m_nIdx;
373  }
374 }
375 
376 void ContentIdxStoreImpl::RestoreFlys(SwDoc* pDoc, updater_t const & rUpdater, bool bAuto)
377 {
378  SwFrameFormats* pSpz = pDoc->GetSpzFrameFormats();
379  for (const MarkEntry& aEntry : m_aFlyEntries)
380  {
381  if(!aEntry.m_bOther)
382  {
383  SwFrameFormat *pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
384  const SwFormatAnchor& rFlyAnchor = pFrameFormat->GetAnchor();
385  if( rFlyAnchor.GetContentAnchor() )
386  {
387  SwFormatAnchor aNew( rFlyAnchor );
388  SwPosition aNewPos( *rFlyAnchor.GetContentAnchor() );
389  rUpdater(aNewPos, aEntry.m_nContent);
390  if ( RndStdIds::FLY_AT_CHAR != rFlyAnchor.GetAnchorId() )
391  {
392  aNewPos.nContent.Assign( nullptr, 0 );
393  }
394  aNew.SetAnchor( &aNewPos );
395  pFrameFormat->SetFormatAttr( aNew );
396  }
397  }
398  else if( bAuto )
399  {
400  SwFrameFormat *pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
401  SfxPoolItem const *pAnchor = static_cast<SfxPoolItem const *>(&pFrameFormat->GetAnchor());
402  pFrameFormat->NotifyClients( pAnchor, pAnchor );
403  }
404  }
405 }
406 
407 void ContentIdxStoreImpl::SaveUnoCursors(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
408 {
409  pDoc->cleanupUnoCursorTable();
410  for (const auto& pWeakUnoCursor : pDoc->mvUnoCursorTable)
411  {
412  auto pUnoCursor(pWeakUnoCursor.lock());
413  if(!pUnoCursor)
414  continue;
415  for(SwPaM& rPaM : pUnoCursor.get()->GetRingContainer())
416  {
417  lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
418  }
419  const SwUnoTableCursor* pUnoTableCursor = dynamic_cast<const SwUnoTableCursor*>(pUnoCursor.get());
420  if( pUnoTableCursor )
421  {
422  for(SwPaM& rPaM : const_cast<SwUnoTableCursor*>(pUnoTableCursor)->GetSelRing().GetRingContainer())
423  {
424  lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
425  }
426  }
427  }
428 }
429 
430 void ContentIdxStoreImpl::RestoreUnoCursors(updater_t const & rUpdater)
431 {
432  for (const PaMEntry& aEntry : m_aUnoCursorEntries)
433  {
434  rUpdater(aEntry.m_pPaM->GetBound(!aEntry.m_isMark), aEntry.m_nContent);
435  }
436 }
437 
438 void ContentIdxStoreImpl::SaveShellCursors(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
439 {
440  SwCursorShell* pShell = pDoc->GetEditShell();
441  if( !pShell )
442  return;
443  for(SwViewShell& rCurShell : pShell->GetRingContainer())
444  {
445  if( dynamic_cast<const SwCursorShell *>(&rCurShell) != nullptr )
446  {
447  SwPaM *_pStackCursor = static_cast<SwCursorShell*>(&rCurShell)->GetStackCursor();
448  if( _pStackCursor )
449  do {
450  lcl_ChkPaMBoth( m_aShellCursorEntries, nNode, nContent, *_pStackCursor);
451  } while ( (_pStackCursor != nullptr ) &&
452  ((_pStackCursor = _pStackCursor->GetNext()) != static_cast<SwCursorShell*>(&rCurShell)->GetStackCursor()) );
453 
454  for(SwPaM& rPaM : static_cast<SwCursorShell*>(&rCurShell)->GetCursor_()->GetRingContainer())
455  {
456  lcl_ChkPaMBoth( m_aShellCursorEntries, nNode, nContent, rPaM);
457  }
458  }
459  }
460 }
461 
462 void ContentIdxStoreImpl::RestoreShellCursors(updater_t const & rUpdater)
463 {
464  for (const PaMEntry& aEntry : m_aShellCursorEntries)
465  {
466  rUpdater(aEntry.m_pPaM->GetBound(aEntry.m_isMark), aEntry.m_nContent);
467  }
468 }
469 
470 namespace sw { namespace mark {
471  std::shared_ptr<ContentIdxStore> ContentIdxStore::Create()
472  {
473  return std::make_shared<ContentIdxStoreImpl>();
474  }
475 }}
476 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:295
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
virtual void Restore(SwDoc *pDoc, sal_uLong nNode, sal_Int32 nOffset=0, bool bAuto=false, RestoreMode=RestoreMode::All)=0
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:543
Marks a position in the document model.
Definition: pam.hxx:35
virtual const SwRootFrame * GetCurrentLayout() const =0
SwNodeIndex nNode
Definition: pam.hxx:37
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
sal_uIntPtr sal_uLong
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1150
Provides access to the marks of a document.
Definition: doc.hxx:185
virtual const SwPosition & GetMarkPos() const =0
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:245
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1552
Dialog to specify the properties of date form field.
Definition: accfrmobj.cxx:40
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
virtual void Clear()=0
virtual void Save(SwDoc *pDoc, sal_uLong nNode, sal_Int32 nContent, bool bSaveFlySplit=false)=0
void cleanupUnoCursorTable() const
Definition: doc.hxx:1628
SwIndex nContent
Definition: pam.hxx:38
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
bool IsTextFrame() const
Definition: frame.hxx:1210
SwPaM * GetNext()
Definition: pam.hxx:264
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:201
virtual bool Empty()=0
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
Style of a layout element.
Definition: frmfmt.hxx:57
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:323
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
Definition: doc.hxx:1625
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
Takes care of storing relevant attributes of an SwTextNode before split, then restore them on the new...
Definition: mvsave.hxx:73
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
SwDoc * GetDoc()
Definition: node.hxx:702
ring_container GetRingContainer()
Definition: ring.hxx:240
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
RestoreMode
Definition: mvsave.hxx:70
void NotifyClients(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:167
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
static std::shared_ptr< ContentIdxStore > Create()
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
Definition: index.hxx:95
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual const SwRedlineTable & GetRedlineTable() const =0
std::vector<::sw::mark::MarkBase * >::const_iterator const & get() const
Definition: docbm.cxx:62
virtual const SwPosition & GetOtherMarkPos() const =0
Base class of the Writer document model elements.
Definition: node.hxx:79