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