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 <bookmark.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
40using namespace ::boost;
41using namespace ::sw::mark;
42
43namespace
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 const int BEFORE_NODE = 0; // Position before the given node index
49 const int BEFORE_SAME_NODE = 1; // Same node index but content index before given content index
50 const int SAME_POSITION = 2; // Same node index and samecontent index
51 const int BEHIND_SAME_NODE = 3; // Same node index but content index behind given content index
52 const int BEHIND_NODE = 4; // Position behind the given node index
53
54 int lcl_RelativePosition( const SwPosition& rPos, SwNodeOffset nNode, sal_Int32 nContent )
55 {
57 int nReturn = BEFORE_NODE;
58 if( nIndex == nNode )
59 {
60 const sal_Int32 nCntIdx = rPos.GetContentIndex();
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 tools::Long 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.Assign(*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 if( nContent < m_nCorrLen )
112 {
113 nContent = std::min( nContent, static_cast<sal_Int32>(m_nLen) );
114 }
115 else
116 {
117 nContent -= m_nCorrLen;
118 }
119 rPos.Assign( *m_pNewContentNode, nContent );
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& rDoc, SwNodeOffset nNode, sal_Int32 nContent, bool bSaveFlySplit=false) override
143 {
144 SaveBkmks(rDoc, nNode, nContent);
145 SaveRedlines(rDoc, nNode, nContent);
146 SaveFlys(rDoc, nNode, nContent, bSaveFlySplit);
147 SaveUnoCursors(rDoc, nNode, nContent);
148 SaveShellCursors(rDoc, nNode, nContent);
149 }
150 virtual void Restore(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nOffset=0, bool bAuto = false, bool bAtStart = false, RestoreMode eMode = RestoreMode::All) override
151 {
152 SwContentNode* pCNd = rDoc.GetNodes()[ nNode ]->GetContentNode();
153 updater_t aUpdater = OffsetUpdater(pCNd, nOffset);
154 if (eMode & RestoreMode::NonFlys)
155 {
156 RestoreBkmks(rDoc, aUpdater);
157 RestoreRedlines(rDoc, aUpdater);
158 RestoreUnoCursors(aUpdater);
159 RestoreShellCursors(aUpdater);
160 }
161 if (eMode & RestoreMode::Flys)
162 {
163 RestoreFlys(rDoc, aUpdater, bAuto, bAtStart);
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& rDoc = rNd.GetDoc();
170 updater_t aUpdater = LimitUpdater(pCNd, nLen, nCorrLen);
171 if (eMode & RestoreMode::NonFlys)
172 {
173 RestoreBkmks(rDoc, aUpdater);
174 RestoreRedlines(rDoc, aUpdater);
175 RestoreUnoCursors(aUpdater);
176 RestoreShellCursors(aUpdater);
177 }
178 if (eMode & RestoreMode::Flys)
179 {
180 RestoreFlys(rDoc, aUpdater, false, false);
181 }
182 }
183
184 private:
185 void SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent);
186 void RestoreBkmks(SwDoc& rDoc, updater_t const & rUpdater);
187 void SaveRedlines(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent);
188 void RestoreRedlines(SwDoc& rDoc, updater_t const & rUpdater);
189 void SaveFlys(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent, bool bSaveFlySplit);
190 void RestoreFlys(SwDoc& rDoc, updater_t const & rUpdater, bool bAuto, bool bAtStart);
191 void SaveUnoCursors(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent);
192 void RestoreUnoCursors(updater_t const & rUpdater);
193 void SaveShellCursors(SwDoc& rDoc, SwNodeOffset 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 SwNodeOffset nNode, const sal_Int32 nContent, SwPaM& rPaM, const bool bGetPoint, bool bSetMark)
201 {
202 const SwPosition* pPos = &rPaM.GetBound(bGetPoint);
203 if( pPos->GetNodeIndex() == nNode && pPos->GetContentIndex() < nContent )
204 {
205 const PaMEntry aEntry = { &rPaM, bSetMark, pPos->GetContentIndex() };
206 rPaMEntries.push_back(aEntry);
207 }
208 }
209 void lcl_ChkPaMBoth( std::vector<PaMEntry>& rPaMEntries, const SwNodeOffset 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 SwNodeOffset 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
229void ContentIdxStoreImpl::SaveBkmks(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent)
230{
231 IDocumentMarkAccess* const pMarkAccess = rDoc.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().GetNodeIndex() == nNode
241 && pBkmk->GetMarkPos().GetContentIndex() <= nContent)
242 {
243 if(pBkmk->GetMarkPos().GetContentIndex() < nContent)
244 {
245 const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().GetContentIndex() };
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().GetNodeIndex() == nNode
253 && pBkmk->GetOtherMarkPos().GetContentIndex() <= nContent)
254 {
255 if(bMarkPosEqual)
256 { // the other position is before, the (main) position is equal
257 const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().GetContentIndex() };
258 m_aBkmkEntries.push_back(aEntry);
259 }
260 const MarkEntry aEntry = { static_cast<tools::Long>(ppBkmk - pMarkAccess->getAllMarksBegin()), true, pBkmk->GetOtherMarkPos().GetContentIndex() };
261 m_aBkmkEntries.push_back(aEntry);
262 }
263 }
264}
265
266void ContentIdxStoreImpl::RestoreBkmks(SwDoc& rDoc, updater_t const & rUpdater)
267{
268 IDocumentMarkAccess* const pMarkAccess = rDoc.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
285void ContentIdxStoreImpl::SaveRedlines(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent)
286{
287 SwRedlineTable const & rRedlineTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable();
288 tools::Long 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()->GetContentIndex() };
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()->GetContentIndex() };
307 m_aRedlineEntries.push_back(aEntry);
308 }
309 ++nIdx;
310 }
311}
312
313void ContentIdxStoreImpl::RestoreRedlines(SwDoc& rDoc, updater_t const & rUpdater)
314{
315 const SwRedlineTable& rRedlTable = rDoc.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
325void ContentIdxStoreImpl::SaveFlys(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent, bool bSaveFlySplit)
326{
327 SwContentNode *pNode = rDoc.GetNodes()[nNode]->GetContentNode();
328 if( !pNode )
329 return;
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 : *rDoc.GetSpzFrameFormats())
341 {
342 if ( RES_FLYFRMFMT == pFrameFormat->Which() || RES_DRAWFRMFMT == pFrameFormat->Which() )
343 {
344 const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
345 SwNode const*const pAnchorNode = rAnchor.GetAnchorNode();
346 if ( pAnchorNode && ( nNode == pAnchorNode->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 = rAnchor.GetAnchorContentOffset();
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
371void ContentIdxStoreImpl::RestoreFlys(SwDoc& rDoc, updater_t const & rUpdater, bool bAuto, bool bAtStart)
372{
374 for (const MarkEntry& aEntry : m_aFlyEntries)
375 {
376 if(!aEntry.m_bOther)
377 {
378 sw::SpzFrameFormat* pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
379 const SwFormatAnchor& rFlyAnchor = pFrameFormat->GetAnchor();
380 if( rFlyAnchor.GetContentAnchor() )
381 {
382 if(bAtStart && RndStdIds::FLY_AT_PARA == rFlyAnchor.GetAnchorId())
383 continue;
384 SwFormatAnchor aNew( rFlyAnchor );
385 SwPosition aNewPos( *rFlyAnchor.GetContentAnchor() );
386 rUpdater(aNewPos, aEntry.m_nContent);
387 if ( RndStdIds::FLY_AT_CHAR != rFlyAnchor.GetAnchorId() )
388 {
389 aNewPos.nContent.Assign( nullptr, 0 );
390 }
391 aNew.SetAnchor( &aNewPos );
392 pFrameFormat->SetFormatAttr( aNew );
393 }
394 }
395 else if( bAuto )
396 {
397 SwFrameFormat* pFrameFormat = (*pSpz)[ aEntry.m_nIdx ];
398 const SfxPoolItem* pAnchor = &pFrameFormat->GetAnchor();
399 pFrameFormat->CallSwClientNotify(sw::LegacyModifyHint(pAnchor, pAnchor));
400 }
401 }
402}
403
404void ContentIdxStoreImpl::SaveUnoCursors(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent)
405{
407 for (const auto& pWeakUnoCursor : rDoc.mvUnoCursorTable)
408 {
409 auto pUnoCursor(pWeakUnoCursor.lock());
410 if(!pUnoCursor)
411 continue;
412 for(SwPaM& rPaM : pUnoCursor->GetRingContainer())
413 {
414 lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
415 }
416 const SwUnoTableCursor* pUnoTableCursor = dynamic_cast<const SwUnoTableCursor*>(pUnoCursor.get());
417 if( pUnoTableCursor )
418 {
419 for(SwPaM& rPaM : const_cast<SwUnoTableCursor*>(pUnoTableCursor)->GetSelRing().GetRingContainer())
420 {
421 lcl_ChkUnoCrsrPaMBoth(m_aUnoCursorEntries, nNode, nContent, rPaM);
422 }
423 }
424 }
425}
426
427void ContentIdxStoreImpl::RestoreUnoCursors(updater_t const & rUpdater)
428{
429 for (const PaMEntry& aEntry : m_aUnoCursorEntries)
430 {
431 rUpdater(aEntry.m_pPaM->GetBound(!aEntry.m_isMark), aEntry.m_nContent);
432 }
433}
434
435void ContentIdxStoreImpl::SaveShellCursors(SwDoc& rDoc, SwNodeOffset nNode, sal_Int32 nContent)
436{
437 SwCursorShell* pShell = rDoc.GetEditShell();
438 if (!pShell)
439 return;
440 for(SwViewShell& rCurShell : pShell->GetRingContainer())
441 {
442 if( auto pCursorShell = dynamic_cast<SwCursorShell *>(&rCurShell) )
443 {
444 SwPaM *_pStackCursor = pCursorShell->GetStackCursor();
445 if( _pStackCursor )
446 for (;;)
447 {
448 lcl_ChkPaMBoth( m_aShellCursorEntries, nNode, nContent, *_pStackCursor);
449 if (!_pStackCursor)
450 break;
451 _pStackCursor = _pStackCursor->GetNext();
452 if (_pStackCursor == pCursorShell->GetStackCursor())
453 break;
454 }
455
456 for(SwPaM& rPaM : pCursorShell->GetCursor_()->GetRingContainer())
457 {
458 lcl_ChkPaMBoth( m_aShellCursorEntries, nNode, nContent, rPaM);
459 }
460 }
461 }
462}
463
464void ContentIdxStoreImpl::RestoreShellCursors(updater_t const & rUpdater)
465{
466 for (const PaMEntry& aEntry : m_aShellCursorEntries)
467 {
468 rUpdater(aEntry.m_pPaM->GetBound(aEntry.m_isMark), aEntry.m_nContent);
469 }
470}
471
472namespace sw::mark {
473 std::shared_ptr<ContentIdxStore> ContentIdxStore::Create()
474 {
475 return std::make_shared<ContentIdxStoreImpl>();
476 }
477}
478/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual const SwRootFrame * GetCurrentLayout() const =0
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
std::vector<::sw::mark::MarkBase * >::const_iterator const & get() const
Definition: docbm.cxx:58
Provides access to the marks of a document.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual void assureSortedMarkContainers() const =0
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
virtual const SwRedlineTable & GetRedlineTable() const =0
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1223
Definition: doc.hxx:197
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
Definition: doc.hxx:1670
void cleanupUnoCursorTable() const
Definition: doc.hxx:1673
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:330
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1890
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
Definition: doc.hxx:759
FlyAnchors.
Definition: fmtanchr.hxx:37
sal_Int32 GetAnchorContentOffset() const
Definition: atrfrm.cxx:1631
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:74
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsTextFrame() const
Definition: frame.hxx:1240
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:568
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwDoc & GetDoc()
Definition: node.hxx:233
SwContentNode * GetContentNode()
Definition: node.hxx:666
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
SwPaM * GetNext()
Definition: pam.hxx:314
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:293
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:465
SwCursor & GetSelRing()
Definition: unocrsr.hxx:101
ring_container GetRingContainer()
Definition: ring.hxx:240
Takes care of storing relevant attributes of an SwTextNode before split, then restore them on the new...
Definition: mvsave.hxx:77
virtual void Save(SwDoc &rDoc, SwNodeOffset nNode, sal_Int32 nContent, bool bSaveFlySplit=false)=0
static std::shared_ptr< ContentIdxStore > Create()
virtual void Restore(SwDoc &rDoc, SwNodeOffset nNode, sal_Int32 nOffset=0, bool bAuto=false, bool bAtStart=false, RestoreMode=RestoreMode::All)=0
virtual void Clear()=0
virtual bool Empty()=0
virtual const SwPosition & GetOtherMarkPos() const =0
virtual const SwPosition & GetMarkPos() const =0
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
sal_Int32 nIndex
#define SAL_INFO(area, stream)
RestoreMode
Definition: mvsave.hxx:73
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
sal_uIntPtr sal_uLong
Marks a position in the document model.
Definition: pam.hxx:38
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:231
SwNodeOffset GetNodeIndex() const
Definition: pam.hxx:78
sal_Int32 GetContentIndex() const
Definition: pam.hxx:85