LibreOffice Module sw (master)  1
undraw.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 <UndoDraw.hxx>
21 
22 #include <rtl/string.h>
23 
24 #include <svx/svdogrp.hxx>
25 #include <svx/svdundo.hxx>
26 #include <svx/svdpage.hxx>
27 #include <svx/svdmark.hxx>
28 
29 #include <hintids.hxx>
30 #include <hints.hxx>
31 #include <fmtanchr.hxx>
32 #include <fmtflcnt.hxx>
33 #include <txtflcnt.hxx>
34 #include <frmfmt.hxx>
35 #include <doc.hxx>
36 #include <IDocumentUndoRedo.hxx>
38 #include <docary.hxx>
39 #include <frame.hxx>
40 #include <swundo.hxx>
41 #include <pam.hxx>
42 #include <ndtxt.hxx>
43 #include <UndoCore.hxx>
44 #include <dcontact.hxx>
45 #include <dview.hxx>
46 #include <rootfrm.hxx>
47 #include <viewsh.hxx>
48 
50 {
54 };
55 
56 // Draw-Objecte
57 
58 void SwDoc::AddDrawUndo( std::unique_ptr<SdrUndoAction> pUndo )
59 {
60  if (GetIDocumentUndoRedo().DoesUndo() &&
61  GetIDocumentUndoRedo().DoesDrawUndo())
62  {
63  const SdrMarkList* pMarkList = nullptr;
65  if( pSh && pSh->HasDrawView() )
66  pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
67 
68  GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwSdrUndo>(std::move(pUndo), pMarkList, this) );
69  }
70 }
71 
72 SwSdrUndo::SwSdrUndo( std::unique_ptr<SdrUndoAction> pUndo, const SdrMarkList* pMrkLst, const SwDoc* pDoc )
73  : SwUndo( SwUndoId::DRAWUNDO, pDoc ), pSdrUndo( std::move(pUndo) )
74 {
75  if( pMrkLst && pMrkLst->GetMarkCount() )
76  pMarkList.reset( new SdrMarkList( *pMrkLst ) );
77 }
78 
80 {
81  pSdrUndo.reset();
82  pMarkList.reset();
83 }
84 
86 {
87  pSdrUndo->Undo();
88  rContext.SetSelections(nullptr, pMarkList.get());
89 }
90 
92 {
93  pSdrUndo->Redo();
94  rContext.SetSelections(nullptr, pMarkList.get());
95 }
96 
97 OUString SwSdrUndo::GetComment() const
98 {
99  return pSdrUndo->GetComment();
100 }
101 
102 static void lcl_SendRemoveToUno( SwFormat& rFormat )
103 {
104  SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFormat );
105  rFormat.ModifyNotification( &aMsgHint, &aMsgHint );
106 }
107 
108 static void lcl_SaveAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos )
109 {
110  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
111  if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) ||
112  (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
113  (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) ||
114  (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()))
115  {
116  rNodePos = rAnchor.GetContentAnchor()->nNode.GetIndex();
117  sal_Int32 nContentPos = 0;
118 
119  if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())
120  {
121  nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex();
122 
123  // destroy TextAttribute
124  SwTextNode *pTextNd = pFormat->GetDoc()->GetNodes()[ rNodePos ]->GetTextNode();
125  OSL_ENSURE( pTextNd, "No text node found!" );
126  SwTextFlyCnt* pAttr = static_cast<SwTextFlyCnt*>(
127  pTextNd->GetTextAttrForCharAt( nContentPos, RES_TXTATR_FLYCNT ));
128  // attribute still in text node, delete
129  if( pAttr && pAttr->GetFlyCnt().GetFrameFormat() == pFormat )
130  {
131  // just set pointer to 0, don't delete
132  const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
133  SwIndex aIdx( pTextNd, nContentPos );
134  pTextNd->EraseText( aIdx, 1 );
135  }
136  }
137  else if (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())
138  {
139  nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex();
140  }
141 
142  pFormat->SetFormatAttr( SwFormatAnchor( rAnchor.GetAnchorId(), nContentPos ) );
143  }
144 }
145 
146 static void lcl_RestoreAnchor( SwFrameFormat* pFormat, sal_uLong nNodePos )
147 {
148  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
149  if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) ||
150  (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
151  (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) ||
152  (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()))
153  {
154  const sal_Int32 nContentPos = rAnchor.GetPageNum();
155  SwNodes& rNds = pFormat->GetDoc()->GetNodes();
156 
157  SwNodeIndex aIdx( rNds, nNodePos );
158  SwPosition aPos( aIdx );
159 
160  SwFormatAnchor aTmp( rAnchor.GetAnchorId() );
161  if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) ||
162  (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()))
163  {
164  aPos.nContent.Assign( aIdx.GetNode().GetContentNode(), nContentPos );
165  }
166  aTmp.SetAnchor( &aPos );
167  RndStdIds nAnchorId = rAnchor.GetAnchorId();
168  pFormat->SetFormatAttr( aTmp );
169 
170  if (RndStdIds::FLY_AS_CHAR == nAnchorId)
171  {
172  SwTextNode *pTextNd = aIdx.GetNode().GetTextNode();
173  OSL_ENSURE( pTextNd, "no Text Node" );
174  SwFormatFlyCnt aFormat( pFormat );
175  pTextNd->InsertItem( aFormat, nContentPos, nContentPos );
176  }
177  }
178 }
179 
180 SwUndoDrawGroup::SwUndoDrawGroup( sal_uInt16 nCnt, const SwDoc* pDoc )
181  : SwUndo( SwUndoId::DRAWGROUP, pDoc ), nSize( nCnt + 1 ), bDelFormat( true )
182 {
183  pObjArr.reset( new SwUndoGroupObjImpl[ nSize ] );
184 }
185 
187 {
188  if( bDelFormat )
189  {
190  SwUndoGroupObjImpl* pTmp = pObjArr.get() + 1;
191  for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
192  delete pTmp->pFormat;
193  }
194  else
195  delete pObjArr[0].pFormat;
196 }
197 
199 {
200  bDelFormat = false;
201 
202  // save group object
203  SwDrawFrameFormat* pFormat = pObjArr[0].pFormat;
204 
206  auto pObj = pObjArr[0].pObj;
207  pObj->SetUserCall(nullptr);
208 
209  ::lcl_SaveAnchor( pFormat, pObjArr[0].nNodeIdx );
210 
211  // notify UNO objects to decouple
212  ::lcl_SendRemoveToUno( *pFormat );
213 
214  // remove from array
215  SwDoc* pDoc = pFormat->GetDoc();
216  SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats();
217  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
218 
219  for( sal_uInt16 n = 1; n < nSize; ++n )
220  {
221  SwUndoGroupObjImpl& rSave = pObjArr[n];
222 
223  ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx );
224  rFlyFormats.push_back( rSave.pFormat );
225 
226  pObj = rSave.pObj;
227 
228  SwDrawContact *pContact = new SwDrawContact( rSave.pFormat, pObj );
229  pContact->ConnectToLayout();
230  // #i45718# - follow-up of #i35635# move object to visible layer
231  pContact->MoveObjToVisibleLayer( pObj );
232 
233  SwDrawFrameFormat* pDrawFrameFormat = rSave.pFormat;
234 
235  // #i45952# - notify that position attributes are already set
236  OSL_ENSURE(pDrawFrameFormat,
237  "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
238  if (pDrawFrameFormat)
239  pDrawFrameFormat->PosAttrSet();
240  }
241 }
242 
244 {
245  bDelFormat = true;
246 
247  // remove from array
248  SwDoc* pDoc = pObjArr[0].pFormat->GetDoc();
249  SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats();
250 
251  for( sal_uInt16 n = 1; n < nSize; ++n )
252  {
253  SwUndoGroupObjImpl& rSave = pObjArr[n];
254 
255  SdrObject* pObj = rSave.pObj;
256 
257  SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
258 
259  // object will destroy itself
260  pContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() );
261  pObj->SetUserCall( nullptr );
262 
263  ::lcl_SaveAnchor( rSave.pFormat, rSave.nNodeIdx );
264 
265  // notify UNO objects to decouple
266  ::lcl_SendRemoveToUno( *rSave.pFormat );
267 
268  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), rSave.pFormat ));
269  }
270 
271  // re-insert group object
272  ::lcl_RestoreAnchor( pObjArr[0].pFormat, pObjArr[0].nNodeIdx );
273  rFlyFormats.push_back( pObjArr[0].pFormat );
274 
275  SwDrawContact *pContact = new SwDrawContact( pObjArr[0].pFormat, pObjArr[0].pObj );
276  // #i26791# - correction: connect object to layout
277  pContact->ConnectToLayout();
278  // #i45718# - follow-up of #i35635# move object to visible layer
279  pContact->MoveObjToVisibleLayer( pObjArr[0].pObj );
280 
281  SwDrawFrameFormat* pDrawFrameFormat = pObjArr[0].pFormat;
282 
283  // #i45952# - notify that position attributes are already set
284  OSL_ENSURE(pDrawFrameFormat,
285  "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
286  if (pDrawFrameFormat)
287  pDrawFrameFormat->PosAttrSet();
288 }
289 
290 void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat, SdrObject* pObj )
291 {
292  SwUndoGroupObjImpl& rSave = pObjArr[nPos + 1];
293  rSave.pObj = pObj;
294  rSave.pFormat = pFormat;
295  ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx );
296 
297  // notify UNO objects to decouple
298  ::lcl_SendRemoveToUno( *pFormat );
299 
300  // remove from array
301  SwFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats();
302  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
303 }
304 
306 {
307  pObjArr[0].pObj = nullptr;
308  pObjArr[0].pFormat = pFormat;
309 }
310 
312  : SwUndo( SwUndoId::DRAWUNGROUP, pDoc ), bDelFormat( false )
313 {
314  nSize = static_cast<sal_uInt16>(pObj->GetSubList()->GetObjCount()) + 1;
315  pObjArr.reset( new SwUndoGroupObjImpl[ nSize ] );
316 
317  SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
318  SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat());
319 
320  pObjArr[0].pObj = pObj;
321  pObjArr[0].pFormat = pFormat;
322 
323  // object will destroy itself
324  pContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() );
325  pObj->SetUserCall( nullptr );
326 
327  ::lcl_SaveAnchor( pFormat, pObjArr[0].nNodeIdx );
328 
329  // notify UNO objects to decouple
330  ::lcl_SendRemoveToUno( *pFormat );
331 
332  // remove from array
333  SwFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats();
334  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
335 }
336 
338 {
339  if( bDelFormat )
340  {
341  SwUndoGroupObjImpl* pTmp = pObjArr.get() + 1;
342  for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
343  delete pTmp->pFormat;
344  }
345  else
346  delete pObjArr[0].pFormat;
347 }
348 
350 {
351  bDelFormat = true;
352 
353  SwDoc *const pDoc = & rContext.GetDoc();
354  SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats();
355 
356  // remove from array
357  for( sal_uInt16 n = 1; n < nSize; ++n )
358  {
359  SwUndoGroupObjImpl& rSave = pObjArr[n];
360 
361  ::lcl_SaveAnchor( rSave.pFormat, rSave.nNodeIdx );
362 
363  // notify UNO objects to decouple
364  ::lcl_SendRemoveToUno( *rSave.pFormat );
365 
366  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), rSave.pFormat ));
367  }
368 
369  // re-insert group object
370  ::lcl_RestoreAnchor( pObjArr[0].pFormat, pObjArr[0].nNodeIdx );
371  rFlyFormats.push_back( pObjArr[0].pFormat );
372 
373  SwDrawContact *pContact = new SwDrawContact( pObjArr[0].pFormat, pObjArr[0].pObj );
374  pContact->ConnectToLayout();
375  // #i45718# - follow-up of #i35635# move object to visible layer
376  pContact->MoveObjToVisibleLayer( pObjArr[0].pObj );
377 
378  SwDrawFrameFormat* pDrawFrameFormat = pObjArr[0].pFormat;
379 
380  // #i45952# - notify that position attributes are already set
381  OSL_ENSURE(pDrawFrameFormat,
382  "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
383  if (pDrawFrameFormat)
384  pDrawFrameFormat->PosAttrSet();
385 }
386 
388 {
389  bDelFormat = false;
390 
391  // save group object
392  SwDrawFrameFormat* pFormat = pObjArr[0].pFormat;
393  pFormat->CallSwClientNotify(sw::ContactChangedHint(&(pObjArr[0].pObj)));
394  pObjArr[0].pObj->SetUserCall( nullptr );
395 
396  ::lcl_SaveAnchor( pFormat, pObjArr[0].nNodeIdx );
397 
398  // notify UNO objects to decouple
399  ::lcl_SendRemoveToUno( *pFormat );
400 
401  // remove from array
402  SwDoc* pDoc = pFormat->GetDoc();
403  SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats();
404  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
405 
406  for( sal_uInt16 n = 1; n < nSize; ++n )
407  {
408  SwUndoGroupObjImpl& rSave = pObjArr[n];
409 
410  ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx );
411  rFlyFormats.push_back( rSave.pFormat );
412 
413  SwDrawFrameFormat* pDrawFrameFormat = rSave.pFormat;
414 
415  // #i45952# - notify that position attributes are already set
416  OSL_ENSURE(pDrawFrameFormat,
417  "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
418  if (pDrawFrameFormat)
419  pDrawFrameFormat->PosAttrSet();
420  }
421 }
422 
423 void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat )
424 {
425  SwUndoGroupObjImpl& rSave = pObjArr[ nPos + 1 ];
426  rSave.pFormat = pFormat;
427  rSave.pObj = nullptr;
428 }
429 
431  : SwUndo( SwUndoId::DRAWUNGROUP, pDoc )
432 {
433 }
434 
436 {
437 }
438 
439 void
441 {
442  for (const std::pair< SwDrawFrameFormat*, SdrObject* > & rPair : aDrawFormatsAndObjs)
443  {
444  SdrObject* pObj( rPair.second );
445  SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(pObj->GetUserCall()) );
446  OSL_ENSURE( pDrawContact,
447  "<SwUndoDrawUnGroupConnectToLayout::Undo(..)> -- missing SwDrawContact instance" );
448  if ( pDrawContact )
449  {
450  // deletion of instance <pDrawContact> and thus disconnection from
451  // the Writer layout.
452  pDrawContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() );
453  pObj->SetUserCall( nullptr );
454  }
455  }
456 }
457 
458 void
460 {
461  for (const std::pair< SwDrawFrameFormat*, SdrObject* > & rPair : aDrawFormatsAndObjs)
462  {
463  SwDrawFrameFormat* pFormat( rPair.first );
464  SdrObject* pObj( rPair.second );
465  SwDrawContact *pContact = new SwDrawContact( pFormat, pObj );
466  pContact->ConnectToLayout();
467  pContact->MoveObjToVisibleLayer( pObj );
468  }
469 }
470 
472  SdrObject* pDrawObject )
473 {
474  aDrawFormatsAndObjs.emplace_back( pDrawFrameFormat, pDrawObject );
475 }
476 
477 SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt, const SwDoc* pDoc )
478  : SwUndo( SwUndoId::DRAWDELETE, pDoc ), bDelFormat( true )
479 {
480  pObjArr.reset( new SwUndoGroupObjImpl[ nCnt ] );
481  pMarkLst.reset( new SdrMarkList() );
482 }
483 
485 {
486  if( bDelFormat )
487  {
488  SwUndoGroupObjImpl* pTmp = pObjArr.get();
489  for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp )
490  delete pTmp->pFormat;
491  }
492 }
493 
495 {
496  bDelFormat = false;
497  SwFrameFormats & rFlyFormats = *rContext.GetDoc().GetSpzFrameFormats();
498  for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n )
499  {
500  SwUndoGroupObjImpl& rSave = pObjArr[n];
501  ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx );
502  rFlyFormats.push_back( rSave.pFormat );
503  SdrObject *pObj = rSave.pObj;
504  SwDrawContact *pContact = new SwDrawContact( rSave.pFormat, pObj );
505  pContact->Changed_( *pObj, SdrUserCallType::Inserted, nullptr );
506  // #i45718# - follow-up of #i35635# move object to visible layer
507  pContact->MoveObjToVisibleLayer( pObj );
508 
509  SwDrawFrameFormat* pDrawFrameFormat = rSave.pFormat;
510 
511  // #i45952# - notify that position attributes are already set
512  OSL_ENSURE(pDrawFrameFormat,
513  "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
514  if (pDrawFrameFormat)
515  pDrawFrameFormat->PosAttrSet();
516  }
517  rContext.SetSelections(nullptr, pMarkLst.get());
518 }
519 
521 {
522  bDelFormat = true;
523  SwFrameFormats & rFlyFormats = *rContext.GetDoc().GetSpzFrameFormats();
524  for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n )
525  {
526  SwUndoGroupObjImpl& rSave = pObjArr[n];
527  SdrObject *pObj = rSave.pObj;
528  SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
529  SwDrawFrameFormat *pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat());
530 
531  // object will destroy itself
532  pContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() );
533  pObj->SetUserCall( nullptr );
534 
535  // notify UNO objects to decouple
536  ::lcl_SendRemoveToUno( *pFormat );
537 
538  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
539  ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx );
540  }
541 }
542 
544  const SdrMark& rMark )
545 {
546  SwUndoGroupObjImpl& rSave = pObjArr[ pMarkLst->GetMarkCount() ];
547  rSave.pObj = rMark.GetMarkedSdrObj();
548  rSave.pFormat = pFormat;
549  ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx );
550 
551  // notify UNO objects to decouple
552  ::lcl_SendRemoveToUno( *pFormat );
553 
554  // remove from array
555  SwDoc* pDoc = pFormat->GetDoc();
556  SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats();
557  rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat ));
558 
559  pMarkLst->InsertEntry( rMark );
560 }
561 
562 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwUndoDrawUnGroupConnectToLayout(const SwDoc *pDoc)
Definition: undraw.cxx:430
bool erase(const value_type &x)
Definition: docfmt.cxx:2086
virtual ~SwUndoDrawUnGroupConnectToLayout() override
Definition: undraw.cxx:435
void SetSelections(SwFrameFormat *const pSelFormat, SdrMarkList *const pMarkList)
Definition: UndoCore.hxx:98
std::unique_ptr< SdrMarkList > pMarkList
Definition: UndoDraw.hxx:39
size_t GetMarkCount() const
Marks a position in the document model.
Definition: pam.hxx:35
SdrView * GetDrawView()
Definition: vnew.cxx:375
std::pair< const_iterator, bool > push_back(const value_type &x)
Definition: docfmt.cxx:2078
std::unique_ptr< SwUndoGroupObjImpl[]> pObjArr
Definition: UndoDraw.hxx:83
SwUndoId
Definition: swundo.hxx:29
SwNodeIndex nNode
Definition: pam.hxx:37
const_iterator begin() const
Definition: docary.hxx:257
std::vector< std::pair< SwDrawFrameFormat *, SdrObject * > > aDrawFormatsAndObjs
Definition: UndoDraw.hxx:101
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
sal_uIntPtr sal_uLong
std::unique_ptr< SdrUndoAction > pSdrUndo
Definition: UndoDraw.hxx:38
std::unique_ptr< SdrMarkList > pMarkLst
Definition: UndoDraw.hxx:118
void AddObj(sal_uInt16 nPos, SwDrawFrameFormat *, SdrObject *)
Definition: undraw.cxx:290
Definition: doc.hxx:185
size_t GetObjCount() const
void PosAttrSet()
Definition: frmfmt.hxx:398
void AddFormatAndObj(SwDrawFrameFormat *pDrawFrameFormat, SdrObject *pDrawObject)
Definition: undraw.cxx:471
bool HasDrawView() const
Definition: vnew.cxx:360
SwNode & GetNode() const
Definition: ndindex.hxx:119
sal_uLong nNodeIdx
Definition: undraw.cxx:53
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
const_iterator end() const
Definition: docary.hxx:258
#define RES_REMOVE_UNO_OBJECT
Definition: hintids.hxx:305
static void lcl_SaveAnchor(SwFrameFormat *pFormat, sal_uLong &rNodePos)
Definition: undraw.cxx:108
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:170
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:737
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:3059
void SetGroupFormat(SwDrawFrameFormat *)
Definition: undraw.cxx:305
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:494
SwIndex nContent
Definition: pam.hxx:38
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:91
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
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:1226
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:440
SwDoc & GetDoc() const
Definition: UndoCore.hxx:94
SwUndoDrawGroup(sal_uInt16 nCnt, const SwDoc *pDoc)
Definition: undraw.cxx:180
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding visible layer
Definition: dcontact.cxx:207
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:198
virtual void ModifyNotification(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.hxx:154
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:201
sal_uInt16 nSize
Definition: UndoDraw.hxx:84
Base class for various Writer styles.
Definition: format.hxx:43
SdrObject * GetMarkedSdrObj() const
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:459
Style of a layout element.
Definition: frmfmt.hxx:57
void AddObj(SwDrawFrameFormat *, const SdrMark &)
Definition: undraw.cxx:543
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwUndoDrawDelete(sal_uInt16 nCnt, const SwDoc *pDoc)
Definition: undraw.cxx:477
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:520
SwContentNode * GetContentNode()
Definition: node.hxx:615
const SdrMarkList & GetMarkedObjectList() const
FlyAnchors.
Definition: fmtanchr.hxx:34
static void lcl_RestoreAnchor(SwFrameFormat *pFormat, sal_uLong nNodePos)
Definition: undraw.cxx:146
Marks a character position inside a document model node.
Definition: index.hxx:37
virtual ~SwUndoDrawUnGroup() override
Definition: undraw.cxx:337
void AddDrawUndo(std::unique_ptr< SdrUndoAction >)
Definition: undraw.cxx:58
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual SdrObjList * GetSubList() const override
void SetUserCall(SdrObjUserCall *pUser)
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
virtual ~SwUndoDrawDelete() override
Definition: undraw.cxx:484
void Changed_(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle *pOldBoundRect)
Used by Changed() and by UndoDraw.
Definition: dcontact.cxx:1078
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
std::unique_ptr< SwUndoGroupObjImpl[]> pObjArr
Definition: UndoDraw.hxx:54
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:243
void EraseText(const SwIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
Definition: ndtxt.cxx:2668
virtual const tools::Rectangle & GetLastBoundRect() const
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual ~SwUndoDrawGroup() override
Definition: undraw.cxx:186
void AddObj(sal_uInt16 nPos, SwDrawFrameFormat *)
Definition: undraw.cxx:423
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
SwUndoDrawUnGroup(SdrObjGroup *, const SwDoc *pDoc)
Definition: undraw.cxx:311
std::unique_ptr< SwUndoGroupObjImpl[]> pObjArr
Definition: UndoDraw.hxx:117
virtual OUString GetComment() const override
Returns textual comment for this undo object.
Definition: undraw.cxx:97
sal_Int32 GetIndex() const
Definition: index.hxx:95
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1714
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect) override
Virtual methods of SdrObjUserCall.
Definition: dcontact.cxx:943
SwNodes & GetNodes()
Definition: doc.hxx:402
SwDrawFrameFormat * pFormat
Definition: undraw.cxx:51
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:85
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:349
virtual ~SwSdrUndo() override
Definition: undraw.cxx:79
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:152
Format of a fly content.
Definition: fmtflcnt.hxx:32
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:376
SdrObject * pObj
Definition: undraw.cxx:52
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
RndStdIds
SdrObjUserCall * GetUserCall() const
static void lcl_SendRemoveToUno(SwFormat &rFormat)
Definition: undraw.cxx:102
SwSdrUndo(std::unique_ptr< SdrUndoAction >, const SdrMarkList *pMarkList, const SwDoc *pDoc)
Definition: undraw.cxx:72
sal_uInt16 const nSize
Definition: UndoDraw.hxx:55
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: undraw.cxx:387
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
const SwFormatFlyCnt & GetFlyCnt() const
Definition: txatbase.hxx:206