LibreOffice Module sw (master)  1
dcontact.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 <memory>
21 #include <hintids.hxx>
22 #include <editeng/lrspitem.hxx>
23 #include <svx/svdpage.hxx>
24 #include <svx/svditer.hxx>
25 #include <svx/svdogrp.hxx>
26 #include <svx/svdotext.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <svx/svdviter.hxx>
29 #include <svx/svdview.hxx>
32 #include <drawdoc.hxx>
33 #include <fmtornt.hxx>
34 #include <viewimp.hxx>
35 #include <fmtsrnd.hxx>
36 #include <fmtanchr.hxx>
37 #include <node.hxx>
38 #include <fmtcntnt.hxx>
39 #include <fmtfsize.hxx>
40 #include <pam.hxx>
41 #include <pagefrm.hxx>
42 #include <rootfrm.hxx>
43 #include <frmtool.hxx>
44 #include <flyfrm.hxx>
45 #include <textboxhelper.hxx>
46 #include <frmfmt.hxx>
47 #include <fmtfollowtextflow.hxx>
48 #include <dflyobj.hxx>
49 #include <dcontact.hxx>
50 #include <unodraw.hxx>
53 #include <doc.hxx>
54 #include <hints.hxx>
55 #include <txtfrm.hxx>
56 #include <frameformats.hxx>
57 #include <docary.hxx>
58 #include <sortedobjs.hxx>
65 #include <com/sun/star/text/WritingMode2.hpp>
66 #include <calbck.hxx>
67 #include <algorithm>
68 #include <txtfly.hxx>
69 #include <sal/log.hxx>
70 
71 using namespace ::com::sun::star;
72 
73 namespace
74 {
76  struct VirtObjAnchoredAtFramePred
77  {
78  const SwFrame* m_pAnchorFrame;
79 
80  // #i26791# - compare with master frame
81  static const SwFrame* FindFrame(const SwFrame* pFrame)
82  {
83  if(!pFrame || !pFrame->IsContentFrame())
84  return pFrame;
85  auto pContentFrame = static_cast<const SwContentFrame*>(pFrame);
86  while(pContentFrame->IsFollow())
87  pContentFrame = pContentFrame->FindMaster();
88  return pContentFrame;
89  }
90 
91  VirtObjAnchoredAtFramePred(const SwFrame* pAnchorFrame)
92  : m_pAnchorFrame(FindFrame(pAnchorFrame))
93  {}
94 
95  bool operator()(const SwDrawVirtObjPtr& rpDrawVirtObj)
96  {
97  return FindFrame(rpDrawVirtObj->GetAnchorFrame()) == m_pAnchorFrame;
98  }
99  };
100 }
101 
102 void setContextWritingMode(SdrObject* pObj, SwFrame const * pAnchor)
103 {
104  if(!pObj || !pAnchor)
105  return;
106  short nWritingDirection =
107  pAnchor->IsVertical() ? text::WritingMode2::TB_RL :
108  pAnchor->IsRightToLeft() ? text::WritingMode2::RL_TB :
109  text::WritingMode2::LR_TB;
110  pObj->SetContextWritingMode(nWritingDirection);
111 }
112 
113 
121 {
122  SwFrameFormat* pRetval = nullptr;
123 
124  if (SwVirtFlyDrawObj* pFlyDrawObj = dynamic_cast<SwVirtFlyDrawObj*>(pObj))
125  {
126  pRetval = pFlyDrawObj->GetFormat();
127  }
128  else
129  {
130  SwContact* pContact = GetUserCall(pObj);
131  if ( pContact )
132  {
133  pRetval = pContact->GetFormat();
134  }
135  }
136  return pRetval;
137 }
138 
139 bool HasWrap( const SdrObject* pObj )
140 {
141  if ( pObj )
142  {
143  const SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
144  if ( pFormat )
145  {
146  return css::text::WrapTextMode_THROUGH != pFormat->GetSurround().GetSurround();
147  }
148  }
149 
150  return false;
151 }
152 
155 {
156  SwRect aRet( pObj->GetCurrentBoundRect() );
157  // #i68520# - call cache of <SwAnchoredObject>
158  SwContact* pContact( GetUserCall( pObj ) );
159  if ( pContact )
160  {
161  const SwAnchoredObject* pAnchoredObj( pContact->GetAnchoredObj( pObj ) );
162  if ( pAnchoredObj )
163  {
164  aRet = pAnchoredObj->GetObjRectWithSpaces();
165  }
166  }
167  return aRet;
168 }
169 
172 {
173  SdrObject *pTmp;
174  while ( !pObj->GetUserCall() && nullptr != (pTmp = pObj->getParentSdrObjectFromSdrObject()) )
175  pObj = pTmp;
176  assert((!pObj->GetUserCall() || nullptr != dynamic_cast<const SwContact*>(pObj->GetUserCall())) &&
177  "<::GetUserCall(..)> - wrong type of found object user call." );
178  return static_cast<SwContact*>(pObj->GetUserCall());
179 }
180 
182 bool IsMarqueeTextObj( const SdrObject& rObj )
183 {
184  SdrTextAniKind eTKind;
185  return SdrInventor::Default == rObj.GetObjInventor() &&
186  OBJ_TEXT == rObj.GetObjIdentifier() &&
187  ( SdrTextAniKind::Scroll == ( eTKind = static_cast<const SdrTextObj&>(rObj).GetTextAniKind())
188  || SdrTextAniKind::Alternate == eTKind || SdrTextAniKind::Slide == eTKind );
189 }
190 
192  SwClient( pToRegisterIn ),
193  mbInDTOR( false )
194 {}
195 
197 {
198  SetInDTOR();
199 }
200 
201 
203 {
204  mbInDTOR = true;
205 }
206 
209 {
210  // #i46297# - notify background about the arriving of
211  // the object and invalidate its position.
212  const bool bNotify( !GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) );
213 
214  MoveObjToLayer( true, _pDrawObj );
215 
216  // #i46297#
217  if ( bNotify )
218  {
219  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
220  assert(pAnchoredObj);
221  ::setContextWritingMode( _pDrawObj, pAnchoredObj->GetAnchorFrameContainingAnchPos() );
222  // Note: as-character anchored objects aren't registered at a page frame and
223  // a notification of its background isn't needed.
224  if ( pAnchoredObj->GetPageFrame() )
225  {
226  ::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrame(),
227  pAnchoredObj->GetObjRect(), PrepareHint::FlyFrameArrive, true );
228  }
229 
230  pAnchoredObj->InvalidateObjPos();
231  }
232 }
233 
236 {
237  // #i46297# - notify background about the leaving of the object.
238  const bool bNotify( GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) );
239 
240  MoveObjToLayer( false, _pDrawObj );
241 
242  // #i46297#
243  if ( bNotify )
244  {
245  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
246  assert(pAnchoredObj);
247  // Note: as-character anchored objects aren't registered at a page frame and
248  // a notification of its background isn't needed.
249  if (pAnchoredObj->GetPageFrame())
250  {
251  ::Notify_Background( _pDrawObj, pAnchoredObj->GetPageFrame(),
252  pAnchoredObj->GetObjRect(), PrepareHint::FlyFrameLeave, true );
253  }
254  }
255 }
256 
262 void SwContact::MoveObjToLayer( const bool _bToVisible,
263  SdrObject* _pDrawObj )
264 {
265  if ( !_pDrawObj )
266  {
267  OSL_FAIL( "SwDrawContact::MoveObjToLayer(..) - no drawing object!" );
268  return;
269  }
270 
271  if ( !GetRegisteredIn() )
272  {
273  OSL_FAIL( "SwDrawContact::MoveObjToLayer(..) - no drawing frame format!" );
274  return;
275  }
276 
277  const IDocumentDrawModelAccess& rIDDMA = static_cast<SwFrameFormat*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
278 
279  SdrLayerID nToHellLayerId =
280  _bToVisible ? rIDDMA.GetHellId() : rIDDMA.GetInvisibleHellId();
281  SdrLayerID nToHeavenLayerId =
282  _bToVisible ? rIDDMA.GetHeavenId() : rIDDMA.GetInvisibleHeavenId();
283  SdrLayerID nToControlLayerId =
284  _bToVisible ? rIDDMA.GetControlsId() : rIDDMA.GetInvisibleControlsId();
285  SdrLayerID nFromHellLayerId =
286  _bToVisible ? rIDDMA.GetInvisibleHellId() : rIDDMA.GetHellId();
287  SdrLayerID nFromHeavenLayerId =
288  _bToVisible ? rIDDMA.GetInvisibleHeavenId() : rIDDMA.GetHeavenId();
289  SdrLayerID nFromControlLayerId =
290  _bToVisible ? rIDDMA.GetInvisibleControlsId() : rIDDMA.GetControlsId();
291 
292  if ( dynamic_cast<const SdrObjGroup*>( _pDrawObj) != nullptr )
293  {
294  // determine layer for group object
295  {
296  // proposed layer of a group object is the hell layer
297  SdrLayerID nNewLayerId = nToHellLayerId;
298  if ( ::CheckControlLayer( _pDrawObj ) )
299  {
300  // it has to be the control layer, if one of the member
301  // is a control
302  nNewLayerId = nToControlLayerId;
303  }
304  else if ( _pDrawObj->GetLayer() == rIDDMA.GetHeavenId() ||
305  _pDrawObj->GetLayer() == rIDDMA.GetInvisibleHeavenId() )
306  {
307  // it has to be the heaven layer, if method <GetLayer()> reveals
308  // a heaven layer
309  nNewLayerId = nToHeavenLayerId;
310  }
311  // set layer at group object, but do *not* broadcast and
312  // no propagation to the members.
313  // Thus, call <NbcSetLayer(..)> at super class
314  _pDrawObj->SdrObject::NbcSetLayer( nNewLayerId );
315  }
316 
317  // call method recursively for group object members
318  const SdrObjList* pLst =
319  static_cast<SdrObjGroup*>(_pDrawObj)->GetSubList();
320  if ( pLst )
321  {
322  for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
323  {
324  MoveObjToLayer( _bToVisible, pLst->GetObj( i ) );
325  }
326  }
327  }
328  else
329  {
330  const SdrLayerID nLayerIdOfObj = _pDrawObj->GetLayer();
331  if ( nLayerIdOfObj == nFromHellLayerId )
332  {
333  _pDrawObj->SetLayer( nToHellLayerId );
334  }
335  else if ( nLayerIdOfObj == nFromHeavenLayerId )
336  {
337  _pDrawObj->SetLayer( nToHeavenLayerId );
338  }
339  else if ( nLayerIdOfObj == nFromControlLayerId )
340  {
341  _pDrawObj->SetLayer( nToControlLayerId );
342  }
343  }
344 }
345 
347 sal_uInt32 SwContact::GetMinOrdNum() const
348 {
349  sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 );
350 
351  std::vector< SwAnchoredObject* > aObjs;
352  GetAnchoredObjs( aObjs );
353 
354  while ( !aObjs.empty() )
355  {
356  sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
357 
358  if ( nTmpOrdNum < nMinOrdNum )
359  {
360  nMinOrdNum = nTmpOrdNum;
361  }
362 
363  aObjs.pop_back();
364  }
365 
366  OSL_ENSURE( nMinOrdNum != SAL_MAX_UINT32,
367  "<SwContact::GetMinOrdNum()> - no order number found." );
368  return nMinOrdNum;
369 }
370 
372 sal_uInt32 SwContact::GetMaxOrdNum() const
373 {
374  sal_uInt32 nMaxOrdNum( 0 );
375 
376  std::vector< SwAnchoredObject* > aObjs;
377  GetAnchoredObjs( aObjs );
378 
379  while ( !aObjs.empty() )
380  {
381  sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
382 
383  if ( nTmpOrdNum > nMaxOrdNum )
384  {
385  nMaxOrdNum = nTmpOrdNum;
386  }
387 
388  aObjs.pop_back();
389  }
390 
391  return nMaxOrdNum;
392 }
393 
394 namespace
395 {
396  Point lcl_GetWW8Pos(SwAnchoredObject const * pAnchoredObj, const bool bFollowTextFlow, sw::WW8AnchorConv& reConv)
397  {
398  switch(reConv)
399  {
401  {
402  bool bRelToTableCell(false);
403  Point aPos(pAnchoredObj->GetRelPosToPageFrame(bFollowTextFlow, bRelToTableCell));
404  if(bRelToTableCell)
406  return aPos;
407  }
409  return pAnchoredObj->GetRelPosToAnchorFrame();
411  return pAnchoredObj->GetRelPosToChar();
413  return pAnchoredObj->GetRelPosToLine();
414  default: ;
415  }
416  return Point();
417  }
418 }
419 void SwContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
420 {
421  // this does not call SwClient::SwClientNotify and thus doesn't handle RES_OBJECTDYING as usual. Is this intentional?
422  if (auto pFindSdrObjectHint = dynamic_cast<const sw::FindSdrObjectHint*>(&rHint))
423  {
424  if(!pFindSdrObjectHint->m_rpObject)
425  pFindSdrObjectHint->m_rpObject = GetMaster();
426  }
427  else if (auto pWW8AnchorConvHint = dynamic_cast<const sw::WW8AnchorConvHint*>(&rHint))
428  {
429  // determine anchored object
430  SwAnchoredObject* pAnchoredObj(nullptr);
431  {
432  std::vector<SwAnchoredObject*> aAnchoredObjs;
433  GetAnchoredObjs(aAnchoredObjs);
434  if(!aAnchoredObjs.empty())
435  pAnchoredObj = aAnchoredObjs.front();
436  }
437  // no anchored object found. Thus, the needed layout information can't
438  // be determined. --> no conversion
439  if(!pAnchoredObj)
440  return;
441  // no conversion for anchored drawing object, which aren't attached to an
442  // anchor frame.
443  // This is the case for drawing objects, which are anchored inside a page
444  // header/footer of an *unused* page style.
445  if(dynamic_cast<SwAnchoredDrawObject*>(pAnchoredObj) && !pAnchoredObj->GetAnchorFrame())
446  return;
447  const bool bFollowTextFlow = static_cast<const SwFrameFormat&>(rMod).GetFollowTextFlow().GetValue();
448  sw::WW8AnchorConvResult& rResult(pWW8AnchorConvHint->m_rResult);
449  // No distinction between layout directions, because of missing
450  // information about WW8 in vertical layout.
451  rResult.m_aPos.setX(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eHoriConv).getX());
452  rResult.m_aPos.setY(lcl_GetWW8Pos(pAnchoredObj, bFollowTextFlow, rResult.m_eVertConv).getY());
453  rResult.m_bConverted = true;
454  }
455 }
456 
457 
459  SwFlyFrameFormat *pToRegisterIn,
460  SdrModel& rTargetModel)
461 : SwContact(pToRegisterIn),
462  mpMasterObj(new SwFlyDrawObj(rTargetModel))
463 {
464  // #i26791# - class <SwFlyDrawContact> contains the 'master'
465  // drawing object of type <SwFlyDrawObj> on its own.
466  mpMasterObj->SetOrdNum( 0xFFFFFFFE );
467  mpMasterObj->SetUserCall( this );
468 }
469 
471 {
472  if ( mpMasterObj )
473  {
474  mpMasterObj->SetUserCall( nullptr );
475  if ( mpMasterObj->getSdrPageFromSdrObject() )
476  mpMasterObj->getSdrPageFromSdrObject()->RemoveObject( mpMasterObj->GetOrdNum() );
477  }
478 }
479 
481 {
482  // search for another Writer fly frame registered at same frame format
484  const SwFlyFrame* pFlyFrame(nullptr);
485  for(pFlyFrame = aIter.First(); pFlyFrame; pFlyFrame = aIter.Next())
486  {
487  if(pFlyFrame != pFly)
488  break;
489  }
490 
491  if(pFlyFrame)
492  {
493  // another Writer fly frame found. Take its order number
494  return pFlyFrame->GetVirtDrawObj()->GetOrdNum();
495  }
496  // no other Writer fly frame found. Take order number of 'master' object
497  // #i35748# - use method <GetOrdNumDirect()> instead
498  // of method <GetOrdNum()> to avoid a recalculation of the order number,
499  // which isn't intended.
500  return GetMaster()->GetOrdNumDirect();
501 }
502 
504 {
505  // Find ContactObject from the Format. If there's already one, we just
506  // need to create a new Ref, else we create the Contact now.
507 
509  SwFlyDrawContact* pContact = pFormat->GetOrCreateContact();
510  SwVirtFlyDrawObj* pDrawObj(
511  new SwVirtFlyDrawObj(
512  pContact->GetMaster()->getSdrModelFromSdrObject(),
513  *pContact->GetMaster(),
514  pFly));
515  pDrawObj->SetUserCall(pContact);
516 
517  // The Reader creates the Masters and inserts them into the Page in
518  // order to transport the z-order.
519  // After creating the first Reference the Masters are removed from the
520  // List and are not important anymore.
521  SdrPage* pPg(nullptr);
522  if(nullptr != (pPg = pContact->GetMaster()->getSdrPageFromSdrObject()))
523  {
524  const size_t nOrdNum = pContact->GetMaster()->GetOrdNum();
525  pPg->ReplaceObject(pDrawObj, nOrdNum);
526  }
527  // #i27030# - insert new <SwVirtFlyDrawObj> instance
528  // into drawing page with correct order number
529  else
530  rIDDMA.GetDrawModel()->GetPage(0)->InsertObject(pDrawObj, pContact->GetOrdNumForNewRef(pFly));
531  // #i38889# - assure, that new <SwVirtFlyDrawObj> instance
532  // is in a visible layer.
533  pContact->MoveObjToVisibleLayer(pDrawObj);
534  return pDrawObj;
535 }
536 
537 // #i26791#
539 {
540  assert(pSdrObj);
541  assert(dynamic_cast<const SwVirtFlyDrawObj*>(pSdrObj) != nullptr);
542  assert(GetUserCall(pSdrObj) == this &&
543  "<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belong to this contact");
544 
545  const SwAnchoredObject *const pRetAnchoredObj =
546  static_cast<const SwVirtFlyDrawObj*>(pSdrObj)->GetFlyFrame();
547 
548  return pRetAnchoredObj;
549 }
550 
552 {
553  return const_cast<SwAnchoredObject *>(const_cast<SwFlyDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
554 }
555 
557 {
558  return mpMasterObj.get();
559 }
560 
567 {
568  assert(dynamic_cast<const SwVirtFlyDrawObj*>(_pDrawObj) != nullptr);
569 
570  if ( GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) )
571  {
572  // nothing to do
573  return;
574  }
575 
576  SwFlyFrame* pFlyFrame = static_cast<SwVirtFlyDrawObj*>(_pDrawObj)->GetFlyFrame();
577 
578  // #i44464# - consider, that Writer fly frame content
579  // already exists - (e.g. WW8 document is inserted into an existing document).
580  if ( !pFlyFrame->Lower() )
581  {
582  pFlyFrame->InsertColumns();
583  pFlyFrame->Chain( pFlyFrame->AnchorFrame() );
584  pFlyFrame->InsertCnt();
585  }
586  if ( pFlyFrame->GetDrawObjs() )
587  {
588  for (SwAnchoredObject* i : *pFlyFrame->GetDrawObjs())
589  {
590  // #i28701# - consider type of objects in sorted object list.
591  SdrObject* pObj = i->DrawObj();
592  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
593  pContact->MoveObjToVisibleLayer( pObj );
594  }
595  }
596 
597  // make fly frame visible
599 }
600 
607 {
608  assert(dynamic_cast<const SwVirtFlyDrawObj*>(_pDrawObj) != nullptr);
609 
610  if ( !GetFormat()->getIDocumentDrawModelAccess().IsVisibleLayerId( _pDrawObj->GetLayer() ) )
611  {
612  // nothing to do
613  return;
614  }
615 
616  SwFlyFrame* pFlyFrame = static_cast<SwVirtFlyDrawObj*>(_pDrawObj)->GetFlyFrame();
617 
618  pFlyFrame->Unchain();
619  pFlyFrame->DeleteCnt();
620  if ( pFlyFrame->GetDrawObjs() )
621  {
622  for (SwAnchoredObject* i : *pFlyFrame->GetDrawObjs())
623  {
624  // #i28701# - consider type of objects in sorted object list.
625  SdrObject* pObj = i->DrawObj();
626  SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
627  pContact->MoveObjToInvisibleLayer( pObj );
628  }
629  }
630 
631  // make fly frame invisible
633 }
634 
636 void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
637 {
638  const SwFrameFormat* pFormat = GetFormat();
639  SwFlyFrame::GetAnchoredObjects( _roAnchoredObjs, *pFormat );
640 }
641 void SwFlyDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
642 {
643  SwContact::SwClientNotify(rMod, rHint);
644  if(auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint))
645  {
646  // #i11176#
647  // This also needs to work when no layout exists. Thus, for
648  // FlyFrames an alternative method is used now in that case.
649  auto pFormat(dynamic_cast<const SwFrameFormat*>(&rMod));
650  if (pFormat && pFormat->Which() == RES_FLYFRMFMT && !pFormat->getIDocumentLayoutAccess().GetCurrentViewShell())
651  pGetZOrdnerHint->m_rnZOrder = GetMaster()->GetOrdNum();
652  }
653 }
654 
655 // SwDrawContact
656 
657 bool CheckControlLayer( const SdrObject *pObj )
658 {
659  if ( SdrInventor::FmForm == pObj->GetObjInventor() )
660  return true;
661  if (const SdrObjGroup *pObjGroup = dynamic_cast<const SdrObjGroup*>(pObj))
662  {
663  const SdrObjList *pLst = pObjGroup->GetSubList();
664  for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
665  {
666  if ( ::CheckControlLayer( pLst->GetObj( i ) ) )
667  {
668  // #i18447# - return correct value ;-)
669  return true;
670  }
671  }
672  }
673  return false;
674 }
675 
677  SwContact( pToRegisterIn ),
678  maAnchoredDrawObj(),
679  mbMasterObjCleared( false ),
680  mbDisconnectInProgress( false ),
681  mbUserCallActive( false ),
682  // Note: value of <meEventTypeOfCurrentUserCall> isn't of relevance, because
683  // <mbUserCallActive> is false.
684  meEventTypeOfCurrentUserCall( SdrUserCallType::MoveOnly )
685 {
686  // --> #i33909# - assure, that drawing object is inserted
687  // in the drawing page.
688  if ( !pObj->IsInserted() )
689  {
690  pToRegisterIn->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)->
691  InsertObject( pObj, pObj->GetOrdNumDirect() );
692  }
693 
694  // Controls have to be always in the Control-Layer. This is also true for
695  // group objects, if they contain controls.
696  if ( ::CheckControlLayer( pObj ) )
697  {
698  // set layer of object to corresponding invisible layer.
699  pObj->SetLayer( pToRegisterIn->getIDocumentDrawModelAccess().GetInvisibleControlsId() );
700  }
701 
702  // #i26791#
703  pObj->SetUserCall( this );
704  maAnchoredDrawObj.SetDrawObj( *pObj );
705 
706  // if there already exists an SwXShape for the object, ensure it knows about us, and the SdrObject
707  // #i99056#
709 }
710 
712 {
713  SetInDTOR();
714 
716 
717  // remove 'master' from drawing page
719 
720  // remove and destroy 'virtual' drawing objects.
722 
723  if ( !mbMasterObjCleared )
724  {
725  SdrObject* pObject = const_cast< SdrObject* >( maAnchoredDrawObj.GetDrawObj() );
726  SdrObject::Free( pObject );
727  }
728 }
729 
730 void SwDrawContact::GetTextObjectsFromFormat(std::list<SdrTextObj*>& o_rTextObjects, SwDoc* pDoc)
731 {
732  for(auto& rpFly : *pDoc->GetSpzFrameFormats())
733  {
734  if(dynamic_cast<const SwDrawFrameFormat*>(rpFly))
735  rpFly->CallSwClientNotify(sw::CollectTextObjectsHint(o_rTextObjects));
736  }
737 }
738 
739 // #i26791#
741 {
742  // handle default parameter value
743  if (!pSdrObj)
744  {
745  pSdrObj = GetMaster();
746  }
747 
748  assert(pSdrObj);
749  assert(dynamic_cast<const SwDrawVirtObj*>(pSdrObj) != nullptr ||
750  dynamic_cast<const SdrVirtObj*>(pSdrObj) == nullptr);
751  assert((GetUserCall(pSdrObj) == this ||
752  pSdrObj == GetMaster()) &&
753  "<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
754 
755  const SwAnchoredObject* pRetAnchoredObj = nullptr;
756 
757  if (auto pVirtObj = dynamic_cast<const SwDrawVirtObj*>(pSdrObj))
758  {
759  pRetAnchoredObj = &(pVirtObj->GetAnchoredObj());
760  }
761  else
762  {
763  assert(dynamic_cast<const SdrVirtObj*>(pSdrObj) == nullptr);
764  pRetAnchoredObj = &maAnchoredDrawObj;
765  }
766 
767  return pRetAnchoredObj;
768 }
769 
771 {
772  return const_cast<SwAnchoredObject*>(const_cast<SwDrawContact const*>(this)->GetAnchoredObj(pSdrObj));
773 }
774 
776 {
777  return !mbMasterObjCleared
779  : nullptr;
780 }
781 
782 const SwFrame* SwDrawContact::GetAnchorFrame( const SdrObject* _pDrawObj ) const
783 {
784  const SwFrame* pAnchorFrame = nullptr;
785  if ( !_pDrawObj ||
786  _pDrawObj == GetMaster() ||
787  ( !_pDrawObj->GetUserCall() &&
788  GetUserCall( _pDrawObj ) == this ) )
789  {
790  pAnchorFrame = maAnchoredDrawObj.GetAnchorFrame();
791  }
792  else
793  {
794  assert(dynamic_cast<SwDrawVirtObj const*>(_pDrawObj) != nullptr);
795  pAnchorFrame = static_cast<const SwDrawVirtObj*>(_pDrawObj)->GetAnchorFrame();
796  }
797 
798  return pAnchorFrame;
799 }
800 
802 {
803  return const_cast<SwFrame *>(const_cast<SwDrawContact const*>(this)->GetAnchorFrame(pDrawObj));
804 }
805 
809 {
810  maDrawVirtObjs.push_back(
812  new SwDrawVirtObj(
813  GetMaster()->getSdrModelFromSdrObject(),
814  *GetMaster(),
815  *this)));
816  maDrawVirtObjs.back()->AddToDrawingPage();
817  return maDrawVirtObjs.back().get();
818 }
819 
822 {
823  for(auto& rpDrawVirtObj : maDrawVirtObjs)
824  {
825  // remove and destroy 'virtual object'
826  rpDrawVirtObj->RemoveFromWriterLayout();
827  rpDrawVirtObj->RemoveFromDrawingPage();
828  }
829  maDrawVirtObjs.clear();
830 }
831 
832 
835 {
836  SdrObject* pRetDrawObj = nullptr;
837 
838  // #i26791# - compare master frames instead of direct frames
839  const SwFrame* pProposedAnchorFrame = &_rAnchorFrame;
840  if ( pProposedAnchorFrame->IsContentFrame() )
841  {
842  const SwContentFrame* pTmpFrame =
843  static_cast<const SwContentFrame*>( pProposedAnchorFrame );
844  while ( pTmpFrame->IsFollow() )
845  {
846  pTmpFrame = pTmpFrame->FindMaster();
847  }
848  pProposedAnchorFrame = pTmpFrame;
849  }
850 
851  const SwFrame* pMasterObjAnchorFrame = GetAnchorFrame();
852  if ( pMasterObjAnchorFrame && pMasterObjAnchorFrame->IsContentFrame() )
853  {
854  const SwContentFrame* pTmpFrame =
855  static_cast<const SwContentFrame*>( pMasterObjAnchorFrame );
856  while ( pTmpFrame->IsFollow() )
857  {
858  pTmpFrame = pTmpFrame->FindMaster();
859  }
860  pMasterObjAnchorFrame = pTmpFrame;
861  }
862 
863  if ( pMasterObjAnchorFrame && pMasterObjAnchorFrame == pProposedAnchorFrame )
864  {
865  pRetDrawObj = GetMaster();
866  }
867  else
868  {
869  const auto ppFoundVirtObj(std::find_if(maDrawVirtObjs.begin(), maDrawVirtObjs.end(),
870  VirtObjAnchoredAtFramePred(pProposedAnchorFrame)));
871  if(ppFoundVirtObj != maDrawVirtObjs.end())
872  pRetDrawObj = ppFoundVirtObj->get();
873  }
874 
875  return pRetDrawObj;
876 }
877 
879 {
880  for(const auto& rpDrawVirtObj : maDrawVirtObjs)
881  {
882  SwDrawVirtObj* pDrawVirtObj(rpDrawVirtObj.get());
883  if ( pDrawVirtObj->GetAnchorFrame() )
884  {
885  // #i34640# - determine correct page frame
886  SwPageFrame* pPage = pDrawVirtObj->AnchoredObj().FindPageFrameOfAnchor();
887  if( pOldBoundRect && pPage )
888  {
889  SwRect aOldRect( *pOldBoundRect );
890  aOldRect.Pos() += pDrawVirtObj->GetOffset();
891  if( aOldRect.HasArea() )
892  ::Notify_Background( pDrawVirtObj, pPage,
893  aOldRect, PrepareHint::FlyFrameLeave,true);
894  }
895  // #i34640# - include spacing for wrapping
896  SwRect aRect( pDrawVirtObj->GetAnchoredObj().GetObjRectWithSpaces() );
897  if (aRect.HasArea() && pPage)
898  {
899  SwPageFrame* pPg = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aRect, pPage )));
900  if ( pPg )
901  ::Notify_Background( pDrawVirtObj, pPg, aRect,
903  }
904  ::ClrContourCache( pDrawVirtObj );
905  }
906  }
907 }
908 
910 static void lcl_NotifyBackgroundOfObj( SwDrawContact const & _rDrawContact,
911  const SdrObject& _rObj,
912  const tools::Rectangle* _pOldObjRect )
913 {
914  // #i34640#
915  SwAnchoredObject* pAnchoredObj =
916  const_cast<SwAnchoredObject*>(_rDrawContact.GetAnchoredObj( &_rObj ));
917  if ( pAnchoredObj && pAnchoredObj->GetAnchorFrame() )
918  {
919  // #i34640# - determine correct page frame
920  SwPageFrame* pPageFrame = pAnchoredObj->FindPageFrameOfAnchor();
921  if( _pOldObjRect && pPageFrame )
922  {
923  SwRect aOldRect( *_pOldObjRect );
924  if( aOldRect.HasArea() )
925  {
926  // #i34640# - determine correct page frame
927  SwPageFrame* pOldPageFrame = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aOldRect, pPageFrame )));
928  ::Notify_Background( &_rObj, pOldPageFrame, aOldRect,
930  }
931  }
932  // #i34640# - include spacing for wrapping
933  SwRect aNewRect( pAnchoredObj->GetObjRectWithSpaces() );
934  if( aNewRect.HasArea() && pPageFrame )
935  {
936  pPageFrame = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( aNewRect, pPageFrame )));
937  ::Notify_Background( &_rObj, pPageFrame, aNewRect,
939  }
940  ClrContourCache( &_rObj );
941  }
942 }
943 
945  SdrUserCallType eType,
946  const tools::Rectangle& rOldBoundRect )
947 {
948  // #i26791# - no event handling, if existing <SwViewShell>
949  // is in construction
950  SwDoc* pDoc = GetFormat()->GetDoc();
953  {
954  return;
955  }
956 
957  // #i44339#
958  // no event handling, if document is in destruction.
959  // Exception: It's the SdrUserCallType::Delete event
960  if ( pDoc->IsInDtor() && eType != SdrUserCallType::Delete )
961  {
962  return;
963  }
964 
965  //Put on Action, but not if presently anywhere an action runs.
966  bool bHasActions(true);
968  if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() )
969  {
971  if ( pSh )
972  {
973  for(SwViewShell& rShell : pSh->GetRingContainer() )
974  {
975  if ( rShell.Imp()->IsAction() || rShell.Imp()->IsIdleAction() )
976  {
977  bHasActions = true;
978  break;
979  }
980  bHasActions = false;
981  }
982  }
983  if(!bHasActions)
984  pTmpRoot->StartAllAction();
985  }
986  SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
987  Changed_( rObj, eType, &rOldBoundRect ); //Attention, possibly suicidal!
988 
989  if(!bHasActions)
990  pTmpRoot->EndAllAction();
991 }
992 
996 {
997  private:
1001 
1002  public:
1004  SdrUserCallType _eEventType )
1005  : mpDrawContact( _pDrawContact ),
1006  mbParentUserCallActive( _pDrawContact->mbUserCallActive ),
1007  meParentUserCallEventType( _pDrawContact->meEventTypeOfCurrentUserCall )
1008  {
1009  mpDrawContact->mbUserCallActive = true;
1010  mpDrawContact->meEventTypeOfCurrentUserCall = _eEventType;
1011  }
1012 
1014  {
1015  if ( mpDrawContact )
1016  {
1017  mpDrawContact->mbUserCallActive = mbParentUserCallActive;
1019  }
1020  }
1021 
1023  {
1024  mpDrawContact = nullptr;
1025  }
1026 
1027  bool IsNestedUserCall() const
1028  {
1029  return mbParentUserCallActive;
1030  }
1031 
1033  {
1034  if ( IsNestedUserCall() )
1035  {
1036  bool bTmpAssert( true );
1037  // Currently its known, that a nested event SdrUserCallType::Resize
1038  // could occur during parent user call SdrUserCallType::Inserted,
1039  // SdrUserCallType::Delete and SdrUserCallType::Resize for edge objects.
1040  // Also possible are nested SdrUserCallType::ChildResize events for
1041  // edge objects
1042  // Thus, assert all other combinations
1043  if ( ( meParentUserCallEventType == SdrUserCallType::Inserted ||
1044  meParentUserCallEventType == SdrUserCallType::Delete ||
1045  meParentUserCallEventType == SdrUserCallType::Resize ) &&
1046  mpDrawContact->meEventTypeOfCurrentUserCall == SdrUserCallType::Resize )
1047  {
1048  bTmpAssert = false;
1049  }
1050  else if ( meParentUserCallEventType == SdrUserCallType::ChildResize &&
1051  mpDrawContact->meEventTypeOfCurrentUserCall == SdrUserCallType::ChildResize )
1052  {
1053  bTmpAssert = false;
1054  }
1055 
1056  if ( bTmpAssert )
1057  {
1058  OSL_FAIL( "<SwDrawContact::Changed_(..)> - unknown nested <UserCall> event. This is serious." );
1059  }
1060  }
1061  }
1062 };
1063 
1066 {
1068  {
1069  // Just notify the textbox that the size has changed, the actual object size is not interesting.
1071  SwFormatFrameSize aSize;
1072  aResizeSet.Put(aSize);
1073  SwTextBoxHelper::syncFlyFrameAttr(*pFormat, aResizeSet);
1074  }
1075 }
1076 
1077 // !!!ATTENTION!!! The object may commit suicide!!!
1078 
1080  SdrUserCallType eType,
1081  const tools::Rectangle* pOldBoundRect )
1082 {
1083  // suppress handling of nested <SdrObjUserCall> events
1084  NestedUserCallHdl aNestedUserCallHdl( this, eType );
1085  if ( aNestedUserCallHdl.IsNestedUserCall() )
1086  {
1087  aNestedUserCallHdl.AssertNestedUserCall();
1088  return;
1089  }
1090  // do *not* notify, if document is destructing
1091  // #i35912# - do *not* notify for as-character anchored
1092  // drawing objects.
1093  // #i35007#
1094  // improvement: determine as-character anchored object flag only once.
1095  const bool bAnchoredAsChar = ObjAnchoredAsChar();
1096  const bool bNotify = !(GetFormat()->GetDoc()->IsInDtor()) &&
1097  ( css::text::WrapTextMode_THROUGH != GetFormat()->GetSurround().GetSurround() ) &&
1098  !bAnchoredAsChar;
1099  switch( eType )
1100  {
1101  case SdrUserCallType::Delete:
1102  {
1103  if ( bNotify )
1104  {
1105  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1106  // --> #i36181# - background of 'virtual'
1107  // drawing objects have also been notified.
1108  NotifyBackgrdOfAllVirtObjs( pOldBoundRect );
1109  }
1110  DisconnectFromLayout( false );
1111  mbMasterObjCleared = true;
1112  delete this;
1113  // --> #i65784# Prevent memory corruption
1114  aNestedUserCallHdl.DrawContactDeleted();
1115  break;
1116  }
1117  case SdrUserCallType::Inserted:
1118  {
1119  if ( mbDisconnectInProgress )
1120  {
1121  OSL_FAIL( "<SwDrawContact::Changed_(..)> - Insert event during disconnection from layout is invalid." );
1122  }
1123  else
1124  {
1125  ConnectToLayout();
1126  if ( bNotify )
1127  {
1128  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1129  }
1130  }
1131  break;
1132  }
1133  case SdrUserCallType::Removed:
1134  {
1135  if ( bNotify )
1136  {
1137  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1138  }
1139  DisconnectFromLayout( false );
1140  break;
1141  }
1142  case SdrUserCallType::ChildInserted :
1143  case SdrUserCallType::ChildRemoved :
1144  {
1145  // --> #i113730#
1146  // force layer of controls for group objects containing control objects
1147  if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj()))
1148  {
1150  {
1151  const IDocumentDrawModelAccess& rIDDMA = static_cast<SwFrameFormat*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
1152  const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
1153  const SdrLayerID aControlLayerID(rIDDMA.GetControlsId());
1154  const SdrLayerID aInvisibleControlLayerID(rIDDMA.GetInvisibleControlsId());
1155 
1156  if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
1157  {
1158  if ( aCurrentLayer == rIDDMA.GetInvisibleHellId() ||
1159  aCurrentLayer == rIDDMA.GetInvisibleHeavenId() )
1160  {
1161  maAnchoredDrawObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
1162  }
1163  else
1164  {
1165  maAnchoredDrawObj.DrawObj()->SetLayer(aControlLayerID);
1166  }
1167  }
1168  }
1169  }
1170  [[fallthrough]];
1171  }
1172  case SdrUserCallType::MoveOnly:
1173  case SdrUserCallType::Resize:
1174  case SdrUserCallType::ChildMoveOnly :
1175  case SdrUserCallType::ChildResize :
1176  case SdrUserCallType::ChildChangeAttr :
1177  case SdrUserCallType::ChildDelete :
1178  {
1179  // #i31698# - improvement
1180  // get instance <SwAnchoredDrawObject> only once
1181  const SwAnchoredDrawObject* pAnchoredDrawObj =
1182  static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
1183 
1184  /* protect against NULL pointer dereferencing */
1185  if(!pAnchoredDrawObj)
1186  {
1187  break;
1188  }
1189 
1190  // #i26791# - adjust positioning and alignment attributes,
1191  // if positioning of drawing object isn't in progress.
1192  // #i53320# - no adjust of positioning attributes,
1193  // if drawing object isn't positioned.
1194  if ( !pAnchoredDrawObj->IsPositioningInProgress() &&
1195  !pAnchoredDrawObj->NotYetPositioned() )
1196  {
1197  // #i34748# - If no last object rectangle is
1198  // provided by the anchored object, use parameter <pOldBoundRect>.
1199  const tools::Rectangle& aOldObjRect = pAnchoredDrawObj->GetLastObjRect()
1200  ? *(pAnchoredDrawObj->GetLastObjRect())
1201  : *pOldBoundRect;
1202  // #i79400#
1203  // always invalidate object rectangle inclusive spaces
1204  pAnchoredDrawObj->InvalidateObjRectWithSpaces();
1205  // #i41324# - notify background before
1206  // adjusting position
1207  if ( bNotify )
1208  {
1209  // #i31573# - correction
1210  // background of given drawing object.
1211  lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
1212  }
1213  // #i31698# - determine layout direction
1214  // via draw frame format.
1215  SwFrameFormat::tLayoutDir eLayoutDir =
1216  pAnchoredDrawObj->GetFrameFormat().GetLayoutDir();
1217  // use geometry of drawing object
1218  SwRect aObjRect( rObj.GetSnapRect() );
1219  // If drawing object is a member of a group, the adjustment
1220  // of the positioning and the alignment attributes has to
1221  // be done for the top group object.
1222  if ( rObj.getParentSdrObjectFromSdrObject() )
1223  {
1224  const SdrObject* pGroupObj = rObj.getParentSdrObjectFromSdrObject();
1225  while ( pGroupObj->getParentSdrObjectFromSdrObject() )
1226  {
1227  pGroupObj = pGroupObj->getParentSdrObjectFromSdrObject();
1228  }
1229  // use geometry of drawing object
1230  aObjRect = pGroupObj->GetSnapRect();
1231  }
1232  SwTwips nXPosDiff(0);
1233  SwTwips nYPosDiff(0);
1234  switch ( eLayoutDir )
1235  {
1237  {
1238  nXPosDiff = aObjRect.Left() - aOldObjRect.Left();
1239  nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
1240  }
1241  break;
1243  {
1244  nXPosDiff = aOldObjRect.Right() - aObjRect.Right();
1245  nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
1246  }
1247  break;
1249  {
1250  nXPosDiff = aObjRect.Top() - aOldObjRect.Top();
1251  nYPosDiff = aOldObjRect.Right() - aObjRect.Right();
1252  }
1253  break;
1254  default:
1255  {
1256  assert(!"<SwDrawContact::Changed_(..)> - unsupported layout direction");
1257  }
1258  }
1259  SfxItemSet aSet( GetFormat()->GetDoc()->GetAttrPool(),
1261  const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient();
1262  if ( nYPosDiff != 0 )
1263  {
1264 
1265  if ( rVert.GetRelationOrient() == text::RelOrientation::CHAR ||
1266  rVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
1267  {
1268  nYPosDiff = -nYPosDiff;
1269  }
1270  aSet.Put( SwFormatVertOrient( rVert.GetPos()+nYPosDiff,
1272  rVert.GetRelationOrient() ) );
1273  }
1274 
1275  const SwFormatHoriOrient& rHori = GetFormat()->GetHoriOrient();
1276  if ( !bAnchoredAsChar && nXPosDiff != 0 )
1277  {
1278  aSet.Put( SwFormatHoriOrient( rHori.GetPos()+nXPosDiff,
1280  rHori.GetRelationOrient() ) );
1281  }
1282 
1283  if ( nYPosDiff ||
1284  ( !bAnchoredAsChar && nXPosDiff != 0 ) )
1285  {
1286  GetFormat()->GetDoc()->SetFlyFrameAttr( *(GetFormat()), aSet );
1287  // keep new object rectangle, to avoid multiple
1288  // changes of the attributes by multiple event from
1289  // the drawing layer - e.g. group objects and its members
1290  // #i34748# - use new method
1291  // <SwAnchoredDrawObject::SetLastObjRect(..)>.
1292  const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
1293  ->SetLastObjRect( aObjRect.SVRect() );
1294  }
1295  else if ( aObjRect.SSize() != aOldObjRect.GetSize() )
1296  {
1297  InvalidateObjs_();
1298  // #i35007# - notify anchor frame
1299  // of as-character anchored object
1300  if ( bAnchoredAsChar )
1301  {
1302  SwFrame* pAnchorFrame = const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)->AnchorFrame();
1303  if(pAnchorFrame)
1304  {
1306  }
1307  }
1308 
1310  }
1311  else if (eType == SdrUserCallType::Resize)
1312  // Even if the bounding box of the shape didn't change,
1313  // notify about the size change, as an adjustment change
1314  // may affect the size of the underlying textbox.
1316  }
1317  }
1318  break;
1319  case SdrUserCallType::ChangeAttr:
1320  if ( bNotify )
1321  {
1322  lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
1323  }
1324  break;
1325  default:
1326  break;
1327  }
1328 }
1329 
1330 namespace
1331 {
1332  const SwFormatAnchor* lcl_getAnchorFormat( const SfxPoolItem& _rItem )
1333  {
1334  sal_uInt16 nWhich = _rItem.Which();
1335  const SwFormatAnchor* pAnchorFormat = nullptr;
1336  if ( RES_ATTRSET_CHG == nWhich )
1337  {
1338  static_cast<const SwAttrSetChg&>(_rItem).GetChgSet()->
1339  GetItemState( RES_ANCHOR, false, reinterpret_cast<const SfxPoolItem**>(&pAnchorFormat) );
1340  }
1341  else if ( RES_ANCHOR == nWhich )
1342  {
1343  pAnchorFormat = &static_cast<const SwFormatAnchor&>(_rItem);
1344  }
1345  return pAnchorFormat;
1346  }
1347 }
1348 
1349 void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
1350 {
1351  SwClient::SwClientNotify(rMod, rHint); // needed as SwContact::SwClientNotify doesn't explicitly call SwClient::SwClientNotify
1352  SwContact::SwClientNotify(rMod, rHint);
1353  if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
1354  {
1355  SAL_WARN_IF(mbDisconnectInProgress, "sw.core", "<SwDrawContact::Modify(..)> called during disconnection.");
1356 
1357  const SfxPoolItem* pNew = pLegacyHint->m_pNew;
1358  sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
1359  if(const SwFormatAnchor* pNewAnchorFormat = pNew ? lcl_getAnchorFormat(*pNew) : nullptr)
1360  {
1361  // Do not respond to a Reset Anchor!
1362  if(GetFormat()->GetAttrSet().GetItemState(RES_ANCHOR, false) == SfxItemState::SET)
1363  {
1364  // no connect to layout during disconnection
1366  {
1367  // determine old object rectangle of 'master' drawing object
1368  // for notification
1369  const tools::Rectangle* pOldRect = nullptr;
1370  tools::Rectangle aOldRect;
1371  if(GetAnchorFrame())
1372  {
1373  // --> #i36181# - include spacing in object
1374  // rectangle for notification.
1376  pOldRect = &aOldRect;
1377  }
1378  // re-connect to layout due to anchor format change
1379  ConnectToLayout(pNewAnchorFormat);
1380  // notify background of drawing objects
1381  lcl_NotifyBackgroundOfObj(*this, *GetMaster(), pOldRect);
1382  NotifyBackgrdOfAllVirtObjs(pOldRect);
1383 
1384  const SwFormatAnchor* pOldAnchorFormat = pLegacyHint->m_pOld ? lcl_getAnchorFormat(*pLegacyHint->m_pOld) : nullptr;
1385  if(!pOldAnchorFormat || (pOldAnchorFormat->GetAnchorId() != pNewAnchorFormat->GetAnchorId()))
1386  {
1388  {
1389  // --> #i102752#
1390  // assure that a ShapePropertyChangeNotifier exists
1392  }
1393  else
1394  SAL_WARN("sw.core", "SwDrawContact::Modify: no draw object here?");
1395  }
1396  }
1397  }
1398  else
1400  }
1401  else if (nWhich == RES_REMOVE_UNO_OBJECT)
1402  {} // nothing to do
1403  // --> #i62875# - no further notification, if not connected to Writer layout
1404  else if ( maAnchoredDrawObj.GetAnchorFrame() &&
1406  {
1407  bool bUpdateSortedObjsList(false);
1408  switch(nWhich)
1409  {
1410  case RES_UL_SPACE:
1411  case RES_LR_SPACE:
1412  case RES_HORI_ORIENT:
1413  case RES_VERT_ORIENT:
1414  case RES_FOLLOW_TEXT_FLOW: // #i28701# - add attribute 'Follow text flow'
1415  break;
1416  case RES_SURROUND:
1417  case RES_OPAQUE:
1419  // --> #i28701# - on change of wrapping style, hell|heaven layer,
1420  // or wrapping style influence an update of the <SwSortedObjs> list,
1421  // the drawing object is registered in, has to be performed. This is triggered
1422  // by the 1st parameter of method call <InvalidateObjs_(..)>.
1423  bUpdateSortedObjsList = true;
1424  break;
1425  case RES_ATTRSET_CHG: // #i35443#
1426  {
1427  auto pChgSet = static_cast<const SwAttrSetChg*>(pNew)->GetChgSet();
1428  if(pChgSet->GetItemState(RES_SURROUND, false) == SfxItemState::SET ||
1429  pChgSet->GetItemState(RES_OPAQUE, false) == SfxItemState::SET ||
1430  pChgSet->GetItemState(RES_WRAP_INFLUENCE_ON_OBJPOS, false) == SfxItemState::SET)
1431  bUpdateSortedObjsList = true;
1432  }
1433  break;
1434  default:
1435  assert(!"<SwDraw Contact::Modify(..)> - unhandled attribute?");
1436  }
1437  lcl_NotifyBackgroundOfObj(*this, *GetMaster(), nullptr);
1438  NotifyBackgrdOfAllVirtObjs(nullptr);
1439  InvalidateObjs_(bUpdateSortedObjsList);
1440  }
1441 
1442  // #i51474#
1444  }
1445  else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint))
1446  {
1447  switch(pDrawFrameFormatHint->m_eId)
1448  {
1450  delete this;
1451  break;
1454  break;
1457  // #i40845# - follow-up of #i35635#
1458  // move object to visible layer
1460  break;
1463  break;
1467  break;
1469  ConnectToLayout();
1470  break;
1473  break;
1474  default:
1475  ;
1476  }
1477  }
1478  else if (auto pCheckDrawFrameFormatLayerHint = dynamic_cast<const sw::CheckDrawFrameFormatLayerHint*>(&rHint))
1479  {
1480  *(pCheckDrawFrameFormatLayerHint->m_bCheckControlLayer) |= (GetMaster() && CheckControlLayer(GetMaster()));
1481  }
1482  else if (auto pContactChangedHint = dynamic_cast<const sw::ContactChangedHint*>(&rHint))
1483  {
1484  if(!*pContactChangedHint->m_ppObject)
1485  *pContactChangedHint->m_ppObject = GetMaster();
1486  auto pObject = *pContactChangedHint->m_ppObject;
1487  Changed(*pObject, SdrUserCallType::Delete, pObject->GetLastBoundRect());
1488  }
1489  else if (auto pDrawFormatLayoutCopyHint = dynamic_cast<const sw::DrawFormatLayoutCopyHint*>(&rHint))
1490  {
1491  const SwDrawFrameFormat& rFormat = static_cast<const SwDrawFrameFormat&>(rMod);
1492  new SwDrawContact(
1493  &pDrawFormatLayoutCopyHint->m_rDestFormat,
1494  pDrawFormatLayoutCopyHint->m_rDestDoc.CloneSdrObj(
1495  *GetMaster(),
1496  pDrawFormatLayoutCopyHint->m_rDestDoc.IsCopyIsMove() && &pDrawFormatLayoutCopyHint->m_rDestDoc == rFormat.GetDoc()));
1497  // #i49730# - notify draw frame format that position attributes are
1498  // already set, if the position attributes are already set at the
1499  // source draw frame format.
1500  if(rFormat.IsPosAttrSet())
1501  pDrawFormatLayoutCopyHint->m_rDestFormat.PosAttrSet();
1502  }
1503  else if (auto pRestoreFlyAnchorHint = dynamic_cast<const sw::RestoreFlyAnchorHint*>(&rHint))
1504  {
1505  SdrObject* pObj = GetMaster();
1506  if(GetAnchorFrame() && !pObj->IsInserted())
1507  {
1508  auto pDrawModel = const_cast<SwDrawFrameFormat&>(static_cast<const SwDrawFrameFormat&>(rMod)).GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
1509  assert(pDrawModel);
1510  pDrawModel->GetPage(0)->InsertObject(pObj);
1511  }
1512  pObj->SetRelativePos(pRestoreFlyAnchorHint->m_aPos);
1513  }
1514  else if (auto pCreatePortionHint = dynamic_cast<const sw::CreatePortionHint*>(&rHint))
1515  {
1516  if(*pCreatePortionHint->m_ppContact)
1517  return;
1518  *pCreatePortionHint->m_ppContact = this; // This is kind of ridiculous: the FrameFormat doesn't even hold a pointer to the contact itself, but here we are leaking it out randomly
1519  if(!GetAnchorFrame())
1520  {
1521  // No direct positioning needed any more
1522  ConnectToLayout();
1523  // Move object to visible layer
1525  }
1526  }
1527  else if (auto pCollectTextObjectsHint = dynamic_cast<const sw::CollectTextObjectsHint*>(&rHint))
1528  {
1529  auto pSdrO = GetMaster();
1530  if(!pSdrO)
1531  return;
1532  if(dynamic_cast<const SdrObjGroup*>(pSdrO))
1533  {
1534  SdrObjListIter aListIter(*pSdrO, SdrIterMode::DeepNoGroups);
1535  //iterate inside of a grouped object
1536  while(aListIter.IsMore())
1537  {
1538  SdrObject* pSdrOElement = aListIter.Next();
1539  auto pTextObj = const_cast<SdrTextObj*>(dynamic_cast<const SdrTextObj*>(pSdrOElement));
1540  if(pTextObj && pTextObj->HasText())
1541  pCollectTextObjectsHint->m_rTextObjects.push_back(pTextObj);
1542  }
1543  }
1544  else if(auto pTextObj = const_cast<SdrTextObj*>(dynamic_cast<const SdrTextObj*>(pSdrO)))
1545  {
1546  if(pTextObj->HasText())
1547  pCollectTextObjectsHint->m_rTextObjects.push_back(pTextObj);
1548  }
1549  }
1550  else if (auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint))
1551  {
1552  auto pFormat(dynamic_cast<const SwFrameFormat*>(&rMod));
1553  if(pFormat->Which() == RES_DRAWFRMFMT)
1554  pGetZOrdnerHint->m_rnZOrder = GetMaster()->GetOrdNum();
1555  }
1556  else if (auto pConnectedHint = dynamic_cast<const sw::GetObjectConnectedHint*>(&rHint))
1557  {
1558  pConnectedHint->m_risConnected |= (GetAnchorFrame() != nullptr);
1559  }
1560 }
1561 
1562 // #i26791#
1563 // #i28701# - added parameter <_bUpdateSortedObjsList>
1564 void SwDrawContact::InvalidateObjs_( const bool _bUpdateSortedObjsList )
1565 {
1566  for(const auto& rpDrawVirtObj : maDrawVirtObjs)
1567  // invalidate position of existing 'virtual' drawing objects
1568  {
1569  SwDrawVirtObj* pDrawVirtObj(rpDrawVirtObj.get());
1570  // #i33313# - invalidation only for connected
1571  // 'virtual' drawing objects
1572  if ( pDrawVirtObj->IsConnected() )
1573  {
1574  pDrawVirtObj->AnchoredObj().InvalidateObjPos();
1575  // #i28701#
1576  if ( _bUpdateSortedObjsList )
1577  {
1578  pDrawVirtObj->AnchoredObj().UpdateObjInSortedList();
1579  }
1580  }
1581  }
1582 
1583  // invalidate position of 'master' drawing object
1584  SwAnchoredObject* pAnchoredObj = GetAnchoredObj( nullptr );
1585  pAnchoredObj->InvalidateObjPos();
1586  // #i28701#
1587  if ( _bUpdateSortedObjsList )
1588  {
1589  pAnchoredObj->UpdateObjInSortedList();
1590  }
1591 }
1592 
1593 void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
1594 {
1595  mbDisconnectInProgress = true;
1596 
1597  // --> #i36181# - notify background of drawing object
1598  if ( _bMoveMasterToInvisibleLayer &&
1599  !(GetFormat()->GetDoc()->IsInDtor()) &&
1600  GetAnchorFrame() && !GetAnchorFrame()->IsInDtor() )
1601  {
1603  lcl_NotifyBackgroundOfObj( *this, *GetMaster(), &aOldRect );
1604  NotifyBackgrdOfAllVirtObjs( &aOldRect );
1605  }
1606 
1607  // remove 'virtual' drawing objects from writer
1608  // layout and from drawing page
1609  for(auto& rpVirtDrawObj : maDrawVirtObjs)
1610  {
1611  rpVirtDrawObj->RemoveFromWriterLayout();
1612  rpVirtDrawObj->RemoveFromDrawingPage();
1613  }
1614 
1616  {
1618  }
1619 
1620  if ( _bMoveMasterToInvisibleLayer && GetMaster() && GetMaster()->IsInserted() )
1621  {
1622  SdrViewIter aIter( GetMaster() );
1623  for( SdrView* pView = aIter.FirstView(); pView;
1624  pView = aIter.NextView() )
1625  {
1626  pView->MarkObj( GetMaster(), pView->GetSdrPageView(), true );
1627  }
1628 
1629  // Instead of removing 'master' object from drawing page, move the
1630  // 'master' drawing object into the corresponding invisible layer.
1631  {
1632  //static_cast<SwFrameFormat*>(GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
1633  // RemoveObject( GetMaster()->GetOrdNum() );
1634  // #i18447# - in order to consider group object correct
1635  // use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
1637  }
1638  }
1639 
1640  mbDisconnectInProgress = false;
1641 }
1642 
1645 {
1646  if ( GetMaster() )
1647  {
1648  GetMaster()->SetUserCall( nullptr );
1649  if ( GetMaster()->IsInserted() )
1650  {
1651  static_cast<SwFrameFormat*>(GetRegisteredIn())->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0)->
1652  RemoveObject( GetMaster()->GetOrdNum() );
1653  }
1654  }
1655 }
1656 
1657 // disconnect for a dedicated drawing object - could be 'master' or 'virtual'.
1658 // a 'master' drawing object will disconnect a 'virtual' drawing object
1659 // in order to take its place.
1660 // #i19919# - no special case, if drawing object isn't in
1661 // page header/footer, in order to get drawing objects in repeating table headers
1662 // also working.
1664 {
1665  if ( dynamic_cast<const SwDrawVirtObj*>( _pDrawObj) != nullptr )
1666  {
1667  SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(_pDrawObj);
1668  pDrawVirtObj->RemoveFromWriterLayout();
1669  pDrawVirtObj->RemoveFromDrawingPage();
1670  }
1671  else
1672  {
1673  const auto ppVirtDrawObj(std::find_if(maDrawVirtObjs.begin(), maDrawVirtObjs.end(),
1674  [] (const SwDrawVirtObjPtr& pObj) { return pObj->IsConnected(); }));
1675 
1676  if(ppVirtDrawObj != maDrawVirtObjs.end())
1677  {
1678  // replace found 'virtual' drawing object by 'master' drawing
1679  // object and disconnect the 'virtual' one
1680  SwDrawVirtObj* pDrawVirtObj(ppVirtDrawObj->get());
1681  SwFrame* pNewAnchorFrameOfMaster = pDrawVirtObj->AnchorFrame();
1682  // disconnect 'virtual' drawing object
1683  pDrawVirtObj->RemoveFromWriterLayout();
1684  pDrawVirtObj->RemoveFromDrawingPage();
1685  // disconnect 'master' drawing object from current frame
1687  // re-connect 'master' drawing object to frame of found 'virtual'
1688  // drawing object.
1689  pNewAnchorFrameOfMaster->AppendDrawObj( maAnchoredDrawObj );
1690  }
1691  else
1692  {
1693  // no connected 'virtual' drawing object found. Thus, disconnect
1694  // completely from layout.
1696  }
1697  }
1698 }
1699 
1700 static SwTextFrame* lcl_GetFlyInContentAnchor( SwTextFrame* _pProposedAnchorFrame,
1701  SwPosition const& rAnchorPos)
1702 {
1703  SwTextFrame* pAct = _pProposedAnchorFrame;
1704  SwTextFrame* pTmp;
1705  TextFrameIndex const nTextOffset(_pProposedAnchorFrame->MapModelToViewPos(rAnchorPos));
1706  do
1707  {
1708  pTmp = pAct;
1709  pAct = pTmp->GetFollow();
1710  }
1711  while (pAct && nTextOffset >= pAct->GetOffset());
1712  return pTmp;
1713 }
1714 
1716 {
1717  // *no* connect to layout during disconnection from layout.
1718  if ( mbDisconnectInProgress )
1719  {
1720  OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> called during disconnection.");
1721  return;
1722  }
1723 
1724  // --> #i33909# - *no* connect to layout, if 'master' drawing
1725  // object isn't inserted in the drawing page
1726  if ( !GetMaster()->IsInserted() )
1727  {
1728  OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
1729  return;
1730  }
1731 
1732  SwFrameFormat* pDrawFrameFormat = static_cast<SwFrameFormat*>(GetRegisteredIn());
1733 
1734  if( !pDrawFrameFormat->getIDocumentLayoutAccess().GetCurrentViewShell() )
1735  return;
1736 
1737  // remove 'virtual' drawing objects from writer
1738  // layout and from drawing page, and remove 'master' drawing object from
1739  // writer layout - 'master' object will remain in drawing page.
1740  DisconnectFromLayout( false );
1741 
1742  if ( !pAnch )
1743  {
1744  pAnch = &(pDrawFrameFormat->GetAnchor());
1745  }
1746 
1747  switch ( pAnch->GetAnchorId() )
1748  {
1749  case RndStdIds::FLY_AT_PAGE:
1750  {
1751  sal_uInt16 nPgNum = pAnch->GetPageNum();
1752  SwViewShell *pShell = pDrawFrameFormat->getIDocumentLayoutAccess().GetCurrentViewShell();
1753  if( !pShell )
1754  break;
1755  SwRootFrame* pRoot = pShell->GetLayout();
1756  SwPageFrame *pPage = static_cast<SwPageFrame*>(pRoot->Lower());
1757 
1758  for ( sal_uInt16 i = 1; i < nPgNum && pPage; ++i )
1759  {
1760  pPage = static_cast<SwPageFrame*>(pPage->GetNext());
1761  }
1762 
1763  if ( pPage )
1764  {
1765  pPage->AppendDrawObj( maAnchoredDrawObj );
1766  }
1767  else
1768  //Looks stupid but is allowed (compare SwFEShell::SetPageObjsNewPage)
1769  pRoot->SetAssertFlyPages();
1770  }
1771  break;
1772 
1773  case RndStdIds::FLY_AT_CHAR:
1774  case RndStdIds::FLY_AT_PARA:
1775  case RndStdIds::FLY_AT_FLY:
1776  case RndStdIds::FLY_AS_CHAR:
1777  {
1778  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1779  {
1781  }
1782  // support drawing objects in header/footer,
1783  // but not control objects:
1784  // anchor at first found frame the 'master' object and
1785  // at the following frames 'virtual' drawing objects.
1786  // Note: method is similar to <SwFlyFrameFormat::MakeFrames(..)>
1787  SwModify *pModify = nullptr;
1788  if( pAnch->GetContentAnchor() )
1789  {
1790  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AT_FLY )
1791  {
1792  SwNodeIndex aIdx( pAnch->GetContentAnchor()->nNode );
1793  SwContentNode* pCNd = pDrawFrameFormat->GetDoc()->GetNodes().GoNext( &aIdx );
1795  pModify = pCNd;
1796  else
1797  {
1798  const SwNodeIndex& rIdx = pAnch->GetContentAnchor()->nNode;
1799  SwFrameFormats& rFormats = *(pDrawFrameFormat->GetDoc()->GetSpzFrameFormats());
1800  for( auto pFlyFormat : rFormats )
1801  {
1802  if( pFlyFormat->GetContent().GetContentIdx() &&
1803  rIdx == *(pFlyFormat->GetContent().GetContentIdx()) )
1804  {
1805  pModify = pFlyFormat;
1806  break;
1807  }
1808  }
1809  }
1810  }
1811  else
1812  {
1813  pModify = pAnch->GetContentAnchor()->nNode.GetNode().GetContentNode();
1814  }
1815  }
1816 
1817  // #i29199# - It is possible, that
1818  // the anchor doesn't exist - E.g., reordering the
1819  // sub-documents in a master document.
1820  // Note: The anchor will be inserted later.
1821  if ( !pModify )
1822  {
1823  // break to end of the current switch case.
1824  break;
1825  }
1826 
1828  SwFrame* pAnchorFrameOfMaster = nullptr;
1829  for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
1830  {
1831  // append drawing object, if
1832  // (1) proposed anchor frame isn't a follow and
1833  // (2) drawing object isn't a control object to be anchored
1834  // in header/footer.
1835  bool bAdd = ( !pFrame->IsContentFrame() ||
1836  !static_cast<SwContentFrame*>(pFrame)->IsFollow() ) &&
1837  ( !::CheckControlLayer( GetMaster() ) ||
1838  !pFrame->FindFooterOrHeader() );
1839 
1840  if (bAdd && RndStdIds::FLY_AT_FLY != pAnch->GetAnchorId())
1841  {
1842  assert(pFrame->IsTextFrame());
1843  bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), *pAnch);
1844  }
1845 
1846  if( bAdd )
1847  {
1848  if ( RndStdIds::FLY_AT_FLY == pAnch->GetAnchorId() && !pFrame->IsFlyFrame() )
1849  {
1850  pFrame = pFrame->FindFlyFrame();
1851  assert(pFrame);
1852  }
1853 
1854  // find correct follow for as character anchored objects
1855  if ((pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR) &&
1856  pFrame->IsTextFrame() )
1857  {
1858  pFrame = lcl_GetFlyInContentAnchor(
1859  static_cast<SwTextFrame*>(pFrame),
1860  *pAnch->GetContentAnchor());
1861  }
1862 
1863  if ( !pAnchorFrameOfMaster )
1864  {
1865  // append 'master' drawing object
1866  pAnchorFrameOfMaster = pFrame;
1867  pFrame->AppendDrawObj( maAnchoredDrawObj );
1868  }
1869  else
1870  {
1871  // append 'virtual' drawing object
1872  SwDrawVirtObj* pDrawVirtObj = AddVirtObj();
1873  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1874  {
1875  ClrContourCache( pDrawVirtObj );
1876  }
1877  pFrame->AppendDrawObj( pDrawVirtObj->AnchoredObj() );
1878 
1879  pDrawVirtObj->ActionChanged();
1880  }
1881 
1882  if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR )
1883  {
1884  pFrame->InvalidatePrt();
1885  }
1886  }
1887  }
1888  }
1889  break;
1890  default:
1891  assert(!"Unknown Anchor.");
1892  break;
1893  }
1894  if ( GetAnchorFrame() )
1895  {
1897  // #i26791# - invalidate objects instead of direct positioning
1898  InvalidateObjs_();
1899  }
1900 }
1901 
1904 {
1905  if ( !GetMaster()->IsInserted() )
1906  {
1908  ->InsertObject( GetMaster(), GetMaster()->GetOrdNumDirect() );
1909  }
1910  GetMaster()->SetUserCall( this );
1911 }
1912 
1914 {
1915  // --> #i28701# - use method <GetPageFrame()>
1916  SwPageFrame* pPg = GetPageFrame();
1917  if ( !pPg && GetAnchorFrame() )
1918  pPg = GetAnchorFrame()->FindPageFrame();
1919  if ( pPg )
1920  pPg = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(::FindPage( rRect, pPg )));
1921  return pPg;
1922 }
1923 
1925 {
1926  if ( mbDisconnectInProgress )
1927  {
1928  OSL_FAIL( "<SwDrawContact::ChkPage()> called during disconnection." );
1929  return;
1930  }
1931 
1932  // --> #i28701#
1935  ? GetPageFrame()
1936  : FindPage( GetMaster()->GetCurrentBoundRect() );
1937  if ( GetPageFrame() != pPg )
1938  {
1939  // if drawing object is anchor in header/footer a change of the page
1940  // is a dramatic change. Thus, completely re-connect to the layout
1943  {
1944  ConnectToLayout();
1945  }
1946  else
1947  {
1948  // --> #i28701# - use methods <GetPageFrame()> and <SetPageFrame>
1949  if ( GetPageFrame() )
1953  }
1954  }
1955 }
1956 
1957 // Important note:
1958 // method is called by method <SwDPage::ReplaceObject(..)>, which called its
1959 // corresponding superclass method <FmFormPage::ReplaceObject(..)>.
1960 // Note: 'master' drawing object *has* to be connected to layout triggered
1961 // by the caller of this, if method is called.
1963 {
1964  DisconnectFromLayout( false );
1965  // consider 'virtual' drawing objects
1967 
1968  GetMaster()->SetUserCall( nullptr );
1969  if(pNewMaster)
1970  maAnchoredDrawObj.SetDrawObj(*pNewMaster);
1971  else
1972  mbMasterObjCleared = true;
1973  GetMaster()->SetUserCall( this );
1974 
1975  InvalidateObjs_();
1976 }
1977 
1979 void SwDrawContact::GetAnchoredObjs(std::vector<SwAnchoredObject*>& o_rAnchoredObjs) const
1980 {
1981  o_rAnchoredObjs.push_back(const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj));
1982 
1983  for(auto& rpDrawVirtObj : maDrawVirtObjs)
1984  o_rAnchoredObjs.push_back(&rpDrawVirtObj->AnchoredObj());
1985 }
1986 
1987 // AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
1988 // since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
1989 // For paint, that offset is used by setting at the OutputDevice; for primitives this is
1990 // not possible since we have no OutputDevice, but define the geometry itself.
1991 
1992 namespace sdr::contact
1993 {
1994  namespace {
1995 
1996  class VOCOfDrawVirtObj : public ViewObjectContactOfSdrObj
1997  {
1998  protected:
2007  virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const override;
2008 
2009  public:
2010  VOCOfDrawVirtObj(ObjectContact& rObjectContact, ViewContact& rViewContact)
2011  : ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
2012  {
2013  }
2014  };
2015 
2016  class VCOfDrawVirtObj : public ViewContactOfVirtObj
2017  {
2018  protected:
2024  virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
2025 
2026  public:
2028  explicit VCOfDrawVirtObj(SwDrawVirtObj& rObj)
2029  : ViewContactOfVirtObj(rObj)
2030  {
2031  }
2032 
2034  SwDrawVirtObj& GetSwDrawVirtObj() const
2035  {
2036  return static_cast<SwDrawVirtObj&>(mrObject);
2037  }
2038  };
2039 
2040  }
2041 } // end of namespace sdr::contact
2042 
2043 namespace sdr::contact
2044 {
2046  static void impAddPrimitivesFromGroup(const ViewObjectContact& rVOC, const basegfx::B2DHomMatrix& rOffsetMatrix, const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rxTarget)
2047  {
2048  const sal_uInt32 nSubHierarchyCount(rVOC.GetViewContact().GetObjectCount());
2049 
2050  for(sal_uInt32 a(0); a < nSubHierarchyCount; a++)
2051  {
2053 
2054  if(rCandidate.GetViewContact().GetObjectCount())
2055  {
2056  // is a group object itself, call recursively
2057  impAddPrimitivesFromGroup(rCandidate, rOffsetMatrix, rDisplayInfo, rxTarget);
2058  }
2059  else
2060  {
2061  // single object, add primitives; check model-view visibility
2062  if(rCandidate.isPrimitiveVisible(rDisplayInfo))
2063  {
2064  drawinglayer::primitive2d::Primitive2DContainer aNewSequence(rCandidate.getPrimitive2DSequence(rDisplayInfo));
2065 
2066  if(!aNewSequence.empty())
2067  {
2068  // get ranges
2069  const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(rCandidate.GetObjectContact().getViewInformation2D());
2070  const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport());
2071  basegfx::B2DRange aObjectRange(rCandidate.getObjectRange());
2072 
2073  // correct with virtual object's offset
2074  aObjectRange.transform(rOffsetMatrix);
2075 
2076  // check geometrical visibility (with offset)
2077  if(!aViewRange.overlaps(aObjectRange))
2078  {
2079  // not visible, release
2080  aNewSequence.clear();
2081  }
2082  }
2083 
2084  if(!aNewSequence.empty())
2085  {
2086  rxTarget.append(aNewSequence);
2087  }
2088  }
2089  }
2090  }
2091  }
2092 
2093  drawinglayer::primitive2d::Primitive2DContainer VOCOfDrawVirtObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
2094  {
2095  // tdf#91260 have already checked top-level one is on the right page
2096  assert(isPrimitiveVisible(rDisplayInfo));
2097  // nasty corner case: override to clear page frame to disable the
2098  // sub-objects' anchor check, because their anchor is always on
2099  // the first page that the page style is applied to
2100  DisplayInfo aDisplayInfo(rDisplayInfo);
2101  aDisplayInfo.SetWriterPageFrame(basegfx::B2IRectangle());
2102  const VCOfDrawVirtObj& rVC = static_cast< const VCOfDrawVirtObj& >(GetViewContact());
2103  const SdrObject& rReferencedObject = rVC.GetSwDrawVirtObj().GetReferencedObj();
2105 
2106  // create offset transformation
2107  basegfx::B2DHomMatrix aOffsetMatrix;
2108  const Point aLocalOffset(rVC.GetSwDrawVirtObj().GetOffset());
2109 
2110  if(aLocalOffset.X() || aLocalOffset.Y())
2111  {
2112  aOffsetMatrix.set(0, 2, aLocalOffset.X());
2113  aOffsetMatrix.set(1, 2, aLocalOffset.Y());
2114  }
2115 
2116  if(dynamic_cast<const SdrObjGroup*>( &rReferencedObject) != nullptr)
2117  {
2118  // group object. Since the VOC/OC/VC hierarchy does not represent the
2119  // hierarchy virtual objects when they have group objects
2120  // (ViewContactOfVirtObj::GetObjectCount() returns null for that purpose)
2121  // to avoid multiple usages of VOCs (which would not work), the primitives
2122  // for the sub-hierarchy need to be collected here
2123 
2124  // Get the VOC of the referenced object (the Group) and fetch primitives from it
2125  const ViewObjectContact& rVOCOfRefObj = rReferencedObject.GetViewContact().GetViewObjectContact(GetObjectContact());
2126  impAddPrimitivesFromGroup(rVOCOfRefObj, aOffsetMatrix, aDisplayInfo, xRetval);
2127  }
2128  else
2129  {
2130  // single object, use method from referenced object to get the Primitive2DSequence
2131  xRetval = rReferencedObject.GetViewContact().getViewIndependentPrimitive2DContainer();
2132  }
2133 
2134  if(!xRetval.empty())
2135  {
2136  // create transform primitive
2138  xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReference };
2139  }
2140 
2141  return xRetval;
2142  }
2143 
2144  ViewObjectContact& VCOfDrawVirtObj::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
2145  {
2146  return *(new VOCOfDrawVirtObj(rObjectContact, *this));
2147  }
2148 
2149 } // end of namespace sdr::contact
2150 
2152 std::unique_ptr<sdr::contact::ViewContact> SwDrawVirtObj::CreateObjectSpecificViewContact()
2153 {
2154  return std::make_unique<sdr::contact::VCOfDrawVirtObj>(*this);
2155 }
2156 
2158  SdrModel& rSdrModel,
2159  SdrObject& _rNewObj,
2160  SwDrawContact& _rDrawContact)
2161 : SdrVirtObj(rSdrModel, _rNewObj ),
2162  maAnchoredDrawObj(),
2163  mrDrawContact(_rDrawContact)
2164 {
2165  // #i26791#
2166  maAnchoredDrawObj.SetDrawObj( *this );
2167 
2168  // #i35635# - set initial position out of sight
2169  NbcMove( Size( -16000, -16000 ) );
2170 }
2171 
2173 {
2174 }
2175 
2177 {
2178  SdrVirtObj::operator=(rObj);
2179  // Note: Members <maAnchoredDrawObj> and <mrDrawContact>
2180  // haven't to be considered.
2181  return *this;
2182 }
2183 
2185 {
2186  SwDrawVirtObj* pObj = new SwDrawVirtObj(
2187  rTargetModel,
2188  rRefObj,
2189  mrDrawContact);
2190 
2191  pObj->operator=( *this );
2192  // Note: Member <maAnchoredDrawObj> hasn't to be considered.
2193 
2194  return pObj;
2195 }
2196 
2198 {
2199  // #i26791# - use new member <maAnchoredDrawObj>
2201 }
2202 
2204 {
2205  // #i26791# - use new member <maAnchoredDrawObj>
2206  return maAnchoredDrawObj.AnchorFrame();
2207 }
2208 
2210 {
2211  // remove contact object from frame for 'virtual' drawing object
2212  // #i26791# - use new member <maAnchoredDrawObj>
2214  {
2216  }
2217 }
2218 
2220 {
2221  // determine 'master'
2222  SdrObject* pOrgMasterSdrObj = mrDrawContact.GetMaster();
2223 
2224  // insert 'virtual' drawing object into page, set layer and user call.
2225  SdrPage* pDrawPg;
2226  // #i27030# - apply order number of referenced object
2227  if ( nullptr != ( pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject() ) )
2228  {
2229  // #i27030# - apply order number of referenced object
2230  pDrawPg->InsertObject( this, GetReferencedObj().GetOrdNum() );
2231  }
2232  else
2233  {
2234  pDrawPg = getSdrPageFromSdrObject();
2235  if ( pDrawPg )
2236  {
2237  pDrawPg->SetObjectOrdNum( GetOrdNumDirect(),
2239  }
2240  else
2241  {
2243  }
2244  }
2246 }
2247 
2249 {
2250  SetUserCall( nullptr );
2251  if ( getSdrPageFromSdrObject() )
2252  {
2254  }
2255 }
2256 
2259 {
2260  bool bRetVal = GetAnchorFrame() &&
2262 
2263  return bRetVal;
2264 }
2265 
2266 void SwDrawVirtObj::NbcSetAnchorPos(const Point& rPnt)
2267 {
2269 }
2270 
2271 // #i97197#
2272 // the methods relevant for positioning
2273 
2275 {
2276  if(aOutRect.IsEmpty())
2277  {
2278  const_cast<SwDrawVirtObj*>(this)->RecalcBoundRect();
2279  }
2280 
2281  return aOutRect;
2282 }
2283 
2285 {
2286  return aOutRect;
2287 }
2288 
2290 {
2291  // do NOT use IsEmpty() here, there is already a useful offset
2292  // in the position
2293  if(aOutRect == tools::Rectangle())
2294  {
2295  return Point();
2296  }
2297  else
2298  {
2300  }
2301 }
2302 
2304 {
2305  // do nothing to not lose model information in aOutRect
2306 }
2307 
2309 {
2310  // #i26791# - switch order of calling <GetOffset()> and
2311  // <ReferencedObj().GetCurrentBoundRect()>, because <GetOffset()> calculates
2312  // its value by the 'BoundRect' of the referenced object.
2313 
2314  const Point aOffset(GetOffset());
2315  aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset;
2316 }
2317 
2319 {
2322 
2323  return aRetval;
2324 }
2325 
2327 {
2330 
2331  return aRetval;
2332 }
2333 
2335 {
2336  SdrHdlList tmpList(nullptr);
2337  rRefObj.AddToHdlList(tmpList);
2338 
2339  size_t cnt = tmpList.GetHdlCount();
2340  for(size_t i=0; i < cnt; ++i)
2341  {
2342  SdrHdl* pHdl = tmpList.GetHdl(i);
2343  Point aP(pHdl->GetPos() + GetOffset());
2344  pHdl->SetPos(aP);
2345  }
2346  tmpList.MoveTo(rHdlList);
2347 }
2348 
2349 void SwDrawVirtObj::NbcMove(const Size& rSiz)
2350 {
2351  SdrObject::NbcMove( rSiz );
2352 }
2353 
2354 void SwDrawVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
2355 {
2356  rRefObj.NbcResize(rRef - GetOffset(), xFact, yFact);
2357  SetRectsDirty();
2358 }
2359 
2360 void SwDrawVirtObj::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
2361 {
2362  rRefObj.NbcRotate(rRef - GetOffset(), nAngle, sn, cs);
2363  SetRectsDirty();
2364 }
2365 
2366 void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
2367 {
2368  rRefObj.NbcMirror(rRef1 - GetOffset(), rRef2 - GetOffset());
2369  SetRectsDirty();
2370 }
2371 
2372 void SwDrawVirtObj::NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear)
2373 {
2374  rRefObj.NbcShear(rRef - GetOffset(), nAngle, tn, bVShear);
2375  SetRectsDirty();
2376 }
2377 
2378 void SwDrawVirtObj::Move(const Size& rSiz)
2379 {
2380  SdrObject::Move( rSiz );
2381 }
2382 
2383 void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
2384 {
2385  if(xFact.GetNumerator() != xFact.GetDenominator() || yFact.GetNumerator() != yFact.GetDenominator())
2386  {
2387  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2388  rRefObj.Resize(rRef - GetOffset(), xFact, yFact, bUnsetRelative);
2389  SetRectsDirty();
2390  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2391  }
2392 }
2393 
2394 void SwDrawVirtObj::Rotate(const Point& rRef, long nAngle, double sn, double cs)
2395 {
2396  if(nAngle)
2397  {
2398  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2399  rRefObj.Rotate(rRef - GetOffset(), nAngle, sn, cs);
2400  SetRectsDirty();
2401  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2402  }
2403 }
2404 
2405 void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
2406 {
2407  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2408  rRefObj.Mirror(rRef1 - GetOffset(), rRef2 - GetOffset());
2409  SetRectsDirty();
2410  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2411 }
2412 
2413 void SwDrawVirtObj::Shear(const Point& rRef, long nAngle, double tn, bool bVShear)
2414 {
2415  if(nAngle)
2416  {
2417  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2418  rRefObj.Shear(rRef - GetOffset(), nAngle, tn, bVShear);
2419  SetRectsDirty();
2420  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2421  }
2422 }
2423 
2425 {
2427  aSnapRect += GetOffset();
2428 }
2429 
2431 {
2432  const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetSnapRect();
2433  const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset();
2434 
2435  return aSnapRect;
2436 }
2437 
2439 {
2440  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2441  tools::Rectangle aR(rRect);
2442  aR -= GetOffset();
2443  rRefObj.SetSnapRect(aR);
2444  SetRectsDirty();
2445  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2446 }
2447 
2449 {
2450  tools::Rectangle aR(rRect);
2451  aR -= GetOffset();
2452  SetRectsDirty();
2453  rRefObj.NbcSetSnapRect(aR);
2454 }
2455 
2457 {
2458  const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetLogicRect();
2459  const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset();
2460 
2461  return aSnapRect;
2462 }
2463 
2465 {
2466  tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
2467  tools::Rectangle aR(rRect);
2468  aR -= GetOffset();
2469  rRefObj.SetLogicRect(aR);
2470  SetRectsDirty();
2471  SendUserCall(SdrUserCallType::Resize, aBoundRect0);
2472 }
2473 
2475 {
2476  tools::Rectangle aR(rRect);
2477  aR -= GetOffset();
2479  SetRectsDirty();
2480 }
2481 
2483 {
2484  Point aP(rRefObj.GetSnapPoint(i));
2485  aP += GetOffset();
2486 
2487  return aP;
2488 }
2489 
2490 Point SwDrawVirtObj::GetPoint(sal_uInt32 i) const
2491 {
2492  return rRefObj.GetPoint(i) + GetOffset();
2493 }
2494 
2495 void SwDrawVirtObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
2496 {
2497  Point aP(rPnt);
2498  aP -= GetOffset();
2499  rRefObj.SetPoint(aP, i);
2500  SetRectsDirty();
2501 }
2502 
2504 {
2505  return rRefObj.HasTextEdit();
2506 }
2507 
2508 // override 'layer' methods for 'virtual' drawing object to assure
2509 // that layer of 'virtual' object is the layer of the referenced object.
2511 {
2512  return GetReferencedObj().GetLayer();
2513 }
2514 
2516 {
2517  ReferencedObj().NbcSetLayer( nLayer );
2519 }
2520 
2522 {
2523  ReferencedObj().SetLayer( nLayer );
2525 }
2526 
2527 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
void RemoveAllVirtObjs()
remove 'virtual' drawing objects and destroy them.
Definition: dcontact.cxx:821
SwFrame * FindFooterOrHeader()
Definition: findfrm.cxx:547
sal_uInt32 GetMaxOrdNum() const
get maximum order number of anchored objects handled by with contact
Definition: dcontact.cxx:372
virtual bool HasTextEdit() const
SwFrame * AnchorFrame()
Definition: dcontact.cxx:2203
virtual void MakeObjPos()=0
method to determine position for the object and set the position at the object
SwRect GetBoundRectOfAnchoredObj(const SdrObject *pObj)
returns the BoundRect inclusive distance of the object.
Definition: dcontact.cxx:154
sal_uInt32 GetOrdNumForNewRef(const SwFlyFrame *pFly)
Definition: dcontact.cxx:480
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2711
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
void ChangeMasterObject(SdrObject *pNewMaster)
Moves all SW-connections to new Master)
Definition: dcontact.cxx:1962
Base class of the Writer layout elements.
Definition: frame.hxx:297
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
SdrObject * GetDrawObjectByAnchorFrame(const SwFrame &_rAnchorFrame)
get drawing object ('master' or 'virtual') by frame.
Definition: dcontact.cxx:834
virtual SwRect GetObjRect() const =0
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
void InsertCnt()
Definition: fly.cxx:207
SwFlyDrawObjPtr mpMasterObj
Definition: dcontact.hxx:180
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2852
SwDrawContact(const SwDrawContact &)=delete
void ChkPage()
Definition: dcontact.cxx:1924
bool IsFollow() const
Definition: flowfrm.hxx:166
WW8AnchorConv
Definition: frmfmt.hxx:294
const SwSortedObjs * GetDrawObjs() const
Definition: frame.hxx:545
SwAnchoredDrawObject maAnchoredDrawObj
anchored drawing object instance for the 'virtual' drawing object
Definition: dcontact.hxx:216
SdrObject & ReferencedObj()
Marks a position in the document model.
Definition: pam.hxx:35
class for the positioning of drawing objects
virtual const tools::Rectangle & GetCurrentBoundRect() const
tools::Rectangle aSnapRect
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true)
void SetPos(const Point &rPnt)
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
SwDrawContact * mpDrawContact
Definition: dcontact.cxx:998
virtual SwDrawVirtObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: dcontact.cxx:2184
bool CheckControlLayer(const SdrObject *pObj)
Definition: dcontact.cxx:657
void InsertColumns()
Definition: fly.cxx:227
void SetPoint(const Point &rPnt, sal_uInt32 i)
SdrObjUserCall * pUserCall
void DisconnectFromLayout(bool _bMoveMasterToInvisibleLayer=true)
Definition: dcontact.cxx:1593
virtual const SwRootFrame * GetCurrentLayout() const =0
std::unique_ptr< SwDrawVirtObj, SdrObjectFreeOp > SwDrawVirtObjPtr
ContactObject for connection of formats as representatives of draw objects in SwClient and the object...
Definition: dcontact.hxx:302
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj) override
override methods to control Writer fly frames, which are linked, and to assure that all objects ancho...
Definition: dcontact.cxx:566
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
SwNodeIndex nNode
Definition: pam.hxx:37
virtual ~SwContact() override
Definition: dcontact.cxx:196
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
Definition: wsfrm.cxx:587
virtual SdrLayerID GetInvisibleControlsId() const =0
OBJ_TEXT
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
const SwFrame * FindPage(const SwRect &rRect, const SwFrame *pPage)
Definition: frmtool.cxx:3539
SwTwips GetPos() const
Definition: fmtornt.hxx:92
static void lcl_NotifyBackgroundOfObj(SwDrawContact const &_rDrawContact, const SdrObject &_rObj, const tools::Rectangle *_pOldObjRect)
local method to notify the background for a drawing object - #i26791#
Definition: dcontact.cxx:910
bool mbMasterObjCleared
boolean indicating set 'master' drawing object has been cleared.
Definition: dcontact.hxx:316
helper class for method for handling nested events ...
Definition: dcontact.cxx:995
virtual SdrLayerID GetHeavenId() const =0
SdrUserCallType
bool IsAnchoredObjShown(SwTextFrame const &rFrame, SwFormatAnchor const &rAnchor)
Definition: frmtool.cxx:1266
void RemoveDrawObjFromPage(SwAnchoredObject &_rToRemoveObj)
Definition: flylay.cxx:1095
virtual ~SwDrawVirtObj() override
Definition: dcontact.cxx:2172
SdrObject * GetObj(size_t nNum) const
bool IsInserted() const
Definition: doc.hxx:186
SwContact(SwFrameFormat *pToRegisterIn)
For reader. Only the connection is created.
Definition: dcontact.cxx:191
virtual SdrLayerID GetControlsId() const =0
size_t GetObjCount() const
TElementType * Next()
Definition: calbck.hxx:351
SwDrawVirtObj(SdrModel &rSdrModel, SdrObject &_rNewObj, SwDrawContact &_rDrawContact)
Definition: dcontact.cxx:2157
virtual ~SwDrawContact() override
Definition: dcontact.cxx:711
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
Definition: dcontact.cxx:2334
ViewObjectContact & GetViewObjectContact(ObjectContact &rObjectContact)
SwNode & GetNode() const
Definition: ndindex.hxx:119
void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:641
bool IsPosAttrSet() const
Definition: frmfmt.hxx:397
long SwTwips
Definition: swtypes.hxx:49
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
virtual void Move(const Size &rSiz) override
Definition: dcontact.cxx:2378
void Pos(const Point &rNew)
Definition: swrect.hxx:169
SdrUserCallType meEventTypeOfCurrentUserCall
event type, which is handled for .
Definition: dcontact.hxx:327
virtual void NbcMove(const Size &rSiz) override
Definition: dcontact.cxx:2349
const Point & GetPos() const
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:108
virtual void AddToHdlList(SdrHdlList &rHdlList) const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
Point GetRelPosToChar() const
method to determine position of anchored object relative to anchor character
static void Free(SdrObject *&_rpObject)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SwDrawContact & mrDrawContact
writer-drawing contact object the 'virtual' drawing object is controlled by.
Definition: dcontact.hxx:221
void Notify_Background(const SdrObject *pObj, SwPageFrame *pPage, const SwRect &rRect, const PrepareHint eHint, const bool bInva)
Definition: frmtool.cxx:3200
EmbeddedObjectRef * pObject
void Chain(SwFrame *_pAnchor)
Definition: fly.cxx:176
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
SwContact * GetUserCall(const SdrObject *pObj)
Returns the UserCall if applicable from the group object.
Definition: dcontact.cxx:171
void DeleteCnt()
Definition: fly.cxx:314
virtual bool HasTextEdit() const override
Definition: dcontact.cxx:2503
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:741
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs)
void MoveObjToLayer(const bool _bToVisible, SdrObject *_pDrawObj)
method to move object to visible/invisible layer
Definition: dcontact.cxx:262
sdr::contact::ViewContact & GetViewContact() const
void DrawContactDeleted()
Definition: dcontact.cxx:1022
SdrTextAniKind
drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(const DisplayInfo &rDisplayInfo) const
virtual Point GetOffset() const override
access to offset
Definition: dcontact.cxx:2289
SwDrawVirtObj * AddVirtObj()
add a 'virtual' drawing object to drawing page.
Definition: dcontact.cxx:808
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
virtual const tools::Rectangle & GetSnapRect() const
bool IsEmpty() const
SdrView * NextView()
#define SAL_MAX_UINT32
void SetDrawObj(SdrObject &_rDrawObj)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
bool IsFlyFrame() const
Definition: frame.hxx:1188
wrapper class for the positioning of Writer fly frames and drawing objects
long Right() const
static SwVirtFlyDrawObj * CreateNewRef(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: dcontact.cxx:503
void RemoveDrawObj(SwAnchoredObject &_rToRemoveObj)
Definition: fly.cxx:2257
SwDrawVirtObj & operator=(const SwDrawVirtObj &rObj)
Definition: dcontact.cxx:2176
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
bool IsMore() const
SdrPage * getSdrPageFromSdrObject() const
const SwFrame * GetAnchorFrame(const SdrObject *_pDrawObj=nullptr) const
Definition: dcontact.cxx:782
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:1349
Point GetRelPosToPageFrame(const bool _bFollowTextFlow, bool &_obRelToTableCell) const
method to determine position of anchored object relative to page frame
virtual Point GetSnapPoint(sal_uInt32 i) const
WW8AnchorConv m_eVertConv
Definition: frmfmt.hxx:306
virtual const tools::Rectangle & GetLogicRect() const override
Definition: dcontact.cxx:2456
#define X
SdrObject & rRefObj
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: dcontact.cxx:419
bool IsTextFrame() const
Definition: frame.hxx:1212
bool mbUserCallActive
Needed data for handling of nested events in method ...
Definition: dcontact.hxx:324
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(161)
const SdrObject & GetReferencedObj() const
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
sal_uInt32 GetMinOrdNum() const
get minimum order number of anchored objects handled by with contact
Definition: dcontact.cxx:347
long Top() const
bool mbParentUserCallActive
Definition: dcontact.cxx:999
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1089
SwFrameFormat * FindFrameFormat(SdrObject *pObj)
The Get reverse way: seeks the format to the specified object.
Definition: dcontact.cxx:120
void AssertNestedUserCall()
Definition: dcontact.cxx:1032
SdrObject * DrawObj()
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const override
get data collection of anchored objects handled by with contact
Definition: dcontact.cxx:636
virtual void NbcMirror(const Point &rRef1, const Point &rRef2) override
Definition: dcontact.cxx:2366
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
virtual void MoveObjToVisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding visible layer
Definition: dcontact.cxx:208
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect)
bool IsInConstructor() const
Definition: viewsh.hxx:554
SwFrame * AnchorFrame()
SwTextFrame * GetFollow()
Definition: txtfrm.hxx:850
TextFrameIndex GetOffset() const
Definition: txtfrm.hxx:430
sal_uInt32 GetOrdNumDirect() const
Specific frame formats (frames, DrawObjects).
bool mbInDTOR
boolean, indicating destruction of contact object important note: boolean has to be set at the beginn...
Definition: dcontact.hxx:71
virtual SdrLayerID GetInvisibleHellId() const =0
ObjectContact & GetObjectContact() const
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:175
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
AW: Need own sdr::contact::ViewContact since AnchorPos from parent is not used but something own (top...
Definition: dcontact.cxx:2152
bool IsMarqueeTextObj(const SdrObject &rObj)
Returns true if the SrdObject is a Marquee-Object (scrolling text)
Definition: dcontact.cxx:182
bool HasWrap(const SdrObject *pObj)
Definition: dcontact.cxx:139
void AddToDrawingPage()
connection to drawing layer
Definition: dcontact.cxx:2219
virtual void SetLayer(SdrLayerID nLayer)
Style of a layout element.
Definition: frmfmt.hxx:57
Point GetRelPosToLine() const
method to determine position of anchored object relative to top of line
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
Definition: txtfrm.cxx:1256
bool IsContentFrame() const
Definition: frame.hxx:1208
void InsertMasterIntoDrawPage()
method to insert 'master' drawing object into drawing page
Definition: dcontact.cxx:1903
virtual const tools::Rectangle & GetCurrentBoundRect() const override
Definition: dcontact.cxx:2274
const SdrObject * GetDrawObj() const
void InvalidatePrt()
Definition: frame.hxx:1014
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
int i
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2474
uno_Any a
virtual SdrLayerID GetLayer() const override
Definition: dcontact.cxx:2510
void MoveTo(SdrHdlList &rOther)
void SetAssertFlyPages()
Makes sure that all requested page-bound Flys find a Page.
Definition: rootfrm.hxx:275
static void GetAnchoredObjects(std::vector< SwAnchoredObject * > &, const SwFormat &rFormat)
Definition: fly.cxx:2793
const drawinglayer::geometry::ViewInformation2D & getViewInformation2D() const
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: format.cxx:760
virtual sal_uInt16 GetObjIdentifier() const
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2769
SwFrameFormat * GetFormat()
Definition: dcontact.hxx:112
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
virtual void SetBoundRectDirty() override
Definition: dcontact.cxx:2303
tools::Rectangle aOutRect
void AppendDrawObjToPage(SwAnchoredObject &_rNewObj)
Definition: flylay.cxx:1046
const SwFrame * Lower() const
Definition: layfrm.hxx:101
TElementType * First()
Definition: calbck.hxx:343
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void ActionChanged() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: dcontact.cxx:2372
static void impAddPrimitivesFromGroup(const ViewObjectContact &rVOC, const basegfx::B2DHomMatrix &rOffsetMatrix, const DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer &rxTarget)
recursively collect primitive data from given VOC with given offset
Definition: dcontact.cxx:2046
bool HasArea() const
Definition: swrect.hxx:288
const SwRect & GetObjRectWithSpaces() const
method to determine object area inclusive its spacing
virtual basegfx::B2DPolyPolygon TakeContour() const
void UpdateObjInSortedList()
method to update anchored object in the lists
SdrModel & getSdrModelFromSdrObject() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
sal_uInt32 GetOrdNum() const
virtual void append(const Primitive2DReference &) override
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
virtual const SdrObject * GetMaster() const override
Definition: dcontact.hxx:349
virtual bool isPrimitiveVisible(const DisplayInfo &rDisplayInfo) const
SwFlyDrawContact(SwFlyFrameFormat *pToRegisterIn, SdrModel &rTargetModel)
Creates DrawObject and registers it with the Model.
Definition: dcontact.cxx:458
virtual void SetLogicRect(const tools::Rectangle &rRect)
Marks a node in the document model.
Definition: ndindex.hxx:31
virtual void Move(const Size &rSiz)
ring_container GetRingContainer()
Definition: ring.hxx:240
void InvalidateObjs_(const bool _bUpdateSortedObjsList=false)
Definition: dcontact.cxx:1564
virtual void InvalidateObjPos()=0
method to invalidate position of the anchored object
virtual void SetRelativePos(const Point &rPnt)
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 const tools::Rectangle & GetLastBoundRect() const override
Definition: dcontact.cxx:2284
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const override
Definition: dcontact.cxx:538
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const =0
void NotifyBackgrdOfAllVirtObjs(const tools::Rectangle *pOldBoundRect)
Definition: dcontact.cxx:878
A page of the document layout.
Definition: pagefrm.hxx:40
virtual SdrObject * RemoveObject(size_t nObjNum)
void notifyShapePropertyChange(const svx::ShapeProperty _eProperty) const
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
Definition: docfly.cxx:541
void Changed_(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle *pOldBoundRect)
Used by Changed() and by UndoDraw.
Definition: dcontact.cxx:1079
SwFrame * GetAnchorFrameContainingAnchPos()
determine anchor frame containing the anchor position
virtual void Mirror(const Point &rRef1, const Point &rRef2)
static sal_uInt16 nPgNum
Definition: viewport.cxx:49
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
Size GetSize() const
#define Y
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(179)
virtual const SdrObject * GetMaster() const =0
virtual SdrInventor GetObjInventor() const
virtual SdrLayerID GetHellId() const =0
virtual SdrLayerID GetLayer() const
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2448
virtual void RecalcBoundRect() override
All overridden methods which need to use the offset.
Definition: dcontact.cxx:2308
virtual void RecalcSnapRect() override
Definition: dcontact.cxx:2424
static void AddExistingShapeToFormat(SdrObject const &_rObj)
Definition: unodraw.cxx:920
std::optional< tools::Rectangle > const & GetLastObjRect() const
virtual void SetLogicRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2464
virtual void NbcShear(const Point &rRef, long nAngle, double tn, bool bVShear)
virtual sal_uInt32 GetObjectCount() const
SdrObject * Next()
size_t GetHdlCount() const
SdrHdl * GetHdl(size_t nNum) const
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
virtual Point GetSnapPoint(sal_uInt32 i) const override
Definition: dcontact.cxx:2482
virtual SwFrameFormat & GetFrameFormat() override
virtual void SetLayer(SdrLayerID nLayer) override
Definition: dcontact.cxx:2521
drawinglayer::primitive2d::Primitive2DContainer const & getViewIndependentPrimitive2DContainer() const
tools::Rectangle SVRect() const
Definition: swrect.hxx:280
sal_Int32 GetDenominator() const
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: dcontact.cxx:2430
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
#define SAL_WARN_IF(condition, area, stream)
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear) override
Definition: dcontact.cxx:2413
virtual SdrLayerID GetInvisibleHeavenId() const =0
SwTextFrame * FindMaster() const
Definition: flowfrm.cxx:679
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
SwPageFrame * GetPageFrame()
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:133
void SetOrdNum(sal_uInt32 nNum)
virtual void Mirror(const Point &rRef1, const Point &rRef2) override
Definition: dcontact.cxx:2405
virtual const SwAnchoredObject * GetAnchoredObj(const SdrObject *_pSdrObj) const override
Definition: dcontact.cxx:740
void SetInDTOR()
Definition: dcontact.cxx:202
virtual void NbcMove(const Size &rSiz)
void SetPageFrame(SwPageFrame *_pNewPageFrame)
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: dcontact.cxx:2515
Point GetRelPosToAnchorFrame() const
method to determine position of anchored object relative to anchor frame
void DisconnectObjFromLayout(SdrObject *_pDrawObj)
disconnect for a dedicated drawing object - could be 'master' or 'virtual'.
Definition: dcontact.cxx:1663
void ConnectToLayout(const SwFormatAnchor *pAnch=nullptr)
Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame).
Definition: dcontact.cxx:1715
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect) override
Virtual methods of SdrObjUserCall.
Definition: dcontact.cxx:944
const SwPageFrame * GetPageFrame() const
Definition: dcontact.hxx:356
virtual void NbcRotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: dcontact.cxx:2360
void RemoveFromDrawingPage()
Definition: dcontact.cxx:2248
SwNodes & GetNodes()
Definition: doc.hxx:405
new class for re-direct methods calls at a 'virtual' drawing object to its referenced object...
Definition: dcontact.hxx:210
bool IsRightToLeft() const
Definition: frame.hxx:965
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
virtual void Resize(const Point &rRef, const Fraction &xFact, const Fraction &yFact, bool bUnsetRelative=true) override
Definition: dcontact.cxx:2383
void InvalidateObjRectWithSpaces() const
bool IsPageFrame() const
Definition: frame.hxx:1156
bool ObjAnchoredAsChar() const
Definition: dcontact.hxx:150
sal_Int32 GetNumerator() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: dcontact.cxx:2354
void RemoveMasterFromDrawPage()
method to remove 'master' drawing object from drawing page.
Definition: dcontact.cxx:1644
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(157)
std::vector< SwDrawVirtObjPtr > maDrawVirtObjs
container for 'virtual' drawing object supporting drawing objects in headers/footers.
Definition: dcontact.hxx:312
long Left() const
void Unchain()
Definition: fly.cxx:306
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const =0
get data collection of anchored objects, handled by with contact
virtual void MoveObjToInvisibleLayer(SdrObject *_pDrawObj)
method to move drawing object to corresponding invisible layer
Definition: dcontact.cxx:235
virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const override
Definition: dcontact.cxx:2318
virtual ViewContact & GetViewContact(sal_uInt32 nIndex) const
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(154)
SdrObject * getParentSdrObjectFromSdrObject() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
void AppendDrawObj(SwAnchoredObject &_rNewObj)
Definition: fly.cxx:2176
virtual ::basegfx::B2DPolyPolygon TakeContour() const override
Definition: dcontact.cxx:2326
virtual void Shear(const Point &rRef, long nAngle, double tn, bool bVShear)
void RemoveFromWriterLayout()
Definition: dcontact.cxx:2209
SdrUserCallType meParentUserCallEventType
Definition: dcontact.cxx:1000
void setContextWritingMode(SdrObject *pObj, SwFrame const *pAnchor)
Definition: dcontact.cxx:102
ViewContact & GetViewContact() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
static void syncFlyFrameAttr(SwFrameFormat &rShape, SfxItemSet const &rSet)
Similar to syncProperty(), but used by the internal API (e.g. for UI purposes).
bool IsVertical() const
Definition: frame.hxx:951
static void GetTextObjectsFromFormat(std::list< SdrTextObj * > &, SwDoc *)
get data collection of anchored objects, handled by with contact
Definition: dcontact.cxx:730
bool IsInDtor() const
Definition: doc.hxx:400
const SwFrame * GetAnchorFrame() const
Definition: dcontact.cxx:2197
SwModify * GetRegisteredInNonConst() const
Definition: calbck.hxx:134
#define SAL_WARN(area, stream)
virtual void NbcSetAnchorPos(const Point &rPnt)
bool IsNestedUserCall() const
Definition: dcontact.cxx:1027
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
virtual void SetSnapRect(const tools::Rectangle &rRect) override
Definition: dcontact.cxx:2438
virtual void Rotate(const Point &rRef, long nAngle, double sn, double cs) override
Definition: dcontact.cxx:2394
virtual const tools::Rectangle & GetLogicRect() const
NestedUserCallHdl(SwDrawContact *_pDrawContact, SdrUserCallType _eEventType)
Definition: dcontact.cxx:1003
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Definition: pagechg.cxx:1865
virtual void NbcSetAnchorPos(const Point &rPnt) override
Definition: dcontact.cxx:2266
SwAnchoredDrawObject maAnchoredDrawObj
anchored drawing object instance for the 'master' drawing object
Definition: dcontact.hxx:309
SdrVirtObj & operator=(const SdrVirtObj &rObj)
bool mbDisconnectInProgress
internal flag to indicate that disconnect from layout is in progress
Definition: dcontact.hxx:320
virtual ~SwFlyDrawContact() override
Definition: dcontact.cxx:470
const SwFrame * GetAnchorFrame() const
void ResetLayoutProcessBools()
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
virtual void MoveObjToInvisibleLayer(SdrObject *_pDrawObj) override
Definition: dcontact.cxx:606
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
void EndAllAction(bool bVirDev=false)
Definition: pagechg.cxx:1877
WW8AnchorConv m_eHoriConv
Definition: frmfmt.hxx:305
virtual void NbcSetPoint(const Point &rPnt, sal_uInt32 i) override
Definition: dcontact.cxx:2495
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2069
bool IsPositioningInProgress() const
is positioning of anchored object in progress
virtual void GetAnchoredObjs(std::vector< SwAnchoredObject * > &_roAnchoredObjs) const override
get data collection of anchored objects, handled by with contact
Definition: dcontact.cxx:1979
virtual Point GetPoint(sal_uInt32 i) const
SdrView * FirstView()
static SwTextFrame * lcl_GetFlyInContentAnchor(SwTextFrame *_pProposedAnchorFrame, SwPosition const &rAnchorPos)
Definition: dcontact.cxx:1700
SdrObjUserCall * GetUserCall() const
virtual Point GetPoint(sal_uInt32 i) const override
Definition: dcontact.cxx:2490
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1277
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
sal_uInt16 Which() const
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
SwAnchoredObject & AnchoredObj()
Definition: dcontact.hxx:245
bool IsCallbackActionEnabled() const
Definition: rootfrm.hxx:382
const basegfx::B2DRange & getObjectRange() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1317
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:758
static void lcl_textBoxSizeNotify(SwFrameFormat *pFormat)
Notify the format's textbox that it should reconsider its position / size.
Definition: dcontact.cxx:1065
bool IsConnected() const
is 'virtual' drawing object connected to writer layout and / to drawing layer.
Definition: dcontact.cxx:2258
virtual const SdrObject * GetMaster() const override
Definition: dcontact.hxx:194
virtual void NbcSetLayer(SdrLayerID nLayer)
SwPageFrame * FindPage(const SwRect &rRect)
Definition: dcontact.cxx:1913