LibreOffice Module sw (master)  1
rolbck.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 <rolbck.hxx>
21 #include <svl/itemiter.hxx>
23 #include <hints.hxx>
24 #include <hintids.hxx>
25 #include <fmtftn.hxx>
26 #include <fchrfmt.hxx>
27 #include <fmtflcnt.hxx>
28 #include <fmtrfmrk.hxx>
29 #include <fmtfld.hxx>
30 #include <fmtpdsc.hxx>
31 #include <txtfld.hxx>
32 #include <txtrfmrk.hxx>
33 #include <txttxmrk.hxx>
34 #include <txtftn.hxx>
35 #include <txtflcnt.hxx>
36 #include <fmtanchr.hxx>
37 #include <fmtcnct.hxx>
38 #include <frmfmt.hxx>
39 #include <ftnidx.hxx>
40 #include <doc.hxx>
41 #include <IDocumentUndoRedo.hxx>
44 #include <docary.hxx>
45 #include <ndtxt.hxx>
46 #include <paratr.hxx>
47 #include <cellatr.hxx>
48 #include <fldbas.hxx>
49 #include <pam.hxx>
50 #include <swtable.hxx>
51 #include <ndgrf.hxx>
52 #include <UndoCore.hxx>
53 #include <IMark.hxx>
54 #include <charfmt.hxx>
55 #include <strings.hrc>
56 #include <bookmrk.hxx>
57 #include <memory>
58 
60 {
61  return OUString();
62 }
63 
66  , m_pAttr( pFormatHt->Clone() )
67  , m_nNodeIndex( nNd )
68 {
69  switch ( m_pAttr->Which() )
70  {
71  case RES_PAGEDESC:
72  static_cast<SwFormatPageDesc&>(*m_pAttr).ChgDefinedIn( nullptr );
73  break;
74  case RES_PARATR_DROP:
75  static_cast<SwFormatDrop&>(*m_pAttr).ChgDefinedIn( nullptr );
76  break;
77  case RES_BOXATR_FORMULA:
78  {
79  // save formulas always in plain text
80  SwTableBoxFormula& rNew = static_cast<SwTableBoxFormula&>(*m_pAttr);
81  if ( rNew.IsIntrnlName() )
82  {
83  const SwTableBoxFormula& rOld =
84  *static_cast<const SwTableBoxFormula*>(pFormatHt);
85  const SwNode* pNd = rOld.GetNodeOfFormula();
86  if ( pNd )
87  {
88  const SwTableNode* pTableNode = pNd->FindTableNode();
89  if (pTableNode)
90  {
91  SwTableFormulaUpdate aMsgHint( &pTableNode->GetTable() );
92  aMsgHint.m_eFlags = TBL_BOXNAME;
93  rNew.ChgDefinedIn( rOld.GetDefinedIn() );
94  rNew.ChangeState( &aMsgHint );
95  }
96  }
97  }
98  rNew.ChgDefinedIn( nullptr );
99  }
100  break;
101  }
102 }
103 
105 {
106  OUString aResult;
107 
108  switch (m_pAttr->Which())
109  {
110  case RES_BREAK:
111  switch (static_cast<SvxFormatBreakItem &>(*m_pAttr).GetBreak())
112  {
113  case SvxBreak::PageBefore:
114  case SvxBreak::PageAfter:
115  case SvxBreak::PageBoth:
116  aResult = SwResId(STR_UNDO_PAGEBREAKS);
117 
118  break;
119  case SvxBreak::ColumnBefore:
120  case SvxBreak::ColumnAfter:
121  case SvxBreak::ColumnBoth:
122  aResult = SwResId(STR_UNDO_COLBRKS);
123 
124  break;
125  default:
126  break;
127  }
128  break;
129  default:
130  break;
131  }
132 
133  return aResult;
134 }
135 
136 void SwHistorySetFormat::SetInDoc( SwDoc* pDoc, bool bTmpSet )
137 {
138  SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
139  if ( pNode->IsContentNode() )
140  {
141  static_cast<SwContentNode*>(pNode)->SetAttr( *m_pAttr );
142  }
143  else if ( pNode->IsTableNode() )
144  {
145  static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat()->SetFormatAttr(
146  *m_pAttr );
147  }
148  else if ( pNode->IsStartNode() && (SwTableBoxStartNode ==
149  static_cast<SwStartNode*>(pNode)->GetStartNodeType()) )
150  {
151  SwTableNode* pTNd = pNode->FindTableNode();
152  if ( pTNd )
153  {
154  SwTableBox* pBox = pTNd->GetTable().GetTableBox( m_nNodeIndex );
155  if (pBox)
156  {
158  }
159  }
160  }
161 
162  if ( !bTmpSet )
163  {
164  m_pAttr.reset();
165  }
166 }
167 
169 {
170 }
171 
174  , m_nNodeIndex( nNodeIdx )
175  , m_nWhich( pFormatHt->Which() )
176 {
177 }
178 
180 {
181  SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
182  if ( pNode->IsContentNode() )
183  {
184  static_cast<SwContentNode*>(pNode)->ResetAttr( m_nWhich );
185  }
186  else if ( pNode->IsTableNode() )
187  {
188  static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat()->
189  ResetFormatAttr( m_nWhich );
190  }
191 }
192 
195  , m_nNodeIndex( nNodePos )
196  , m_nStart( pTextHt->GetStart() )
197  , m_nEnd( pTextHt->GetAnyEnd() )
198  , m_bFormatIgnoreStart(pTextHt->IsFormatIgnoreStart())
199  , m_bFormatIgnoreEnd (pTextHt->IsFormatIgnoreEnd ())
200 {
201  // Caution: the following attributes generate no format attributes:
202  // - NoLineBreak, NoHyphen, Inserted, Deleted
203  // These cases must be handled separately !!!
204 
205  // a little bit complicated but works: first assign a copy of the
206  // default value and afterwards the values from text attribute
207  if ( RES_TXTATR_CHARFMT == pTextHt->Which() )
208  {
209  m_pAttr.reset( new SwFormatCharFormat( pTextHt->GetCharFormat().GetCharFormat() ) );
210  }
211  else
212  {
213  m_pAttr.reset( pTextHt->GetAttr().Clone() );
214  }
215 }
216 
218 {
219 }
220 
222 {
223  if (!m_pAttr)
224  return;
225 
226  if ( RES_TXTATR_CHARFMT == m_pAttr->Which() )
227  {
228  // ask the Doc if the CharFormat still exists
229  if (!pDoc->GetCharFormats()->IsAlive(static_cast<SwFormatCharFormat&>(*m_pAttr).GetCharFormat()))
230  return; // do not set, format does not exist
231  }
232 
233  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
234  OSL_ENSURE( pTextNd, "SwHistorySetText::SetInDoc: not a TextNode" );
235 
236  if ( pTextNd )
237  {
238  SwTextAttr *const pAttr = pTextNd->InsertItem(*m_pAttr, m_nStart, m_nEnd,
241  // shouldn't be possible to hit any error/merging path from here
242  assert(pAttr);
244  {
245  pAttr->SetFormatIgnoreStart(true);
246  }
247  if (m_bFormatIgnoreEnd)
248  {
249  pAttr->SetFormatIgnoreEnd(true);
250  }
251  }
252 }
253 
256  , m_pField( new SwFormatField( *pTextField->GetFormatField().GetField() ) )
257 {
258  // only copy if not Sys-FieldType
259  SwDoc* pDoc = pTextField->GetTextNode().GetDoc();
260 
261  m_nFieldWhich = m_pField->GetField()->GetTyp()->Which();
267  {
268  m_pFieldType = m_pField->GetField()->GetTyp()->Copy();
269  m_pField->GetField()->ChgTyp( m_pFieldType.get() ); // change field type
270  }
271  m_nNodeIndex = nNodePos;
272  m_nPos = pTextField->GetStart();
273 }
274 
276 {
277  return m_pField->GetField()->GetDescription();
278 }
279 
281 {
282 }
283 
285 {
286  if (!m_pField)
287  return;
288 
289  SwFieldType* pNewFieldType = m_pFieldType.get();
290  if ( !pNewFieldType )
291  {
292  pNewFieldType = pDoc->getIDocumentFieldsAccess().GetSysFieldType( m_nFieldWhich );
293  }
294  else
295  {
296  // register type with the document
297  pNewFieldType = pDoc->getIDocumentFieldsAccess().InsertFieldType( *m_pFieldType );
298  }
299 
300  m_pField->GetField()->ChgTyp( pNewFieldType ); // change field type
301 
302  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
303  OSL_ENSURE( pTextNd, "SwHistorySetTextField: no TextNode" );
304 
305  if ( pTextNd )
306  {
307  pTextNd->InsertItem( *m_pField, m_nPos, m_nPos,
309  }
310 }
311 
314  , m_RefName( pTextHt->GetRefMark().GetRefName() )
315  , m_nNodeIndex( nNodePos )
316  , m_nStart( pTextHt->GetStart() )
317  , m_nEnd( pTextHt->GetAnyEnd() )
318 {
319 }
320 
322 {
323  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
324  OSL_ENSURE( pTextNd, "SwHistorySetRefMark: no TextNode" );
325  if ( !pTextNd )
326  return;
327 
328  SwFormatRefMark aRefMark( m_RefName );
329 
330  // if a reference mark without an end already exists here: must not insert!
331  if ( m_nStart != m_nEnd ||
333  {
334  pTextNd->InsertItem( aRefMark, m_nStart, m_nEnd,
336  }
337 }
338 
341  , m_TOXMark( pTextHt->GetTOXMark() )
342  , m_TOXName( m_TOXMark.GetTOXType()->GetTypeName() )
343  , m_eTOXTypes( m_TOXMark.GetTOXType()->GetType() )
344  , m_nNodeIndex( nNodePos )
345  , m_nStart( pTextHt->GetStart() )
346  , m_nEnd( pTextHt->GetAnyEnd() )
347 {
349 }
350 
352 {
353  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
354  OSL_ENSURE( pTextNd, "SwHistorySetTOXMark: no TextNode" );
355  if ( !pTextNd )
356  return;
357 
358  // search for respective TOX type
359  const sal_uInt16 nCnt = pDoc->GetTOXTypeCount( m_eTOXTypes );
360  SwTOXType* pToxType = nullptr;
361  for ( sal_uInt16 n = 0; n < nCnt; ++n )
362  {
363  pToxType = const_cast<SwTOXType*>(pDoc->GetTOXType( m_eTOXTypes, n ));
364  if ( pToxType->GetTypeName() == m_TOXName )
365  break;
366  pToxType = nullptr;
367  }
368 
369  if ( !pToxType ) // TOX type not found, create new
370  {
371  pToxType = const_cast<SwTOXType*>(
373  }
374 
375  SwTOXMark aNew( m_TOXMark );
376  aNew.RegisterToTOXType( *pToxType );
377 
378  pTextNd->InsertItem( aNew, m_nStart, m_nEnd,
380 }
381 
382 bool SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const
383 {
384  return m_TOXName == rCmp.GetTOXType()->GetTypeName() &&
385  m_eTOXTypes == rCmp.GetTOXType()->GetType() &&
387  ( (TOX_INDEX == m_eTOXTypes)
388  ? ( m_TOXMark.GetPrimaryKey() == rCmp.GetPrimaryKey() &&
390  : m_TOXMark.GetLevel() == rCmp.GetLevel()
391  );
392 }
393 
395  sal_Int32 nAttrStart, sal_Int32 nAttrEnd, sal_uLong nNodePos )
397  , m_nNodeIndex( nNodePos ), m_nStart( nAttrStart ), m_nEnd( nAttrEnd )
398  , m_nAttr( nWhich )
399 {
400 }
401 
403 {
404  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
405  OSL_ENSURE( pTextNd, "SwHistoryResetText: no TextNode" );
406  if ( pTextNd )
407  {
408  pTextNd->DeleteAttributes( m_nAttr, m_nStart, m_nEnd );
409  }
410 }
411 
414  , m_pUndo( new SwUndoSaveSection )
415  , m_FootnoteNumber( pTextFootnote->GetFootnote().GetNumStr() )
416  , m_nNodeIndex( nNodePos )
417  , m_nStart( pTextFootnote->GetStart() )
418  , m_bEndNote( pTextFootnote->GetFootnote().IsEndNote() )
419 {
420  OSL_ENSURE( pTextFootnote->GetStartNode(),
421  "SwHistorySetFootnote: Footnote without Section" );
422 
423  // keep the old NodePos (because who knows what later will be saved/deleted
424  // in SaveSection)
425  SwDoc* pDoc = const_cast<SwDoc*>(pTextFootnote->GetTextNode().GetDoc());
426  SwNode* pSaveNd = pDoc->GetNodes()[ m_nNodeIndex ];
427 
428  // keep pointer to StartNode of FootnoteSection and reset its attribute for now
429  // (as a result, its/all Frames will be deleted automatically)
430  SwNodeIndex aSttIdx( *pTextFootnote->GetStartNode() );
431  pTextFootnote->SetStartNode( nullptr, false );
432 
433  m_pUndo->SaveSection( aSttIdx );
434  m_nNodeIndex = pSaveNd->GetIndex();
435 }
436 
439  , m_FootnoteNumber( rTextFootnote.GetFootnote().GetNumStr() )
440  , m_nNodeIndex( SwTextFootnote_GetIndex( (&rTextFootnote) ) )
441  , m_nStart( rTextFootnote.GetStart() )
442  , m_bEndNote( rTextFootnote.GetFootnote().IsEndNote() )
443 {
444  OSL_ENSURE( rTextFootnote.GetStartNode(),
445  "SwHistorySetFootnote: Footnote without Section" );
446 }
447 
449 {
450  return SwResId(STR_FOOTNOTE);
451 }
452 
454 {
455 }
456 
458 {
459  SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode();
460  OSL_ENSURE( pTextNd, "SwHistorySetFootnote: no TextNode" );
461  if ( !pTextNd )
462  return;
463 
464  if (m_pUndo)
465  {
466  // set the footnote in the TextNode
467  SwFormatFootnote aTemp( m_bEndNote );
468  SwFormatFootnote& rNew = const_cast<SwFormatFootnote&>(
469  pDoc->GetAttrPool().Put(aTemp) );
470  if ( !m_FootnoteNumber.isEmpty() )
471  {
472  rNew.SetNumStr( m_FootnoteNumber );
473  }
474  SwTextFootnote* pTextFootnote = new SwTextFootnote( rNew, m_nStart );
475 
476  // create the section of the Footnote
477  SwNodeIndex aIdx( *pTextNd );
478  m_pUndo->RestoreSection( pDoc, &aIdx, SwFootnoteStartNode );
479  pTextFootnote->SetStartNode( &aIdx );
480  if ( m_pUndo->GetHistory() )
481  {
482  // create frames only now
483  m_pUndo->GetHistory()->Rollback( pDoc );
484  }
485 
486  pTextNd->InsertHint( pTextFootnote );
487  }
488  else
489  {
490  SwTextFootnote * const pFootnote =
491  static_cast<SwTextFootnote*>(
492  pTextNd->GetTextAttrForCharAt( m_nStart ));
493  assert(pFootnote);
494  SwFormatFootnote &rFootnote = const_cast<SwFormatFootnote&>(pFootnote->GetFootnote());
495  rFootnote.SetNumStr( m_FootnoteNumber );
496  if ( rFootnote.IsEndNote() != m_bEndNote )
497  {
498  rFootnote.SetEndNote( m_bEndNote );
499  pFootnote->CheckCondColl();
500  }
501  }
502 }
503 
505  SwNodeType nNodeWhich )
507  , m_pColl( pFormatColl )
508  , m_nNodeIndex( nNd )
509  , m_nNodeType( nNodeWhich )
510 {
511 }
512 
514 {
515  SwContentNode * pContentNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetContentNode();
516  OSL_ENSURE( pContentNd, "SwHistoryChangeFormatColl: no ContentNode" );
517 
518  // before setting the format, check if it is still available in the
519  // document. if it has been deleted, there is no undo!
520  if ( pContentNd && m_nNodeType == pContentNd->GetNodeType() )
521  {
522  if ( SwNodeType::Text == m_nNodeType )
523  {
524  if (pDoc->GetTextFormatColls()->IsAlive(static_cast<SwTextFormatColl *>(m_pColl)))
525  {
526  pContentNd->ChgFormatColl( m_pColl );
527  }
528  }
529  else if (pDoc->GetGrfFormatColls()->IsAlive(static_cast<SwGrfFormatColl *>(m_pColl)))
530  {
531  pContentNd->ChgFormatColl( m_pColl );
532  }
533  }
534 }
535 
538  , m_pUndo( new SwUndoDelLayFormat( pFlyFormat ) )
539 {
540  OSL_ENSURE( pFlyFormat, "SwHistoryTextFlyCnt: no Format" );
541  m_pUndo->ChgShowSel( false );
542 }
543 
545 {
546 }
547 
549 {
551  assert(pISCS);
552  ::sw::UndoRedoContext context(*pDoc, *pISCS);
553  m_pUndo->UndoImpl(context);
554 }
555 
557  const ::sw::mark::IMark& rBkmk,
558  bool bSavePos,
559  bool bSaveOtherPos)
561  , m_aName(rBkmk.GetName())
562  , m_aShortName()
563  , m_aKeycode()
564  , m_nNode(bSavePos ?
565  rBkmk.GetMarkPos().nNode.GetIndex() : 0)
566  , m_nOtherNode(bSaveOtherPos ?
567  rBkmk.GetOtherMarkPos().nNode.GetIndex() : 0)
568  , m_nContent(bSavePos ?
569  rBkmk.GetMarkPos().nContent.GetIndex() : 0)
570  , m_nOtherContent(bSaveOtherPos ?
571  rBkmk.GetOtherMarkPos().nContent.GetIndex() :0)
572  , m_bSavePos(bSavePos)
573  , m_bSaveOtherPos(bSaveOtherPos)
574  , m_bHadOtherPos(rBkmk.IsExpanded())
575  , m_eBkmkType(IDocumentMarkAccess::GetType(rBkmk))
576 {
577  const ::sw::mark::IBookmark* const pBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(&rBkmk);
578  if(pBookmark)
579  {
580  m_aKeycode = pBookmark->GetKeyCode();
581  m_aShortName = pBookmark->GetShortName();
582 
583  ::sfx2::Metadatable const*const pMetadatable(
584  dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
585  if (pMetadatable)
586  {
587  m_pMetadataUndo = pMetadatable->CreateUndo();
588  }
589  }
590 }
591 
593 {
594  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
595 
596  SwNodes& rNds = pDoc->GetNodes();
597  IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
598  std::unique_ptr<SwPaM> pPam;
599  ::sw::mark::IMark* pMark = nullptr;
600 
601  if(m_bSavePos)
602  {
603  SwContentNode* const pContentNd = rNds[m_nNode]->GetContentNode();
604  OSL_ENSURE(pContentNd,
605  "<SwHistoryBookmark::SetInDoc(..)>"
606  " - wrong node for a mark");
607 
608  // #111660# don't crash when nNode1 doesn't point to content node.
609  if(pContentNd)
610  pPam.reset(new SwPaM(*pContentNd, m_nContent));
611  }
612  else
613  {
614  pMark = *pMarkAccess->findMark(m_aName);
615  pPam.reset(new SwPaM(pMark->GetMarkPos()));
616  }
617 
618  if(m_bSaveOtherPos)
619  {
620  SwContentNode* const pContentNd = rNds[m_nOtherNode]->GetContentNode();
621  OSL_ENSURE(pContentNd,
622  "<SwHistoryBookmark::SetInDoc(..)>"
623  " - wrong node for a mark");
624 
625  if (pPam != nullptr && pContentNd)
626  {
627  pPam->SetMark();
628  pPam->GetMark()->nNode = m_nOtherNode;
629  pPam->GetMark()->nContent.Assign(pContentNd, m_nOtherContent);
630  }
631  }
632  else if(m_bHadOtherPos)
633  {
634  if(!pMark)
635  pMark = *pMarkAccess->findMark(m_aName);
636  OSL_ENSURE(pMark->IsExpanded(),
637  "<SwHistoryBookmark::SetInDoc(..)>"
638  " - missing pos on old mark");
639  pPam->SetMark();
640  *pPam->GetMark() = pMark->GetOtherMarkPos();
641  }
642 
643  if (pPam)
644  {
645  if ( pMark != nullptr )
646  {
647  pMarkAccess->deleteMark( pMark );
648  }
649  ::sw::mark::IBookmark* const pBookmark =
650  dynamic_cast<::sw::mark::IBookmark*>(
651  pMarkAccess->makeMark(*pPam, m_aName, m_eBkmkType, sw::mark::InsertMode::New));
652  if ( pBookmark != nullptr )
653  {
654  pBookmark->SetKeyCode(m_aKeycode);
655  pBookmark->SetShortName(m_aShortName);
656  if (m_pMetadataUndo)
657  {
658  ::sfx2::Metadatable * const pMeta(
659  dynamic_cast< ::sfx2::Metadatable* >(pBookmark));
660  OSL_ENSURE(pMeta, "metadata undo, but not metadatable?");
661  if (pMeta)
662  {
664  }
665  }
666  }
667  }
668 }
669 
670 bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::IMark& rBkmk)
671 {
672  return m_nNode == rBkmk.GetMarkPos().nNode.GetIndex()
673  && m_nContent == rBkmk.GetMarkPos().nContent.GetIndex()
674  && m_aName == rBkmk.GetName();
675 }
676 
677 SwHistoryNoTextFieldmark::SwHistoryNoTextFieldmark(const ::sw::mark::IFieldmark& rFieldMark)
679  , m_sType(rFieldMark.GetFieldname())
680  , m_nNode(rFieldMark.GetMarkPos().nNode.GetIndex())
681  , m_nContent(rFieldMark.GetMarkPos().nContent.GetIndex())
682 {
683 }
684 
686 {
687  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
688 
689  SwNodes& rNds = pDoc->GetNodes();
690  std::unique_ptr<SwPaM> pPam;
691 
692  const SwContentNode* pContentNd = rNds[m_nNode]->GetContentNode();
693  if(pContentNd)
694  pPam.reset(new SwPaM(*pContentNd, m_nContent));
695 
696  if (pPam)
697  {
698  IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
699  pMarkAccess->makeNoTextFieldBookmark(*pPam, OUString(), m_sType);
700  }
701 }
702 
704 {
705  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
706 
707  SwNodes& rNds = pDoc->GetNodes();
708  std::unique_ptr<SwPaM> pPam;
709 
710  const SwContentNode* pContentNd = rNds[m_nNode]->GetContentNode();
711  if(pContentNd)
712  pPam.reset(new SwPaM(*pContentNd, m_nContent-1));
713 
714  if (pPam)
715  {
716  IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
717  pMarkAccess->deleteFieldmarkAt(*pPam->GetPoint());
718  }
719 }
720 
721 SwHistoryTextFieldmark::SwHistoryTextFieldmark(const ::sw::mark::IFieldmark& rFieldMark)
723  , m_sName(rFieldMark.GetName())
724  , m_sType(rFieldMark.GetFieldname())
725  , m_nNode(rFieldMark.GetMarkPos().nNode.GetIndex())
726  , m_nContent(rFieldMark.GetMarkPos().nContent.GetIndex())
727 {
728 }
729 
731 {
732  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
733 
734  SwNodes& rNds = pDoc->GetNodes();
735  std::unique_ptr<SwPaM> pPam;
736 
737  const SwContentNode* pContentNd = rNds[m_nNode]->GetContentNode();
738  if(pContentNd)
739  pPam.reset(new SwPaM(*pContentNd, m_nContent));
740 
741  if (pPam)
742  {
743  IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
744  SwPaM aFieldPam(pPam->GetPoint()->nNode, pPam->GetPoint()->nContent.GetIndex(),
745  pPam->GetPoint()->nNode, pPam->GetPoint()->nContent.GetIndex() + 5);
746  pMarksAccess->makeFieldBookmark(aFieldPam, m_sName, m_sType);
747  }
748 }
749 
751 {
752  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
753 
754  SwNodes& rNds = pDoc->GetNodes();
755  std::unique_ptr<SwPaM> pPam;
756 
757  const SwContentNode* pContentNd = rNds[m_nNode]->GetContentNode();
758  if(pContentNd)
759  pPam.reset(new SwPaM(*pContentNd, m_nContent));
760 
761  if (pPam)
762  {
763  IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
764  pMarkAccess->deleteFieldmarkAt(*pPam->GetPoint());
765  }
766 }
767 
769  sal_uLong nNodePos, const std::set<sal_uInt16> &rSetArr )
771  , m_OldSet( rSet )
772  , m_ResetArray( 0, 4 )
773  , m_nNodeIndex( nNodePos )
774 {
775  SfxItemIter aIter( m_OldSet ), aOrigIter( rSet );
776  const SfxPoolItem* pItem = aIter.FirstItem(),
777  * pOrigItem = aOrigIter.FirstItem();
778  while (pItem && pOrigItem)
779  {
780  if( !rSetArr.count( pOrigItem->Which() ))
781  {
782  m_ResetArray.push_back( pOrigItem->Which() );
783  m_OldSet.ClearItem( pOrigItem->Which() );
784  }
785  else
786  {
787  switch ( pItem->Which() )
788  {
789  case RES_PAGEDESC:
790  static_cast<SwFormatPageDesc*>(
791  const_cast<SfxPoolItem*>(pItem))->ChgDefinedIn( nullptr );
792  break;
793 
794  case RES_PARATR_DROP:
795  static_cast<SwFormatDrop*>(
796  const_cast<SfxPoolItem*>(pItem))->ChgDefinedIn( nullptr );
797  break;
798 
799  case RES_BOXATR_FORMULA:
800  {
801  // When a formula is set, never save the value. It
802  // possibly must be recalculated!
803  // Save formulas always in plain text
805 
806  SwTableBoxFormula& rNew =
807  *static_cast<SwTableBoxFormula*>(
808  const_cast<SfxPoolItem*>(pItem));
809  if ( rNew.IsIntrnlName() )
810  {
811  const SwTableBoxFormula& rOld =
812  rSet.Get( RES_BOXATR_FORMULA );
813  const SwNode* pNd = rOld.GetNodeOfFormula();
814  if ( pNd )
815  {
816  const SwTableNode* pTableNode
817  = pNd->FindTableNode();
818  if (pTableNode)
819  {
820  SwTableFormulaUpdate aMsgHint(
821  &pTableNode->GetTable() );
822  aMsgHint.m_eFlags = TBL_BOXNAME;
823  rNew.ChgDefinedIn( rOld.GetDefinedIn() );
824  rNew.ChangeState( &aMsgHint );
825  }
826  }
827  }
828  rNew.ChgDefinedIn( nullptr );
829  }
830  break;
831  }
832  }
833 
834  pItem = aIter.NextItem();
835  pOrigItem = aOrigIter.NextItem();
836  }
837 }
838 
840 {
841  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
842 
843  SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
844  if ( pNode->IsContentNode() )
845  {
846  static_cast<SwContentNode*>(pNode)->SetAttr( m_OldSet );
847  if ( !m_ResetArray.empty() )
848  {
849  static_cast<SwContentNode*>(pNode)->ResetAttr( m_ResetArray );
850  }
851  }
852  else if ( pNode->IsTableNode() )
853  {
854  SwFormat& rFormat =
855  *static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat();
856  rFormat.SetFormatAttr( m_OldSet );
857  if ( !m_ResetArray.empty() )
858  {
859  rFormat.ResetFormatAttr( m_ResetArray.front() );
860  }
861  }
862 }
863 
866  , m_rFormat( rFormat )
867  , m_nOldNodeIndex( rFormat.GetAnchor().GetContentAnchor()->nNode.GetIndex() )
868  , m_nOldContentIndex( (RndStdIds::FLY_AT_CHAR == rFormat.GetAnchor().GetAnchorId())
869  ? rFormat.GetAnchor().GetContentAnchor()->nContent.GetIndex()
870  : COMPLETE_STRING )
871 {
872 }
873 
875 {
876  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
877 
878  if (pDoc->GetSpzFrameFormats()->IsAlive(&m_rFormat)) // Format does still exist
879  {
881 
882  SwNode* pNd = pDoc->GetNodes()[ m_nOldNodeIndex ];
883  SwContentNode* pCNd = pNd->GetContentNode();
884  SwPosition aPos( *pNd );
886  {
887  OSL_ENSURE(pCNd, "SwHistoryChangeFlyAnchor: no ContentNode");
888  if (pCNd)
889  {
890  aPos.nContent.Assign( pCNd, m_nOldContentIndex );
891  }
892  }
893  aTmp.SetAnchor( &aPos );
894 
895  // so the Layout does not get confused
896  if (!pCNd || !pCNd->getLayoutFrame(pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, nullptr))
897  {
899  }
900 
901  m_rFormat.SetFormatAttr( aTmp );
902  }
903 }
904 
906  const SwFormatChain& rAttr )
908  , m_pPrevFormat( rAttr.GetPrev() )
909  , m_pNextFormat( rAttr.GetNext() )
910  , m_pFlyFormat( &rFormat )
911 {
912 }
913 
915 {
917  {
918  SwFormatChain aChain;
919 
920  if (m_pPrevFormat &&
922  {
923  aChain.SetPrev( m_pPrevFormat );
925  aTmp.SetNext( m_pFlyFormat );
926  m_pPrevFormat->SetFormatAttr( aTmp );
927  }
928 
929  if (m_pNextFormat &&
931  {
932  aChain.SetNext( m_pNextFormat );
934  aTmp.SetPrev( m_pFlyFormat );
935  m_pNextFormat->SetFormatAttr( aTmp );
936  }
937 
938  if ( aChain.GetNext() || aChain.GetPrev() )
939  {
940  m_pFlyFormat->SetFormatAttr( aChain );
941  }
942  }
943 }
944 
945 // -> #i27615#
947  const OUString & sFormat)
949  , m_OldSet(rSet), m_Format(sFormat)
950 {
951 }
952 
954 {
955  SwCharFormat * pCharFormat = pDoc->FindCharFormatByName(m_Format);
956 
957  if (pCharFormat)
958  {
959  pCharFormat->SetFormatAttr(m_OldSet);
960  }
961 }
962 // <- #i27615#
963 
965  : m_SwpHstry()
966  , m_nEndDiff( 0 )
967 {
968 }
969 
971 {
972 }
973 
975  const SfxPoolItem* pOldValue,
976  const SfxPoolItem* pNewValue,
977  sal_uLong nNodeIdx)
978 {
979  OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
980  const sal_uInt16 nWhich(pNewValue->Which());
981 
982  // excluded values
983  if(nWhich == RES_TXTATR_FIELD || nWhich == RES_TXTATR_ANNOTATION)
984  {
985  return;
986  }
987 
988  // no default Attribute?
989  std::unique_ptr<SwHistoryHint> pHt;
990 
991  // To be able to include the DrawingLayer FillItems something more
992  // general has to be done to check if an Item is default than to check
993  // if its pointer equals that in Writer's global PoolDefaults (held in
994  // aAttrTab and used to fill the pool defaults in Writer - looks as if
995  // Writer is *older* than the SfxItemPool ?). I checked the possibility to
996  // get the SfxItemPool here (works), but decided to use the SfxPoolItem's
997  // global tooling aka IsDefaultItem(const SfxPoolItem*) for now
998  if(pOldValue && !IsDefaultItem(pOldValue))
999  {
1000  pHt.reset( new SwHistorySetFormat( pOldValue, nNodeIdx ) );
1001  }
1002  else
1003  {
1004  pHt.reset( new SwHistoryResetFormat( pNewValue, nNodeIdx ) );
1005  }
1006 
1007  m_SwpHstry.push_back( std::move(pHt) );
1008 }
1009 
1010 // FIXME: refactor the following "Add" methods (DRY)?
1011 void SwHistory::Add( SwTextAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
1012 {
1013  OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
1014 
1015  std::unique_ptr<SwHistoryHint> pHt;
1016  if( !bNewAttr )
1017  {
1018  switch ( pHint->Which() )
1019  {
1020  case RES_TXTATR_FTN:
1021  pHt.reset( new SwHistorySetFootnote(
1022  static_cast<SwTextFootnote*>(pHint), nNodeIdx ) );
1023  break;
1024  case RES_TXTATR_FLYCNT:
1025  pHt.reset( new SwHistoryTextFlyCnt( static_cast<SwTextFlyCnt*>(pHint)
1026  ->GetFlyCnt().GetFrameFormat() ) );
1027  break;
1028  case RES_TXTATR_FIELD:
1029  case RES_TXTATR_ANNOTATION:
1030  pHt.reset( new SwHistorySetTextField(
1031  static_txtattr_cast<SwTextField*>(pHint), nNodeIdx) );
1032  break;
1033  case RES_TXTATR_TOXMARK:
1034  pHt.reset( new SwHistorySetTOXMark(
1035  static_txtattr_cast<SwTextTOXMark*>(pHint), nNodeIdx) );
1036  break;
1037  case RES_TXTATR_REFMARK:
1038  pHt.reset( new SwHistorySetRefMark(
1039  static_txtattr_cast<SwTextRefMark*>(pHint), nNodeIdx) );
1040  break;
1041  default:
1042  pHt.reset( new SwHistorySetText( pHint, nNodeIdx ) );
1043  }
1044  }
1045  else
1046  {
1047  pHt.reset( new SwHistoryResetText( pHint->Which(), pHint->GetStart(),
1048  pHint->GetAnyEnd(), nNodeIdx ) );
1049  }
1050  m_SwpHstry.push_back( std::move(pHt) );
1051 }
1052 
1053 void SwHistory::Add( SwFormatColl* pColl, sal_uLong nNodeIdx, SwNodeType nWhichNd )
1054 {
1055  OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
1056 
1057  std::unique_ptr<SwHistoryHint> pHt(
1058  new SwHistoryChangeFormatColl( pColl, nNodeIdx, nWhichNd ));
1059  m_SwpHstry.push_back( std::move(pHt) );
1060 }
1061 
1062 void SwHistory::Add(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOtherPos)
1063 {
1064  OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
1065 
1066  std::unique_ptr<SwHistoryHint> pHt(new SwHistoryBookmark(rBkmk, bSavePos, bSaveOtherPos));
1067  m_SwpHstry.push_back( std::move(pHt) );
1068 }
1069 
1071 {
1072  std::unique_ptr<SwHistoryHint> pHt(new SwHistoryChangeFlyAnchor( rFormat ));
1073  m_SwpHstry.push_back( std::move(pHt) );
1074 }
1075 
1076 void SwHistory::Add( SwFlyFrameFormat& rFormat, sal_uInt16& rSetPos )
1077 {
1078  OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
1079 
1080  const sal_uInt16 nWh = rFormat.Which();
1081  if( RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh )
1082  {
1083  std::unique_ptr<SwHistoryHint> pHint(new SwHistoryTextFlyCnt( &rFormat ));
1084  m_SwpHstry.push_back( std::move(pHint) );
1085 
1086  const SwFormatChain* pChainItem;
1087  if( SfxItemState::SET == rFormat.GetItemState( RES_CHAIN, false,
1088  reinterpret_cast<const SfxPoolItem**>(&pChainItem) ))
1089  {
1090  if( pChainItem->GetNext() || pChainItem->GetPrev() )
1091  {
1092  std::unique_ptr<SwHistoryHint> pHt(
1093  new SwHistoryChangeFlyChain( rFormat, *pChainItem ));
1094  m_SwpHstry.insert( m_SwpHstry.begin() + rSetPos++, std::move(pHt) );
1095  if ( pChainItem->GetNext() )
1096  {
1097  SwFormatChain aTmp( pChainItem->GetNext()->GetChain() );
1098  aTmp.SetPrev( nullptr );
1099  pChainItem->GetNext()->SetFormatAttr( aTmp );
1100  }
1101  if ( pChainItem->GetPrev() )
1102  {
1103  SwFormatChain aTmp( pChainItem->GetPrev()->GetChain() );
1104  aTmp.SetNext( nullptr );
1105  pChainItem->GetPrev()->SetFormatAttr( aTmp );
1106  }
1107  }
1108  rFormat.ResetFormatAttr( RES_CHAIN );
1109  }
1110  }
1111 }
1112 
1113 void SwHistory::Add( const SwTextFootnote& rFootnote )
1114 {
1115  std::unique_ptr<SwHistoryHint> pHt(new SwHistorySetFootnote( rFootnote ));
1116  m_SwpHstry.push_back( std::move(pHt) );
1117 }
1118 
1119 // #i27615#
1120 void SwHistory::Add(const SfxItemSet & rSet, const SwCharFormat & rFormat)
1121 {
1122  std::unique_ptr<SwHistoryHint> pHt(new SwHistoryChangeCharFormat(rSet, rFormat.GetName()));
1123  m_SwpHstry.push_back( std::move(pHt) );
1124 }
1125 
1126 bool SwHistory::Rollback( SwDoc* pDoc, sal_uInt16 nStart )
1127 {
1128  if ( !Count() )
1129  return false;
1130 
1131  for ( sal_uInt16 i = Count(); i > nStart ; )
1132  {
1133  SwHistoryHint * pHHt = m_SwpHstry[ --i ].get();
1134  pHHt->SetInDoc( pDoc, false );
1135  }
1136  m_SwpHstry.erase( m_SwpHstry.begin() + nStart, m_SwpHstry.end() );
1137  m_nEndDiff = 0;
1138  return true;
1139 }
1140 
1141 bool SwHistory::TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool bToFirst )
1142 {
1143  sal_uInt16 nEnd = Count() - m_nEndDiff;
1144  if ( !Count() || !nEnd || nStart >= nEnd )
1145  return false;
1146 
1147  if ( bToFirst )
1148  {
1149  for ( ; nEnd > nStart; ++m_nEndDiff )
1150  {
1151  SwHistoryHint* pHHt = m_SwpHstry[ --nEnd ].get();
1152  pHHt->SetInDoc( pDoc, true );
1153  }
1154  }
1155  else
1156  {
1157  for ( ; nStart < nEnd; ++m_nEndDiff, ++nStart )
1158  {
1159  SwHistoryHint* pHHt = m_SwpHstry[ nStart ].get();
1160  pHHt->SetInDoc( pDoc, true );
1161  }
1162  }
1163  return true;
1164 }
1165 
1166 sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd )
1167 {
1168  OSL_ENSURE( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
1169 
1170  const sal_uInt16 nOld = Count() - m_nEndDiff;
1171  m_nEndDiff = Count() - nNewTmpEnd;
1172 
1173  // for every SwHistoryFlyCnt, call the Redo of its UndoObject.
1174  // this saves the formats of the flys!
1175  for ( sal_uInt16 n = nOld; n < nNewTmpEnd; n++ )
1176  {
1177  if ( HSTRY_FLYCNT == (*this)[ n ]->Which() )
1178  {
1179  static_cast<SwHistoryTextFlyCnt*>((*this)[ n ])
1180  ->GetUDelLFormat()->RedoForRollback();
1181  }
1182  }
1183 
1184  return nOld;
1185 }
1186 
1188  const SfxItemSet& rSet,
1189  sal_uLong nNodeIdx)
1190 {
1191  if(rSet.Count())
1192  {
1193  SfxItemIter aIter(rSet);
1194 
1195  do
1196  {
1197  if(!IsInvalidItem(aIter.GetCurItem()))
1198  {
1199  const SfxPoolItem* pNew = aIter.GetCurItem();
1200 
1201  Add(
1202  pNew,
1203  pNew,
1204  nNodeIdx);
1205  }
1206 
1207  if(aIter.IsAtEnd())
1208  {
1209  break;
1210  }
1211 
1212  aIter.NextItem();
1213 
1214  } while(true);
1215  }
1216 }
1217 
1219  SwpHints const * pHts,
1220  const sal_uLong nNodeIdx,
1221  const sal_Int32 nStart,
1222  const sal_Int32 nEnd,
1223  const bool bCopyFields )
1224 {
1225  if( !pHts )
1226  return;
1227 
1228  // copy all attributes of the TextNode in the area from nStart to nEnd
1229  SwTextAttr* pHt;
1230  for( size_t n = 0; n < pHts->Count(); ++n )
1231  {
1232  // nAttrStt must even be set when !pEndIdx
1233  pHt = pHts->Get(n);
1234  const sal_Int32 nAttrStt = pHt->GetStart();
1235  const sal_Int32 * pEndIdx = pHt->GetEnd();
1236  if( nullptr != pEndIdx && nAttrStt > nEnd )
1237  break;
1238 
1239  // never copy Flys and Footnote !!
1240  bool bNextAttr = false;
1241  switch( pHt->Which() )
1242  {
1243  case RES_TXTATR_FIELD:
1244  case RES_TXTATR_ANNOTATION:
1245  case RES_TXTATR_INPUTFIELD:
1246  if( !bCopyFields )
1247  bNextAttr = true;
1248  break;
1249  case RES_TXTATR_FLYCNT:
1250  case RES_TXTATR_FTN:
1251  bNextAttr = true;
1252  break;
1253  }
1254 
1255  if( bNextAttr )
1256  continue;
1257 
1258  // save all attributes that are somehow in this area
1259  if ( nStart <= nAttrStt )
1260  {
1261  if ( nEnd > nAttrStt )
1262  {
1263  Add( pHt, nNodeIdx, false );
1264  }
1265  }
1266  else if ( pEndIdx && nStart < *pEndIdx )
1267  {
1268  Add( pHt, nNodeIdx, false );
1269  }
1270  }
1271 }
1272 
1273 // Class to register the history at a Node, Format, HintsArray, ...
1275  : SwClient( nullptr )
1276  , m_pHistory( pHst )
1277  , m_nNodeIndex( ULONG_MAX )
1278 {
1279  MakeSetWhichIds();
1280 }
1281 
1283  SwHistory* pHst )
1284  : SwClient( pRegIn )
1285  , m_pHistory( pHst )
1286  , m_nNodeIndex( rNd.GetIndex() )
1287 {
1288  MakeSetWhichIds();
1289 }
1290 
1292  : SwClient( nullptr )
1293  , m_pHistory( pHst )
1294  , m_nNodeIndex( rNd.GetIndex() )
1295 {
1296  MakeSetWhichIds();
1297 }
1298 
1299 void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
1300 {
1301  if ( m_pHistory && ( pOld || pNew ) && pOld != pNew )
1302  {
1303  if ( pNew->Which() < POOLATTR_END )
1304  {
1305  if(RES_UPDATE_ATTR == pNew->Which())
1306  {
1307  // const SfxItemPool& rPool = static_cast< const SwUpdateAttr* >(pNew)->GetSfxItemPool();
1308 
1309  m_pHistory->Add(
1310  // rPool,
1311  pOld,
1312  pNew,
1313  m_nNodeIndex);
1314  }
1315  else
1316  {
1317  OSL_ENSURE(false, "Unexpected update attribute (!)");
1318  }
1319  }
1320  else if (pOld && RES_ATTRSET_CHG == pNew->Which())
1321  {
1322  std::unique_ptr<SwHistoryHint> pNewHstr;
1323  const SfxItemSet& rSet = *static_cast< const SwAttrSetChg* >(pOld)->GetChgSet();
1324 
1325  if ( 1 < rSet.Count() )
1326  {
1327  pNewHstr.reset( new SwHistorySetAttrSet( rSet, m_nNodeIndex, m_WhichIdSet ) );
1328  }
1329  else if (const SfxPoolItem* pItem = SfxItemIter( rSet ).FirstItem())
1330  {
1331  if ( m_WhichIdSet.count( pItem->Which() ) )
1332  {
1333  pNewHstr.reset( new SwHistorySetFormat( pItem, m_nNodeIndex ) );
1334  }
1335  else
1336  {
1337  pNewHstr.reset( new SwHistoryResetFormat( pItem, m_nNodeIndex ) );
1338  }
1339  }
1340 
1341  if (pNewHstr)
1342  m_pHistory->m_SwpHstry.push_back( std::move(pNewHstr) );
1343  }
1344  }
1345 }
1346 
1347 void SwRegHistory::AddHint( SwTextAttr* pHt, const bool bNew )
1348 {
1349  m_pHistory->Add( pHt, m_nNodeIndex, bNew );
1350 }
1351 
1353  sal_Int32 const nStart, sal_Int32 const nEnd, SetAttrMode const nFlags,
1354  SwTextAttr **ppNewTextAttr )
1355 {
1356  if( !rSet.Count() )
1357  return false;
1358 
1359  SwTextNode * const pTextNode =
1360  dynamic_cast<SwTextNode *>(GetRegisteredIn());
1361 
1362  OSL_ENSURE(pTextNode, "SwRegHistory not registered at text node?");
1363  if (!pTextNode)
1364  return false;
1365 
1366  if (m_pHistory)
1367  {
1368  pTextNode->GetOrCreateSwpHints().Register(this);
1369  }
1370 
1371  const bool bInserted = pTextNode->SetAttr( rSet, nStart, nEnd, nFlags, ppNewTextAttr );
1372 
1373  // Caution: The array can be deleted when inserting an attribute!
1374  // This can happen when the value that should be added first deletes
1375  // an existing attribute but does not need to be added itself because
1376  // the paragraph attributes are identical
1377  // ( -> bForgetAttr in SwpHints::Insert )
1378  if ( pTextNode->GetpSwpHints() && m_pHistory )
1379  {
1380  pTextNode->GetpSwpHints()->DeRegister();
1381  }
1382 
1383 #ifndef NDEBUG
1384  if ( m_pHistory && bInserted )
1385  {
1386  SfxItemIter aIter(rSet);
1387  for (SfxPoolItem const* pItem = aIter.FirstItem(); pItem; pItem = aIter.NextItem())
1388  { // check that the history recorded a hint to reset every item
1389  sal_uInt16 const nWhich(pItem->Which());
1390  sal_uInt16 const nExpected(
1391  (isCHRATR(nWhich) || RES_TXTATR_UNKNOWN_CONTAINER == nWhich)
1393  : nWhich);
1394  if (RES_TXTATR_AUTOFMT == nExpected)
1395  continue; // special case, may get set on text node itself
1396  // tdf#105077 even worse, node's set could cause
1397  // nothing at all to be inserted
1398  assert(std::any_of(
1399  m_pHistory->m_SwpHstry.begin(), m_pHistory->m_SwpHstry.end(),
1400  [nExpected](std::unique_ptr<SwHistoryHint> const& pHint) -> bool {
1401  SwHistoryResetText const*const pReset(
1402  dynamic_cast<SwHistoryResetText const*>(pHint.get()));
1403  return pReset && (pReset->GetWhich() == nExpected);
1404  }));
1405  }
1406  }
1407 #endif
1408 
1409  return bInserted;
1410 }
1411 
1413 {
1414  if ( m_pHistory && pRegIn )
1415  {
1416  pRegIn->Add( this );
1417  m_nNodeIndex = rNd.GetIndex();
1418  MakeSetWhichIds();
1419  }
1420  else
1421  {
1422  m_WhichIdSet.clear();
1423  }
1424 }
1425 
1427 {
1428  if (!m_pHistory) return;
1429 
1430  m_WhichIdSet.clear();
1431 
1432  if( GetRegisteredIn() )
1433  {
1434  const SfxItemSet* pSet = nullptr;
1435  if( dynamic_cast< const SwContentNode *>( GetRegisteredIn() ) != nullptr )
1436  {
1437  pSet = static_cast<SwContentNode*>(
1438  GetRegisteredIn())->GetpSwAttrSet();
1439  }
1440  else if ( dynamic_cast< const SwFormat *>( GetRegisteredIn() ) != nullptr )
1441  {
1442  pSet = &static_cast<SwFormat*>(
1443  GetRegisteredIn())->GetAttrSet();
1444  }
1445  if( pSet && pSet->Count() )
1446  {
1447  SfxItemIter aIter( *pSet );
1448  const SfxPoolItem* pItem = aIter.FirstItem();
1449  while(pItem)
1450  {
1451  sal_uInt16 nW = pItem->Which();
1452  m_WhichIdSet.insert( nW );
1453  if( aIter.IsAtEnd() )
1454  break;
1455  pItem = aIter.NextItem();
1456  }
1457  }
1458  }
1459 }
1460 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const std::unique_ptr< SwFormatField > m_pField
Definition: rolbck.hxx:135
void ChgDefinedIn(const SwModify *pNew)
Definition: fmtpdsc.hxx:70
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:233
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:179
bool const m_bFormatIgnoreEnd
Definition: rolbck.hxx:121
Starts a section of nodes in the document model.
Definition: node.hxx:303
const OUString m_sType
Definition: rolbck.hxx:274
const SwGrfFormatColls * GetGrfFormatColls() const
Definition: doc.hxx:801
const TOXTypes m_eTOXTypes
Definition: rolbck.hxx:167
void SetEndNote(bool b)
Definition: atrftn.cxx:166
SwHistoryNoTextFieldmark(const ::sw::mark::IFieldmark &rFieldMark)
Definition: rolbck.cxx:677
sal_uLong GetIndex() const
Definition: node.hxx:282
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
const std::unique_ptr< SwUndoSaveSection, o3tl::default_delete< SwUndoSaveSection > > m_pUndo
Definition: rolbck.hxx:199
sal_uInt16 GetWhich() const
Definition: rolbck.hxx:191
Marks a position in the document model.
Definition: pam.hxx:35
std::vector< std::unique_ptr< SwHistoryHint > > m_SwpHstry
Definition: rolbck.hxx:346
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1344
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:342
#define RES_ATTRSET_CHG
Definition: hintids.hxx:285
const sal_Int32 m_nStart
Definition: rolbck.hxx:182
const sal_uInt16 m_nWhich
Definition: rolbck.hxx:106
virtual const SwRootFrame * GetCurrentLayout() const =0
OUString const & GetPrimaryKey() const
Definition: tox.hxx:604
const sal_uInt16 m_nAttr
Definition: rolbck.hxx:184
const bool m_bHadOtherPos
Definition: rolbck.hxx:259
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4890
void SetStartNode(const SwNodeIndex *pNode, bool bDelNodes=true)
Definition: atrftn.cxx:275
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:219
SwHistoryChangeCharFormat(const SfxItemSet &rSet, const OUString &sFormat)
Definition: rolbck.cxx:946
bool Rollback(SwDoc *pDoc, sal_uInt16 nStart=0)
Definition: rolbck.cxx:1126
const bool m_bSavePos
Definition: rolbck.hxx:257
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
const SwTOXType * InsertTOXType(const SwTOXType &rTyp)
Definition: doctxm.cxx:630
void RegisterInModify(SwModify *pRegIn, const SwNode &rNd)
Definition: rolbck.cxx:1412
const SfxItemSet m_OldSet
Definition: rolbck.hxx:332
virtual const sal_Int32 * GetEnd() const
end position
Definition: txatbase.cxx:49
sal_uIntPtr sal_uLong
void CheckCondColl()
Definition: atrftn.cxx:552
virtual ~SwHistorySetFormat() override
Definition: rolbck.cxx:168
SwHistorySetTextField(SwTextField *pTextField, sal_uLong nNode)
Definition: rolbck.cxx:254
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.
SwHistorySetFootnote(SwTextFootnote *pTextFootnote, sal_uLong nNode)
Definition: rolbck.cxx:412
Definition: doc.hxx:185
void SetNumStr(const OUString &rStr)
Definition: fmtftn.hxx:75
#define RES_TXTATR_UNKNOWN_CONTAINER
Definition: hintids.hxx:144
void SetFormatIgnoreStart(bool bFlag)
Definition: txatbase.hxx:104
virtual const SwPosition & GetMarkPos() const =0
virtual void SetInDoc(SwDoc *pDoc, bool) override
Definition: rolbck.cxx:685
bool IsEqual(const SwTOXMark &rCmp) const
Definition: rolbck.cxx:382
bool IsAtEnd() const
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:284
virtual ::sw::mark::IMark * makeMark(const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark,::sw::mark::InsertMode eMode)=0
Generates a new mark in the document for a certain selection.
virtual OUString GetDescription() const
Definition: rolbck.cxx:59
bool TmpRollback(SwDoc *pDoc, sal_uInt16 nStart, bool ToFirst=true)
Definition: rolbck.cxx:1141
bool IsEndNote() const
Definition: fmtftn.hxx:73
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1552
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
const SwTOXType * GetTOXType() const
Definition: tox.hxx:542
void SetFormatIgnoreEnd(bool bFlag)
Definition: txatbase.hxx:105
#define RES_TXTATR_CHARFMT
Definition: hintids.hxx:142
sal_uInt16 Which() const
Definition: txatbase.hxx:110
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2033
const sal_Int32 m_nEnd
Definition: rolbck.hxx:119
sal_Int32 GetAnyEnd() const
end (if available), else start
Definition: txatbase.hxx:153
void ChangeState(const SfxPoolItem *pItem)
Definition: cellatr.cxx:107
void ChgDefinedIn(const SwModify *pNew)
Definition: paratr.hxx:106
For old documents the Field-Which IDs must be preserved !!!
const SfxPoolItem * FirstItem()
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:351
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet)=0
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:402
virtual ~SwHistorySetText() override
Definition: rolbck.cxx:217
bool IsAlive(SwFrameFormat const *) const
not so fast check that given format is still alive (i.e. contained here)
Definition: docfmt.cxx:2146
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:3058
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
#define RES_UPDATE_ATTR
Definition: hintids.hxx:289
#define POOLATTR_END
Definition: hintids.hxx:64
#define RES_CHAIN
Definition: hintids.hxx:219
const sal_Int32 m_nStart
Definition: rolbck.hxx:169
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:181
SwHistoryChangeFormatColl(SwFormatColl *pColl, sal_uLong nNode, SwNodeType nNodeWhich)
Definition: rolbck.cxx:504
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:321
SwNodeType GetNodeType() const
Definition: node.hxx:144
SwIndex nContent
Definition: pam.hxx:38
const sal_uLong m_nOldNodeIndex
Definition: rolbck.hxx:311
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:153
std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo
Definition: rolbck.hxx:261
const IDocumentMarkAccess::MarkType m_eBkmkType
Definition: rolbck.hxx:260
SwFlyFrameFormat *const m_pPrevFormat
Definition: rolbck.hxx:321
const OUString & GetName() const
Definition: format.hxx:111
std::unique_ptr< SwFieldType > m_pFieldType
! beware of the order for the declaration of the unique_ptrs.
Definition: rolbck.hxx:134
const sal_uLong m_nNode
Definition: rolbck.hxx:253
bool IsEqualBookmark(const ::sw::mark::IMark &rBkmk)
Definition: rolbck.cxx:670
sal_Int32 GetStart() const
Definition: txatbase.hxx:82
bool IsStartNode() const
Definition: node.hxx:624
const OUString m_FootnoteNumber
Definition: rolbck.hxx:200
SwHistoryChangeFlyChain(SwFlyFrameFormat &rFormat, const SwFormatChain &rAttr)
Definition: rolbck.cxx:905
virtual OUString GetDescription() const override
Definition: rolbck.cxx:448
const sal_uLong m_nOtherNode
Definition: rolbck.hxx:254
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:1224
const SwTable & GetTable() const
Definition: node.hxx:497
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
Definition: doctxm.cxx:612
virtual OUString GetDescription() const override
Definition: rolbck.cxx:104
SwHistorySetFormat(const SfxPoolItem *pFormatHt, sal_uLong nNode)
Definition: rolbck.cxx:64
const SwModify * GetDefinedIn() const
Definition: cellatr.hxx:64
const sal_Int32 m_nContent
Definition: rolbck.hxx:276
const OUString m_sName
Definition: rolbck.hxx:289
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:548
virtual void SetKeyCode(const vcl::KeyCode &)=0
const sal_Int32 m_nEnd
Definition: rolbck.hxx:155
SwHistoryTextFieldmark(const ::sw::mark::IFieldmark &rFieldMark)
Definition: rolbck.cxx:721
virtual void SetShortName(const OUString &)=0
SwHistory *const m_pHistory
Definition: rolbck.hxx:403
std::unique_ptr< SfxPoolItem > m_pAttr
Definition: rolbck.hxx:92
Base class for various Writer styles.
Definition: format.hxx:43
void EndListeningAll()
Definition: calbck.cxx:124
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
Definition: docary.hxx:144
SwHistoryResetFormat(const SfxPoolItem *pFormatHt, sal_uLong nNodeIdx)
Definition: rolbck.cxx:172
SwHistorySetRefMark(SwTextRefMark *pTextHt, sal_uLong nNode)
Definition: rolbck.cxx:312
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=0
Deletes a mark.
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
const OUString & GetAlternativeText() const
Definition: tox.hxx:533
OUString m_aShortName
Definition: rolbck.hxx:251
SwHistoryTextFlyCnt(SwFrameFormat *const pFlyFormat)
Definition: rolbck.cxx:536
bool IsContentNode() const
Definition: node.hxx:628
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:874
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
Style of a layout element.
Definition: frmfmt.hxx:57
size_t Count() const
Definition: ndhints.hxx:142
void DeRegister()
deregister the currently registered History
Definition: ndhints.hxx:197
SwNodeType
Definition: ndtyp.hxx:28
std::set< sal_uInt16 > m_WhichIdSet
Definition: rolbck.hxx:402
SwTextAttr * Get(size_t nPos) const
Definition: ndhints.hxx:144
const OUString m_TOXName
Definition: rolbck.hxx:166
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
SwHistoryResetText(sal_uInt16 nWhich, sal_Int32 nStt, sal_Int32 nEnd, sal_uLong nNode)
Definition: rolbck.cxx:394
SwFieldIds m_nFieldWhich
Definition: rolbck.hxx:139
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:218
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
const OUString m_aName
Definition: rolbck.hxx:250
virtual ~SwHistorySetTextField() override
Definition: rolbck.cxx:280
bool IsIntrnlName() const
Definition: cellfml.hxx:130
void CopyAttr(SwpHints const *pHts, const sal_uLong nNodeIdx, const sal_Int32 nStart, const sal_Int32 nEnd, const bool bCopyFields)
Definition: rolbck.cxx:1218
SetAttrMode
Definition: swtypes.hxx:143
int i
SwContentNode * GetContentNode()
Definition: node.hxx:615
const bool m_bEndNote
Definition: rolbck.hxx:203
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
sal_uLong m_nNodeIndex
Definition: rolbck.hxx:137
sal_uInt16 GetLevel() const
Definition: tox.hxx:598
const SfxPoolItem * NextItem()
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:105
SwDoc * GetDoc()
Definition: node.hxx:702
void RegisterToTOXType(SwTOXType &rMark)
Definition: tox.cxx:137
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
virtual sw::mark::IFieldmark * makeFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:117
virtual void SetInDoc(SwDoc *pDoc, bool) override
Definition: rolbck.cxx:730
const OUString & GetTypeName() const
Definition: tox.hxx:660
void CopyFormatAttr(const SfxItemSet &rSet, sal_uLong nNodeIdx)
Definition: rolbck.cxx:1187
std::shared_ptr< MetadatableUndo > CreateUndo() const
const sal_Int32 m_nStart
Definition: rolbck.hxx:118
const sal_uLong m_nNode
Definition: rolbck.hxx:275
std::unique_ptr< SwUndoDelLayFormat > m_pUndo
Definition: rolbck.hxx:229
const sal_Int32 m_nStart
Definition: rolbck.hxx:154
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:398
#define RES_TXTATR_TOXMARK
Definition: hintids.hxx:137
virtual ~SwHistorySetFootnote() override
Definition: rolbck.cxx:453
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
#define SwTextFootnote_GetIndex(pFIdx)
Definition: ftnidx.hxx:34
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:299
void Register(SwRegHistory *pHist)
register a History, which receives all attribute changes (for Undo)
Definition: ndhints.hxx:195
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
#define RES_BOXATR_VALUE
Definition: hintids.hxx:263
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:457
void ResetInDoc(SwDoc *pDoc)
Definition: rolbck.cxx:703
virtual SwFormatColl * ChgFormatColl(SwFormatColl *)
Definition: node.cxx:1185
SwFrameFormat & m_rFormat
Definition: rolbck.hxx:310
virtual void deleteFieldmarkAt(const SwPosition &rPos)=0
void ChgDefinedIn(const SwModify *pNew)
Definition: cellatr.hxx:65
void Add(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, sal_uLong nNodeIdx)
Definition: rolbck.cxx:974
attention: NOHINTADJUST prevents MergePortions! when using this need to pay attention to ignore start...
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:200
virtual sw::mark::IFieldmark * makeNoTextFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:168
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
const sal_Int32 m_nStart
Definition: rolbck.hxx:202
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
The Undo actions need to create new Shell cursors.
void ResetInDoc(SwDoc *pDoc)
Definition: rolbck.cxx:750
SwHistory()
Definition: rolbck.cxx:964
sal_uInt16 Count() const
Definition: rolbck.hxx:368
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
const OUString m_RefName
Definition: rolbck.hxx:152
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:766
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
bool const m_bFormatIgnoreStart
Definition: rolbck.hxx:120
void DeleteAttributes(const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd=0)
delete all attributes of type nWhich at nStart (opt. end nEnd)
Definition: thints.cxx:1673
void AddHint(SwTextAttr *pHt, const bool bNew)
Definition: rolbck.cxx:1347
const sal_Int32 m_nOldContentIndex
Definition: rolbck.hxx:312
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:652
#define RES_TXTATR_FIELD
Definition: hintids.hxx:150
SwCharFormat * GetCharFormat() const
Definition: fchrfmt.hxx:70
#define RES_TXTATR_AUTOFMT
Definition: hintids.hxx:140
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:67
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:734
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
OUString const & GetSecondaryKey() const
Definition: tox.hxx:610
virtual const SwNode * GetNodeOfFormula() const override
Get node type of the node containing this formula.
Definition: cellatr.cxx:87
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:773
const sal_uLong m_nNode
Definition: rolbck.hxx:291
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:914
SwHistorySetAttrSet(const SfxItemSet &rSet, sal_uLong nNode, const std::set< sal_uInt16 > &rSetArr)
Definition: rolbck.cxx:768
const sal_Int32 m_nContent
Definition: rolbck.hxx:255
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
const sal_Int32 m_nEnd
Definition: rolbck.hxx:183
SwHistorySetTOXMark(SwTextTOXMark *pTextHt, sal_uLong nNode)
Definition: rolbck.cxx:339
virtual ~SwHistoryTextFlyCnt() override
Definition: rolbck.cxx:544
void MakeSetWhichIds()
Definition: rolbck.cxx:1426
SwNodes & GetNodes()
Definition: doc.hxx:403
SfxItemSet m_OldSet
Definition: rolbck.hxx:297
SwTOXMark m_TOXMark
Definition: rolbck.hxx:165
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:221
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
sal_uInt16 SetTmpEnd(sal_uInt16 nTmpEnd)
Definition: rolbck.cxx:1166
SwFlyFrameFormat *const m_pFlyFormat
Definition: rolbck.hxx:323
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
const OUString m_Format
Definition: rolbck.hxx:333
SwFlyFrameFormat *const m_pNextFormat
Definition: rolbck.hxx:322
const OUString m_sType
Definition: rolbck.hxx:290
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:513
~SwHistory()
Definition: rolbck.cxx:970
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:136
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:151
SwFrameFormat * ClaimFrameFormat()
Definition: swtable.cxx:1706
#define RES_TXTATR_REFMARK
Definition: hintids.hxx:136
TOXTypes GetType() const
Definition: tox.hxx:663
virtual void SetInDoc(SwDoc *pDoc, bool) override
Definition: rolbck.cxx:592
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:351
bool InsertHint(SwTextAttr *const pAttr, const SetAttrMode nMode=SetAttrMode::DEFAULT)
Insert pAttr into hints array.
Definition: thints.cxx:1259
const bool m_bSaveOtherPos
Definition: rolbck.hxx:258
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:159
SwHistorySetText(SwTextAttr *pTextHt, sal_uLong nNode)
Definition: rolbck.cxx:193
SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
vcl::KeyCode m_aKeycode
Definition: rolbck.hxx:252
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2041
RndStdIds
bool IsTableNode() const
Definition: node.hxx:640
const sal_Int32 m_nEnd
Definition: rolbck.hxx:170
#define RES_PARATR_DROP
Definition: hintids.hxx:168
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: rolbck.cxx:1299
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:839
std::unique_ptr< SfxPoolItem > m_pAttr
Definition: rolbck.hxx:116
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
Definition: doctxm.cxx:621
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps...
Definition: paratr.hxx:50
TableFormulaUpdateFlags m_eFlags
Definition: hints.hxx:208
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
const SwFormatCharFormat & GetCharFormat() const
Definition: txatbase.hxx:179
bool InsertItems(const SfxItemSet &rSet, sal_Int32 const nStart, sal_Int32 const nEnd, SetAttrMode const nFlags, SwTextAttr **ppNewTextAttr)
Definition: rolbck.cxx:1352
bool IsInvalidItem(const SfxPoolItem *pItem)
SwHistoryBookmark(const ::sw::mark::IMark &rBkmk, bool bSavePos, bool bSaveOtherPos)
Definition: rolbck.cxx:556
#define RES_PAGEDESC
Definition: hintids.hxx:198
#define RES_BREAK
Definition: hintids.hxx:199
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
SwFormatColl *const m_pColl
Definition: rolbck.hxx:217
virtual bool IsExpanded() const =0
const SwNodeType m_nNodeType
Definition: rolbck.hxx:219
sal_uInt16 m_nEndDiff
Definition: rolbck.hxx:347
std::vector< sal_uInt16 > m_ResetArray
Definition: rolbck.hxx:298
#define RES_TXTATR_INPUTFIELD
Definition: hintids.hxx:145
::sw::IShellCursorSupplier * GetIShellCursorSupplier()
Definition: doccorr.cxx:346
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:69
void RestoreMetadata(std::shared_ptr< MetadatableUndo > const &i_pUndo)
sal_uLong m_nNodeIndex
Definition: rolbck.hxx:201
SwHistoryChangeFlyAnchor(SwFrameFormat &rFormat)
Definition: rolbck.cxx:864
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
sal_uInt16 Which() const
virtual void SetInDoc(SwDoc *pDoc, bool bTmpSet) override
Definition: rolbck.cxx:953
const SfxPoolItem * GetCurItem() const
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
sal_uLong m_nNodeIndex
Definition: rolbck.hxx:404
SwRegHistory(SwHistory *pHst)
Definition: rolbck.cxx:1274
const sal_Int32 m_nOtherContent
Definition: rolbck.hxx:256
const sal_Int32 m_nContent
Definition: rolbck.hxx:292
SwpHints & GetOrCreateSwpHints()
Definition: ndtxt.hxx:820
virtual const SwPosition & GetOtherMarkPos() const =0
#define RES_BOXATR_FORMULA
Definition: hintids.hxx:262
bool IsDefaultItem(const SfxPoolItem *pItem)
const sal_uLong m_nNodeIndex
Definition: rolbck.hxx:93
Base class of the Writer document model elements.
Definition: node.hxx:79
virtual OUString GetDescription() const override
Definition: rolbck.cxx:275
const OUString m_sName