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