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