LibreOffice Module sw (master)  1
unattr.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 <sal/config.h>
21 
22 #include <utility>
23 
24 #include <UndoAttribute.hxx>
25 #include <svl/itemiter.hxx>
26 #include <editeng/tstpitem.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <svx/svdpage.hxx>
29 #include <drawdoc.hxx>
30 #include <hintids.hxx>
31 #include <fmtflcnt.hxx>
32 #include <txtftn.hxx>
33 #include <fmtornt.hxx>
34 #include <fmtanchr.hxx>
35 #include <fmtfsize.hxx>
36 #include <frmfmt.hxx>
37 #include <fmtcntnt.hxx>
38 #include <ftnidx.hxx>
39 #include <doc.hxx>
40 #include <IDocumentUndoRedo.hxx>
44 #include <IShellCursorSupplier.hxx>
45 #include <docary.hxx>
46 #include <swundo.hxx>
47 #include <pam.hxx>
48 #include <ndtxt.hxx>
49 #include <swtable.hxx>
50 #include <swtblfmt.hxx>
51 #include <UndoCore.hxx>
52 #include <hints.hxx>
53 #include <rolbck.hxx>
54 #include <ndnotxt.hxx>
55 #include <dcontact.hxx>
56 #include <ftninfo.hxx>
57 #include <redline.hxx>
58 #include <section.hxx>
59 #include <charfmt.hxx>
60 #include <calbck.hxx>
61 
63  : SwClient( &rFormat )
64  , m_bSaveDrawPt( bSvDrwPt )
65 {
66 }
67 
68 void SwUndoFormatAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
69 {
70  if( pOld ) {
71  if ( pOld->Which() == RES_OBJECTDYING ) {
72  CheckRegistration( pOld );
73  } else if ( pNew ) {
74  if( POOLATTR_END >= pOld->Which() ) {
75  if ( GetUndo() ) {
76  m_pUndo->PutAttr( *pOld );
77  } else {
78  m_pUndo.reset( new SwUndoFormatAttr( *pOld,
79  *static_cast<SwFormat*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
80  }
81  } else if ( RES_ATTRSET_CHG == pOld->Which() ) {
82  if ( GetUndo() ) {
83  SfxItemIter aIter(
84  *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() );
85  const SfxPoolItem* pItem = aIter.GetCurItem();
86  while ( pItem ) {
87  m_pUndo->PutAttr( *pItem );
88  if( aIter.IsAtEnd() )
89  break;
90  pItem = aIter.NextItem();
91  }
92  } else {
93  m_pUndo.reset( new SwUndoFormatAttr(
94  *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(),
95  *static_cast<SwFormat*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
96  }
97  }
98  }
99  }
100 }
101 
103  SwFormat& rChgFormat,
104  bool bSaveDrawPt )
105  : SwUndo( SwUndoId::INSFMTATTR, rChgFormat.GetDoc() )
106  , m_pFormat( &rChgFormat )
107  // #i56253#
108  , m_pOldSet( new SfxItemSet( rOldSet ) )
109  , m_nNodeIndex( 0 )
110  , m_nFormatWhich( rChgFormat.Which() )
111  , m_bSaveDrawPt( bSaveDrawPt )
112 {
113  Init();
114 }
115 
117  bool bSaveDrawPt )
118  : SwUndo( SwUndoId::INSFMTATTR, rChgFormat.GetDoc() )
119  , m_pFormat( &rChgFormat )
120  , m_pOldSet( m_pFormat->GetAttrSet().Clone( false ) )
121  , m_nNodeIndex( 0 )
122  , m_nFormatWhich( rChgFormat.Which() )
123  , m_bSaveDrawPt( bSaveDrawPt )
124 {
125  m_pOldSet->Put( rItem );
126  Init();
127 }
128 
130 {
131  // tdf#126017 never save SwNodeIndex, it will go stale
132  m_pOldSet->ClearItem(RES_CNTNT);
133  // treat change of anchor specially
134  if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) {
136  } else if ( RES_FRMFMT == m_nFormatWhich ) {
137  SwDoc* pDoc = m_pFormat->GetDoc();
138  if (pDoc->GetTableFrameFormats()->ContainsFormat(dynamic_cast<const SwFrameFormat&>(*m_pFormat)))
139  {
140  // Table Format: save table position, table formats are volatile!
141  SwTable * pTable = SwIterator<SwTable,SwFormat>( *m_pFormat ).First();
142  if ( pTable ) {
143  m_nNodeIndex = pTable->GetTabSortBoxes()[ 0 ]->GetSttNd()
144  ->FindTableNode()->GetIndex();
145  }
146  } else if (pDoc->GetSections().ContainsFormat(m_pFormat)) {
148  } else if ( dynamic_cast< SwTableBoxFormat* >( m_pFormat ) != nullptr ) {
149  SwTableBox * pTableBox = SwIterator<SwTableBox,SwFormat>( *m_pFormat ).First();
150  if ( pTableBox ) {
151  m_nNodeIndex = pTableBox->GetSttIdx();
152  }
153  }
154  }
155 }
156 
158 {
159 }
160 
162 {
163  // OD 2004-10-26 #i35443#
164  // Important note: <Undo(..)> also called by <ReDo(..)>
165 
166  if (!m_pOldSet || !m_pFormat || !IsFormatInDoc(&rContext.GetDoc()))
167  return;
168 
169  // #i35443# - If anchor attribute has been successful
170  // restored, all other attributes are also restored.
171  // Thus, keep track of its restoration
172  bool bAnchorAttrRestored( false );
173  if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) {
174  bAnchorAttrRestored = RestoreFlyAnchor(rContext);
175  if ( bAnchorAttrRestored ) {
176  // Anchor attribute successful restored.
177  // Thus, keep anchor position for redo
178  SaveFlyAnchor();
179  } else {
180  // Anchor attribute not restored due to invalid anchor position.
181  // Thus, delete anchor attribute.
182  m_pOldSet->ClearItem( RES_ANCHOR );
183  }
184  }
185 
186  if ( !bAnchorAttrRestored ) {
189  if ( aTmp.GetUndo() ) {
190  // transfer ownership of helper object's old set
191  m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet);
192  } else {
193  m_pOldSet->ClearItem();
194  }
195 
197  rContext.SetSelections(static_cast<SwFrameFormat*>(m_pFormat), nullptr);
198  }
199  }
200 }
201 
203 {
204  // search for the Format in the Document; if it does not exist any more,
205  // the attribute is not restored!
206  bool isAlive(false);
207  switch ( m_nFormatWhich )
208  {
209  case RES_TXTFMTCOLL:
210  case RES_CONDTXTFMTCOLL:
211  isAlive = pDoc->GetTextFormatColls()->IsAlive(
212  static_cast<const SwTextFormatColl *>(m_pFormat));
213  break;
214 
215  case RES_GRFFMTCOLL:
216  isAlive = pDoc->GetGrfFormatColls()->IsAlive(
217  static_cast<const SwGrfFormatColl*>(m_pFormat));
218  break;
219 
220  case RES_CHRFMT:
221  isAlive = pDoc->GetCharFormats()->IsAlive(
222  static_cast<const SwCharFormat *>(m_pFormat));
223  break;
224 
225  case RES_FRMFMT:
226  if ( m_nNodeIndex && (m_nNodeIndex < pDoc->GetNodes().Count()) )
227  {
228  SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ];
229  if ( pNd->IsTableNode() )
230  {
231  m_pFormat =
232  static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat();
233  isAlive = true;
234  break;
235  }
236  else if ( pNd->IsSectionNode() )
237  {
238  m_pFormat =
239  static_cast<SwSectionNode*>(pNd)->GetSection().GetFormat();
240  isAlive = true;
241  break;
242  }
243  else if ( pNd->IsStartNode() && (SwTableBoxStartNode ==
244  static_cast< SwStartNode* >(pNd)->GetStartNodeType()) )
245  {
246  SwTableNode* pTableNode = pNd->FindTableNode();
247  if ( pTableNode )
248  {
249  SwTableBox* pBox =
250  pTableNode->GetTable().GetTableBox( m_nNodeIndex );
251  if ( pBox )
252  {
253  m_pFormat = pBox->GetFrameFormat();
254  isAlive = true;
255  break;
256  }
257  }
258  }
259  }
260  [[fallthrough]];
261  case RES_DRAWFRMFMT:
262  case RES_FLYFRMFMT:
263  if (pDoc->GetSpzFrameFormats()->IsAlive(static_cast<const SwFrameFormat *>(m_pFormat))
264  || pDoc->GetFrameFormats()->IsAlive(static_cast<const SwFrameFormat *>(m_pFormat)))
265  {
266  isAlive = true;
267  }
268  break;
269  }
270 
271  if (!isAlive)
272  {
273  // Format does not exist; reset
274  m_pFormat = nullptr;
275  }
276 
277  return nullptr != m_pFormat;
278 }
279 
280 // Check if it is still in Doc
282 {
283  return m_pFormat && IsFormatInDoc( &rDoc ) ? m_pFormat : nullptr;
284 }
285 
287 {
288  // #i35443# - Because the undo stores the attributes for
289  // redo, the same code as for <Undo(..)> can be applied for <Redo(..)>
290  UndoImpl(rContext);
291 }
292 
294 {
295  if (!m_pOldSet)
296  return;
297 
298  SwDoc & rDoc(rContext.GetDoc());
299 
300  switch ( m_nFormatWhich ) {
301  case RES_GRFFMTCOLL: {
302  SwNoTextNode *const pNd =
303  rContext.GetRepeatPaM().GetNode().GetNoTextNode();
304  if( pNd ) {
305  rDoc.SetAttr( m_pFormat->GetAttrSet(), *pNd->GetFormatColl() );
306  }
307  }
308  break;
309 
310  case RES_TXTFMTCOLL:
311  case RES_CONDTXTFMTCOLL:
312  {
313  SwTextNode *const pNd =
314  rContext.GetRepeatPaM().GetNode().GetTextNode();
315  if( pNd ) {
316  rDoc.SetAttr( m_pFormat->GetAttrSet(), *pNd->GetFormatColl() );
317  }
318  }
319  break;
320 
321  case RES_FLYFRMFMT: {
322  // Check if the cursor is in a flying frame
323  // Steps: search in all FlyFrameFormats for the FlyContent attribute
324  // and validate if the cursor is in the respective section
325  SwFrameFormat *const pFly =
326  rContext.GetRepeatPaM().GetNode().GetFlyFormat();
327  if( pFly ) {
328  // Bug 43672: do not set all attributes!
329  if (SfxItemState::SET ==
331  SfxItemSet aTmpSet( m_pFormat->GetAttrSet() );
332  aTmpSet.ClearItem( RES_CNTNT );
333  if( aTmpSet.Count() ) {
334  rDoc.SetAttr( aTmpSet, *pFly );
335  }
336  } else {
337  rDoc.SetAttr( m_pFormat->GetAttrSet(), *pFly );
338  }
339  }
340  break;
341  }
342  }
343 }
344 
346 {
347  SwRewriter aRewriter;
348 
349  if (m_pFormat) {
350  aRewriter.AddRule(UndoArg1, m_pFormat->GetName());
351  }
352 
353  return aRewriter;
354 }
355 
357 {
358  if (RES_CNTNT == rItem.Which())
359  {
360  return; // tdf#126017 never save SwNodeIndex, it will go stale
361  }
362  m_pOldSet->Put( rItem );
363  if ( RES_ANCHOR == rItem.Which() ) {
365  }
366 }
367 
368 void SwUndoFormatAttr::SaveFlyAnchor( bool bSvDrwPt )
369 {
370  // Format is valid, otherwise you would not reach this point here
371  if( bSvDrwPt ) {
372  if ( RES_DRAWFRMFMT == m_pFormat->Which() ) {
373  Point aPt( static_cast<SwFrameFormat*>(m_pFormat)->FindSdrObject()
374  ->GetRelativePos() );
375  // store old value as attribute, to keep SwUndoFormatAttr small
376  m_pOldSet->Put( SwFormatFrameSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) );
377  }
378  }
379 
380  const SwFormatAnchor& rAnchor =
381  m_pOldSet->Get( RES_ANCHOR, false );
382  if( !rAnchor.GetContentAnchor() )
383  return;
384 
385  sal_Int32 nContent = 0;
386  switch( rAnchor.GetAnchorId() ) {
387  case RndStdIds::FLY_AS_CHAR:
388  case RndStdIds::FLY_AT_CHAR:
389  nContent = rAnchor.GetContentAnchor()->nContent.GetIndex();
390  [[fallthrough]];
391  case RndStdIds::FLY_AT_PARA:
392  case RndStdIds::FLY_AT_FLY:
394  break;
395  default:
396  return;
397  }
398 
399  SwFormatAnchor aAnchor( rAnchor.GetAnchorId(), nContent );
400  m_pOldSet->Put( aAnchor );
401 }
402 
403 // #i35443# - Add return value, type <bool>.
404 // Return value indicates, if anchor attribute is restored.
405 // Note: If anchor attribute is restored, all other existing attributes
406 // are also restored.
408 {
409  SwDoc *const pDoc = & rContext.GetDoc();
410  SwFrameFormat* pFrameFormat = static_cast<SwFrameFormat*>(m_pFormat);
411  const SwFormatAnchor& rAnchor =
412  m_pOldSet->Get( RES_ANCHOR, false );
413 
414  SwFormatAnchor aNewAnchor( rAnchor.GetAnchorId() );
415  if (RndStdIds::FLY_AT_PAGE != rAnchor.GetAnchorId()) {
416  SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ];
417 
418  if ( (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId())
419  ? ( !pNd->IsStartNode() || (SwFlyStartNode !=
420  static_cast<SwStartNode*>(pNd)->GetStartNodeType()) )
421  : !pNd->IsTextNode() ) {
422  // #i35443# - invalid position.
423  // Thus, anchor attribute not restored
424  return false;
425  }
426 
427  SwPosition aPos( *pNd );
428  if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) ||
429  (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) {
430  aPos.nContent.Assign( static_cast<SwTextNode*>(pNd), rAnchor.GetPageNum() );
431  if ( aPos.nContent.GetIndex() > pNd->GetTextNode()->GetText().getLength()) {
432  // #i35443# - invalid position.
433  // Thus, anchor attribute not restored
434  return false;
435  }
436  }
437  aNewAnchor.SetAnchor( &aPos );
438  } else
439  aNewAnchor.SetPageNum( rAnchor.GetPageNum() );
440 
441  Point aDrawSavePt, aDrawOldPt;
443  if( RES_DRAWFRMFMT == pFrameFormat->Which() ) {
444  // get the old cached value
445  const SwFormatFrameSize& rOldSize = m_pOldSet->Get( RES_FRM_SIZE );
446  aDrawSavePt.setX( rOldSize.GetWidth() );
447  aDrawSavePt.setY( rOldSize.GetHeight() );
448  m_pOldSet->ClearItem( RES_FRM_SIZE );
449 
450  // write the current value into cache
451  aDrawOldPt = pFrameFormat->FindSdrObject()->GetRelativePos();
452  } else {
453  pFrameFormat->DelFrames(); // delete Frames
454  }
455  }
456 
457  const SwFormatAnchor &rOldAnch = pFrameFormat->GetAnchor();
458  // #i54336#
459  // Consider case, that as-character anchored object has moved its anchor position.
460  if (RndStdIds::FLY_AS_CHAR == rOldAnch.GetAnchorId()) {
461  // With InContents it's tricky: the text attribute needs to be deleted.
462  // Unfortunately, this not only destroys the Frames but also the format.
463  // To prevent that, first detach the connection between attribute and
464  // format.
465  const SwPosition *pPos = rOldAnch.GetContentAnchor();
466  SwTextNode *pTextNode = static_cast<SwTextNode*>(&pPos->nNode.GetNode());
467  OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." );
468  const sal_Int32 nIdx = pPos->nContent.GetIndex();
469  SwTextAttr * const pHint =
470  pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
471  assert(pHint && "Missing Hint.");
472  OSL_ENSURE( pHint->Which() == RES_TXTATR_FLYCNT,
473  "Missing FlyInCnt-Hint." );
474  OSL_ENSURE( pHint->GetFlyCnt().GetFrameFormat() == pFrameFormat,
475  "Wrong TextFlyCnt-Hint." );
476  const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt()).SetFlyFormat();
477 
478  // Connection is now detached, therefore the attribute can be deleted
479  pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx );
480  }
481 
482  {
483  m_pOldSet->Put( aNewAnchor );
486  if ( aTmp.GetUndo() ) {
488  // transfer ownership of helper object's old set
489  m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet);
490  } else {
491  m_pOldSet->ClearItem();
492  }
493  }
494 
495  if ( RES_DRAWFRMFMT == pFrameFormat->Which() )
496  {
497  // The Draw model also prepared an Undo object for its right positioning
498  // which unfortunately is relative. Therefore block here a position
499  // change of the Contact object by setting the anchor.
500  pFrameFormat->CallSwClientNotify(sw::RestoreFlyAnchorHint(aDrawSavePt));
501  // cache the old value again
502  m_pOldSet->Put(SwFormatFrameSize(ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y()));
503  }
504 
505  if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) {
506  const SwPosition* pPos = aNewAnchor.GetContentAnchor();
507  SwTextNode* pTextNd = pPos->nNode.GetNode().GetTextNode();
508  OSL_ENSURE( pTextNd, "no Text Node at position." );
509  SwFormatFlyCnt aFormat( pFrameFormat );
510  pTextNd->InsertItem( aFormat, pPos->nContent.GetIndex(), 0 );
511  }
512 
513  if (RES_DRAWFRMFMT != pFrameFormat->Which())
514  pFrameFormat->MakeFrames();
515  else
516  {
518  }
519 
520  rContext.SetSelections(pFrameFormat, nullptr);
521 
522  // #i35443# - anchor attribute restored.
523  return true;
524 }
525 
527  const sal_uInt16 nWhichId )
528  : SwUndo( SwUndoId::RESETATTR, rChangedFormat.GetDoc() )
529  , m_pChangedFormat( &rChangedFormat )
530  , m_nWhichId( nWhichId )
531 {
532  const SfxPoolItem* pItem = nullptr;
533  if (rChangedFormat.GetItemState(nWhichId, false, &pItem ) == SfxItemState::SET && pItem) {
534  m_pOldItem.reset( pItem->Clone() );
535  }
536 }
537 
539 {
540 }
541 
543 {
544  if (m_pOldItem)
545  {
547  }
548 }
549 
551 {
552  if (m_pOldItem)
553  {
555  }
556 }
557 
558 SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFormatId )
559  : SwUndo( SwUndoId::RESETATTR, rRange.GetDoc() ), SwUndRng( rRange )
560  , m_pHistory( new SwHistory )
561  , m_nFormatId( nFormatId )
562 {
563 }
564 
565 SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, sal_uInt16 nFormatId )
566  : SwUndo( SwUndoId::RESETATTR, rPos.GetDoc() )
567  , m_pHistory( new SwHistory )
568  , m_nFormatId( nFormatId )
569 {
570  nSttNode = nEndNode = rPos.nNode.GetIndex();
572 }
573 
575 {
576 }
577 
579 {
580  // reset old values
581  SwDoc & rDoc = rContext.GetDoc();
582  m_pHistory->TmpRollback( &rDoc, 0 );
583  m_pHistory->SetTmpEnd( m_pHistory->Count() );
584 
585  if ((RES_CONDTXTFMTCOLL == m_nFormatId) &&
586  (nSttNode == nEndNode) && (nSttContent == nEndContent)) {
587  SwTextNode* pTNd = rDoc.GetNodes()[ nSttNode ]->GetTextNode();
588  if( pTNd ) {
589  SwIndex aIdx( pTNd, nSttContent );
590  pTNd->DontExpandFormat( aIdx, false );
591  }
592  }
593 
594  AddUndoRedoPaM(rContext);
595 }
596 
598 {
599  SwDoc & rDoc = rContext.GetDoc();
600  SwPaM & rPam = AddUndoRedoPaM(rContext);
601 
602  switch ( m_nFormatId ) {
603  case RES_CHRFMT:
604  rDoc.RstTextAttrs(rPam);
605  break;
606  case RES_TXTFMTCOLL:
607  rDoc.ResetAttrs(rPam, false, m_Ids );
608  break;
609  case RES_CONDTXTFMTCOLL:
610  rDoc.ResetAttrs(rPam, true, m_Ids );
611 
612  break;
613  case RES_TXTATR_TOXMARK:
614  // special treatment for TOXMarks
615  {
617  SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
618  SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetContentNode(),
619  nSttContent ));
620 
621  sal_uInt16 nCnt = SwDoc::GetCurTOXMark( aPos, aArr );
622  if( nCnt ) {
623  if( 1 < nCnt ) {
624  // search for the right one
625  SwHistoryHint* pHHint = (GetHistory())[ 0 ];
626  if( pHHint && HSTRY_SETTOXMARKHNT == pHHint->Which() ) {
627  while( nCnt ) {
628  if ( static_cast<SwHistorySetTOXMark*>(pHHint)
629  ->IsEqual( *aArr[ --nCnt ] ) ) {
630  ++nCnt;
631  break;
632  }
633  }
634  } else
635  nCnt = 0;
636  }
637  // found one, thus delete it
638  if( nCnt-- ) {
639  rDoc.DeleteTOXMark( aArr[ nCnt ] );
640  }
641  }
642  }
643  break;
644  }
645 }
646 
648 {
649  if (m_nFormatId < RES_FMT_BEGIN) {
650  return;
651  }
652 
653  switch ( m_nFormatId ) {
654  case RES_CHRFMT:
655  rContext.GetDoc().RstTextAttrs(rContext.GetRepeatPaM());
656  break;
657  case RES_TXTFMTCOLL:
658  rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, m_Ids);
659  break;
660  case RES_CONDTXTFMTCOLL:
661  rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, m_Ids);
662  break;
663  }
664 }
665 
666 void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs )
667 {
668  m_Ids.clear();
669  m_Ids.insert( rAttrs.begin(), rAttrs.end() );
670 }
671 
672 SwUndoAttr::SwUndoAttr( const SwPaM& rRange, const SfxPoolItem& rAttr,
673  const SetAttrMode nFlags )
674  : SwUndo( SwUndoId::INSATTR, rRange.GetDoc() ), SwUndRng( rRange )
675  , m_AttrSet( rRange.GetDoc()->GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} )
676  , m_pHistory( new SwHistory )
677  , m_nNodeIndex( ULONG_MAX )
678  , m_nInsertFlags( nFlags )
679 {
680  m_AttrSet.Put( rAttr );
681 }
682 
683 SwUndoAttr::SwUndoAttr( const SwPaM& rRange, const SfxItemSet& rSet,
684  const SetAttrMode nFlags )
685  : SwUndo( SwUndoId::INSATTR, rRange.GetDoc() ), SwUndRng( rRange )
686  , m_AttrSet( rSet )
687  , m_pHistory( new SwHistory )
688  , m_nNodeIndex( ULONG_MAX )
689  , m_nInsertFlags( nFlags )
690 {
691 }
692 
694 {
695 }
696 
697 void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsContent )
698 {
699  SwDoc* pDoc = rPam.GetDoc();
700  if ( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) {
701  m_pRedlineData.reset( new SwRedlineData( bIsContent
705  }
706 
709  m_pRedlineSaveData.reset();
710 
712  if ( bIsContent ) {
713  m_nNodeIndex = rPam.GetPoint()->nNode.GetIndex();
714  }
715 }
716 
718 {
719  SwDoc *const pDoc = & rContext.GetDoc();
720 
721  RemoveIdx( *pDoc );
722 
724  SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
725  if ( ULONG_MAX != m_nNodeIndex ) {
726  aPam.DeleteMark();
727  aPam.GetPoint()->nNode = m_nNodeIndex;
728  aPam.GetPoint()->nContent.Assign( aPam.GetContentNode(), nSttContent );
729  aPam.SetMark();
730  ++aPam.GetPoint()->nContent;
732  } else {
733  // remove all format redlines, will be recreated if needed
734  SetPaM(aPam);
736  if (m_pRedlineSaveData)
737  {
738  SetSaveData( *pDoc, *m_pRedlineSaveData );
739  }
740  }
741  }
742 
743  const bool bToLast = (1 == m_AttrSet.Count())
746 
747  // restore old values
748  m_pHistory->TmpRollback( pDoc, 0, !bToLast );
749  m_pHistory->SetTmpEnd( m_pHistory->Count() );
750 
751  // set cursor onto Undo area
752  AddUndoRedoPaM(rContext);
753 }
754 
756 {
757  // RefMarks are not repeat capable
758  if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, false ) ) {
761  } else if ( 1 < m_AttrSet.Count() ) {
762  SfxItemSet aTmpSet( m_AttrSet );
763  aTmpSet.ClearItem( RES_TXTATR_REFMARK );
765  aTmpSet, m_nInsertFlags );
766  }
767 }
768 
770 {
771  SwDoc & rDoc = rContext.GetDoc();
772  SwPaM & rPam = AddUndoRedoPaM(rContext);
773 
774  if ( m_pRedlineData.get() &&
779 
780  if ( ULONG_MAX != m_nNodeIndex ) {
781  rPam.SetMark();
782  if ( rPam.Move( fnMoveBackward ) ) {
784  true);
785  }
786  rPam.DeleteMark();
787  } else {
789  }
790 
792  } else {
794  }
795 }
796 
798 {
799  if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_FTN, false ))
800  return ;
801 
802  SwNodes& rNds = rDoc.GetNodes();
803  for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n ) {
804  sal_Int32 nContent = 0;
805  sal_uLong nNode = 0;
806  SwHistoryHint* pHstHint = (*m_pHistory)[ n ];
807  switch ( pHstHint->Which() ) {
808  case HSTRY_RESETTXTHNT: {
809  SwHistoryResetText * pHistoryHint
810  = static_cast<SwHistoryResetText*>(pHstHint);
811  if ( RES_TXTATR_FTN == pHistoryHint->GetWhich() ) {
812  nNode = pHistoryHint->GetNode();
813  nContent = pHistoryHint->GetContent();
814  }
815  }
816  break;
817 
818  default:
819  break;
820  }
821 
822  if( nNode ) {
823  SwTextNode* pTextNd = rNds[ nNode ]->GetTextNode();
824  if( pTextNd ) {
825  SwTextAttr *const pTextHt =
826  pTextNd->GetTextAttrForCharAt(nContent, RES_TXTATR_FTN);
827  if( pTextHt ) {
828  // ok, so get values
829  SwTextFootnote* pFootnote = static_cast<SwTextFootnote*>(pTextHt);
830  RemoveIdxFromSection( rDoc, pFootnote->GetStartNode()->GetIndex() );
831  return ;
832  }
833  }
834  }
835  }
836 }
837 
839  : SwUndo( SwUndoId::SETDEFTATTR, pDoc )
840 {
841  const SfxPoolItem* pItem;
842  if( SfxItemState::SET == rSet.GetItemState( RES_PARATR_TABSTOP, false, &pItem ) ) {
843  // store separately, because it may change!
844  m_pTabStop.reset( static_cast<SvxTabStopItem*>(pItem->Clone()) );
845  if ( 1 != rSet.Count() ) { // are there more attributes?
846  m_pOldSet.reset( new SfxItemSet( rSet ) );
847  }
848  } else {
849  m_pOldSet.reset( new SfxItemSet( rSet ) );
850  }
851 }
852 
854 {
855 }
856 
858 {
859  SwDoc & rDoc = rContext.GetDoc();
860  if (m_pOldSet)
861  {
863  *rDoc.GetDfltTextFormatColl() );
864  rDoc.SetDefault( *m_pOldSet );
865  m_pOldSet.reset();
866  if ( aTmp.GetUndo() ) {
867  // transfer ownership of helper object's old set
868  m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet);
869  }
870  }
871  if (m_pTabStop)
872  {
873  std::unique_ptr<SvxTabStopItem> pOld(static_cast<SvxTabStopItem*>(
874  rDoc.GetDefault( RES_PARATR_TABSTOP ).Clone() ));
875  rDoc.SetDefault( *m_pTabStop );
876  m_pTabStop = std::move( pOld );
877  }
878 }
879 
881 {
882  UndoImpl(rContext);
883 }
884 
886  const SwPaM& rPam, bool bFlag, bool bMod )
887  : SwUndo( bFlag ? SwUndoId::INC_LEFTMARGIN : SwUndoId::DEC_LEFTMARGIN, rPam.GetDoc() )
888  , SwUndRng( rPam )
889  , m_pHistory( new SwHistory )
890  , m_bModulus( bMod )
891 {
892 }
893 
895 {
896 }
897 
899 {
900  SwDoc & rDoc = rContext.GetDoc();
901 
902  // restore old values
903  m_pHistory->TmpRollback( & rDoc, 0 );
904  m_pHistory->SetTmpEnd( m_pHistory->Count() );
905 
906  AddUndoRedoPaM(rContext);
907 }
908 
910 {
911  SwDoc & rDoc = rContext.GetDoc();
912  SwPaM & rPam = AddUndoRedoPaM(rContext);
913 
914  rDoc.MoveLeftMargin( rPam,
916 }
917 
919 {
920  SwDoc & rDoc = rContext.GetDoc();
922  m_bModulus );
923 }
924 
926  const SwPaM& rRange, const OUString& rText,
927  bool const bIsEndNote)
928  : SwUndo( SwUndoId::CHGFTN, rRange.GetDoc() ), SwUndRng( rRange )
929  , m_pHistory( new SwHistory() )
930  , m_Text( rText )
931  , m_bEndNote( bIsEndNote )
932 {
933 }
934 
936 {
937 }
938 
940 {
941  SwDoc & rDoc = rContext.GetDoc();
942 
943  m_pHistory->TmpRollback( &rDoc, 0 );
944  m_pHistory->SetTmpEnd( m_pHistory->Count() );
945 
947 
948  AddUndoRedoPaM(rContext);
949 }
950 
952 {
953  SwDoc & rDoc( rContext.GetDoc() );
954  SwPaM & rPaM = AddUndoRedoPaM(rContext);
955  rDoc.SetCurFootnote(rPaM, m_Text, m_bEndNote);
956  SetPaM(rPaM);
957 }
958 
960 {
961  SwDoc & rDoc = rContext.GetDoc();
962  rDoc.SetCurFootnote(rContext.GetRepeatPaM(), m_Text, m_bEndNote);
963 }
964 
966  : SwUndo( SwUndoId::FTNINFO, pDoc )
967  , m_pFootNoteInfo( new SwFootnoteInfo( rInfo ) )
968 {
969 }
970 
972 {
973 }
974 
976 {
977  SwDoc & rDoc = rContext.GetDoc();
978  SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() );
980  m_pFootNoteInfo.reset( pInf );
981 }
982 
984 {
985  SwDoc & rDoc = rContext.GetDoc();
986  SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() );
988  m_pFootNoteInfo.reset( pInf );
989 }
990 
992  : SwUndo( SwUndoId::FTNINFO, pDoc )
993  , m_pEndNoteInfo( new SwEndNoteInfo( rInfo ) )
994 {
995 }
996 
998 {
999 }
1000 
1002 {
1003  SwDoc & rDoc = rContext.GetDoc();
1004  SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
1005  rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
1006  m_pEndNoteInfo.reset( pInf );
1007 }
1008 
1010 {
1011  SwDoc & rDoc = rContext.GetDoc();
1012  SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
1013  rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
1014  m_pEndNoteInfo.reset( pInf );
1015 }
1016 
1018  : SwUndo( SwUndoId::DONTEXPAND, rPos.GetDoc() )
1019  , m_nNodeIndex( rPos.nNode.GetIndex() )
1020  , m_nContentIndex( rPos.nContent.GetIndex() )
1021 {
1022 }
1023 
1025 {
1026  SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
1027  SwDoc *const pDoc = & rContext.GetDoc();
1028 
1029  SwPosition& rPos = *pPam->GetPoint();
1030  rPos.nNode = m_nNodeIndex;
1032  pDoc->DontExpandFormat( rPos, false );
1033 }
1034 
1036 {
1037  SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
1038  SwDoc *const pDoc = & rContext.GetDoc();
1039 
1040  SwPosition& rPos = *pPam->GetPoint();
1041  rPos.nNode = m_nNodeIndex;
1043  pDoc->DontExpandFormat( rPos );
1044 }
1045 
1047 {
1048  SwPaM & rPam = rContext.GetRepeatPaM();
1049  SwDoc & rDoc = rContext.GetDoc();
1050  rDoc.DontExpandFormat( *rPam.GetPoint() );
1051 }
1052 
1053 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Starts a section of nodes in the document model.
Definition: node.hxx:303
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
Definition: undobj.cxx:106
const SwGrfFormatColls * GetGrfFormatColls() const
Definition: doc.hxx:801
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const std::set< sal_uInt16 > &rAttrs=std::set< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
Definition: docfmt.cxx:256
SwUndoResetAttr(const SwPaM &, sal_uInt16 nFormatId)
Definition: unattr.cxx:558
void DeleteMark()
Definition: pam.hxx:177
const sal_uInt16 m_nFormatWhich
#define RES_FRM_SIZE
Definition: hintids.hxx:194
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
void SetSelections(SwFrameFormat *const pSelFormat, SdrMarkList *const pMarkList)
Definition: UndoCore.hxx:98
#define RES_GRFFMTCOLL
Definition: hintids.hxx:276
#define RES_FRMFMT
Definition: hintids.hxx:273
sal_uLong m_nNodeIndex
sal_uInt16 GetWhich() const
Definition: rolbck.hxx:191
Marks a position in the document model.
Definition: pam.hxx:35
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:880
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:909
std::unique_ptr< SfxPoolItem > m_pOldItem
bool IsSectionNode() const
Definition: node.hxx:644
#define RES_CONDTXTFMTCOLL
Definition: hintids.hxx:278
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1344
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
Definition: docftn.cxx:290
sal_Int32 nSttContent
Definition: undobj.hxx:217
#define RES_ATTRSET_CHG
Definition: hintids.hxx:285
const OUString & GetText() const
Definition: ndtxt.hxx:211
sal_uLong GetSttIdx() const
Definition: swtable.cxx:1880
SwUndoId
Definition: swundo.hxx:29
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4890
void PutAttr(const SfxPoolItem &rItem)
Definition: unattr.cxx:356
const sal_uLong m_nNodeIndex
virtual SwPaM & CreateNewShellCursor()=0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
const SwFrameFormats * GetTableFrameFormats() const
Definition: doc.hxx:806
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
Definition: undobj.cxx:1416
SwNodeIndex nNode
Definition: pam.hxx:37
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
long GetWidth() const
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1024
const std::unique_ptr< SwHistory > m_pHistory
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
SwUndoChangeFootNote(const SwPaM &rRange, const OUString &rText, bool bIsEndNote)
Definition: unattr.cxx:925
SwHistory & GetHistory()
sal_uIntPtr sal_uLong
SwPaM & GetRepeatPaM()
Definition: UndoCore.hxx:128
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:44
virtual Point GetRelativePos() const
bool DontExpandFormat(const SwIndex &rIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
Definition: ndtxt.cxx:1605
Definition: doc.hxx:185
const std::unique_ptr< SwHistory > m_pHistory
const sal_uInt16 m_nFormatId
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:118
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool IsAtEnd() const
SfxItemSet m_AttrSet
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:293
sal_uInt16 Which() const
Definition: txatbase.hxx:110
static void RemoveIdxFromSection(SwDoc &, sal_uLong nSttIdx, const sal_uLong *pEndIdx=nullptr)
Definition: undobj.cxx:114
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:959
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:983
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
#define RES_CNTNT
Definition: hintids.hxx:200
SwUndoId GetId() const
Definition: undobj.hxx:99
std::unique_ptr< SvxTabStopItem > m_pTabStop
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
IShellCursorSupplier & GetCursorSupplier()
Definition: UndoCore.hxx:96
sal_uLong nEndNode
Definition: undobj.hxx:216
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
virtual ~SwUndoChangeFootNote() override
Definition: unattr.cxx:935
#define POOLATTR_END
Definition: hintids.hxx:64
const SetAttrMode m_nInsertFlags
SwIndex nContent
Definition: pam.hxx:38
void setX(long nX)
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:771
static bool IsRedlineOn(const RedlineFlags eM)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:126
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:166
const OUString & GetName() const
Definition: format.hxx:111
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:682
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
bool IsFormatInDoc(SwDoc *)
Definition: unattr.cxx:202
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:542
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1009
bool IsStartNode() const
Definition: node.hxx:624
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
SwUndoMoveLeftMargin(const SwPaM &, bool bRight, bool bModulus)
Definition: unattr.cxx:885
#define RES_TXTFMTCOLL
Definition: hintids.hxx:275
void setY(long nY)
SwDoc & GetDoc() const
Definition: UndoCore.hxx:94
SwUndoFormatAttr(const SfxItemSet &rOldSet, SwFormat &rFormat, bool bSaveDrawPt)
Definition: unattr.cxx:102
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:117
std::unique_ptr< SwFootnoteInfo > m_pFootNoteInfo
virtual ~SwUndoEndNoteInfo() override
Definition: unattr.cxx:997
SwUndoFormatAttr * GetUndo() const
sal_uLong GetNode() const
Definition: rolbck.hxx:192
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:717
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
Base class for various Writer styles.
Definition: format.hxx:43
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:286
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
SwFormat * m_pFormat
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:259
virtual std::size_t GetRedlineAuthor()=0
bool SetCurFootnote(const SwPaM &rPam, const OUString &rNumStr, bool bIsEndNote)
change footnotes in range
Definition: docftn.cxx:432
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:483
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
Style of a layout element.
Definition: frmfmt.hxx:57
std::unique_ptr< sw::ModifyChangedHint > CheckRegistration(const SfxPoolItem *pOldValue)
Definition: calbck.cxx:78
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:975
bool RestoreFlyAnchor(::sw::UndoRedoContext &rContext)
Definition: unattr.cxx:407
#define RES_ANCHOR
Definition: hintids.hxx:209
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:918
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
const SwPosition * GetPoint() const
Definition: pam.hxx:207
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:550
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:161
void SaveRedlineData(const SwPaM &rPam, bool bInsContent)
Definition: unattr.cxx:697
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
virtual ~SwUndoMoveLeftMargin() override
Definition: unattr.cxx:894
Count
const OUString m_Text
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
Definition: undobj.cxx:1446
SetAttrMode
Definition: swtypes.hxx:143
TElementType * First()
Definition: calbck.hxx:345
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
Definition: node.hxx:615
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
std::unique_ptr< SfxItemSet > m_pOldSet
const SfxPoolItem * NextItem()
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
SwDoc * GetDoc() const
Definition: pam.hxx:243
virtual ~SwUndoFormatResetAttr() override
Definition: unattr.cxx:538
const sal_uInt16 m_nWhichId
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
Marks a character position inside a document model node.
Definition: index.hxx:37
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:29
sal_uLong nSttNode
Definition: undobj.hxx:216
SwUndoEndNoteInfo(const SwEndNoteInfo &rInfo, const SwDoc *pDoc)
Definition: unattr.cxx:991
SwUndoAttr(const SwPaM &, const SfxItemSet &, const SetAttrMode nFlags)
Definition: unattr.cxx:683
SwUndoFormatResetAttr(SwFormat &rChangedFormat, const sal_uInt16 nWhichId)
Definition: unattr.cxx:526
const std::unique_ptr< SwHistory > m_pHistory
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
Marks a node in the document model.
Definition: ndindex.hxx:31
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:425
virtual ~SwUndoFootNoteInfo() override
Definition: unattr.cxx:971
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
std::unique_ptr< SwRedlineData > m_pRedlineData
SwFormat *const m_pChangedFormat
void SetAttrs(const std::set< sal_uInt16 > &rAttrs)
Definition: unattr.cxx:666
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:755
sal_Int32 nEndContent
Definition: undobj.hxx:217
long X() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
std::unique_ptr< SwUndoFormatAttr > m_pUndo
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
Definition: docfmt.cxx:235
std::unique_ptr< SfxItemSet > m_pOldSet
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
ignore Redlines
virtual ~SwUndoResetAttr() override
Definition: unattr.cxx:574
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
SwFormat * GetFormat(SwDoc &rDoc)
Definition: unattr.cxx:281
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
Definition: docftn.cxx:363
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
Definition: docfmt.cxx:554
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:939
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 DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
Definition: doctxm.cxx:160
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
Definition: docfmt.cxx:1645
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:652
void RemoveIdx(SwDoc &rDoc)
Definition: unattr.cxx:797
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:367
#define RES_TXTATR_FIELD
Definition: hintids.hxx:150
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:578
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1471
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:734
void SetPaM(SwPaM &, bool bCorrToContent=false) const
Definition: undobj.cxx:78
sal_uLong m_nNodeIndex
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:773
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
Definition: unattr.cxx:68
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:597
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
Definition: doctxm.cxx:122
std::unique_ptr< SwEndNoteInfo > m_pEndNoteInfo
#define RES_TXTATR_ANNOTATION
Definition: hintids.hxx:153
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
Definition: docfmt.cxx:1709
sal_Int32 GetIndex() const
Definition: index.hxx:95
#define RES_CHRFMT
Definition: hintids.hxx:272
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2628
SwUndoDontExpandFormat(const SwPosition &rPos)
Definition: unattr.cxx:1017
virtual bool IsRedlineOn() const =0
Query if redlining is on.
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:951
virtual ~SwUndoAttr() override
Definition: unattr.cxx:693
SwUndoFootNoteInfo(const SwFootnoteInfo &rInfo, const SwDoc *pDoc)
Definition: unattr.cxx:965
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
sal_Int32 GetContent() const
Definition: rolbck.hxx:193
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:769
std::set< sal_uInt16 > m_Ids
HISTORY_HINT Which() const
Definition: rolbck.hxx:86
const bool m_bSaveDrawPt
bool isAlive()
void SaveFlyAnchor(bool bSaveDrawPt=false)
Definition: unattr.cxx:368
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:151
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:1046
#define RES_TXTATR_REFMARK
Definition: hintids.hxx:136
const SvxPageUsage aArr[]
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1001
Format of a fly content.
Definition: fmtflcnt.hxx:32
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:376
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:351
#define RES_OBJECTDYING
Definition: hintids.hxx:283
const sal_uInt16 * GetRanges() const
SwModify * GetRegisteredInNonConst() const
Definition: calbck.hxx:134
SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:628
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
bool ContainsFormat(SwFrameFormat const &rFormat) const
fast check if given format is contained here pFormat must not have been deleted
Definition: docfmt.cxx:2141
bool IsTableNode() const
Definition: node.hxx:640
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:898
SwFormatColl * GetFormatColl() const
Definition: node.hxx:447
bool ContainsFormat(SwFormat const *const pFormat) const
check if given format is contained here pFormat must not have been deleted
Definition: docary.hxx:170
SwUndoDefaultAttr(const SfxItemSet &rOldSet, const SwDoc *pDoc)
Definition: unattr.cxx:838
#define RES_FMT_BEGIN
Definition: hintids.hxx:271
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:457
virtual ~SwUndoFormatAttr() override
Definition: unattr.cxx:157
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
SwUndoFormatAttrHelper(SwFormat &rFormat, bool bSaveDrawPt=true)
Definition: unattr.cxx:62
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:732
void UpdateAllFootnote()
Definition: ftnidx.cxx:267
long GetHeight() const
SwSectionFormats & GetSections()
Definition: doc.hxx:1326
bool IsTextNode() const
Definition: node.hxx:636
Frame is variable in Var-direction.
Definition: fmtfsize.hxx:37
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:710
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:137
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:857
const sal_Int32 m_nContentIndex
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:624
sal_uInt16 Which() const
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:626
long Y() const
const SfxPoolItem * GetCurItem() const
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unattr.cxx:345
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
bool HasHints() const
Definition: ndtxt.hxx:221
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unattr.cxx:1035
virtual ~SwUndoDefaultAttr() override
Definition: unattr.cxx:853
const std::unique_ptr< SwHistory > m_pHistory
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unattr.cxx:647
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:206
Base class of the Writer document model elements.
Definition: node.hxx:79